From c9e1538298ccfc2172d4db06df54f0f321b7db09 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Apr 2004 13:15:43 +0300 Subject: [PATCH 001/162] Introduce keys in child tables corresponding to FOREIGN KEYs Remove redundant keys in CREATE TABLE and ALTER TABLE mysql-test/r/constraints.result: Remove redundant keys mysql-test/r/create.result: Remove redundant keys mysql-test/r/innodb.result: Remove redundant keys mysql-test/r/range.result: Remove redundant keys mysql-test/t/range.test: Remove redundant keys sql/sql_class.cc: Equality comparison of keys (ignoring name) sql/sql_class.h: Equality comparison of keys (ignoring name) sql/sql_table.cc: Remove redundant keys sql/sql_yacc.yy: Introduce keys in child tables corresponding to FOREIGN KEYs --- mysql-test/r/constraints.result | 4 +--- mysql-test/r/create.result | 32 +------------------------------- mysql-test/r/innodb.result | 1 - mysql-test/r/range.result | 8 ++------ mysql-test/t/range.test | 3 +-- sql/sql_class.cc | 28 ++++++++++++++++++++++++++++ sql/sql_class.h | 3 +++ sql/sql_table.cc | 33 +++++++++++++++++++++++++++++---- sql/sql_yacc.yy | 4 +++- 9 files changed, 68 insertions(+), 48 deletions(-) diff --git a/mysql-test/r/constraints.result b/mysql-test/r/constraints.result index d4d525c8991..e2fb0607819 100644 --- a/mysql-test/r/constraints.result +++ b/mysql-test/r/constraints.result @@ -22,8 +22,6 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) default NULL, - UNIQUE KEY `constraint_1` (`a`), - UNIQUE KEY `key_1` (`a`), - UNIQUE KEY `key_2` (`a`) + UNIQUE KEY `constraint_1` (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index ce72c353d20..e24297dc77c 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -155,37 +155,7 @@ t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL default '0', `b` int(11) default NULL, PRIMARY KEY (`a`), - KEY `b` (`b`), - KEY `b_2` (`b`), - KEY `b_3` (`b`), - KEY `b_4` (`b`), - KEY `b_5` (`b`), - KEY `b_6` (`b`), - KEY `b_7` (`b`), - KEY `b_8` (`b`), - KEY `b_9` (`b`), - KEY `b_10` (`b`), - KEY `b_11` (`b`), - KEY `b_12` (`b`), - KEY `b_13` (`b`), - KEY `b_14` (`b`), - KEY `b_15` (`b`), - KEY `b_16` (`b`), - KEY `b_17` (`b`), - KEY `b_18` (`b`), - KEY `b_19` (`b`), - KEY `b_20` (`b`), - KEY `b_21` (`b`), - KEY `b_22` (`b`), - KEY `b_23` (`b`), - KEY `b_24` (`b`), - KEY `b_25` (`b`), - KEY `b_26` (`b`), - KEY `b_27` (`b`), - KEY `b_28` (`b`), - KEY `b_29` (`b`), - KEY `b_30` (`b`), - KEY `b_31` (`b`) + KEY `b` (`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 select if(1,'1','0'), month("2002-08-02"); diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 5e513061821..0729fd1b547 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -371,7 +371,6 @@ t1 0 PRIMARY 2 b A # NULL NULL BTREE t1 0 c 1 c A # NULL NULL BTREE t1 0 b 1 b A # NULL NULL BTREE t1 1 a 1 a A # NULL NULL BTREE -t1 1 a_2 1 a A # NULL NULL BTREE drop table t1; create table t1 (col1 int not null, col2 char(4) not null, primary key(col1)); alter table t1 engine=innodb; diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result index d1a5dd00370..290e72d3b55 100644 --- a/mysql-test/r/range.result +++ b/mysql-test/r/range.result @@ -249,18 +249,14 @@ explain select count(*) from t1 where x in (1,2); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range x x 5 NULL 2 Using where; Using index drop table t1; -CREATE TABLE t1 (key1 int(11) NOT NULL default '0', KEY i1 (key1), KEY i2 (key1)); +CREATE TABLE t1 (key1 int(11) NOT NULL default '0', KEY i1 (key1)); INSERT INTO t1 VALUES (0),(0),(1),(1); CREATE TABLE t2 (keya int(11) NOT NULL default '0', KEY j1 (keya)); INSERT INTO t2 VALUES (0),(0),(1),(1),(2),(2); explain select * from t1, t2 where (t1.key1 col_it1(columns); + List_iterator col_it2(other.columns); + const key_part_spec *col1, *col2; + while ((col1 = col_it1++)) + { + col2 = col_it2++; + DBUG_ASSERT(col2 != NULL); + if (!(*col1 == *col2)) + return false; + } + return true; + } + return false; +} + + /**************************************************************************** ** Thread specific functions ****************************************************************************/ diff --git a/sql/sql_class.h b/sql/sql_class.h index d5eb7a9fd0e..a2094d8fe7c 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -210,6 +210,7 @@ public: const char *field_name; uint length; key_part_spec(const char *name,uint len=0) :field_name(name), length(len) {} + bool operator==(const key_part_spec& other) const; }; @@ -245,6 +246,8 @@ public: :type(type_par), algorithm(alg_par), columns(cols), name(name_arg) {} ~Key() {} + /* Equality comparison of keys (ignoring name) */ + bool operator==(Key& other); }; class Table_ident; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index c46a9823a52..d00cb7ed546 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -639,12 +639,13 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, /* Create keys */ - List_iterator key_iterator(keys); + List_iterator key_iterator(keys), key_iterator2(keys); uint key_parts=0, fk_key_count=0; - List keys_in_order; // Add new keys here bool primary_key=0,unique_key=0; - Key *key; + Key *key, *key2; uint tmp, key_number; + /* special marker for keys to be ignored */ + static char ignore_key[1]; /* Calculate number of key segements */ *key_count= 0; @@ -677,7 +678,21 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, my_error(ER_TOO_LONG_IDENT, MYF(0), key->name); DBUG_RETURN(-1); } - key_parts+=key->columns.elements; + key_iterator2.rewind (); + while ((key2 = key_iterator2++) != key) + { + if (*key == *key2) + { + /* TO DO: issue warning message */ + /* mark that the key should be ignored */ + key->name=ignore_key; + break; + } + } + if (key->name != ignore_key) + key_parts+=key->columns.elements; + else + (*key_count)--; if (key->name && !tmp_table && !my_strcasecmp(system_charset_info,key->name,primary_key_name)) { @@ -704,6 +719,16 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, uint key_length=0; key_part_spec *column; + if (key->name == ignore_key) + { + /* ignore redundant keys */ + do + key=key_iterator++; + while (key && key->name == ignore_key); + if (!key) + break; + } + switch(key->type){ case Key::MULTIPLE: key_info->flags = 0; diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 568a526fd58..85257f90fe0 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -1200,12 +1200,14 @@ key_def: | opt_constraint FOREIGN KEY_SYM opt_ident '(' key_list ')' references { LEX *lex=Lex; - lex->key_list.push_back(new foreign_key($4, lex->col_list, + lex->key_list.push_back(new foreign_key($4 ? $4:$1, lex->col_list, $8, lex->ref_list, lex->fk_delete_opt, lex->fk_update_opt, lex->fk_match_option)); + lex->key_list.push_back(new Key(Key::MULTIPLE, $4 ? $4:$1, + HA_KEY_ALG_UNDEF, lex->col_list)); lex->col_list.empty(); /* Alloced by sql_alloc */ } | opt_constraint check_constraint From 1fa5853260607deed24a24c58a6730db7ffef9a2 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Apr 2004 10:49:51 +0200 Subject: [PATCH 002/162] Split Ndberror.cpp so it can be used by perror --- ndb/src/ndbapi/Makefile | 1 + ndb/src/ndbapi/NdbErrorOut.cpp | 107 +++++++++++++++++ ndb/src/ndbapi/Ndberror.cpp | 202 +++++++++++++-------------------- 3 files changed, 185 insertions(+), 125 deletions(-) create mode 100644 ndb/src/ndbapi/NdbErrorOut.cpp diff --git a/ndb/src/ndbapi/Makefile b/ndb/src/ndbapi/Makefile index 932fbd844d2..23a5cb946d1 100644 --- a/ndb/src/ndbapi/Makefile +++ b/ndb/src/ndbapi/Makefile @@ -32,6 +32,7 @@ SOURCES = \ Ndbif.cpp \ Ndbinit.cpp \ Ndberror.cpp \ + NdbErrorOut.cpp \ NdbConnection.cpp \ NdbConnectionScan.cpp \ NdbOperation.cpp \ diff --git a/ndb/src/ndbapi/NdbErrorOut.cpp b/ndb/src/ndbapi/NdbErrorOut.cpp new file mode 100644 index 00000000000..286f8216bf7 --- /dev/null +++ b/ndb/src/ndbapi/NdbErrorOut.cpp @@ -0,0 +1,107 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + +#include +#include +#include + +#include + +#include + +const char *ndberror_status_message(const NdbError::Status & status); +const char *ndberror_classification_message(const NdbError::Classification & classification); +int ndb_error_string(int err_no, char *str, size_t size); +void ndberror_update(const NdbError & _err); + +/** + * operators + */ +NdbOut & +operator<<(NdbOut & out, const NdbError & error){ + if(error.message != 0) + out << error.code << ": " << error.message; + else + out << error.code << ": "; + return out; +} + +NdbOut & +operator<<(NdbOut & out, const NdbError::Status & status){ + return out << ndberror_status_message(status); +} + +NdbOut & +operator<<(NdbOut & out, const NdbError::Classification & classification){ + return out << ndberror_classification_message(classification); +} + +/****************************************************** + * + */ +#include "NdbImpl.hpp" +#include "NdbDictionaryImpl.hpp" +#include +#include +#include + + +const +NdbError & +Ndb::getNdbError(int code){ + theError.code = code; + ndberror_update(theError); + return theError; +} + +const +NdbError & +Ndb::getNdbError() const { + ndberror_update(theError); + return theError; +} + +const +NdbError & +NdbDictionaryImpl::getNdbError() const { + ndberror_update(m_error); + return m_error; +} + +const +NdbError & +NdbConnection::getNdbError() const { + ndberror_update(theError); + return theError; +} + +const +NdbError & +NdbOperation::getNdbError() const { + ndberror_update(theError); + return theError; +} + +const +NdbError & +NdbSchemaCon::getNdbError() const { + ndberror_update(theError); + return theError; +} + + + diff --git a/ndb/src/ndbapi/Ndberror.cpp b/ndb/src/ndbapi/Ndberror.cpp index 2aa890b0918..4e2cbc0b257 100644 --- a/ndb/src/ndbapi/Ndberror.cpp +++ b/ndb/src/ndbapi/Ndberror.cpp @@ -16,9 +16,8 @@ #include -#include +#include #include - #include struct ErrorBundle { @@ -50,6 +49,8 @@ static const NdbError::Classification IE = NdbError::InternalError; static const NdbError::Classification NI = NdbError::FunctionNotImplemented; static const NdbError::Classification UE = NdbError::UnknownErrorCode; +static const char* empty_string = ""; + static const ErrorBundle ErrorCodes[] = { @@ -420,9 +421,15 @@ static const int NbErrorCodes = sizeof(ErrorCodes)/sizeof(ErrorBundle); +struct ErrorStatusMessage { + NdbError::Status status; + const char * message; +}; + struct ErrorStatusClassification { NdbError::Status status; NdbError::Classification classification; + const char * message; }; /** @@ -430,31 +437,44 @@ struct ErrorStatusClassification { */ static const -ErrorStatusClassification StatusClassificationMapping[] = { - { NdbError::Success, NdbError::NoError }, - { NdbError::PermanentError, NdbError::ApplicationError }, - { NdbError::PermanentError, NdbError::NoDataFound }, - { NdbError::PermanentError, NdbError::ConstraintViolation }, - { NdbError::PermanentError, NdbError::SchemaError }, - { NdbError::PermanentError, NdbError::UserDefinedError }, - { NdbError::PermanentError, NdbError::InsufficientSpace }, - - { NdbError::TemporaryError, NdbError::TemporaryResourceError }, - { NdbError::TemporaryError, NdbError::NodeRecoveryError }, - { NdbError::TemporaryError, NdbError::OverloadError }, - { NdbError::TemporaryError, NdbError::TimeoutExpired }, - { NdbError::TemporaryError, NdbError::NodeShutdown }, - - { NdbError::UnknownResult , NdbError::UnknownResultError }, - { NdbError::UnknownResult , NdbError::UnknownErrorCode }, - - { NdbError::PermanentError, NdbError::InternalError }, - { NdbError::PermanentError, NdbError::FunctionNotImplemented } +ErrorStatusMessage StatusMessageMapping[] = { + { NdbError::Success, "Success"}, + { NdbError::PermanentError, "Permanent error"}, + { NdbError::TemporaryError, "Temporary error"}, + { NdbError::UnknownResult , "Unknown result"} }; static const -int Nb = sizeof(StatusClassificationMapping)/sizeof(ErrorStatusClassification); +int NbStatus = sizeof(StatusMessageMapping)/sizeof(ErrorStatusMessage); + +static +const +ErrorStatusClassification StatusClassificationMapping[] = { + { NdbError::Success, NdbError::NoError, "No error"}, + { NdbError::PermanentError, NdbError::ApplicationError, "Application error"}, + { NdbError::PermanentError, NdbError::NoDataFound, "No data found"}, + { NdbError::PermanentError, NdbError::ConstraintViolation, "Constraint violation"}, + { NdbError::PermanentError, NdbError::SchemaError, "Schema error"}, + { NdbError::PermanentError, NdbError::UserDefinedError, "User defined error"}, + { NdbError::PermanentError, NdbError::InsufficientSpace, "Insufficient space"}, + + { NdbError::TemporaryError, NdbError::TemporaryResourceError, "Temporary Resource error"}, + { NdbError::TemporaryError, NdbError::NodeRecoveryError, "Node Recovery error"}, + { NdbError::TemporaryError, NdbError::OverloadError, "Overload error"}, + { NdbError::TemporaryError, NdbError::TimeoutExpired, "Timeout expired"}, + { NdbError::TemporaryError, NdbError::NodeShutdown, "Node shutdown"}, + + { NdbError::UnknownResult , NdbError::UnknownResultError, "Unknown result error"}, + { NdbError::UnknownResult , NdbError::UnknownErrorCode, "Unknown error code"}, + + { NdbError::PermanentError, NdbError::InternalError, "Internal error"}, + { NdbError::PermanentError, NdbError::FunctionNotImplemented, "Function not implemented"} +}; + +static +const +int NbClassification = sizeof(StatusClassificationMapping)/sizeof(ErrorStatusClassification); /** * Complete all fields of an NdbError given the error code @@ -471,9 +491,9 @@ set(NdbError & error, int code, const char * details, ...){ va_end(ap); } -static + void -update(const NdbError & _err){ +ndberror_update(const NdbError & _err){ NdbError & error = (NdbError &) _err; bool found = false; @@ -492,7 +512,7 @@ update(const NdbError & _err){ } found = false; - for(int i = 0; i - -/** - * operators - */ -NdbOut & -operator<<(NdbOut & out, const NdbError & error){ - if(error.message != 0) - out << error.code << ": " << error.message; - else - out << error.code << ": "; - return out; +const char *ndberror_status_message(const NdbError::Status & status) +{ + for (int i= 0; i < NbStatus; i++) + if (StatusMessageMapping[i].status == status) + return StatusMessageMapping[i].message; + return empty_string; } -NdbOut & -operator<<(NdbOut & out, const NdbError::Status & status){ - switch(status) { - case NdbError::Success: out << "Success"; break; - case NdbError::TemporaryError: out << "Temporary error"; break; - case NdbError::PermanentError: out << "Permanent error"; break; - case NdbError::UnknownResult: out << "Unknown result"; break; - } - return out; +const char *ndberror_classification_message(const NdbError::Classification & classification) +{ + for (int i= 0; i < NbClassification; i++) + if (StatusClassificationMapping[i].classification == classification) + return StatusClassificationMapping[i].message; + return empty_string; } -NdbOut & -operator<<(NdbOut & out, const NdbError::Classification & classification){ - switch(classification) { - case NdbError::NoError: out << "No error"; break; - case NdbError::ApplicationError: out << "Application error"; break; - case NdbError::NoDataFound: out << "No data found"; break; - case NdbError::ConstraintViolation: out << "Constraint violation"; break; - case NdbError::SchemaError: out << "Schema error"; break; - case NdbError::UserDefinedError: out << "User defined error"; break; - case NdbError::InsufficientSpace: out << "Insufficient space"; break; - case NdbError::TemporaryResourceError: out << "Temporary Resource error"; - break; - case NdbError::NodeRecoveryError: out << "Node Recovery error"; break; - case NdbError::OverloadError: out << "Overload error"; break; - case NdbError::TimeoutExpired: out << "Timeout expired"; break; - case NdbError::UnknownResultError: out << "Unknown result error"; break; - case NdbError::InternalError: out << "Internal error"; break; - case NdbError::FunctionNotImplemented: out << "Function not implemented"; - break; - case NdbError::UnknownErrorCode: out << "Unknown error code"; break; - case NdbError::NodeShutdown: out << "Node shutdown"; break; - } - return out; +extern "C" { +int ndb_error_string(int err_no, char *str, size_t size) +{ + NdbError error; + int len= 0, tlen= 0; + + error.code = err_no; + ndberror_update(error); + + len+= snprintf(str+tlen, size-tlen, "%s", error.message); + tlen= len < size ? len : size; + len+= snprintf(str+tlen, size-tlen, ": "); + tlen= len < size ? len : size; + len+= snprintf(str+tlen, size-tlen, "%s", ndberror_status_message(error.status)); + tlen= len < size ? len : size; + len+= snprintf(str+tlen, size-tlen, ": "); + tlen= len < size ? len : size; + len+= snprintf(str+tlen, size-tlen, "%s", ndberror_classification_message(error.classification)); + return len; } - -/****************************************************** - * - */ -#include "NdbImpl.hpp" -#include "NdbDictionaryImpl.hpp" -#include -#include -#include - - -const -NdbError & -Ndb::getNdbError(int code){ - theError.code = code; - update(theError); - return theError; } - -const -NdbError & -Ndb::getNdbError() const { - update(theError); - return theError; -} - -const -NdbError & -NdbDictionaryImpl::getNdbError() const { - update(m_error); - return m_error; -} - -const -NdbError & -NdbConnection::getNdbError() const { - update(theError); - return theError; -} - -const -NdbError & -NdbOperation::getNdbError() const { - update(theError); - return theError; -} - -const -NdbError & -NdbSchemaCon::getNdbError() const { - update(theError); - return theError; -} - - - From 9f76f43cb9aceb160fa6faea0fd8c2ea91ce761e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 5 May 2004 11:29:56 +0200 Subject: [PATCH 003/162] Restructure of ndb error ndb/src/kernel/blocks/backup/restore/Makefile: better make --- ndb/include/ndbapi/NdbError.hpp | 58 +- ndb/include/ndbapi/ndberror.h | 100 +++ ndb/src/kernel/blocks/backup/restore/Makefile | 6 +- ndb/src/ndbapi/Makefile | 1 + ndb/src/ndbapi/NdbErrorOut.cpp | 65 +- ndb/src/ndbapi/Ndberror.cpp | 600 ++---------------- ndb/src/ndbapi/ndberror.c | 596 +++++++++++++++++ 7 files changed, 785 insertions(+), 641 deletions(-) create mode 100644 ndb/include/ndbapi/ndberror.h create mode 100644 ndb/src/ndbapi/ndberror.c diff --git a/ndb/include/ndbapi/NdbError.hpp b/ndb/include/ndbapi/NdbError.hpp index b08dd1041b2..2bcc3cee983 100644 --- a/ndb/include/ndbapi/NdbError.hpp +++ b/ndb/include/ndbapi/NdbError.hpp @@ -17,6 +17,8 @@ #ifndef NDB_ERROR_HPP #define NDB_ERROR_HPP +#include + /** * @struct NdbError * @brief Contains error information @@ -51,7 +53,7 @@ struct NdbError { * The error code indicate success
* (Includes classification: NdbError::NoError) */ - Success = 0, + Success = ndberror_st_success, /** * The error code indicates a temporary error. @@ -61,7 +63,7 @@ struct NdbError { * NdbError::OverloadError, NdbError::NodeShutdown * and NdbError::TimeoutExpired.) */ - TemporaryError = 1, + TemporaryError = ndberror_st_temporary, /** * The error code indicates a permanent error.
@@ -71,14 +73,14 @@ struct NdbError { * NdbError::UserDefinedError, NdbError::InternalError, and, * NdbError::FunctionNotImplemented.) */ - PermanentError = 2, + PermanentError = ndberror_st_permanent, /** * The result/status is unknown.
* (Includes classifications: NdbError::UnknownResultError, and * NdbError::UnknownErrorCode.) */ - UnknownResult = 3 + UnknownResult = ndberror_st_unknown }; /** @@ -88,85 +90,85 @@ struct NdbError { /** * Success. No error occurred. */ - NoError = 0, + NoError = ndberror_cl_none, /** * Error in application program. */ - ApplicationError = 1, + ApplicationError = ndberror_cl_application, /** * Read operation failed due to missing record. */ - NoDataFound = 2, + NoDataFound = ndberror_cl_no_data_found, /** * E.g. inserting a tuple with a primary key already existing * in the table. */ - ConstraintViolation = 3, + ConstraintViolation = ndberror_cl_constraint_violation, /** * Error in creating table or usage of table. */ - SchemaError = 4, + SchemaError = ndberror_cl_schema_error, /** * Error occurred in interpreted program. */ - UserDefinedError = 5, + UserDefinedError = ndberror_cl_user_defined, /** * E.g. insufficient memory for data or indexes. */ - InsufficientSpace = 6, + InsufficientSpace = ndberror_cl_insufficient_space, /** * E.g. too many active transactions. */ - TemporaryResourceError = 7, + TemporaryResourceError = ndberror_cl_temporary_resource, /** * Temporary failures which are probably inflicted by a node * recovery in progress. Examples: information sent between * application and NDB lost, distribution change. */ - NodeRecoveryError = 8, + NodeRecoveryError = ndberror_cl_node_recovery, /** * E.g. out of log file space. */ - OverloadError = 9, + OverloadError = ndberror_cl_overload, /** * Timeouts, often inflicted by deadlocks in NDB. */ - TimeoutExpired = 10, + TimeoutExpired = ndberror_cl_timeout_expired, /** * Is is unknown whether the transaction was committed or not. */ - UnknownResultError = 11, + UnknownResultError = ndberror_cl_unknown_result, /** * A serious error in NDB has occurred. */ - InternalError = 12, + InternalError = ndberror_cl_internal_error, /** * A function used is not yet implemented. */ - FunctionNotImplemented = 13, + FunctionNotImplemented = ndberror_cl_function_not_implemented, /** * Error handler could not determine correct error code. */ - UnknownErrorCode = 14, + UnknownErrorCode = ndberror_cl_unknown_error_code, /** * Node shutdown */ - NodeShutdown = 15 + NodeShutdown = ndberror_cl_node_shutdown }; /** @@ -204,6 +206,22 @@ struct NdbError { message = 0; details = 0; } + NdbError(ndberror_struct ndberror){ + status = (NdbError::Status) ndberror.status; + classification = (NdbError::Classification) ndberror.classification; + code = ndberror.code; + message = ndberror.message; + details = ndberror.details; + } + operator ndberror_struct() const { + ndberror_struct ndberror; + ndberror.status = (ndberror_status_enum) status; + ndberror.classification = (ndberror_classification_enum) classification; + ndberror.code = code; + ndberror.message = message; + ndberror.details = details; + return ndberror; + } }; class NdbOut& operator <<(class NdbOut&, const NdbError &); diff --git a/ndb/include/ndbapi/ndberror.h b/ndb/include/ndbapi/ndberror.h new file mode 100644 index 00000000000..2a18e1eb913 --- /dev/null +++ b/ndb/include/ndbapi/ndberror.h @@ -0,0 +1,100 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef NDBERROR_H +#define NDBERROR_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum +{ + ndberror_st_success = 0, + ndberror_st_temporary = 1, + ndberror_st_permanent = 2, + ndberror_st_unknown = 3 +} ndberror_status_enum; + +typedef enum +{ + ndberror_cl_none = 0, + ndberror_cl_application = 1, + ndberror_cl_no_data_found = 2, + ndberror_cl_constraint_violation = 3, + ndberror_cl_schema_error = 4, + ndberror_cl_user_defined = 5, + ndberror_cl_insufficient_space = 6, + ndberror_cl_temporary_resource = 7, + ndberror_cl_node_recovery = 8, + ndberror_cl_overload = 9, + ndberror_cl_timeout_expired = 10, + ndberror_cl_unknown_result = 11, + ndberror_cl_internal_error = 12, + ndberror_cl_function_not_implemented = 13, + ndberror_cl_unknown_error_code = 14, + ndberror_cl_node_shutdown = 15 +} ndberror_classification_enum; + + +typedef struct { + + /** + * Error status. + */ + ndberror_status_enum status; + + /** + * Error type + */ + ndberror_classification_enum classification; + + /** + * Error code + */ + int code; + + /** + * Error message + */ + const char * message; + + /** + * The detailed description. This is extra information regarding the + * error which is not included in the error message. + * + * @note Is NULL when no details specified + */ + char * details; + +} ndberror_struct; + + +typedef ndberror_status_enum ndberror_status; +typedef ndberror_classification_enum ndberror_classification; + +const char *ndberror_status_message(const ndberror_status); +const char *ndberror_classification_message(const ndberror_classification); +void ndberror_update(ndberror_struct *); +int ndb_error_string(int err_no, char *str, size_t size); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/ndb/src/kernel/blocks/backup/restore/Makefile b/ndb/src/kernel/blocks/backup/restore/Makefile index f99e3e3da0d..4c884525d73 100644 --- a/ndb/src/kernel/blocks/backup/restore/Makefile +++ b/ndb/src/kernel/blocks/backup/restore/Makefile @@ -1,12 +1,12 @@ include .defs.mk -TYPE := ndbapi ndbapiclient +TYPE := * BIN_TARGET := restore BIN_TARGET_LIBS := -BIN_TARGET_ARCHIVES := NDB_API general +BIN_TARGET_ARCHIVES := NDB_API -CCFLAGS_LOC = -I.. -I$(NDB_TOP)/src/ndbapi +CCFLAGS_LOC = -I.. -I$(NDB_TOP)/src/ndbapi -I$(NDB_TOP)/include/ndbapi -I$(NDB_TOP)/include/util -I$(NDB_TOP)/include/portlib -I$(NDB_TOP)/include/kernel #ifneq ($(MYSQLCLUSTER_TOP),) #CCFLAGS_LOC +=-I$(MYSQLCLUSTER_TOP)/include -D USE_MYSQL diff --git a/ndb/src/ndbapi/Makefile b/ndb/src/ndbapi/Makefile index 23a5cb946d1..328bb5e3741 100644 --- a/ndb/src/ndbapi/Makefile +++ b/ndb/src/ndbapi/Makefile @@ -32,6 +32,7 @@ SOURCES = \ Ndbif.cpp \ Ndbinit.cpp \ Ndberror.cpp \ + ndberror.c \ NdbErrorOut.cpp \ NdbConnection.cpp \ NdbConnectionScan.cpp \ diff --git a/ndb/src/ndbapi/NdbErrorOut.cpp b/ndb/src/ndbapi/NdbErrorOut.cpp index 286f8216bf7..01d5f63599b 100644 --- a/ndb/src/ndbapi/NdbErrorOut.cpp +++ b/ndb/src/ndbapi/NdbErrorOut.cpp @@ -15,7 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include #include #include @@ -23,10 +22,7 @@ #include -const char *ndberror_status_message(const NdbError::Status & status); -const char *ndberror_classification_message(const NdbError::Classification & classification); -int ndb_error_string(int err_no, char *str, size_t size); -void ndberror_update(const NdbError & _err); +#include /** * operators @@ -42,66 +38,11 @@ operator<<(NdbOut & out, const NdbError & error){ NdbOut & operator<<(NdbOut & out, const NdbError::Status & status){ - return out << ndberror_status_message(status); + return out << ndberror_status_message((ndberror_status)status); } NdbOut & operator<<(NdbOut & out, const NdbError::Classification & classification){ - return out << ndberror_classification_message(classification); + return out << ndberror_classification_message((ndberror_classification)classification); } -/****************************************************** - * - */ -#include "NdbImpl.hpp" -#include "NdbDictionaryImpl.hpp" -#include -#include -#include - - -const -NdbError & -Ndb::getNdbError(int code){ - theError.code = code; - ndberror_update(theError); - return theError; -} - -const -NdbError & -Ndb::getNdbError() const { - ndberror_update(theError); - return theError; -} - -const -NdbError & -NdbDictionaryImpl::getNdbError() const { - ndberror_update(m_error); - return m_error; -} - -const -NdbError & -NdbConnection::getNdbError() const { - ndberror_update(theError); - return theError; -} - -const -NdbError & -NdbOperation::getNdbError() const { - ndberror_update(theError); - return theError; -} - -const -NdbError & -NdbSchemaCon::getNdbError() const { - ndberror_update(theError); - return theError; -} - - - diff --git a/ndb/src/ndbapi/Ndberror.cpp b/ndb/src/ndbapi/Ndberror.cpp index f90d18fc68a..faa2f00cfce 100644 --- a/ndb/src/ndbapi/Ndberror.cpp +++ b/ndb/src/ndbapi/Ndberror.cpp @@ -16,572 +16,60 @@ #include -#include -#include -#include - -struct ErrorBundle { - int code; - NdbError::Classification classification; - const char * message; -}; - -/** - * Shorter names in table below - */ -static const NdbError::Classification NE = NdbError::NoError; -static const NdbError::Classification AE = NdbError::ApplicationError; -static const NdbError::Classification ND = NdbError::NoDataFound; -static const NdbError::Classification CV = NdbError::ConstraintViolation; -static const NdbError::Classification SE = NdbError::SchemaError; -static const NdbError::Classification UD = NdbError::UserDefinedError; - -static const NdbError::Classification IS = NdbError::InsufficientSpace; -static const NdbError::Classification TR = NdbError::TemporaryResourceError; -static const NdbError::Classification NR = NdbError::NodeRecoveryError; -static const NdbError::Classification OL = NdbError::OverloadError; -static const NdbError::Classification TO = NdbError::TimeoutExpired; -static const NdbError::Classification NS = NdbError::NodeShutdown; - -static const NdbError::Classification UR = NdbError::UnknownResultError; - -static const NdbError::Classification IE = NdbError::InternalError; -static const NdbError::Classification NI = NdbError::FunctionNotImplemented; -static const NdbError::Classification UE = NdbError::UnknownErrorCode; - -static const char* empty_string = ""; - -static -const -ErrorBundle ErrorCodes[] = { - /** - * No error - */ - { 0, NE, "No error" }, - - /** - * NoDataFound - */ - { 626, ND, "Tuple did not exist" }, - - /** - * ConstraintViolation - */ - { 630, CV, "Tuple already existed when attempting to insert" }, - { 840, CV, "Trying to set a NOT NULL attribute to NULL" }, - { 893, CV, "Constraint violation e.g. duplicate value in unique index" }, - - /** - * Node recovery errors - */ - { 286, NR, "Node failure caused abort of transaction" }, - { 250, NR, "Node where lock was held crashed, restart scan transaction" }, - { 499, NR, "Scan take over error, restart scan transaction" }, - { 1204, NR, "Temporary failure, distribution changed" }, - { 4002, NR, "Send to NDB failed" }, - { 4010, NR, "Node failure caused abort of transaction" }, - { 4025, NR, "Node failure caused abort of transaction" }, - { 4027, NR, "Node failure caused abort of transaction" }, - { 4028, NR, "Node failure caused abort of transaction" }, - { 4029, NR, "Node failure caused abort of transaction" }, - { 4031, NR, "Node failure caused abort of transaction" }, - { 4033, NR, "Send to NDB failed" }, - - /** - * Node shutdown - */ - { 280, NS, "Transaction aborted due to node shutdown" }, - // This scan trans had an active fragment scan in a LQH which have crashed - { 270, NS, "Transaction aborted due to node shutdown" }, - { 1223, NS, "Read operation aborted due to node shutdown" }, - { 4023, NS, "Transaction aborted due to node shutdown" }, - { 4030, NS, "Transaction aborted due to node shutdown" }, - { 4034, NS, "Transaction aborted due to node shutdown" }, +#include "NdbImpl.hpp" +#include "NdbDictionaryImpl.hpp" +#include +#include +#include - - /** - * Unknown result - */ - { 4008, UR, "Receive from NDB failed" }, - { 4009, UR, "Cluster Failure" }, - { 4012, UR, - "Time-out, most likely caused by simple read or cluster failure" }, - { 4024, UR, - "Time-out, most likely caused by simple read or cluster failure" }, - { 4115, UR, - "Transaction was committed but all read information was not " - "received due to node crash" }, - - /** - * TemporaryResourceError - */ - { 217, TR, "217" }, - { 218, TR, "218" }, - { 219, TR, "219" }, - { 233, TR, "Out of operation records in transaction coordinator" }, - { 275, TR, "275" }, - { 279, TR, "Out of transaction markers in transaction coordinator" }, - { 414, TR, "414" }, - { 418, TR, "Out of transaction buffers in LQH" }, - { 419, TR, "419" }, - { 245, TR, "Too many active scans" }, - { 488, TR, "Too many active scans" }, - { 490, TR, "Too many active scans" }, - { 805, TR, "Out of attrinfo records in tuple manager" }, - { 830, TR, "Out of add fragment operation records" }, - { 873, TR, "Out of attrinfo records for scan in tuple manager" }, - { 1217, TR, "1217" }, - { 1219, TR, "Out of operation records in local data manager" }, - { 1220, TR, "1220" }, - { 1222, TR, "Out of transaction markers in LQH" }, - { 4021, TR, "Out of Send Buffer space in NDB API" }, - { 4022, TR, "Out of Send Buffer space in NDB API" }, - { 4032, TR, "Out of Send Buffer space in NDB API" }, - - /** - * InsufficientSpace - */ - { 623, IS, "623" }, - { 624, IS, "624" }, - { 625, IS, "Out of memory in Ndb Kernel, index part" }, - { 826, IS, "826" }, - { 827, IS, "Out of memory in Ndb Kernel, data part" }, - { 832, IS, "832" }, - - /** - * TimeoutExpired - */ - { 266, TO, "Time-out in NDB, probably caused by deadlock" }, - { 274, TO, "Time-out in NDB, probably caused by deadlock" }, // Scan trans timeout - { 296, TO, "Time-out in NDB, probably caused by deadlock" }, // Scan trans timeout - { 297, TO, "Time-out in NDB, probably caused by deadlock" }, // Scan trans timeout, temporary!! - { 237, TO, "Transaction had timed out when trying to commit it" }, - - - /** - * OverloadError - */ - { 410, OL, "Out of log file space temporarily" }, - { 677, OL, "Index UNDO buffers overloaded" }, - { 891, OL, "Data UNDO buffers overloaded" }, - { 1221, OL, "REDO log buffers overloaded" }, - { 4006, AE, "Connect failure - out of connection objects" }, - - - - /** - * Internal errors - */ - { 892, IE, "Inconsistent hash index. The index needs to be dropped and recreated" }, - { 895, IE, "Inconsistent ordered index. The index needs to be dropped and recreated" }, - { 202, IE, "202" }, - { 203, IE, "203" }, - { 207, IE, "207" }, - { 208, IE, "208" }, - { 209, IE, "Communication problem, signal error" }, - { 220, IE, "220" }, - { 230, IE, "230" }, - { 232, IE, "232" }, - { 238, IE, "238" }, - { 271, IE, "Simple Read transaction without any attributes to read" }, - { 272, IE, "Update operation without any attributes to update" }, - { 276, IE, "276" }, - { 277, IE, "277" }, - { 278, IE, "278" }, - { 287, IE, "Index corrupted" }, - { 631, IE, "631" }, - { 632, IE, "632" }, - { 702, IE, "Request to non-master" }, - { 706, IE, "Inconsistency during table creation" }, - { 809, IE, "809" }, - { 812, IE, "812" }, - { 829, IE, "829" }, - { 833, IE, "833" }, - { 839, IE, "Illegal null attribute" }, - { 871, IE, "871" }, - { 882, IE, "882" }, - { 883, IE, "883" }, - { 887, IE, "887" }, - { 888, IE, "888" }, - { 890, IE, "890" }, - { 4000, IE, "MEMORY ALLOCATION ERROR" }, - { 4001, IE, "Signal Definition Error" }, - { 4005, IE, "Internal Error in NdbApi" }, - { 4011, IE, "Internal Error in NdbApi" }, - { 4107, IE, "Simple Transaction and Not Start" }, - { 4108, IE, "Faulty operation type" }, - { 4109, IE, "Faulty primary key attribute length" }, - { 4110, IE, "Faulty length in ATTRINFO signal" }, - { 4111, IE, "Status Error in NdbConnection" }, - { 4113, IE, "Too many operations received" }, - { 4320, IE, "Cannot use the same object twice to create table" }, - { 4321, IE, "Trying to start two schema transactions" }, - { 4344, IE, "Only DBDICT and TRIX can send requests to TRIX" }, - { 4345, IE, "TRIX block is not available yet, probably due to node failure" }, - { 4346, IE, "Internal error at index create/build" }, - { 4347, IE, "Bad state at alter index" }, - { 4348, IE, "Inconsistency detected at alter index" }, - { 4349, IE, "Inconsistency detected at index usage" }, - - /** - * Application error - */ - { 823, AE, "Too much attrinfo from application in tuple manager" }, - { 876, AE, "876" }, - { 877, AE, "877" }, - { 878, AE, "878" }, - { 879, AE, "879" }, - { 884, AE, "Stack overflow in interpreter" }, - { 885, AE, "Stack underflow in interpreter" }, - { 886, AE, "More than 65535 instructions executed in interpreter" }, - { 4256, AE, "Must call Ndb::init() before this function" }, - { 880, AE, "Tried to read too much - too many getValue calls" }, - { 4257, AE, "Tried to read too much - too many getValue calls" }, - - /** - * Scan application errors - */ - { 242, AE, "Zero concurrency in scan"}, - { 244, AE, "Too high concurrency in scan"}, - { 269, AE, "No condition and attributes to read in scan"}, - { 4600, AE, "Transaction is already started"}, - { 4601, AE, "Transaction is not started"}, - { 4602, AE, "You must call getNdbOperation before executeScan" }, - { 4603, AE, "There can only be ONE operation in a scan transaction" }, - { 4604, AE, "takeOverScanOp, opType must be UpdateRequest or DeleteRequest" }, - { 4605, AE, "You may only call openScanRead or openScanExclusive once for each operation"}, - { 4607, AE, "There may only be one operation in a scan transaction"}, - { 4608, AE, "You can not takeOverScan unless you have used openScanExclusive"}, - { 4609, AE, "You must call nextScanResult before trying to takeOverScan"}, - { 4232, AE, "Parallelism can only be between 1 and 240" }, - { 290, AE, "Scan not started or has been closed by kernel due to timeout" }, - - /** - * SchemaError - */ - { 701, SE, "System busy with other schema operation" }, - { 703, SE, "Invalid table format" }, - { 704, SE, "Attribute name too long" }, - { 705, SE, "Table name too long" }, - { 707, SE, "No more table metadata records" }, - { 708, SE, "No more attribute metadata records" }, - { 709, SE, "No such table existed" }, - { 721, SE, "Table or index with given name already exists" }, - { 723, SE, "No such table existed" }, - { 736, SE, "Wrong attribute size" }, - { 737, SE, "Attribute array size too big" }, - { 738, SE, "Record too big" }, - { 739, SE, "Unsupported primary key length" }, - { 740, SE, "Nullable primary key not supported" }, - { 741, SE, "Unsupported alter table" }, - { 241, SE, "Invalid schema object version" }, - { 283, SE, "Table is being dropped" }, - { 284, SE, "Table not defined in transaction coordinator" }, - { 285, SE, "Unknown table error in transaction coordinator" }, - { 881, SE, "Unable to create table, out of data pages" }, - { 1225, SE, "Table not defined in local query handler" }, - { 1226, SE, "Table is being dropped" }, - { 1228, SE, "Cannot use drop table for drop index" }, - { 1229, SE, "Too long frm data supplied" }, - - /** - * FunctionNotImplemented - */ - { 4003, NI, "Function not implemented yet" }, - - /** - * Still uncategorized - */ - { 720, AE, "Attribute name reused in table definition" }, - { 4004, AE, "Attribute name not found in the Table" }, - - { 4100, AE, "Status Error in NDB" }, - { 4101, AE, "No connections to NDB available and connect failed" }, - { 4102, AE, "Type in NdbTamper not correct" }, - { 4103, AE, "No schema connections to NDB available and connect failed" }, - { 4104, AE, "Ndb Init in wrong state, destroy Ndb object and create a new" }, - { 4105, AE, "Too many Ndb objects" }, - { 4106, AE, "All Not NULL attribute have not been defined" }, - { 4114, AE, "Transaction is already completed" }, - { 4116, AE, "Operation was not defined correctly, probably missing a key" }, - { 4117, AE, "Could not start transporter, configuration error"}, - { 4118, AE, "Parameter error in API call" }, - { 4300, AE, "Tuple Key Type not correct" }, - { 4301, AE, "Fragment Type not correct" }, - { 4302, AE, "Minimum Load Factor not correct" }, - { 4303, AE, "Maximum Load Factor not correct" }, - { 4304, AE, "Maximum Load Factor smaller than Minimum" }, - { 4305, AE, "K value must currently be set to 6" }, - { 4306, AE, "Memory Type not correct" }, - { 4307, AE, "Invalid table name" }, - { 4308, AE, "Attribute Size not correct" }, - { 4309, AE, "Fixed array too large, maximum 64000 bytes" }, - { 4310, AE, "Attribute Type not correct" }, - { 4311, AE, "Storage Mode not correct" }, - { 4312, AE, "Null Attribute Type not correct" }, - { 4313, AE, "Index only storage for non-key attribute" }, - { 4314, AE, "Storage Type of attribute not correct" }, - { 4315, AE, "No more key attributes allowed after defining variable length key attribute" }, - { 4316, AE, "Key attributes are not allowed to be NULL attributes" }, - { 4317, AE, "Too many primary keys defined in table" }, - { 4318, AE, "Invalid attribute name" }, - { 4319, AE, "createAttribute called at erroneus place" }, - { 4322, AE, "Attempt to define distribution key when not prepared to" }, - { 4323, AE, "Distribution Key set on table but not defined on first attribute" }, - { 4324, AE, "Attempt to define distribution group when not prepared to" }, - { 4325, AE, "Distribution Group set on table but not defined on first attribute" }, - { 4326, AE, "Distribution Group with erroneus number of bits" }, - { 4327, AE, "Distribution Group with 1 byte attribute is not allowed" }, - { 4328, AE, "Disk memory attributes not yet supported" }, - { 4329, AE, "Variable stored attributes not yet supported" }, - { 4330, AE, "Table names limited to 127 bytes" }, - { 4331, AE, "Attribute names limited to 31 bytes" }, - { 4332, AE, "Maximum 2000 attributes in a table" }, - { 4333, AE, "Maximum 4092 bytes long keys allowed" }, - { 4334, AE, "Attribute properties length limited to 127 bytes" }, - - { 4400, AE, "Status Error in NdbSchemaCon" }, - { 4401, AE, "Only one schema operation per schema transaction" }, - { 4402, AE, "No schema operation defined before calling execute" }, - - { 4500, AE, "Cannot handle more than 2048 tables in NdbApi" }, - { 4501, AE, "Insert in hash table failed when getting table information from Ndb" }, - { 4502, AE, "GetValue not allowed in Update operation" }, - { 4503, AE, "GetValue not allowed in Insert operation" }, - { 4504, AE, "SetValue not allowed in Read operation" }, - { 4505, AE, "NULL value not allowed in primary key search" }, - { 4506, AE, "Missing getValue/setValue when calling execute" }, - { 4507, AE, "Missing operation request when calling execute" }, - - { 4200, AE, "Status Error when defining an operation" }, - { 4201, AE, "Variable Arrays not yet supported" }, - { 4202, AE, "Set value on tuple key attribute is not allowed" }, - { 4203, AE, "Trying to set a NOT NULL attribute to NULL" }, - { 4204, AE, "Set value and Read/Delete Tuple is incompatible" }, - { 4205, AE, "No Key attribute used to define tuple" }, - { 4206, AE, "Not allowed to equal key attribute twice" }, - { 4207, AE, "Key size is limited to 4092 bytes" }, - { 4208, AE, "Trying to read a non-stored attribute" }, - { 4209, AE, "Length parameter in equal/setValue is incorrect" }, - { 4210, AE, "Ndb sent more info than the length he specified" }, - { 4211, AE, "Inconsistency in list of NdbRecAttr-objects" }, - { 4212, AE, "Ndb reports NULL value on Not NULL attribute" }, - { 4213, AE, "Not all data of an attribute has been received" }, - { 4214, AE, "Not all attributes have been received" }, - { 4215, AE, "More data received than reported in TCKEYCONF message" }, - { 4216, AE, "More than 8052 bytes in setValue cannot be handled" }, - { 4217, AE, "It is not allowed to increment any other than unsigned ints" }, - { 4218, AE, "Currently not allowed to increment NULL-able attributes" }, - { 4219, AE, "Maximum size of interpretative attributes are 64 bits" }, - { 4220, AE, "Maximum size of interpretative attributes are 64 bits" }, - { 4221, AE, "Trying to jump to a non-defined label" }, - { 4222, AE, "Label was not found, internal error" }, - { 4223, AE, "Not allowed to create jumps to yourself" }, - { 4224, AE, "Not allowed to jump to a label in a different subroutine" }, - { 4225, AE, "All primary keys defined, call setValue/getValue"}, - { 4226, AE, "Bad number when defining a label" }, - { 4227, AE, "Bad number when defining a subroutine" }, - { 4228, AE, "Illegal interpreter function in scan definition" }, - { 4229, AE, "Illegal register in interpreter function definition" }, - { 4230, AE, "Illegal state when calling getValue, probably not a read" }, - { 4231, AE, "Illegal state when calling interpreter routine" }, - { 4233, AE, "Calling execute (synchronous) when already prepared asynchronous transaction exists" }, - { 4234, AE, "Illegal to call setValue in this state" }, - { 4235, AE, "No callback from execute" }, - { 4236, AE, "Trigger name too long" }, - { 4237, AE, "Too many triggers" }, - { 4238, AE, "Trigger not found" }, - { 4239, AE, "Trigger with given name already exists"}, - { 4240, AE, "Unsupported trigger type"}, - { 4241, AE, "Index name too long" }, - { 4242, AE, "Too many indexes" }, - { 4243, AE, "Index not found" }, - { 4244, AE, "Index or table with given name already exists" }, - { 4245, AE, "Index attribute must be defined as stored, i.e. the StorageAttributeType must be defined as NormalStorageAttribute"}, - { 4246, AE, "Combined index attributes are not allowed to be NULL attributes" }, - { 4247, AE, "Illegal index/trigger create/drop/alter request" }, - { 4248, AE, "Trigger/index name invalid" }, - { 4249, AE, "Invalid table" }, - { 4250, AE, "Invalid index type or index logging option" }, - { 4251, AE, "Cannot create unique index, duplicate keys found" }, - { 4252, AE, "Failed to allocate space for index" }, - { 4253, AE, "Failed to create index table" }, - { 4254, AE, "Table not an index table" }, - { 4255, AE, "Hash index attributes must be specified in same order as table attributes" }, - { 4258, AE, "Cannot create unique index, duplicate attributes found in definition" }, - { 4259, AE, "Invalid set of range scan bounds" }, - { 4260, UD, "NdbScanFilter: Operator is not defined in NdbScanFilter::Group"}, - { 4261, UD, "NdbScanFilter: Column is NULL"}, - { 4262, UD, "NdbScanFilter: Condition is out of bounds"} - -}; - -static -const -int NbErrorCodes = sizeof(ErrorCodes)/sizeof(ErrorBundle); - -struct ErrorStatusMessage { - NdbError::Status status; - const char * message; -}; - -struct ErrorStatusClassification { - NdbError::Status status; - NdbError::Classification classification; - const char * message; -}; - -/** - * Mapping between classification and status - */ -static -const -ErrorStatusMessage StatusMessageMapping[] = { - { NdbError::Success, "Success"}, - { NdbError::PermanentError, "Permanent error"}, - { NdbError::TemporaryError, "Temporary error"}, - { NdbError::UnknownResult , "Unknown result"} -}; - -static -const -int NbStatus = sizeof(StatusMessageMapping)/sizeof(ErrorStatusMessage); - -static -const -ErrorStatusClassification StatusClassificationMapping[] = { - { NdbError::Success, NdbError::NoError, "No error"}, - { NdbError::PermanentError, NdbError::ApplicationError, "Application error"}, - { NdbError::PermanentError, NdbError::NoDataFound, "No data found"}, - { NdbError::PermanentError, NdbError::ConstraintViolation, "Constraint violation"}, - { NdbError::PermanentError, NdbError::SchemaError, "Schema error"}, - { NdbError::PermanentError, NdbError::UserDefinedError, "User defined error"}, - { NdbError::PermanentError, NdbError::InsufficientSpace, "Insufficient space"}, - - { NdbError::TemporaryError, NdbError::TemporaryResourceError, "Temporary Resource error"}, - { NdbError::TemporaryError, NdbError::NodeRecoveryError, "Node Recovery error"}, - { NdbError::TemporaryError, NdbError::OverloadError, "Overload error"}, - { NdbError::TemporaryError, NdbError::TimeoutExpired, "Timeout expired"}, - { NdbError::TemporaryError, NdbError::NodeShutdown, "Node shutdown"}, - - { NdbError::UnknownResult , NdbError::UnknownResultError, "Unknown result error"}, - { NdbError::UnknownResult , NdbError::UnknownErrorCode, "Unknown error code"}, - - { NdbError::PermanentError, NdbError::InternalError, "Internal error"}, - { NdbError::PermanentError, NdbError::FunctionNotImplemented, "Function not implemented"} -}; - -static -const -int NbClassification = sizeof(StatusClassificationMapping)/sizeof(ErrorStatusClassification); - -/** - * Complete all fields of an NdbError given the error code - * and details - */ -static -void -set(NdbError & error, int code, const char * details, ...){ - error.code = code; - - va_list ap; - va_start(ap, details); - vsnprintf(error.details, sizeof(error.details), details, ap); - va_end(ap); -} - - -void -ndberror_update(const NdbError & _err){ +static void +update(const NdbError & _err){ NdbError & error = (NdbError &) _err; - - bool found = false; - for(int i = 0; i +#include +#include +#include + +typedef struct ErrorBundle { + int code; + ndberror_classification classification; + const char * message; +} ErrorBundle; + +/** + * Shorter names in table below + */ + +#define ST_S ndberror_st_success +#define ST_P ndberror_st_permanent +#define ST_T ndberror_st_temporary +#define ST_U ndberror_st_unknown + +#define NE ndberror_cl_none +#define AE ndberror_cl_application +#define ND ndberror_cl_no_data_found +#define CV ndberror_cl_constraint_violation +#define SE ndberror_cl_schema_error +#define UD ndberror_cl_user_defined + +#define IS ndberror_cl_insufficient_space +#define TR ndberror_cl_temporary_resource +#define NR ndberror_cl_node_recovery +#define OL ndberror_cl_overload +#define TO ndberror_cl_timeout_expired +#define NS ndberror_cl_node_shutdown + +#define UR ndberror_cl_unknown_result + +#define IE ndberror_cl_internal_error +#define NI ndberror_cl_function_not_implemented +#define UE ndberror_cl_unknown_error_code + +static const char* empty_string = ""; + +static +const +ErrorBundle ErrorCodes[] = { + /** + * No error + */ + { 0, NE, "No error" }, + + /** + * NoDataFound + */ + { 626, ND, "Tuple did not exist" }, + + /** + * ConstraintViolation + */ + { 630, CV, "Tuple already existed when attempting to insert" }, + { 840, CV, "Trying to set a NOT NULL attribute to NULL" }, + { 893, CV, "Constraint violation e.g. duplicate value in unique index" }, + + /** + * Node recovery errors + */ + { 286, NR, "Node failure caused abort of transaction" }, + { 250, NR, "Node where lock was held crashed, restart scan transaction" }, + { 499, NR, "Scan take over error, restart scan transaction" }, + { 1204, NR, "Temporary failure, distribution changed" }, + { 4002, NR, "Send to NDB failed" }, + { 4010, NR, "Node failure caused abort of transaction" }, + { 4025, NR, "Node failure caused abort of transaction" }, + { 4027, NR, "Node failure caused abort of transaction" }, + { 4028, NR, "Node failure caused abort of transaction" }, + { 4029, NR, "Node failure caused abort of transaction" }, + { 4031, NR, "Node failure caused abort of transaction" }, + { 4033, NR, "Send to NDB failed" }, + + /** + * Node shutdown + */ + { 280, NS, "Transaction aborted due to node shutdown" }, + /* This scan trans had an active fragment scan in a LQH which have crashed */ + { 270, NS, "Transaction aborted due to node shutdown" }, + { 1223, NS, "Read operation aborted due to node shutdown" }, + { 4023, NS, "Transaction aborted due to node shutdown" }, + { 4030, NS, "Transaction aborted due to node shutdown" }, + { 4034, NS, "Transaction aborted due to node shutdown" }, + + + + /** + * Unknown result + */ + { 4008, UR, "Receive from NDB failed" }, + { 4009, UR, "Cluster Failure" }, + { 4012, UR, + "Time-out, most likely caused by simple read or cluster failure" }, + { 4024, UR, + "Time-out, most likely caused by simple read or cluster failure" }, + { 4115, UR, + "Transaction was committed but all read information was not " + "received due to node crash" }, + + /** + * TemporaryResourceError + */ + { 217, TR, "217" }, + { 218, TR, "218" }, + { 219, TR, "219" }, + { 233, TR, "Out of operation records in transaction coordinator" }, + { 275, TR, "275" }, + { 279, TR, "Out of transaction markers in transaction coordinator" }, + { 414, TR, "414" }, + { 418, TR, "Out of transaction buffers in LQH" }, + { 419, TR, "419" }, + { 245, TR, "Too many active scans" }, + { 488, TR, "Too many active scans" }, + { 490, TR, "Too many active scans" }, + { 805, TR, "Out of attrinfo records in tuple manager" }, + { 830, TR, "Out of add fragment operation records" }, + { 873, TR, "Out of attrinfo records for scan in tuple manager" }, + { 1217, TR, "1217" }, + { 1219, TR, "Out of operation records in local data manager" }, + { 1220, TR, "1220" }, + { 1222, TR, "Out of transaction markers in LQH" }, + { 4021, TR, "Out of Send Buffer space in NDB API" }, + { 4022, TR, "Out of Send Buffer space in NDB API" }, + { 4032, TR, "Out of Send Buffer space in NDB API" }, + + /** + * InsufficientSpace + */ + { 623, IS, "623" }, + { 624, IS, "624" }, + { 625, IS, "Out of memory in Ndb Kernel, index part" }, + { 826, IS, "826" }, + { 827, IS, "Out of memory in Ndb Kernel, data part" }, + { 832, IS, "832" }, + + /** + * TimeoutExpired + */ + { 266, TO, "Time-out in NDB, probably caused by deadlock" }, + { 274, TO, "Time-out in NDB, probably caused by deadlock" }, /* Scan trans timeout */ + { 296, TO, "Time-out in NDB, probably caused by deadlock" }, /* Scan trans timeout */ + { 297, TO, "Time-out in NDB, probably caused by deadlock" }, /* Scan trans timeout, temporary!! */ + { 237, TO, "Transaction had timed out when trying to commit it" }, + + + /** + * OverloadError + */ + { 410, OL, "Out of log file space temporarily" }, + { 677, OL, "Index UNDO buffers overloaded" }, + { 891, OL, "Data UNDO buffers overloaded" }, + { 1221, OL, "REDO log buffers overloaded" }, + { 4006, AE, "Connect failure - out of connection objects" }, + + + + /** + * Internal errors + */ + { 892, IE, "Inconsistent hash index. The index needs to be dropped and recreated" }, + { 895, IE, "Inconsistent ordered index. The index needs to be dropped and recreated" }, + { 202, IE, "202" }, + { 203, IE, "203" }, + { 207, IE, "207" }, + { 208, IE, "208" }, + { 209, IE, "Communication problem, signal error" }, + { 220, IE, "220" }, + { 230, IE, "230" }, + { 232, IE, "232" }, + { 238, IE, "238" }, + { 271, IE, "Simple Read transaction without any attributes to read" }, + { 272, IE, "Update operation without any attributes to update" }, + { 276, IE, "276" }, + { 277, IE, "277" }, + { 278, IE, "278" }, + { 287, IE, "Index corrupted" }, + { 631, IE, "631" }, + { 632, IE, "632" }, + { 702, IE, "Request to non-master" }, + { 706, IE, "Inconsistency during table creation" }, + { 809, IE, "809" }, + { 812, IE, "812" }, + { 829, IE, "829" }, + { 833, IE, "833" }, + { 839, IE, "Illegal null attribute" }, + { 871, IE, "871" }, + { 882, IE, "882" }, + { 883, IE, "883" }, + { 887, IE, "887" }, + { 888, IE, "888" }, + { 890, IE, "890" }, + { 4000, IE, "MEMORY ALLOCATION ERROR" }, + { 4001, IE, "Signal Definition Error" }, + { 4005, IE, "Internal Error in NdbApi" }, + { 4011, IE, "Internal Error in NdbApi" }, + { 4107, IE, "Simple Transaction and Not Start" }, + { 4108, IE, "Faulty operation type" }, + { 4109, IE, "Faulty primary key attribute length" }, + { 4110, IE, "Faulty length in ATTRINFO signal" }, + { 4111, IE, "Status Error in NdbConnection" }, + { 4113, IE, "Too many operations received" }, + { 4320, IE, "Cannot use the same object twice to create table" }, + { 4321, IE, "Trying to start two schema transactions" }, + { 4344, IE, "Only DBDICT and TRIX can send requests to TRIX" }, + { 4345, IE, "TRIX block is not available yet, probably due to node failure" }, + { 4346, IE, "Internal error at index create/build" }, + { 4347, IE, "Bad state at alter index" }, + { 4348, IE, "Inconsistency detected at alter index" }, + { 4349, IE, "Inconsistency detected at index usage" }, + + /** + * Application error + */ + { 823, AE, "Too much attrinfo from application in tuple manager" }, + { 876, AE, "876" }, + { 877, AE, "877" }, + { 878, AE, "878" }, + { 879, AE, "879" }, + { 884, AE, "Stack overflow in interpreter" }, + { 885, AE, "Stack underflow in interpreter" }, + { 886, AE, "More than 65535 instructions executed in interpreter" }, + { 4256, AE, "Must call Ndb::init() before this function" }, + { 880, AE, "Tried to read too much - too many getValue calls" }, + { 4257, AE, "Tried to read too much - too many getValue calls" }, + + /** + * Scan application errors + */ + { 242, AE, "Zero concurrency in scan"}, + { 244, AE, "Too high concurrency in scan"}, + { 269, AE, "No condition and attributes to read in scan"}, + { 4600, AE, "Transaction is already started"}, + { 4601, AE, "Transaction is not started"}, + { 4602, AE, "You must call getNdbOperation before executeScan" }, + { 4603, AE, "There can only be ONE operation in a scan transaction" }, + { 4604, AE, "takeOverScanOp, opType must be UpdateRequest or DeleteRequest" }, + { 4605, AE, "You may only call openScanRead or openScanExclusive once for each operation"}, + { 4607, AE, "There may only be one operation in a scan transaction"}, + { 4608, AE, "You can not takeOverScan unless you have used openScanExclusive"}, + { 4609, AE, "You must call nextScanResult before trying to takeOverScan"}, + { 4232, AE, "Parallelism can only be between 1 and 240" }, + { 290, AE, "Scan not started or has been closed by kernel due to timeout" }, + + /** + * SchemaError + */ + { 701, SE, "System busy with other schema operation" }, + { 703, SE, "Invalid table format" }, + { 704, SE, "Attribute name too long" }, + { 705, SE, "Table name too long" }, + { 707, SE, "No more table metadata records" }, + { 708, SE, "No more attribute metadata records" }, + { 709, SE, "No such table existed" }, + { 721, SE, "Table or index with given name already exists" }, + { 723, SE, "No such table existed" }, + { 736, SE, "Wrong attribute size" }, + { 737, SE, "Attribute array size too big" }, + { 738, SE, "Record too big" }, + { 739, SE, "Unsupported primary key length" }, + { 740, SE, "Nullable primary key not supported" }, + { 741, SE, "Unsupported alter table" }, + { 241, SE, "Invalid schema object version" }, + { 283, SE, "Table is being dropped" }, + { 284, SE, "Table not defined in transaction coordinator" }, + { 285, SE, "Unknown table error in transaction coordinator" }, + { 881, SE, "Unable to create table, out of data pages" }, + { 1225, SE, "Table not defined in local query handler" }, + { 1226, SE, "Table is being dropped" }, + { 1228, SE, "Cannot use drop table for drop index" }, + { 1229, SE, "Too long frm data supplied" }, + + /** + * FunctionNotImplemented + */ + { 4003, NI, "Function not implemented yet" }, + + /** + * Still uncategorized + */ + { 720, AE, "Attribute name reused in table definition" }, + { 4004, AE, "Attribute name not found in the Table" }, + + { 4100, AE, "Status Error in NDB" }, + { 4101, AE, "No connections to NDB available and connect failed" }, + { 4102, AE, "Type in NdbTamper not correct" }, + { 4103, AE, "No schema connections to NDB available and connect failed" }, + { 4104, AE, "Ndb Init in wrong state, destroy Ndb object and create a new" }, + { 4105, AE, "Too many Ndb objects" }, + { 4106, AE, "All Not NULL attribute have not been defined" }, + { 4114, AE, "Transaction is already completed" }, + { 4116, AE, "Operation was not defined correctly, probably missing a key" }, + { 4117, AE, "Could not start transporter, configuration error"}, + { 4118, AE, "Parameter error in API call" }, + { 4300, AE, "Tuple Key Type not correct" }, + { 4301, AE, "Fragment Type not correct" }, + { 4302, AE, "Minimum Load Factor not correct" }, + { 4303, AE, "Maximum Load Factor not correct" }, + { 4304, AE, "Maximum Load Factor smaller than Minimum" }, + { 4305, AE, "K value must currently be set to 6" }, + { 4306, AE, "Memory Type not correct" }, + { 4307, AE, "Invalid table name" }, + { 4308, AE, "Attribute Size not correct" }, + { 4309, AE, "Fixed array too large, maximum 64000 bytes" }, + { 4310, AE, "Attribute Type not correct" }, + { 4311, AE, "Storage Mode not correct" }, + { 4312, AE, "Null Attribute Type not correct" }, + { 4313, AE, "Index only storage for non-key attribute" }, + { 4314, AE, "Storage Type of attribute not correct" }, + { 4315, AE, "No more key attributes allowed after defining variable length key attribute" }, + { 4316, AE, "Key attributes are not allowed to be NULL attributes" }, + { 4317, AE, "Too many primary keys defined in table" }, + { 4318, AE, "Invalid attribute name" }, + { 4319, AE, "createAttribute called at erroneus place" }, + { 4322, AE, "Attempt to define distribution key when not prepared to" }, + { 4323, AE, "Distribution Key set on table but not defined on first attribute" }, + { 4324, AE, "Attempt to define distribution group when not prepared to" }, + { 4325, AE, "Distribution Group set on table but not defined on first attribute" }, + { 4326, AE, "Distribution Group with erroneus number of bits" }, + { 4327, AE, "Distribution Group with 1 byte attribute is not allowed" }, + { 4328, AE, "Disk memory attributes not yet supported" }, + { 4329, AE, "Variable stored attributes not yet supported" }, + { 4330, AE, "Table names limited to 127 bytes" }, + { 4331, AE, "Attribute names limited to 31 bytes" }, + { 4332, AE, "Maximum 2000 attributes in a table" }, + { 4333, AE, "Maximum 4092 bytes long keys allowed" }, + { 4334, AE, "Attribute properties length limited to 127 bytes" }, + + { 4400, AE, "Status Error in NdbSchemaCon" }, + { 4401, AE, "Only one schema operation per schema transaction" }, + { 4402, AE, "No schema operation defined before calling execute" }, + + { 4500, AE, "Cannot handle more than 2048 tables in NdbApi" }, + { 4501, AE, "Insert in hash table failed when getting table information from Ndb" }, + { 4502, AE, "GetValue not allowed in Update operation" }, + { 4503, AE, "GetValue not allowed in Insert operation" }, + { 4504, AE, "SetValue not allowed in Read operation" }, + { 4505, AE, "NULL value not allowed in primary key search" }, + { 4506, AE, "Missing getValue/setValue when calling execute" }, + { 4507, AE, "Missing operation request when calling execute" }, + + { 4200, AE, "Status Error when defining an operation" }, + { 4201, AE, "Variable Arrays not yet supported" }, + { 4202, AE, "Set value on tuple key attribute is not allowed" }, + { 4203, AE, "Trying to set a NOT NULL attribute to NULL" }, + { 4204, AE, "Set value and Read/Delete Tuple is incompatible" }, + { 4205, AE, "No Key attribute used to define tuple" }, + { 4206, AE, "Not allowed to equal key attribute twice" }, + { 4207, AE, "Key size is limited to 4092 bytes" }, + { 4208, AE, "Trying to read a non-stored attribute" }, + { 4209, AE, "Length parameter in equal/setValue is incorrect" }, + { 4210, AE, "Ndb sent more info than the length he specified" }, + { 4211, AE, "Inconsistency in list of NdbRecAttr-objects" }, + { 4212, AE, "Ndb reports NULL value on Not NULL attribute" }, + { 4213, AE, "Not all data of an attribute has been received" }, + { 4214, AE, "Not all attributes have been received" }, + { 4215, AE, "More data received than reported in TCKEYCONF message" }, + { 4216, AE, "More than 8052 bytes in setValue cannot be handled" }, + { 4217, AE, "It is not allowed to increment any other than unsigned ints" }, + { 4218, AE, "Currently not allowed to increment NULL-able attributes" }, + { 4219, AE, "Maximum size of interpretative attributes are 64 bits" }, + { 4220, AE, "Maximum size of interpretative attributes are 64 bits" }, + { 4221, AE, "Trying to jump to a non-defined label" }, + { 4222, AE, "Label was not found, internal error" }, + { 4223, AE, "Not allowed to create jumps to yourself" }, + { 4224, AE, "Not allowed to jump to a label in a different subroutine" }, + { 4225, AE, "All primary keys defined, call setValue/getValue"}, + { 4226, AE, "Bad number when defining a label" }, + { 4227, AE, "Bad number when defining a subroutine" }, + { 4228, AE, "Illegal interpreter function in scan definition" }, + { 4229, AE, "Illegal register in interpreter function definition" }, + { 4230, AE, "Illegal state when calling getValue, probably not a read" }, + { 4231, AE, "Illegal state when calling interpreter routine" }, + { 4233, AE, "Calling execute (synchronous) when already prepared asynchronous transaction exists" }, + { 4234, AE, "Illegal to call setValue in this state" }, + { 4235, AE, "No callback from execute" }, + { 4236, AE, "Trigger name too long" }, + { 4237, AE, "Too many triggers" }, + { 4238, AE, "Trigger not found" }, + { 4239, AE, "Trigger with given name already exists"}, + { 4240, AE, "Unsupported trigger type"}, + { 4241, AE, "Index name too long" }, + { 4242, AE, "Too many indexes" }, + { 4243, AE, "Index not found" }, + { 4244, AE, "Index or table with given name already exists" }, + { 4245, AE, "Index attribute must be defined as stored, i.e. the StorageAttributeType must be defined as NormalStorageAttribute"}, + { 4246, AE, "Combined index attributes are not allowed to be NULL attributes" }, + { 4247, AE, "Illegal index/trigger create/drop/alter request" }, + { 4248, AE, "Trigger/index name invalid" }, + { 4249, AE, "Invalid table" }, + { 4250, AE, "Invalid index type or index logging option" }, + { 4251, AE, "Cannot create unique index, duplicate keys found" }, + { 4252, AE, "Failed to allocate space for index" }, + { 4253, AE, "Failed to create index table" }, + { 4254, AE, "Table not an index table" }, + { 4255, AE, "Hash index attributes must be specified in same order as table attributes" }, + { 4258, AE, "Cannot create unique index, duplicate attributes found in definition" }, + { 4259, AE, "Invalid set of range scan bounds" }, + { 4260, UD, "NdbScanFilter: Operator is not defined in NdbScanFilter::Group"}, + { 4261, UD, "NdbScanFilter: Column is NULL"}, + { 4262, UD, "NdbScanFilter: Condition is out of bounds"} + +}; + +static +const +int NbErrorCodes = sizeof(ErrorCodes)/sizeof(ErrorBundle); + +typedef struct ErrorStatusMessage { + ndberror_status status; + const char * message; +} ErrorStatusMessage; + +typedef struct ErrorStatusClassification { + ndberror_status status; + ndberror_classification classification; + const char * message; +} ErrorStatusClassification; + +/** + * Mapping between classification and status + */ +static +const +ErrorStatusMessage StatusMessageMapping[] = { + { ST_S, "Success"}, + { ST_P, "Permanent error"}, + { ST_T, "Temporary error"}, + { ST_U ,"Unknown result"} +}; + +static +const +int NbStatus = sizeof(StatusMessageMapping)/sizeof(ErrorStatusMessage); + +static +const +ErrorStatusClassification StatusClassificationMapping[] = { + { ST_S, NE, "No error"}, + { ST_P, AE, "Application error"}, + { ST_P, ND, "No data found"}, + { ST_P, CV, "Constraint violation"}, + { ST_P, SE, "Schema error"}, + { ST_P, UD, "User defined error"}, + { ST_P, IS, "Insufficient space"}, + + { ST_T, TR, "Temporary Resource error"}, + { ST_T, NR, "Node Recovery error"}, + { ST_T, OL, "Overload error"}, + { ST_T, TO, "Timeout expired"}, + { ST_T, NS, "Node shutdown"}, + + { ST_U , UR, "Unknown result error"}, + { ST_U , UE, "Unknown error code"}, + + { ST_P, IE, "Internal error"}, + { ST_P, NI, "Function not implemented"} +}; + +static +const +int NbClassification = sizeof(StatusClassificationMapping)/sizeof(ErrorStatusClassification); + +/** + * Complete all fields of an NdbError given the error code + * and details + */ +static +void +set(ndberror_struct * error, int code, const char * details, ...){ + error->code = code; + { + va_list ap; + va_start(ap, details); + vsnprintf(error->details, sizeof(error->details), details, ap); + va_end(ap); + } +} + + +void +ndberror_update(ndberror_struct * error){ + + int found = 0; + int i; + + for(i = 0; icode){ + error->classification = ErrorCodes[i].classification; + error->message = ErrorCodes[i].message; + found = 1; + break; + } + } + + if(!found){ + error->classification = UE; + error->message = "Unknown error code"; + } + + found = 0; + for(i = 0; iclassification){ + error->status = StatusClassificationMapping[i].status; + found = 1; + break; + } + } + if(!found){ + error->status = ST_U; + } + + error->details = 0; +} + +int +checkErrorCodes(){ + int i, j; + for(i = 0; i Date: Wed, 5 May 2004 12:42:00 +0200 Subject: [PATCH 004/162] Fix ndberror after jonas comments --- ndb/include/ndbapi/NdbError.hpp | 2 +- ndb/include/ndbapi/ndberror.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ndb/include/ndbapi/NdbError.hpp b/ndb/include/ndbapi/NdbError.hpp index 2bcc3cee983..8cde2a8cf38 100644 --- a/ndb/include/ndbapi/NdbError.hpp +++ b/ndb/include/ndbapi/NdbError.hpp @@ -206,7 +206,7 @@ struct NdbError { message = 0; details = 0; } - NdbError(ndberror_struct ndberror){ + NdbError(const ndberror_struct & ndberror){ status = (NdbError::Status) ndberror.status; classification = (NdbError::Classification) ndberror.classification; code = ndberror.code; diff --git a/ndb/include/ndbapi/ndberror.h b/ndb/include/ndbapi/ndberror.h index 2a18e1eb913..3d950ddaa8d 100644 --- a/ndb/include/ndbapi/ndberror.h +++ b/ndb/include/ndbapi/ndberror.h @@ -88,8 +88,8 @@ typedef struct { typedef ndberror_status_enum ndberror_status; typedef ndberror_classification_enum ndberror_classification; -const char *ndberror_status_message(const ndberror_status); -const char *ndberror_classification_message(const ndberror_classification); +const char *ndberror_status_message(ndberror_status); +const char *ndberror_classification_message(ndberror_classification); void ndberror_update(ndberror_struct *); int ndb_error_string(int err_no, char *str, size_t size); From d90b362f1a0d4db41c5eecf90c3d1a100ab56b5d Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 5 May 2004 13:37:59 +0200 Subject: [PATCH 005/162] small fix after bar's code review --- ndb/src/ndbapi/ndberror.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/ndb/src/ndbapi/ndberror.c b/ndb/src/ndbapi/ndberror.c index bcd71475b0e..4e5281ccfcf 100644 --- a/ndb/src/ndbapi/ndberror.c +++ b/ndb/src/ndbapi/ndberror.c @@ -578,19 +578,14 @@ const char *ndberror_classification_message(ndberror_classification classificati int ndb_error_string(int err_no, char *str, size_t size) { ndberror_struct error; - size_t len= 0, tlen= 0; + size_t len; error.code = err_no; ndberror_update(&error); - len+= snprintf(str+tlen, size-tlen, "%s", error.message); - tlen= len < size ? len : size; - len+= snprintf(str+tlen, size-tlen, ": "); - tlen= len < size ? len : size; - len+= snprintf(str+tlen, size-tlen, "%s", ndberror_status_message(error.status)); - tlen= len < size ? len : size; - len+= snprintf(str+tlen, size-tlen, ": "); - tlen= len < size ? len : size; - len+= snprintf(str+tlen, size-tlen, "%s", ndberror_classification_message(error.classification)); + len = snprintf(str, size-1, "%s: %s: %s", error.message, + ndberror_status_message(error.status), ndberror_classification_message(error.classification)); + str[size-1]= '\0'; + return len; } From 5c1069614cfd74ff56ff1393224cbec6d4dc773a Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 5 May 2004 14:19:47 +0200 Subject: [PATCH 006/162] extended perror to enable printing of storage engine specific errors for ndb --- extra/Makefile.am | 2 +- extra/perror.c | 24 +++++++++++++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/extra/Makefile.am b/extra/Makefile.am index 0276355ef65..df29a3a6ab7 100644 --- a/extra/Makefile.am +++ b/extra/Makefile.am @@ -14,7 +14,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include +INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include @ndbcluster_includes@ LDADD = @CLIENT_EXTRA_LDFLAGS@ ../mysys/libmysys.a \ ../dbug/libdbug.a ../strings/libmystrings.a bin_PROGRAMS = replace comp_err perror resolveip my_print_defaults \ diff --git a/extra/perror.c b/extra/perror.c index d05fa2492de..743aa09ed2e 100644 --- a/extra/perror.c +++ b/extra/perror.c @@ -23,15 +23,27 @@ #include #include #include +#ifdef HAVE_NDBCLUSTER_DB +#include "../ndb/src/ndbapi/ndberror.c" +#endif static my_bool verbose, print_all_codes; +#ifdef HAVE_NDBCLUSTER_DB +static my_bool ndb_code; +static char ndb_string[1024]; +#endif + static struct my_option my_long_options[] = { {"help", '?', "Displays this help and exits.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"info", 'I', "Synonym for --help.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, +#ifdef HAVE_NDBCLUSTER_DB + {"ndb", 0, "Ndbcluster storage engine specific error codes.", (gptr*) &ndb_code, + (gptr*) &ndb_code, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, +#endif #ifdef HAVE_SYS_ERRLIST {"all", 'a', "Print all the error messages and the number.", (gptr*) &print_all_codes, (gptr*) &print_all_codes, 0, GET_BOOL, NO_ARG, @@ -199,7 +211,17 @@ int main(int argc,char *argv[]) { found=0; code=atoi(*argv); - msg = strerror(code); +#ifdef HAVE_NDBCLUSTER_DB + if (ndb_code) + { + if (ndb_error_string(code, ndb_string, 1024) < 0) + msg= 0; + else + msg= ndb_string; + } + else +#endif + msg = strerror(code); if (msg) { found=1; From 7436480e23dcc79e9eb050b7ba3ae9f2176c3f4d Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 5 May 2004 22:47:09 +0200 Subject: [PATCH 007/162] mysql.cc: allow several -e on the command line clarify --help text make -B to work as advertised in force mode execute the rest of multi-statement line in case of error in one statement client/my_readline.h: allow several -e on the command line client/readline.cc: allow several -e on the command line --- client/my_readline.h | 2 +- client/mysql.cc | 28 +++++++++++----------------- client/readline.cc | 40 ++++++++++++++++++++++++---------------- 3 files changed, 36 insertions(+), 34 deletions(-) diff --git a/client/my_readline.h b/client/my_readline.h index 2e716eec4cf..6052d462ab9 100644 --- a/client/my_readline.h +++ b/client/my_readline.h @@ -29,6 +29,6 @@ typedef struct st_line_buffer } LINE_BUFFER; extern LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file); -extern LINE_BUFFER *batch_readline_command(my_string str); +extern LINE_BUFFER *batch_readline_command(LINE_BUFFER *buffer, my_string str); extern char *batch_readline(LINE_BUFFER *buffer); extern void batch_readline_end(LINE_BUFFER *buffer); diff --git a/client/mysql.cc b/client/mysql.cc index fe6af909a5a..e4499cc67ec 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -494,7 +494,7 @@ static struct my_option my_long_options[] = "No automatic rehashing. One has to use 'rehash' to get table and field completion. This gives a quicker start of mysql and disables rehashing on reconnect. WARNING: options deprecated; use --disable-auto-rehash instead.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"batch", 'B', - "Print results with a tab as separator, each row on new line. Doesn't use history file.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + "Don't use history file. Disable interactive behavior. (Enables --silent)", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"character-sets-dir", OPT_CHARSETS_DIR, "Directory where character sets are.", (gptr*) &charsets_dir, (gptr*) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, @@ -515,7 +515,7 @@ static struct my_option my_long_options[] = (gptr*) ¤t_db, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"delimiter", OPT_DELIMITER, "Delimiter to be used.", (gptr*) &delimiter_str, (gptr*) &delimiter_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"execute", 'e', "Execute command and quit. (Output like with --batch).", 0, + {"execute", 'e', "Execute command and quit. (Disables --force and history file)", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"vertical", 'E', "Print the output of a query (rows) vertically.", (gptr*) &vertical, (gptr*) &vertical, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, @@ -597,7 +597,7 @@ static struct my_option my_long_options[] = 0, 0, 0}, {"reconnect", OPT_RECONNECT, "Reconnect if the connection is lost. Disable with --disable-reconnect. This option is enabled by default.", (gptr*) &opt_reconnect, (gptr*) &opt_reconnect, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, - {"silent", 's', "Be more silent.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, + {"silent", 's', "Be more silent. Print results with a tab as separator, each row on new line.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #ifdef HAVE_SMEM {"shared_memory_base_name", OPT_SHARED_MEMORY_BASE_NAME, @@ -755,10 +755,10 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), case 'e': status.batch= 1; status.add_to_history= 0; - batch_readline_end(status.line_buff); // If multiple -e - if (!(status.line_buff= batch_readline_command(argument))) + if (!status.line_buff) + ignore_errors= 0; // do it for the first -e only + if (!(status.line_buff= batch_readline_command(status.line_buff, argument))) return 1; - ignore_errors= 0; break; case 'o': if (argument == disabled_my_option) @@ -798,12 +798,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), verbose++; break; case 'B': - if (!status.batch) - { - status.batch= 1; - status.add_to_history= 0; - opt_silent++; // more silent - } + status.batch= 1; + status.add_to_history= 0; + opt_silent++; // more silent break; case 'W': #ifdef __WIN__ @@ -1108,11 +1105,8 @@ static bool add_line(String &buffer,char *line,char *in_string, } else { - int error= com_go(&buffer, 0); - if (error) - { - return error < 0 ? 0 : 1; // < 0 is not fatal - } + if (com_go(&buffer, 0) > 0) // < 0 is not fatal + return 1; } buffer.length(0); out= line; diff --git a/client/readline.cc b/client/readline.cc index f5fbfd8cd0c..52ecb4e5c68 100644 --- a/client/readline.cc +++ b/client/readline.cc @@ -31,7 +31,8 @@ static char *intern_read_line(LINE_BUFFER *buffer,ulong *out_length); LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file) { LINE_BUFFER *line_buff; - if (!(line_buff=(LINE_BUFFER*) my_malloc(sizeof(*line_buff),MYF(MY_WME)))) + if (!(line_buff=(LINE_BUFFER*) + my_malloc(sizeof(*line_buff),MYF(MY_WME | MY_ZEROFILL)))) return 0; if (init_line_buffer(line_buff,fileno(file),IO_SIZE,max_size)) { @@ -67,11 +68,12 @@ void batch_readline_end(LINE_BUFFER *line_buff) } -LINE_BUFFER *batch_readline_command(my_string str) +LINE_BUFFER *batch_readline_command(LINE_BUFFER *line_buff, my_string str) { - LINE_BUFFER *line_buff; - if (!(line_buff=(LINE_BUFFER*) my_malloc(sizeof(*line_buff),MYF(MY_WME)))) - return 0; + if (!line_buff) + if (!(line_buff=(LINE_BUFFER*) + my_malloc(sizeof(*line_buff),MYF(MY_WME | MY_ZEROFILL)))) + return 0; if (init_line_buffer_from_string(line_buff,str)) { my_free((char*) line_buff,MYF(0)); @@ -88,7 +90,6 @@ LINE_BUFFER *batch_readline_command(my_string str) static bool init_line_buffer(LINE_BUFFER *buffer,File file,ulong size,ulong max_buffer) { - bzero((char*) buffer,sizeof(buffer[0])); buffer->file=file; buffer->bufread=size; buffer->max_size=max_buffer; @@ -100,19 +101,26 @@ init_line_buffer(LINE_BUFFER *buffer,File file,ulong size,ulong max_buffer) return 0; } - +/* + init_line_buffer_from_string can be called on the same buffer + several times. the resulting buffer will contain a + concatenation of all strings separated by spaces +*/ static bool init_line_buffer_from_string(LINE_BUFFER *buffer,my_string str) { - uint length; - bzero((char*) buffer,sizeof(buffer[0])); - length=(uint) strlen(str); - if (!(buffer->buffer=buffer->start_of_line=buffer->end_of_line= - (char*)my_malloc(length+2,MYF(MY_FAE)))) + uint old_length=buffer->end - buffer->buffer; + uint length= (uint) strlen(str); + if (!(buffer->buffer= buffer->start_of_line= buffer->end_of_line= + (char*)my_realloc(buffer->buffer, old_length+length+2, + MYF(MY_FAE|MY_ALLOW_ZERO_PTR)))) return 1; - memcpy(buffer->buffer,str,length); - buffer->buffer[length]='\n'; - buffer->buffer[length+1]=0; - buffer->end=buffer->buffer+length+1; + buffer->end= buffer->buffer + old_length; + if (old_length) + buffer->end[-1]=' '; + memcpy(buffer->end, str, length); + buffer->end[length]= '\n'; + buffer->end[length+1]= 0; + buffer->end+= length+1; buffer->eof=1; buffer->max_size=1; return 0; From 8546f81a6a29c5dff4625607db429a79e2ef54ce Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 6 May 2004 09:15:39 +0200 Subject: [PATCH 008/162] strlcpy.c, strlcat.c, strdup.c, getarg.c, NdbString.h, Epilogue.mk, Defs.mk: introduced ndb_global.h and removed som HAVE_ and -D flags ndb_global.h: new file ndb/Defs.mk: introduced ndb_global.h and removed som HAVE_ and -D flags ndb/Epilogue.mk: introduced ndb_global.h and removed som HAVE_ and -D flags ndb/include/util/NdbString.h: introduced ndb_global.h and removed som HAVE_ and -D flags ndb/src/common/util/getarg.c: introduced ndb_global.h and removed som HAVE_ and -D flags ndb/src/common/util/strdup.c: introduced ndb_global.h and removed som HAVE_ and -D flags ndb/src/common/util/strlcat.c: introduced ndb_global.h and removed som HAVE_ and -D flags ndb/src/common/util/strlcpy.c: introduced ndb_global.h and removed som HAVE_ and -D flags --- ndb/Defs.mk | 23 ----------------------- ndb/Epilogue.mk | 2 +- ndb/include/ndb_global.h | 3 +++ ndb/include/util/NdbString.h | 1 + ndb/src/common/util/getarg.c | 6 +----- ndb/src/common/util/strdup.c | 1 + ndb/src/common/util/strlcat.c | 5 +---- ndb/src/common/util/strlcpy.c | 5 +---- 8 files changed, 9 insertions(+), 37 deletions(-) create mode 100644 ndb/include/ndb_global.h diff --git a/ndb/Defs.mk b/ndb/Defs.mk index d5a21c64ca9..8ac9e28b721 100644 --- a/ndb/Defs.mk +++ b/ndb/Defs.mk @@ -21,57 +21,34 @@ LIBPREFIX := lib fixpath = $1 ar_rcs = $(AR_RCS) $1 $2 #check-odbc = $(findstring sqlext.h, $(wildcard /usr/include/sqlext.h) $(wildcard /usr/local/include/sqlext.h)) -CCFLAGS_TOP += -DHAVE_STRCASECMP - endif ifeq ($(NDB_OS), WIN32) -CCFLAGS_TOP += -DHAVE_STRDUP -NDB_STRLCPY := Y -NDB_STRLCAT := Y SHLIBEXT := dll endif ifeq ($(NDB_OS), LINUX) -CCFLAGS_TOP += -DHAVE_STRDUP -NDB_STRLCAT := Y -NDB_STRLCPY := Y SHLIBEXT := so endif ifeq ($(NDB_OS), SOLARIS) -CCFLAGS_TOP += -DHAVE_STRDUP -NDB_STRLCAT := Y -NDB_STRLCPY := Y SHLIBEXT := so endif ifeq ($(NDB_OS), HPUX) -CCFLAGS_TOP += -DHAVE_STRDUP -NDB_STRLCAT := Y -NDB_STRLCPY := Y SHLIBEXT := sl endif ifeq ($(NDB_OS), MACOSX) -CCFLAGS_TOP += -DHAVE_STRLCAT -CCFLAGS_TOP += -DHAVE_STRLCAT -CCFLAGS_TOP += -DHAVE_STRLCPY CCFLAGS_TOP += -DNDBOUT_UINTPTR SHLIBEXT := dylib endif ifeq ($(NDB_OS), OSE) -NDB_STRDUP := Y -NDB_STRLCAT := Y -NDB_STRLCPY := Y SHLIBEXT := so endif ifeq ($(NDB_OS), SOFTOSE) -NDB_STRDUP := Y -NDB_STRLCAT := Y -NDB_STRLCPY := Y SHLIBEXT := so endif diff --git a/ndb/Epilogue.mk b/ndb/Epilogue.mk index dc78a66a1f8..bcdc54a87f1 100644 --- a/ndb/Epilogue.mk +++ b/ndb/Epilogue.mk @@ -227,7 +227,7 @@ CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/include/util) \ BIN_TARGET_LIBS += logger general portlib endif -CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/include) +CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/include) -I$(call fixpath,$(NDB_TOP)/../include) ifeq ($(NDB_SCI), Y) BIN_TARGET_LIBS += sisci diff --git a/ndb/include/ndb_global.h b/ndb/include/ndb_global.h new file mode 100644 index 00000000000..3db70f90ef2 --- /dev/null +++ b/ndb/include/ndb_global.h @@ -0,0 +1,3 @@ +/*#include */ +#include + diff --git a/ndb/include/util/NdbString.h b/ndb/include/util/NdbString.h index 97646f813ac..9d910605e16 100644 --- a/ndb/include/util/NdbString.h +++ b/ndb/include/util/NdbString.h @@ -17,6 +17,7 @@ #ifndef __NDBSTRING_H_INCLUDED__ #define __NDBSTRING_H_INCLUDED__ +#include #include #include diff --git a/ndb/src/common/util/getarg.c b/ndb/src/common/util/getarg.c index 5f792437a65..7d627a92d18 100644 --- a/ndb/src/common/util/getarg.c +++ b/ndb/src/common/util/getarg.c @@ -32,13 +32,9 @@ * SUCH DAMAGE. */ +#include #include -#ifdef HAVE_CONFIG_H -#include -RCSID("$KTH: getarg.c,v 1.23 2000/09/01 21:25:54 lha Exp $"); -#endif - #include #include #include diff --git a/ndb/src/common/util/strdup.c b/ndb/src/common/util/strdup.c index 5291be86b0f..c7fb8002ff0 100644 --- a/ndb/src/common/util/strdup.c +++ b/ndb/src/common/util/strdup.c @@ -15,6 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #ifndef HAVE_STRDUP diff --git a/ndb/src/common/util/strlcat.c b/ndb/src/common/util/strlcat.c index ccff15da27f..f6e695dffa8 100644 --- a/ndb/src/common/util/strlcat.c +++ b/ndb/src/common/util/strlcat.c @@ -31,10 +31,7 @@ * SUCH DAMAGE. */ -#ifdef HAVE_CONFIG_H -#include -#endif - +#include #include /* RCSID("$KTH: strlcat.c,v 1.1 2000/08/16 01:23:47 lha Exp $"); */ diff --git a/ndb/src/common/util/strlcpy.c b/ndb/src/common/util/strlcpy.c index 9a3048081ca..70233e3e239 100644 --- a/ndb/src/common/util/strlcpy.c +++ b/ndb/src/common/util/strlcpy.c @@ -31,10 +31,7 @@ * SUCH DAMAGE. */ -#ifdef HAVE_CONFIG_H -#include -#endif - +#include #include /* RCSID("$KTH: strlcpy.c,v 1.1 2000/08/16 01:23:48 lha Exp $"); */ From c91ea436f59174b28059a424f062229cb27daed5 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 6 May 2004 12:53:41 +0200 Subject: [PATCH 009/162] Makefile: forgot to fix makefile to remove e.g. NDB_STRLCAT ndb/src/common/util/Makefile: forgot to fix makefile to remove e.g. NDB_STRLCAT --- ndb/src/common/util/Makefile | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/ndb/src/common/util/Makefile b/ndb/src/common/util/Makefile index b3e33704266..e8ca2b87c20 100644 --- a/ndb/src/common/util/Makefile +++ b/ndb/src/common/util/Makefile @@ -18,15 +18,7 @@ endif ifeq ($(NDB_OS), OSE) SOURCES += NdbErrHnd.cpp endif -ifdef NDB_STRDUP - SOURCES.c += strdup.c -endif -ifdef NDB_STRLCAT - SOURCES.c += strlcat.c -endif -ifdef NDB_STRLCPY - SOURCES.c += strlcpy.c -endif + SOURCES.c += strdup.c strlcat.c strlcpy.c DIRS := testSimpleProperties From 789adced2bb4d72f3bf2cdf66870a11718d9cf95 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 6 May 2004 13:11:14 +0200 Subject: [PATCH 010/162] Many files: included full my_global.h and resolved some resulting name conflicts ndb/include/ndb_global.h: included full my_global.h and resolved some resulting name conflicts ndb/include/logger/FileLogHandler.hpp: included full my_global.h and resolved some resulting name conflicts ndb/include/util/File.hpp: included full my_global.h and resolved some resulting name conflicts ndb/src/common/logger/FileLogHandler.cpp: included full my_global.h and resolved some resulting name conflicts ndb/src/common/util/File.cpp: included full my_global.h and resolved some resulting name conflicts ndb/src/common/util/strlcat.c: included full my_global.h and resolved some resulting name conflicts ndb/src/kernel/blocks/dbtux/Dbtux.hpp: included full my_global.h and resolved some resulting name conflicts ndb/src/rep/RepComponents.hpp: included full my_global.h and resolved some resulting name conflicts ndb/src/rep/rep_version.hpp: included full my_global.h and resolved some resulting name conflicts ndb/src/rep/storage/GCIContainer.hpp: included full my_global.h and resolved some resulting name conflicts --- ndb/include/logger/FileLogHandler.hpp | 4 +-- ndb/include/ndb_global.h | 4 +-- ndb/include/util/File.hpp | 14 ++++---- ndb/src/common/logger/FileLogHandler.cpp | 12 +++---- ndb/src/common/util/File.cpp | 44 ++++++++++++------------ ndb/src/common/util/strlcat.c | 1 + ndb/src/kernel/blocks/dbtux/Dbtux.hpp | 3 ++ ndb/src/rep/RepComponents.hpp | 1 - ndb/src/rep/rep_version.hpp | 2 +- ndb/src/rep/storage/GCIContainer.hpp | 2 ++ 10 files changed, 46 insertions(+), 41 deletions(-) diff --git a/ndb/include/logger/FileLogHandler.hpp b/ndb/include/logger/FileLogHandler.hpp index ae69a2f5418..08e46c11844 100644 --- a/ndb/include/logger/FileLogHandler.hpp +++ b/ndb/include/logger/FileLogHandler.hpp @@ -19,7 +19,7 @@ #include "LogHandler.hpp" -class File; +class File_class; /** * Logs messages to a file. The log file will be archived depending on @@ -104,7 +104,7 @@ private: int m_maxNoFiles; long m_maxFileSize; unsigned int m_maxLogEntries; - File* m_pLogFile; + File_class* m_pLogFile; }; #endif diff --git a/ndb/include/ndb_global.h b/ndb/include/ndb_global.h index 3db70f90ef2..eb52ea4268f 100644 --- a/ndb/include/ndb_global.h +++ b/ndb/include/ndb_global.h @@ -1,3 +1,3 @@ -/*#include */ -#include +#include +/*#include */ diff --git a/ndb/include/util/File.hpp b/ndb/include/util/File.hpp index fe3d2642b18..8418ea015bf 100644 --- a/ndb/include/util/File.hpp +++ b/ndb/include/util/File.hpp @@ -26,7 +26,7 @@ * * @version #@ $Id: File.hpp,v 1.5 2002/04/26 13:15:38 ejonore Exp $ */ -class File +class File_class { public: /** @@ -65,7 +65,7 @@ public: /** * Default constructor. */ - File(); + File_class(); /** * Creates a new File with the specified filename and file mode. @@ -76,12 +76,12 @@ public: * @param aFileName a filename. * @param mode the mode which the file should be opened/created with, default "r". */ - File(const char* aFileName, const char* mode = "r"); + File_class(const char* aFileName, const char* mode = "r"); /** * Destructor. */ - ~File(); + ~File_class(); /** * Opens/creates the file. If open() fails then 'errno' and perror() @@ -198,9 +198,9 @@ private: char m_fileName[MAX_FILE_NAME_SIZE]; const char* m_fileMode; /* Prohibit */ - File(const File& aCopy); - File operator = (const File&); - bool operator == (const File&); + File_class (const File_class& aCopy); + File_class operator = (const File_class&); + bool operator == (const File_class&); }; #endif diff --git a/ndb/src/common/logger/FileLogHandler.cpp b/ndb/src/common/logger/FileLogHandler.cpp index f3d547b4fe7..8e83510788b 100644 --- a/ndb/src/common/logger/FileLogHandler.cpp +++ b/ndb/src/common/logger/FileLogHandler.cpp @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "FileLogHandler.hpp" +#include #include @@ -35,7 +35,7 @@ FileLogHandler::FileLogHandler() : m_maxLogEntries(MAX_LOG_ENTRIES) { - m_pLogFile = new File("logger.log", "a+"); + m_pLogFile = new File_class("logger.log", "a+"); } FileLogHandler::FileLogHandler(const char* aFileName, @@ -47,7 +47,7 @@ FileLogHandler::FileLogHandler(const char* aFileName, m_maxFileSize(maxFileSize), m_maxLogEntries(maxLogEntries) { - m_pLogFile = new File(aFileName, "a+"); + m_pLogFile = new File_class(aFileName, "a+"); } FileLogHandler::~FileLogHandler() @@ -166,10 +166,10 @@ FileLogHandler::createNewFile() ::snprintf(newName, sizeof(newName), "%s.%d", m_pLogFile->getName(), fileNo++); - } while (File::exists(newName)); + } while (File_class::exists(newName)); m_pLogFile->close(); - if (!File::rename(m_pLogFile->getName(), newName)) + if (!File_class::rename(m_pLogFile->getName(), newName)) { setErrorCode(errno); rc = false; @@ -201,7 +201,7 @@ FileLogHandler::setFilename(const BaseString &filename) { close(); if(m_pLogFile) delete m_pLogFile; - m_pLogFile = new File(filename.c_str(), "a+"); + m_pLogFile = new File_class(filename.c_str(), "a+"); open(); return true; }; diff --git a/ndb/src/common/util/File.cpp b/ndb/src/common/util/File.cpp index ad72b41835d..bbd2067f424 100644 --- a/ndb/src/common/util/File.cpp +++ b/ndb/src/common/util/File.cpp @@ -31,7 +31,7 @@ // bool -File::exists(const char* aFileName) +File_class::exists(const char* aFileName) { bool rc = true; @@ -56,7 +56,7 @@ File::exists(const char* aFileName) } long -File::size(FILE* f) +File_class::size(FILE* f) { long cur_pos = 0, length = 0; @@ -69,23 +69,23 @@ File::size(FILE* f) } bool -File::rename(const char* currFileName, const char* newFileName) +File_class::rename(const char* currFileName, const char* newFileName) { return ::rename(currFileName, newFileName) == 0 ? true : false; } bool -File::remove(const char* aFileName) +File_class::remove(const char* aFileName) { return ::remove(aFileName) == 0 ? true : false; } -File::File() : +File_class::File_class() : m_file(NULL), m_fileMode("r") { } -File::File(const char* aFileName, const char* mode) : +File_class::File_class(const char* aFileName, const char* mode) : m_file(NULL), m_fileMode(mode) { @@ -93,13 +93,13 @@ File::File(const char* aFileName, const char* mode) : } bool -File::open() +File_class::open() { return open(m_fileName, m_fileMode); } bool -File::open(const char* aFileName, const char* mode) +File_class::open(const char* aFileName, const char* mode) { if(m_fileName != aFileName){ /** @@ -116,21 +116,21 @@ File::open(const char* aFileName, const char* mode) return rc; } -File::~File() +File_class::~File_class() { close(); } bool -File::remove() +File_class::remove() { // Close the file first! close(); - return File::remove(m_fileName); + return File_class::remove(m_fileName); } bool -File::close() +File_class::close() { bool rc = true; if (m_file != NULL) @@ -144,55 +144,55 @@ File::close() } int -File::read(void* buf, size_t itemSize, size_t nitems) const +File_class::read(void* buf, size_t itemSize, size_t nitems) const { return ::fread(buf, itemSize, nitems, m_file); } int -File::readChar(char* buf, long start, long length) const +File_class::readChar(char* buf, long start, long length) const { return ::fread((void*)&buf[start], 1, length, m_file); } int -File::readChar(char* buf) +File_class::readChar(char* buf) { return readChar(buf, 0, strlen(buf)); } int -File::write(const void* buf, size_t size, size_t nitems) +File_class::write(const void* buf, size_t size, size_t nitems) { return ::fwrite(buf, size, nitems, m_file); } int -File::writeChar(const char* buf, long start, long length) +File_class::writeChar(const char* buf, long start, long length) { return ::fwrite((const void*)&buf[start], sizeof(char), length, m_file); } int -File::writeChar(const char* buf) +File_class::writeChar(const char* buf) { return writeChar(buf, 0, ::strlen(buf)); } long -File::size() const +File_class::size() const { - return File::size(m_file); + return File_class::size(m_file); } const char* -File::getName() const +File_class::getName() const { return m_fileName; } int -File::flush() const +File_class::flush() const { #if defined NDB_OSE || defined NDB_SOFTOSE ::fflush(m_file); diff --git a/ndb/src/common/util/strlcat.c b/ndb/src/common/util/strlcat.c index f6e695dffa8..0235e9adf55 100644 --- a/ndb/src/common/util/strlcat.c +++ b/ndb/src/common/util/strlcat.c @@ -39,6 +39,7 @@ //#include #ifndef HAVE_STRLCAT + size_t strlcat (char *dst, const char *src, size_t dst_sz) { diff --git a/ndb/src/kernel/blocks/dbtux/Dbtux.hpp b/ndb/src/kernel/blocks/dbtux/Dbtux.hpp index c56e455a42a..4737c8422c4 100644 --- a/ndb/src/kernel/blocks/dbtux/Dbtux.hpp +++ b/ndb/src/kernel/blocks/dbtux/Dbtux.hpp @@ -83,6 +83,9 @@ #define jamEntry() jamEntryLine(90000 + __LINE__) #endif +#undef max +#undef min + class Configuration; class Dbtux : public SimulatedBlock { diff --git a/ndb/src/rep/RepComponents.hpp b/ndb/src/rep/RepComponents.hpp index 8b24858271b..ff0f29e2128 100644 --- a/ndb/src/rep/RepComponents.hpp +++ b/ndb/src/rep/RepComponents.hpp @@ -26,7 +26,6 @@ #include - /** * Connection data */ diff --git a/ndb/src/rep/rep_version.hpp b/ndb/src/rep/rep_version.hpp index 0182f080730..3830f9c351c 100644 --- a/ndb/src/rep/rep_version.hpp +++ b/ndb/src/rep/rep_version.hpp @@ -29,7 +29,7 @@ extern "C" void -DBUG_PRINT(const char * fmt, ...); +DBUG_PRINT__(const char * fmt, ...); extern "C" void diff --git a/ndb/src/rep/storage/GCIContainer.hpp b/ndb/src/rep/storage/GCIContainer.hpp index 173bb790a57..bcea11aae0f 100644 --- a/ndb/src/rep/storage/GCIContainer.hpp +++ b/ndb/src/rep/storage/GCIContainer.hpp @@ -17,6 +17,8 @@ #ifndef GCI_CONTAINER_HPP #define GCI_CONTAINER_HPP +#undef swap + #include #include "LogRecord.hpp" From dea071fd5bd9a49e0c3388c99061a072a2313d55 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 6 May 2004 15:13:23 +0200 Subject: [PATCH 011/162] don't let -B increment opt_silent twice --- client/mysql.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/mysql.cc b/client/mysql.cc index e4499cc67ec..ddc6441f08a 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -800,7 +800,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), case 'B': status.batch= 1; status.add_to_history= 0; - opt_silent++; // more silent + set_if_bigger(opt_silent,1); // more silent break; case 'W': #ifdef __WIN__ From bfe2425aadc92071392cc339229270f563a22216 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 6 May 2004 15:53:01 +0200 Subject: [PATCH 012/162] WL#1687 - Optimize UNION DISTINCT ... UNION ALL (again). HEAP: Copies the key count to a backup variable and sets the key count to zero. That way, no HEAP function will ever try to touch any index. Re-enabling is done by copying back the backup variable. To avoid memory leak at table close, disable deletes all index trees. Re-enabling must be done with empty indexes and data anyway. Otherwise, the indexes would need to be repaired, wich HEAP is not capable of. MyISAM: Only the key_map is cleared and set. Re-enabling must be done with empty indexes and data. Otherwise, repair needs to be done which will enable all keys persistently. The former implementation disabled only non-unique keys and maked this persistent. The new implementation additionally can disable all keys, but only without making this persistent. Re-enabling all keys can be done without repair, if data file and indexes are empty. heap/heapdef.h: WL#1687 - Optimize UNION DISTINCT ... UNION ALL (again). Pulled hp_clear_keys() out of hp_clear(). heap/hp_clear.c: WL#1687 - Optimize UNION DISTINCT ... UNION ALL (again). Pulled hp_clear_keys() out of hp_clear(). Added the new functions for disabling and enabling keys and to ask for the key state. include/heap.h: WL#1687 - Optimize UNION DISTINCT ... UNION ALL (again). Added a new HP_SHARE element to save the key count while keys are disabled. Added declarations for the new functions. myisam/mi_open.c: WL#1687 - Optimize UNION DISTINCT ... UNION ALL (again). Added the new functions for disabling and enabling keys and to ask for the key state. myisam/myisamdef.h: WL#1687 - Optimize UNION DISTINCT ... UNION ALL (again). Added declarations for the new functions. sql/ha_heap.cc: WL#1687 - Optimize UNION DISTINCT ... UNION ALL (again). Pulled set_keys_for_scanning() out of open(). Added the new functions for disabling and enabling keys and to ask for the key state. sql/ha_heap.h: WL#1687 - Optimize UNION DISTINCT ... UNION ALL (again). Added declarations for the new functions. sql/ha_myisam.cc: WL#1687 - Optimize UNION DISTINCT ... UNION ALL (again). Extended disable_indexes() for all keys and no save. The argument is now 'mode' as it must handle different cases. Extended enable_indexes() for no save. The new feature needs the new argument 'mode' with the same semantics as in disable_indexes(). Added indexes_are_disabled() to ask for the key state. Extended the existing call to enable_indexes() by the new argument. sql/ha_myisam.h: WL#1687 - Optimize UNION DISTINCT ... UNION ALL (again). Modified the declarations of dis-/enable_indexes() for the new argument. Added the declaration of the new function to ask for the key state. sql/handler.h: WL#1687 - Optimize UNION DISTINCT ... UNION ALL (again). Added declarations for the operation modes for the key switching functions. Modified the declarations of dis-/enable_indexes() for the new argument. Added the declaration of the new function to ask for the key state. sql/sql_select.cc: WL#1687 - Optimize UNION DISTINCT ... UNION ALL (again). In create_myisam_from_heap() take notice of disabled keys and disable them in the new table before copying the data. sql/sql_table.cc: WL#1687 - Optimize UNION DISTINCT ... UNION ALL (again). Modified the calls of dis-/enable_indexes() for the new argument. --- heap/heapdef.h | 3 +- heap/hp_clear.c | 145 ++++++++++++++++++++++++++++++++++++-- include/heap.h | 7 +- myisam/mi_open.c | 83 +++++++++++++++++++++- myisam/myisamdef.h | 5 +- sql/ha_heap.cc | 144 ++++++++++++++++++++++++++++++++++++-- sql/ha_heap.h | 6 +- sql/ha_myisam.cc | 168 ++++++++++++++++++++++++++++++++++++--------- sql/ha_myisam.h | 7 +- sql/handler.h | 14 +++- sql/sql_select.cc | 4 +- sql/sql_table.cc | 6 +- 12 files changed, 530 insertions(+), 62 deletions(-) diff --git a/heap/heapdef.h b/heap/heapdef.h index 63109badb05..083765334ab 100644 --- a/heap/heapdef.h +++ b/heap/heapdef.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB +/* Copyright (C) 2000,2004 MySQL AB & MySQL Finland AB & TCX DataKonsult AB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -97,6 +97,7 @@ extern uint hp_rb_null_key_length(HP_KEYDEF *keydef, const byte *key); extern my_bool hp_if_null_in_key(HP_KEYDEF *keyinfo, const byte *record); extern int hp_close(register HP_INFO *info); extern void hp_clear(HP_SHARE *info); +extern void hp_clear_keys(HP_SHARE *info); extern uint hp_rb_pack_key(HP_KEYDEF *keydef, uchar *key, const uchar *old, uint k_len); #ifdef THREAD diff --git a/heap/hp_clear.c b/heap/hp_clear.c index e65d3a172c3..4440344f990 100644 --- a/heap/hp_clear.c +++ b/heap/hp_clear.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB +/* Copyright (C) 2000,2004 MySQL AB & MySQL Finland AB & TCX DataKonsult AB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -29,13 +29,60 @@ void heap_clear(HP_INFO *info) void hp_clear(HP_SHARE *info) { - uint key; DBUG_ENTER("hp_clear"); if (info->block.levels) VOID(hp_free_level(&info->block,info->block.levels,info->block.root, (byte*) 0)); info->block.levels=0; + hp_clear_keys(info); + info->records=info->deleted=info->data_length=0; + info->blength=1; + info->changed=0; + info->del_link=0; + DBUG_VOID_RETURN; +} + + +/* + Clear all keys. + + SYNOPSIS + heap_clear_keys() + info A pointer to the heap storage engine HP_INFO struct. + + DESCRIPTION + Delete all trees of all indexes and leave them empty. + + RETURN + void +*/ + +void heap_clear_keys(HP_INFO *info) +{ + hp_clear(info->s); +} + + +/* + Clear all keys. + + SYNOPSIS + hp_clear_keys() + info A pointer to the heap storage engine HP_SHARE struct. + + DESCRIPTION + Delete all trees of all indexes and leave them empty. + + RETURN + void +*/ + +void hp_clear_keys(HP_SHARE *info) +{ + uint key; + DBUG_ENTER("hp_clear_keys"); + for (key=0 ; key < info->keys ; key++) { HP_KEYDEF *keyinfo = info->keydef + key; @@ -52,9 +99,95 @@ void hp_clear(HP_SHARE *info) block->last_allocated=0; } } - info->records=info->deleted=info->data_length=info->index_length=0; - info->blength=1; - info->changed=0; - info->del_link=0; + info->index_length=0; DBUG_VOID_RETURN; } + + +/* + Disable all indexes. + + SYNOPSIS + heap_disable_indexes() + info A pointer to the heap storage engine HP_INFO struct. + + DESCRIPTION + Disable and clear (remove contents of) all indexes. + + RETURN + 0 ok +*/ + +int heap_disable_indexes(HP_INFO *info) +{ + HP_SHARE *share= info->s; + + if (share->keys) + { + hp_clear_keys(share); + share->currently_disabled_keys= share->keys; + share->keys= 0; + } + return 0; +} + + +/* + Enable all indexes + + SYNOPSIS + heap_enable_indexes() + info A pointer to the heap storage engine HP_INFO struct. + + DESCRIPTION + Enable all indexes. The indexes might have been disabled + by heap_disable_index() before. + The function works only if both data and indexes are empty, + since the heap storage engine cannot repair the indexes. + To be sure, call handler::delete_all_rows() before. + + RETURN + 0 ok + HA_ERR_CRASHED data or index is non-empty. +*/ + +int heap_enable_indexes(HP_INFO *info) +{ + int error= 0; + HP_SHARE *share= info->s; + + if (share->data_length || share->index_length) + error= HA_ERR_CRASHED; + else + if (share->currently_disabled_keys) + { + share->keys= share->currently_disabled_keys; + share->currently_disabled_keys= 0; + } + return error; +} + + +/* + Test if indexes are disabled. + + SYNOPSIS + heap_indexes_are_disabled() + info A pointer to the heap storage engine HP_INFO struct. + + DESCRIPTION + Test if indexes are disabled. + + RETURN + 0 indexes are not disabled + 1 all indexes are disabled + [2 non-unique indexes are disabled - NOT YET IMPLEMENTED] +*/ + +int heap_indexes_are_disabled(HP_INFO *info) +{ + HP_SHARE *share= info->s; + + return (! share->keys && share->currently_disabled_keys); +} + diff --git a/include/heap.h b/include/heap.h index c5f2be81fb7..b536937c8c0 100644 --- a/include/heap.h +++ b/include/heap.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (C) 2000,2004 MySQL AB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -107,6 +107,7 @@ typedef struct st_heap_share uint reclength; /* Length of one record */ uint changed; uint keys,max_key_length; + uint currently_disabled_keys; /* saved value from "keys" when disabled */ uint open_count; byte *del_link; /* Link to next block with del. rec */ my_string name; /* Name of "memory-file" */ @@ -176,6 +177,10 @@ extern int heap_rprev(HP_INFO *info,byte *record); extern int heap_rfirst(HP_INFO *info,byte *record,int inx); extern int heap_rlast(HP_INFO *info,byte *record,int inx); extern void heap_clear(HP_INFO *info); +extern void heap_clear_keys(HP_INFO *info); +extern int heap_disable_indexes(HP_INFO *info); +extern int heap_enable_indexes(HP_INFO *info); +extern int heap_indexes_are_disabled(HP_INFO *info); extern void heap_update_auto_increment(HP_INFO *info, const byte *record); ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, const byte *start_key, uint start_key_len, diff --git a/myisam/mi_open.c b/myisam/mi_open.c index 2c4661c4d3e..53cf87b24b4 100644 --- a/myisam/mi_open.c +++ b/myisam/mi_open.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB +/* Copyright (C) 2000,2004 MySQL AB & MySQL Finland AB & TCX DataKonsult AB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1151,3 +1151,84 @@ int mi_open_keyfile(MYISAM_SHARE *share) return 1; return 0; } + + +/* + Disable all indexes. + + SYNOPSIS + mi_disable_indexes() + info A pointer to the MyISAM storage engine MI_INFO struct. + + DESCRIPTION + Disable all indexes. + + RETURN + 0 ok +*/ + +int mi_disable_indexes(MI_INFO *info) +{ + MYISAM_SHARE *share= info->s; + + share->state.key_map= 0; + return 0; +} + + +/* + Enable all indexes + + SYNOPSIS + mi_enable_indexes() + info A pointer to the MyISAM storage engine MI_INFO struct. + + DESCRIPTION + Enable all indexes. The indexes might have been disabled + by mi_disable_index() before. + The function works only if both data and indexes are empty, + otherwise a repair is required. + To be sure, call handler::delete_all_rows() before. + + RETURN + 0 ok + HA_ERR_CRASHED data or index is non-empty. +*/ + +int mi_enable_indexes(MI_INFO *info) +{ + int error= 0; + MYISAM_SHARE *share= info->s; + + if (share->state.state.data_file_length || + (share->state.state.key_file_length != share->base.keystart)) + error= HA_ERR_CRASHED; + else + share->state.key_map= ((ulonglong) 1L << share->base.keys) - 1; + return error; +} + + +/* + Test if indexes are disabled. + + SYNOPSIS + mi_indexes_are_disabled() + info A pointer to the MyISAM storage engine MI_INFO struct. + + DESCRIPTION + Test if indexes are disabled. + + RETURN + 0 indexes are not disabled + 1 all indexes are disabled + [2 non-unique indexes are disabled - NOT YET IMPLEMENTED] +*/ + +int mi_indexes_are_disabled(MI_INFO *info) +{ + MYISAM_SHARE *share= info->s; + + return (! share->state.key_map && share->base.keys); +} + diff --git a/myisam/myisamdef.h b/myisam/myisamdef.h index 0f43fe7fb61..1f100590049 100644 --- a/myisam/myisamdef.h +++ b/myisam/myisamdef.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB +/* Copyright (C) 2000,2004 MySQL AB & MySQL Finland AB & TCX DataKonsult AB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -684,6 +684,9 @@ uint mi_uniquedef_write(File file, MI_UNIQUEDEF *keydef); char *mi_uniquedef_read(char *ptr, MI_UNIQUEDEF *keydef); uint mi_recinfo_write(File file, MI_COLUMNDEF *recinfo); char *mi_recinfo_read(char *ptr, MI_COLUMNDEF *recinfo); +extern int mi_disable_indexes(MI_INFO *info); +extern int mi_enable_indexes(MI_INFO *info); +extern int mi_indexes_are_disabled(MI_INFO *info); ulong _my_calc_total_blob_length(MI_INFO *info, const byte *record); ha_checksum mi_checksum(MI_INFO *info, const byte *buf); ha_checksum mi_static_checksum(MI_INFO *info, const byte *buf); diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc index 47978d647ec..12b922e6fc0 100644 --- a/sql/ha_heap.cc +++ b/sql/ha_heap.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB +/* Copyright (C) 2000,2004 MySQL AB & MySQL Finland AB & TCX DataKonsult AB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -47,12 +47,7 @@ int ha_heap::open(const char *name, int mode, uint test_if_locked) if (file) { /* Initialize variables for the opened table */ - btree_keys.clear_all(); - for (uint i= 0 ; i < table->keys ; i++) - { - if (table->key_info[i].algorithm == HA_KEY_ALG_BTREE) - btree_keys.set_bit(i); - } + set_keys_for_scanning(); } return (file ? 0 : 1); } @@ -62,6 +57,33 @@ int ha_heap::close(void) return heap_close(file); } + +/* + Compute which keys to use for scanning + + SYNOPSIS + set_keys_for_scanning() + no parameter + + DESCRIPTION + Set the bitmap btree_keys, which is used when the upper layers ask + which keys to use for scanning. For each btree index the + corresponding bit is set. + + RETURN + void +*/ + +void ha_heap::set_keys_for_scanning(void) +{ + btree_keys.clear_all(); + for (uint i= 0 ; i < table->keys ; i++) + { + if (table->key_info[i].algorithm == HA_KEY_ALG_BTREE) + btree_keys.set_bit(i); + } +} + int ha_heap::write_row(byte * buf) { statistic_increment(ha_write_count,&LOCK_status); @@ -207,6 +229,114 @@ int ha_heap::external_lock(THD *thd, int lock_type) return 0; // No external locking } + +/* + Disable indexes. + + SYNOPSIS + disable_indexes() + mode mode of operation: + HA_KEY_SWITCH_NONUNIQ disable all non-unique keys + HA_KEY_SWITCH_ALL disable all keys + HA_KEY_SWITCH_NONUNIQ_SAVE dis. non-uni. and make persistent + HA_KEY_SWITCH_ALL_SAVE dis. all keys and make persistent + + DESCRIPTION + Disable indexes and clear keys to use for scanning. + + IMPLEMENTATION + HA_KEY_SWITCH_NONUNIQ is not implemented. + HA_KEY_SWITCH_NONUNIQ_SAVE is not implemented with HEAP. + HA_KEY_SWITCH_ALL_SAVE is not implemented with HEAP. + + RETURN + 0 ok + HA_ERR_WRONG_COMMAND mode not implemented. +*/ + +int ha_heap::disable_indexes(uint mode) +{ + int error; + + if (mode == HA_KEY_SWITCH_ALL) + { + if (!(error= heap_disable_indexes(file))) + set_keys_for_scanning(); + } + else + { + /* mode not implemented */ + error= HA_ERR_WRONG_COMMAND; + } + return error; +} + + +/* + Enable indexes. + + SYNOPSIS + enable_indexes() + mode mode of operation: + HA_KEY_SWITCH_NONUNIQ enable all non-unique keys + HA_KEY_SWITCH_ALL enable all keys + HA_KEY_SWITCH_NONUNIQ_SAVE en. non-uni. and make persistent + HA_KEY_SWITCH_ALL_SAVE en. all keys and make persistent + + DESCRIPTION + Enable indexes and set keys to use for scanning. + The indexes might have been disabled by disable_index() before. + The function works only if both data and indexes are empty, + since the heap storage engine cannot repair the indexes. + To be sure, call handler::delete_all_rows() before. + + IMPLEMENTATION + HA_KEY_SWITCH_NONUNIQ is not implemented. + HA_KEY_SWITCH_NONUNIQ_SAVE is not implemented with HEAP. + HA_KEY_SWITCH_ALL_SAVE is not implemented with HEAP. + + RETURN + 0 ok + HA_ERR_CRASHED data or index is non-empty. Delete all rows and retry. + HA_ERR_WRONG_COMMAND mode not implemented. +*/ + +int ha_heap::enable_indexes(uint mode) +{ + int error; + + if (mode == HA_KEY_SWITCH_ALL) + { + if (!(error= heap_enable_indexes(file))) + set_keys_for_scanning(); + } + else + { + /* mode not implemented */ + error= HA_ERR_WRONG_COMMAND; + } + return error; +} + + +/* + Test if indexes are disabled. + + SYNOPSIS + indexes_are_disabled() + no parameters + + RETURN + 0 indexes are not disabled + 1 all indexes are disabled + [2 non-unique indexes are disabled - NOT YET IMPLEMENTED] +*/ + +int ha_heap::indexes_are_disabled(void) +{ + return heap_indexes_are_disabled(file); +} + THR_LOCK_DATA **ha_heap::store_lock(THD *thd, THR_LOCK_DATA **to, enum thr_lock_type lock_type) diff --git a/sql/ha_heap.h b/sql/ha_heap.h index 68406202c76..2f849d2574b 100644 --- a/sql/ha_heap.h +++ b/sql/ha_heap.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB +/* Copyright (C) 2000,2004 MySQL AB & MySQL Finland AB & TCX DataKonsult AB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -61,6 +61,7 @@ class ha_heap: public handler int open(const char *name, int mode, uint test_if_locked); int close(void); + void set_keys_for_scanning(void); int write_row(byte * buf); int update_row(const byte * old_data, byte * new_data); int delete_row(const byte * buf); @@ -82,6 +83,9 @@ class ha_heap: public handler int extra(enum ha_extra_function operation); int external_lock(THD *thd, int lock_type); int delete_all_rows(void); + int disable_indexes(uint mode); + int enable_indexes(uint mode); + int indexes_are_disabled(void); ha_rows records_in_range(int inx, const byte *start_key,uint start_key_len, enum ha_rkey_function start_search_flag, const byte *end_key,uint end_key_len, diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index b9d6cec38aa..1b24633953d 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB +/* Copyright (C) 2000,2004 MySQL AB & MySQL Finland AB & TCX DataKonsult AB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -810,47 +810,146 @@ int ha_myisam::preload_keys(THD* thd, HA_CHECK_OPT *check_opt) } } + /* - disable indexes, making it persistent if requested + Disable indexes, making it persistent if requested. + SYNOPSIS - disable_indexes(all, save) - all disable all indexes - if not set only non-unique indexes will be disabled - [all=1 is NOT IMPLEMENTED YET] - save save the disabled state, so that it will persist - between queries/threads/reboots - [save=0 is NOT IMPLEMENTED YET] + disable_indexes() + mode mode of operation: + HA_KEY_SWITCH_NONUNIQ disable all non-unique keys + HA_KEY_SWITCH_ALL disable all keys + HA_KEY_SWITCH_NONUNIQ_SAVE dis. non-uni. and make persistent + HA_KEY_SWITCH_ALL_SAVE dis. all keys and make persistent + + IMPLEMENTATION + HA_KEY_SWITCH_NONUNIQ is not implemented. + HA_KEY_SWITCH_ALL_SAVE is not implemented. + + RETURN + 0 ok + HA_ERR_WRONG_COMMAND mode not implemented. */ -int ha_myisam::disable_indexes(bool all, bool save) -{ - mi_extra(file, HA_EXTRA_NO_KEYS, 0); - info(HA_STATUS_CONST); // Read new key info - return 0; -} -int ha_myisam::enable_indexes() +int ha_myisam::disable_indexes(uint mode) { - if (file->s->state.key_map == set_bits(ulonglong, file->s->base.keys)) - return 0; + int error; - int error=0; - THD *thd=current_thd; - MI_CHECK param; - const char *save_proc_info=thd->proc_info; - thd->proc_info="Creating index"; - myisamchk_init(¶m); - param.op_name = (char*) "recreating_index"; - param.testflag = (T_SILENT | T_REP_BY_SORT | T_QUICK | - T_CREATE_MISSING_KEYS); - param.myf_rw&= ~MY_WAIT_IF_FULL; - param.sort_buffer_length= thd->variables.myisam_sort_buff_size; - param.tmpdir=&mysql_tmpdir_list; - error=repair(thd,param,0) != HA_ADMIN_OK; - info(HA_STATUS_CONST); - thd->proc_info=save_proc_info; + if (mode == HA_KEY_SWITCH_ALL) + { + /* call a storage engine function to switch the key map */ + error= mi_disable_indexes(file); + } + else if (mode == HA_KEY_SWITCH_NONUNIQ_SAVE) + { + mi_extra(file, HA_EXTRA_NO_KEYS, 0); + info(HA_STATUS_CONST); // Read new key info + error= 0; + } + else + { + /* mode not implemented */ + error= HA_ERR_WRONG_COMMAND; + } return error; } + +/* + Enable indexes, making it persistent if requested. + + SYNOPSIS + enable_indexes() + mode mode of operation: + HA_KEY_SWITCH_NONUNIQ enable all non-unique keys + HA_KEY_SWITCH_ALL enable all keys + HA_KEY_SWITCH_NONUNIQ_SAVE en. non-uni. and make persistent + HA_KEY_SWITCH_ALL_SAVE en. all keys and make persistent + + DESCRIPTION + Enable indexes, which might have been disabled by disable_index() before. + The modes without _SAVE work only if both data and indexes are empty, + since the MyISAM repair would enable them persistently. + To be sure in these cases, call handler::delete_all_rows() before. + + IMPLEMENTATION + HA_KEY_SWITCH_NONUNIQ is not implemented. + HA_KEY_SWITCH_ALL_SAVE is not implemented. + + RETURN + 0 ok + !=0 Error, among others: + HA_ERR_CRASHED data or index is non-empty. Delete all rows and retry. + HA_ERR_WRONG_COMMAND mode not implemented. +*/ + +int ha_myisam::enable_indexes(uint mode) +{ + int error; + + if (file->s->state.key_map == set_bits(ulonglong, file->s->base.keys)) + { + /* All indexes are enabled already. */ + return 0; + } + + if (mode == HA_KEY_SWITCH_ALL) + { + error= mi_enable_indexes(file); + /* + Do not try to repair on error, + as this could make the enabled state persistent, + but mode==HA_KEY_SWITCH_ALL forbids it. + */ + } + else if (mode == HA_KEY_SWITCH_NONUNIQ_SAVE) + { + THD *thd=current_thd; + MI_CHECK param; + const char *save_proc_info=thd->proc_info; + thd->proc_info="Creating index"; + myisamchk_init(¶m); + param.op_name = (char*) "recreating_index"; + param.testflag = (T_SILENT | T_REP_BY_SORT | T_QUICK | + T_CREATE_MISSING_KEYS); + param.myf_rw&= ~MY_WAIT_IF_FULL; + param.sort_buffer_length= thd->variables.myisam_sort_buff_size; + param.tmpdir=&mysql_tmpdir_list; + error=repair(thd,param,0) != HA_ADMIN_OK; + info(HA_STATUS_CONST); + thd->proc_info=save_proc_info; + } + else + { + /* mode not implemented */ + error= HA_ERR_WRONG_COMMAND; + } + return error; +} + + +/* + Test if indexes are disabled. + + + SYNOPSIS + indexes_are_disabled() + no parameters + + + RETURN + 0 indexes are not disabled + 1 all indexes are disabled + [2 non-unique indexes are disabled - NOT YET IMPLEMENTED] +*/ + +int ha_myisam::indexes_are_disabled(void) +{ + + return mi_indexes_are_disabled(file); +} + + /* prepare for a many-rows insert operation e.g. - disable indexes (if they can be recreated fast) or @@ -898,7 +997,8 @@ int ha_myisam::end_bulk_insert() { mi_end_bulk_insert(file); int err=mi_extra(file, HA_EXTRA_NO_CACHE, 0); - return err ? err : can_enable_indexes ? enable_indexes() : 0; + return err ? err : can_enable_indexes ? + enable_indexes(HA_KEY_SWITCH_NONUNIQ_SAVE) : 0; } diff --git a/sql/ha_myisam.h b/sql/ha_myisam.h index ca318b02778..206a1c62a2f 100644 --- a/sql/ha_myisam.h +++ b/sql/ha_myisam.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB +/* Copyright (C) 2000,2004 MySQL AB & MySQL Finland AB & TCX DataKonsult AB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -105,8 +105,9 @@ class ha_myisam: public handler int extra_opt(enum ha_extra_function operation, ulong cache_size); int external_lock(THD *thd, int lock_type); int delete_all_rows(void); - int disable_indexes(bool all, bool save); - int enable_indexes(); + int disable_indexes(uint mode); + int enable_indexes(uint mode); + int indexes_are_disabled(void); void start_bulk_insert(ha_rows rows); int end_bulk_insert(); ha_rows records_in_range(int inx, diff --git a/sql/handler.h b/sql/handler.h index 62ff74c436a..33d713090df 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB +/* Copyright (C) 2000,2004 MySQL AB & MySQL Finland AB & TCX DataKonsult AB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -91,6 +91,13 @@ #define HA_KEY_READ_ONLY 64 /* Support HA_EXTRA_KEYREAD */ +/* operations for disable/enable indexes */ +#define HA_KEY_SWITCH_NONUNIQ 0 +#define HA_KEY_SWITCH_ALL 1 +#define HA_KEY_SWITCH_NONUNIQ_SAVE 2 +#define HA_KEY_SWITCH_ALL_SAVE 3 + + /* Bits in index_ddl_flags(KEY *wanted_index) for what ddl you can do with index @@ -371,8 +378,9 @@ public: */ virtual int restore(THD* thd, HA_CHECK_OPT* check_opt); virtual int dump(THD* thd, int fd = -1) { return ER_DUMP_NOT_IMPLEMENTED; } - virtual int disable_indexes(bool all, bool save) { return HA_ERR_WRONG_COMMAND; } - virtual int enable_indexes() { return HA_ERR_WRONG_COMMAND; } + virtual int disable_indexes(uint mode) { return HA_ERR_WRONG_COMMAND; } + virtual int enable_indexes(uint mode) { return HA_ERR_WRONG_COMMAND; } + virtual int indexes_are_disabled(void) {return 0;} virtual void start_bulk_insert(ha_rows rows) {} virtual int end_bulk_insert() {return 0; } virtual int discard_or_import_tablespace(my_bool discard) {return -1;} diff --git a/sql/sql_select.cc b/sql/sql_select.cc index ffc52817322..f8347b9342f 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2003 MySQL AB & MySQL Finland AB & TCX DataKonsult AB +/* Copyright (C) 2000-2004 MySQL AB & MySQL Finland AB & TCX DataKonsult AB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -5545,6 +5545,8 @@ bool create_myisam_from_heap(THD *thd, TABLE *table, TMP_TABLE_PARAM *param, goto err2; if (open_tmp_table(&new_table)) goto err1; + if (table->file->indexes_are_disabled()) + new_table.file->disable_indexes(HA_KEY_SWITCH_ALL); table->file->index_end(); table->file->rnd_init(); if (table->no_rows) diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 0d0be1b7e10..fd980f90468 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2003 MySQL AB +/* Copyright (C) 2000-2004 MySQL AB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -2556,14 +2556,14 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, VOID(pthread_mutex_lock(&LOCK_open)); wait_while_table_is_used(thd, table, HA_EXTRA_FORCE_REOPEN); VOID(pthread_mutex_unlock(&LOCK_open)); - error= table->file->enable_indexes(); + error= table->file->enable_indexes(HA_KEY_SWITCH_NONUNIQ_SAVE); /* COND_refresh will be signaled in close_thread_tables() */ break; case DISABLE: VOID(pthread_mutex_lock(&LOCK_open)); wait_while_table_is_used(thd, table, HA_EXTRA_FORCE_REOPEN); VOID(pthread_mutex_unlock(&LOCK_open)); - error=table->file->disable_indexes(0, 1); + error=table->file->disable_indexes(HA_KEY_SWITCH_NONUNIQ_SAVE); /* COND_refresh will be signaled in close_thread_tables() */ break; } From 392757a2144e8cd82effe2a9065fc84ec63f5680 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 6 May 2004 16:15:46 +0200 Subject: [PATCH 013/162] Fix a forgotten skip of space at line begin for the 'system' command. BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + client/mysql.cc | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index b805749821c..a51078f675f 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -39,6 +39,7 @@ hf@deer.mysql.r18.ru hf@genie.(none) igor@hundin.mysql.fi igor@rurik.mysql.com +ingo@mysql.com jani@dsl-jkl1657.dial.inet.fi jani@hynda.(none) jani@hynda.mysql.fi diff --git a/client/mysql.cc b/client/mysql.cc index 695cb1f28be..46ade3aef26 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -2042,6 +2042,10 @@ static int com_shell(String *buffer, char *line __attribute__((unused))) { char *shell_cmd; + + /* Skip space from line begin */ + while (isspace(*line)) + line++; if (!(shell_cmd = strchr(line, ' '))) { put_info("Usage: \\! shell-command", INFO_ERROR); From 1a4f499ca87634d4256d2531bab68b32f3e5fa49 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 6 May 2004 20:40:21 +0300 Subject: [PATCH 014/162] EXPLAIN UNION using same routing which used for execution which allow return correct bug messages (Bug #3639) EXPLAIN of hidden SELECT of UNION mysql-test/r/derived.result: explain of hidden select mysql-test/r/subselect.result: explain of hidden select mysql-test/r/union.result: explain of hidden select correct error messages on explain mysql-test/t/subselect.test: show eliminated costants in WHERE clause mysql-test/t/union.test: correct error messages on EXPLAIN with union sql/item.cc: fixed name constructing for global ORDER BY items sql/sql_class.h: select ID can be negative (for hidden SELECTs) removed unused field sql/sql_lex.cc: new flag of UNION EXPLAIN sql/sql_lex.h: new flag of UNION EXPLAIN select ID can be negative (for hidden SELECTs) sql/sql_select.cc: EXPLAIN UNION using same routing which used for execution explain for hidden SELECT of UNION sql/sql_union.cc: EXPLAIN UNION using same routing which used for execution --- mysql-test/r/derived.result | 4 + mysql-test/r/subselect.result | 11 ++- mysql-test/r/union.result | 23 +++--- mysql-test/t/subselect.test | 2 +- mysql-test/t/union.test | 12 +++ sql/item.cc | 11 ++- sql/sql_class.h | 3 +- sql/sql_lex.cc | 1 + sql/sql_lex.h | 3 +- sql/sql_select.cc | 147 ++++++++++++++++++++++------------ sql/sql_union.cc | 36 +++++++-- 11 files changed, 179 insertions(+), 74 deletions(-) diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result index 81e2cd03d1a..cdbca9aa2aa 100644 --- a/mysql-test/r/derived.result +++ b/mysql-test/r/derived.result @@ -94,11 +94,13 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY ALL NULL NULL NULL NULL 3 2 DERIVED t1 ALL NULL NULL NULL NULL 4 3 UNION t1 ALL NULL NULL NULL NULL 4 +-2 UNION RESULT ALL NULL NULL NULL NULL NULL explain select * from (select * from t1 union all select * from t1) a; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY ALL NULL NULL NULL NULL 8 2 DERIVED t1 ALL NULL NULL NULL NULL 4 3 UNION t1 ALL NULL NULL NULL NULL 4 +-2 UNION RESULT ALL NULL NULL NULL NULL NULL CREATE TABLE t2 (a int not null); insert into t2 values(1); select * from (select * from t1 where t1.a=(select a from t2 where t2.a=t1.a)) a; @@ -246,8 +248,10 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY ALL NULL NULL NULL NULL 2 4 DERIVED t1 ALL NULL NULL NULL NULL 2 5 UNION t1 ALL NULL NULL NULL NULL 2 +-4 UNION RESULT ALL NULL NULL NULL NULL NULL 2 DERIVED t1 ALL NULL NULL NULL NULL 2 3 UNION t1 ALL NULL NULL NULL NULL 2 +-2 UNION RESULT ALL NULL NULL NULL NULL NULL drop table t1; CREATE TABLE `t1` ( `N` int(11) unsigned NOT NULL default '0', diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index a2210fde222..f578c1a6b64 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -16,6 +16,7 @@ explain extended SELECT (SELECT 1) UNION SELECT (SELECT 2); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used 3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used +-1 UNION RESULT ALL NULL NULL NULL NULL NULL Warnings: Note 1249 Select 2 was reduced during optimisation Note 1249 Select 4 was reduced during optimisation @@ -28,6 +29,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used 3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used 4 UNION NULL NULL NULL NULL NULL NULL NULL No tables used +-3 UNION RESULT ALL NULL NULL NULL NULL NULL Warnings: Note 1249 Select 2 was reduced during optimisation Note 1003 select high_priority (select 0 AS `0` union select 0 AS `0`) AS `(SELECT (SELECT 0 UNION SELECT 0))` @@ -182,6 +184,7 @@ id select_type table type possible_keys key key_len ref rows Extra 2 SUBQUERY t3 ALL NULL NULL NULL NULL 3 Using filesort 3 UNION t4 ALL NULL NULL NULL NULL 3 Using where; Using filesort 4 SUBQUERY t2 ALL NULL NULL NULL NULL 2 +-1 UNION RESULT ALL NULL NULL NULL NULL NULL Warnings: Note 1003 (select high_priority test.t2.a AS `a`,test.t2.b AS `b` from test.t2 where (test.t2.b = (select test.t3.a AS `a` from test.t3 order by test.t3.a desc limit 1))) union (select test.t4.a AS `a`,test.t4.b AS `b` from test.t4 where (test.t4.b = (select (max(test.t2.a) * 4) AS `max(t2.a)*4` from test.t2)) order by test.t4.a) select (select a from t3 where a ALL NULL NULL NULL NULL NULL Warnings: Note 1276 Field or reference 't2.a' of SELECT #2 was resolved in SELECT #1 Note 1276 Field or reference 't2.a' of SELECT #3 was resolved in SELECT #1 @@ -413,6 +417,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 index NULL topic 3 NULL 2 Using index 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used 3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used +-2 UNION RESULT ALL NULL NULL NULL NULL NULL Warnings: Note 1003 select high_priority 1 AS `1` from test.t1 drop table t1; @@ -727,6 +732,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 index NULL id 5 NULL 2 Using where; Using index 2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used 3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL No tables used +-2 UNION RESULT ALL NULL NULL NULL NULL NULL Warnings: Note 1003 select high_priority test.t2.id AS `id` from test.t2 where (test.t2.id,(select 1 AS `Not_used` having ((test.t2.id) = (1)) union select 1 AS `Not_used` having ((test.t2.id) = (3)))) SELECT * FROM t2 WHERE id IN (SELECT 5 UNION SELECT 3); @@ -1536,11 +1542,14 @@ e select * from t1 where 'f' > any (select s1 from t1 union select s1 from t1); s1 e -explain select * from t1 where 'f' > any (select s1 from t1 union select s1 from t1); +explain extended select * from t1 where 'f' > any (select s1 from t1 union select s1 from t1); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system NULL NULL NULL NULL 1 2 SUBQUERY t1 system NULL NULL NULL NULL 1 3 UNION t1 system NULL NULL NULL NULL 1 +-2 UNION RESULT ALL NULL NULL NULL NULL NULL +Warnings: +Note 1003 select high_priority test.t1.s1 AS `s1` from test.t1 drop table t1; CREATE TABLE t1 (number char(11) NOT NULL default '') ENGINE=MyISAM CHARSET=latin1; INSERT INTO t1 VALUES ('69294728265'),('18621828126'),('89356874041'),('95895001874'); diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index bf8b8df7c65..d14c4408946 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -86,6 +86,7 @@ explain extended (select a,b from t1 limit 2) union all (select a,b from t2 ord id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 4 2 UNION t2 ALL NULL NULL NULL NULL 4 Using filesort +-1 UNION RESULT ALL NULL NULL NULL NULL NULL Using filesort Warnings: Note 1003 (select high_priority test.t1.a AS `a`,test.t1.b AS `b` from test.t1 limit 2) union all (select test.t2.a AS `a`,test.t2.b AS `b` from test.t2 order by test.t2.a limit 1) order by b desc (select sql_calc_found_rows a,b from t1 limit 2) union all (select a,b from t2 order by a) limit 2; @@ -106,21 +107,15 @@ explain select a,b from t1 union all select a,b from t2; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 4 2 UNION t2 ALL NULL NULL NULL NULL 4 +-1 UNION RESULT ALL NULL NULL NULL NULL NULL explain select xx from t1 union select 1; ERROR 42S22: Unknown column 'xx' in 'field list' explain select a,b from t1 union select 1; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -2 UNION NULL NULL NULL NULL NULL NULL NULL No tables used +ERROR 21000: The used SELECT statements have a different number of columns explain select 1 union select a,b from t1 union select 1; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used -2 UNION t1 ALL NULL NULL NULL NULL 4 -3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used +ERROR 21000: The used SELECT statements have a different number of columns explain select a,b from t1 union select 1 limit 0; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 UNION NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +ERROR 21000: The used SELECT statements have a different number of columns select a,b from t1 into outfile 'skr' union select a,b from t2; ERROR HY000: Wrong usage of UNION and INTO select a,b from t1 order by a union select a,b from t2; @@ -475,6 +470,7 @@ explain extended (select * from t1 where a=1) union (select * from t2 where a=1) id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 const PRIMARY PRIMARY 4 const 1 2 UNION t2 const PRIMARY PRIMARY 4 const 1 +-1 UNION RESULT ALL NULL NULL NULL NULL NULL Warnings: Note 1003 (select high_priority test.t1.a AS `a`,test.t1.b AS `b` from test.t1 where (test.t1.a = 1)) union (select test.t2.a AS `a`,test.t2.b AS `b` from test.t2 where (test.t2.a = 1)) (select * from t1 where a=5) union (select * from t2 where a=1); @@ -497,10 +493,12 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 2 UNION t1 index PRIMARY PRIMARY 4 NULL 4 Using index 2 UNION t2 index PRIMARY PRIMARY 4 NULL 3 Using where; Using index +-1 UNION RESULT ALL NULL NULL NULL NULL NULL explain (select * from t1 where a=1) union (select * from t1 where b=1); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 const PRIMARY PRIMARY 4 const 1 2 UNION t1 ref b b 5 const 1 Using where +-1 UNION RESULT ALL NULL NULL NULL NULL NULL drop table t1,t2; create table t1 ( id int not null auto_increment, primary key (id) ,user_name text ); create table t2 ( id int not null auto_increment, primary key (id) ,group_name text ); @@ -950,3 +948,8 @@ a 1 drop table t1, t2; set sql_select_limit=default; +CREATE TABLE t1 (i int(11) default NULL,c char(1) default NULL,KEY i (i)); +CREATE TABLE t2 (i int(11) default NULL,c char(1) default NULL,KEY i (i)); +explain (select * from t1) union (select * from t2) order by not_existing_column; +ERROR 42S22: Unknown column 'not_existing_column' in 'order clause' +drop table t1, t2; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 1b5bb807b97..8f616af667a 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -974,7 +974,7 @@ create table t1 (s1 char); insert into t1 values ('e'); select * from t1 where 'f' > any (select s1 from t1); select * from t1 where 'f' > any (select s1 from t1 union select s1 from t1); -explain select * from t1 where 'f' > any (select s1 from t1 union select s1 from t1); +explain extended select * from t1 where 'f' > any (select s1 from t1 union select s1 from t1); drop table t1; # diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test index d9e19571f81..f6006a87d47 100644 --- a/mysql-test/t/union.test +++ b/mysql-test/t/union.test @@ -39,8 +39,11 @@ explain select a,b from t1 union all select a,b from t2; --error 1054 explain select xx from t1 union select 1; +--error 1222 explain select a,b from t1 union select 1; +--error 1222 explain select 1 union select a,b from t1 union select 1; +--error 1222 explain select a,b from t1 union select 1 limit 0; --error 1221 @@ -515,3 +518,12 @@ SET SQL_SELECT_LIMIT=1; select a from t1 union select a from t2 order by a; drop table t1, t2; set sql_select_limit=default; + +# +# nonexisting column in global ORDER BY +# +CREATE TABLE t1 (i int(11) default NULL,c char(1) default NULL,KEY i (i)); +CREATE TABLE t2 (i int(11) default NULL,c char(1) default NULL,KEY i (i)); +--error 1054 +explain (select * from t1) union (select * from t2) order by not_existing_column; +drop table t1, t2; diff --git a/sql/item.cc b/sql/item.cc index 2dabb8e26ef..96b78b38fb7 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -369,9 +369,14 @@ const char *Item_ident::full_name() const } else { - tmp=(char*) sql_alloc((uint) strlen(table_name)+ - (uint) strlen(field_name)+2); - strxmov(tmp,table_name,".",field_name,NullS); + if (table_name[0]) + { + tmp= (char*) sql_alloc((uint) strlen(table_name) + + (uint) strlen(field_name) + 2); + strxmov(tmp, table_name, ".", field_name, NullS); + } + else + tmp= (char*) field_name; } return tmp; } diff --git a/sql/sql_class.h b/sql/sql_class.h index d5eb7a9fd0e..af0fff4435a 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -768,7 +768,7 @@ public: uint current_tablenr,tmp_table; uint server_status,open_options,system_thread; uint32 db_length; - uint select_number; //number of select (used for EXPLAIN) + int select_number; //number of select (used for EXPLAIN) /* variables.transaction_isolation is reset to this after each commit */ enum_tx_isolation session_tx_isolation; enum_check_fields count_cuted_fields; @@ -1147,7 +1147,6 @@ class select_union :public select_result { TABLE *table; COPY_INFO info; TMP_TABLE_PARAM tmp_table_param; - bool not_describe; select_union(TABLE *table_par); ~select_union(); diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 5fa8b37285e..586706be6c1 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -1007,6 +1007,7 @@ void st_select_lex_unit::init_query() fake_select_lex= 0; cleaned= 0; item_list.empty(); + describe= 0; } void st_select_lex::init_query() diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 50f13a0391c..fd6e9142275 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -336,6 +336,7 @@ public: st_select_lex *fake_select_lex; st_select_lex *union_distinct; /* pointer to the last UNION DISTINCT */ + bool describe; /* union exec() called for EXPLAIN */ void init_query(); bool create_total_list(THD *thd, st_lex *lex, TABLE_LIST **result); @@ -413,7 +414,7 @@ public: ulong table_join_options; uint in_sum_expr; - uint select_number; /* number of select (used for EXPLAIN) */ + int select_number; /* number of select (used for EXPLAIN) */ uint with_wild; /* item list contain '*' */ bool braces; /* SELECT ... UNION (SELECT ... ) <- this braces */ /* TRUE when having fix field called in processing of this SELECT */ diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 2cfeb171153..2b3de669618 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -991,7 +991,7 @@ JOIN::optimize() } } - if (select_lex->master_unit()->uncacheable) + if (select_lex->master_unit()->uncacheable || thd->lex->describe) { if (!(tmp_join= (JOIN*)thd->alloc(sizeof(JOIN)))) DBUG_RETURN(-1); @@ -9132,7 +9132,8 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order, if (message) { - item_list.push_back(new Item_int((int32) join->select_lex->select_number)); + item_list.push_back(new Item_int((longlong) + join->select_lex->select_number)); item_list.push_back(new Item_string(join->select_lex->type, strlen(join->select_lex->type), cs)); for (uint i=0 ; i < 7; i++) @@ -9141,6 +9142,49 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order, if (result->send_data(item_list)) join->error= 1; } + else if (join->select_lex == join->unit->fake_select_lex) + { + /* + Here is guessing about fake_select_lex to avoid union SELECT + execution to get accurate information + */ + char table_name_buffer[64]; + item_list.empty(); + /* id */ + item_list.push_back(new Item_int((int32) + join->select_lex->select_number)); + /* select_type */ + item_list.push_back(new Item_string(join->select_lex->type, + strlen(join->select_lex->type), + cs)); + /* table */ + int len= my_snprintf(table_name_buffer, sizeof(table_name_buffer)-1, + "", + -join->select_lex->select_number); + item_list.push_back(new Item_string(table_name_buffer, len, cs)); + item_list.push_back(new Item_string(join_type_str[JT_ALL], + strlen(join_type_str[JT_ALL]), + cs)); + /* possible_keys */ + item_list.push_back(item_null); + /* key*/ + item_list.push_back(item_null); + /* key_len */ + item_list.push_back(item_null); + /* ref */ + item_list.push_back(item_null); + /* rows */ + item_list.push_back(item_null); + /* extra */ + if (join->unit->global_parameters->order_list.first) + item_list.push_back(new Item_string("Using filesort", + 14, cs)); + else + item_list.push_back(new Item_string("", 0, cs)); + + if (result->send_data(item_list)) + join->error= 1; + } else { table_map used_tables=0; @@ -9150,36 +9194,41 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order, TABLE *table=tab->table; char buff[512],*buff_ptr=buff; char buff1[512], buff2[512]; - char derived_name[64]; + char table_name_buffer[64]; String tmp1(buff1,sizeof(buff1),cs); String tmp2(buff2,sizeof(buff2),cs); tmp1.length(0); tmp2.length(0); item_list.empty(); + /* id */ item_list.push_back(new Item_int((int32) join->select_lex->select_number)); + /* select_type */ item_list.push_back(new Item_string(join->select_lex->type, strlen(join->select_lex->type), cs)); if (tab->type == JT_ALL && tab->select && tab->select->quick) tab->type= JT_RANGE; + /* table */ if (table->derived_select_number) { /* Derived table name generation */ - int len= my_snprintf(derived_name, sizeof(derived_name)-1, + int len= my_snprintf(table_name_buffer, sizeof(table_name_buffer)-1, "", table->derived_select_number); - item_list.push_back(new Item_string(derived_name, len, cs)); + item_list.push_back(new Item_string(table_name_buffer, len, cs)); } else item_list.push_back(new Item_string(table->table_name, strlen(table->table_name), cs)); + /* type */ item_list.push_back(new Item_string(join_type_str[tab->type], strlen(join_type_str[tab->type]), cs)); uint j; + /* possible_keys */ if (!tab->keys.is_clear_all()) { for (j=0 ; j < table->keys ; j++) @@ -9196,6 +9245,7 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order, item_list.push_back(new Item_string(tmp1.ptr(),tmp1.length(),cs)); else item_list.push_back(item_null); + /* key key_len ref */ if (tab->ref.key_parts) { KEY *key_info=table->key_info+ tab->ref.key; @@ -9234,9 +9284,11 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order, item_list.push_back(item_null); item_list.push_back(item_null); } + /* rows */ item_list.push_back(new Item_int((longlong) (ulonglong) join->best_positions[i]. records_read, 21)); + /* extra */ my_bool key_read=table->key_read; if ((tab->type == JT_NEXT || tab->type == JT_CONST) && table->used_keys.is_set(tab->index)) @@ -9301,32 +9353,53 @@ int mysql_explain_union(THD *thd, SELECT_LEX_UNIT *unit, select_result *result) DBUG_ENTER("mysql_explain_union"); int res= 0; SELECT_LEX *first= unit->first_select(); + for (SELECT_LEX *sl= first; sl; sl= sl->next_select()) { // drop UNCACHEABLE_EXPLAIN, because it is for internal usage only uint8 uncacheable= (sl->uncacheable & ~UNCACHEABLE_EXPLAIN); - - res= mysql_explain_select(thd, sl, - (((&thd->lex->select_lex)==sl)? - ((thd->lex->all_selects_list != sl) ? - primary_key_name : "SIMPLE"): - ((sl == first)? - ((sl->linkage == DERIVED_TABLE_TYPE) ? - "DERIVED": - ((uncacheable & UNCACHEABLE_DEPENDENT) ? - "DEPENDENT SUBQUERY": - (uncacheable?"UNCACHEABLE SUBQUERY": - "SUBQUERY"))): - ((uncacheable & UNCACHEABLE_DEPENDENT) ? - "DEPENDENT UNION": - uncacheable?"UNCACHEABLE UNION": - "UNION"))), - result); - if (res) - break; - + sl->type= (((&thd->lex->select_lex)==sl)? + ((thd->lex->all_selects_list != sl) ? + primary_key_name : "SIMPLE"): + ((sl == first)? + ((sl->linkage == DERIVED_TABLE_TYPE) ? + "DERIVED": + ((uncacheable & UNCACHEABLE_DEPENDENT) ? + "DEPENDENT SUBQUERY": + (uncacheable?"UNCACHEABLE SUBQUERY": + "SUBQUERY"))): + ((uncacheable & UNCACHEABLE_DEPENDENT) ? + "DEPENDENT UNION": + uncacheable?"UNCACHEABLE UNION": + "UNION"))); + sl->options|= SELECT_DESCRIBE; + } + if (first->next_select()) + { + unit->fake_select_lex->select_number= -first->select_number; + unit->fake_select_lex->type= "UNION RESULT"; + unit->fake_select_lex->options|= SELECT_DESCRIBE; + if (!(res= unit->prepare(thd, result, SELECT_NO_UNLOCK | SELECT_DESCRIBE))) + res= unit->exec(); + res|= unit->cleanup(); + } + else + { + thd->lex->current_select= first; + res= mysql_select(thd, &first->ref_pointer_array, + (TABLE_LIST*) first->table_list.first, + first->with_wild, first->item_list, + first->where, + first->order_list.elements + + first->group_list.elements, + (ORDER*) first->order_list.first, + (ORDER*) first->group_list.first, + first->having, + (ORDER*) thd->lex->proc_list.first, + first->options | thd->options | SELECT_DESCRIBE, + result, unit, first); } if (res > 0 || thd->net.report_error) res= -1; // mysql_explain_select do not report error @@ -9334,30 +9407,6 @@ int mysql_explain_union(THD *thd, SELECT_LEX_UNIT *unit, select_result *result) } -int mysql_explain_select(THD *thd, SELECT_LEX *select_lex, char const *type, - select_result *result) -{ - DBUG_ENTER("mysql_explain_select"); - DBUG_PRINT("info", ("Select 0x%lx, type %s", (ulong)select_lex, type)) - select_lex->type= type; - thd->lex->current_select= select_lex; - SELECT_LEX_UNIT *unit= select_lex->master_unit(); - int res= mysql_select(thd, &select_lex->ref_pointer_array, - (TABLE_LIST*) select_lex->table_list.first, - select_lex->with_wild, select_lex->item_list, - select_lex->where, - select_lex->order_list.elements + - select_lex->group_list.elements, - (ORDER*) select_lex->order_list.first, - (ORDER*) select_lex->group_list.first, - select_lex->having, - (ORDER*) thd->lex->proc_list.first, - select_lex->options | thd->options | SELECT_DESCRIBE, - result, unit, select_lex); - DBUG_RETURN(res); -} - - void st_select_lex::print(THD *thd, String *str) { if (!thd) diff --git a/sql/sql_union.cc b/sql/sql_union.cc index e5649192fe5..b4f3e78e33a 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -41,7 +41,7 @@ int mysql_union(THD *thd, LEX *lex, select_result *result, ***************************************************************************/ select_union::select_union(TABLE *table_par) - :table(table_par), not_describe(0) + :table(table_par) { bzero((char*) &info,sizeof(info)); /* @@ -114,6 +114,8 @@ int st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result, select_result *tmp_result; DBUG_ENTER("st_select_lex_unit::prepare"); + describe= test(additional_options & SELECT_DESCRIBE); + /* result object should be reassigned even if preparing already done for max/min subquery (ALL/ANY optimization) @@ -121,7 +123,26 @@ int st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result, result= sel_result; if (prepared) + { + if (describe) + { + /* fast reinit for EXPLAIN */ + for (sl= first_select_in_union(); sl; sl= sl->next_select()) + { + sl->join->result= result; + select_limit_cnt= HA_POS_ERROR; + offset_limit_cnt= 0; + if (!sl->join->procedure && + result->prepare(sl->join->fields_list, this)) + { + DBUG_RETURN(1); + } + sl->join->select_options|= SELECT_DESCRIBE; + sl->join->reinit(); + } + } DBUG_RETURN(0); + } prepared= 1; res= 0; @@ -134,8 +155,9 @@ int st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result, { if (!(tmp_result= union_result= new select_union(0))) goto err; - union_result->not_describe= 1; union_result->tmp_table_param.init(); + if (describe) + tmp_result= sel_result; } else { @@ -269,11 +291,11 @@ int st_select_lex_unit::exec() ulonglong add_rows=0; DBUG_ENTER("st_select_lex_unit::exec"); - if (executed && !uncacheable) + if (executed && !uncacheable && !describe) DBUG_RETURN(0); executed= 1; - if (uncacheable || !item || !item->assigned()) + if (uncacheable || !item || !item->assigned() || describe) { if (optimized && item && item->assigned()) { @@ -292,7 +314,7 @@ int st_select_lex_unit::exec() res= sl->join->reinit(); else { - if (sl != global_parameters) + if (sl != global_parameters && !describe) { offset_limit_cnt= sl->offset_limit; select_limit_cnt= sl->select_limit+sl->offset_limit; @@ -304,7 +326,7 @@ int st_select_lex_unit::exec() We can't use LIMIT at this stage if we are using ORDER BY for the whole query */ - if (sl->order_list.first) + if (sl->order_list.first || describe) select_limit_cnt= HA_POS_ERROR; else select_limit_cnt= sl->select_limit+sl->offset_limit; @@ -373,7 +395,7 @@ int st_select_lex_unit::exec() if (!thd->is_fatal_error) // Check if EOM { - ulong options_tmp= thd->options; + ulong options_tmp= thd->options | fake_select_lex->options; thd->lex->current_select= fake_select_lex; offset_limit_cnt= global_parameters->offset_limit; select_limit_cnt= global_parameters->select_limit + From eb09108e42a9f48276b1c5803038ac5f38b9ca1d Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 6 May 2004 20:45:25 +0200 Subject: [PATCH 015/162] mysqldump: help text corrected client/mysqldump.c: help text corrected --- client/mysqldump.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index ba0b5d42a0e..ec8f4d4fa1e 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -241,10 +241,10 @@ static struct my_option my_long_options[] = {"no-data", 'd', "No row information.", (gptr*) &dFlag, (gptr*) &dFlag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"no-set-names", 'N', - "'SET NAMES charset_name' will not be put in the output. Deprecated, use --set-charset or --skip-set-charset to enable/disable charset settings instead", + "Deprecated, use --set-charset or --skip-set-charset to enable/disable charset settings instead", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"set-charset", OPT_SET_CHARSET, - "'SET NAMES charset_name' will be put in the output", + "'SET CHARACTER_SET_CLIENT=default_character_set' will be put in the output", (gptr*) &opt_set_charset, (gptr*) &opt_set_charset, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {"set-variable", 'O', From 9bf1414317242f113c4c6329b0b9087f95a6a510 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 6 May 2004 22:55:30 +0200 Subject: [PATCH 016/162] A DBUG_RETURN to match a DBUG_ENTER myisam/mi_dynrec.c: need DBUG_RETURN as we DBUG_ENTER --- myisam/mi_dynrec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/myisam/mi_dynrec.c b/myisam/mi_dynrec.c index 2a3f4aec0a8..0ffab05b6bc 100644 --- a/myisam/mi_dynrec.c +++ b/myisam/mi_dynrec.c @@ -311,7 +311,7 @@ static int update_backward_delete_link(MI_INFO *info, my_off_t delete_block, DBUG_RETURN(1); /* Wrong delete link */ } } - return 0; + DBUG_RETURN(0); } /* Delete datarecord from database */ From b20399d9d6f61eaf2ac18bd49c8309466c39678a Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 7 May 2004 01:02:57 +0300 Subject: [PATCH 017/162] Fixed a problem with option --where, which earlier was not dynamic. One was not able to use long query strings with it. Bug#3633 BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + client/mysqldump.c | 63 ++++++++++++++++++++++++++++++---------- 2 files changed, 48 insertions(+), 16 deletions(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index b805749821c..ef879971e38 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -39,6 +39,7 @@ hf@deer.mysql.r18.ru hf@genie.(none) igor@hundin.mysql.fi igor@rurik.mysql.com +jani@a80-186-24-72.elisa-laajakaista.fi jani@dsl-jkl1657.dial.inet.fi jani@hynda.(none) jani@hynda.mysql.fi diff --git a/client/mysqldump.c b/client/mysqldump.c index 42b094d2902..f264b9b61c6 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -36,7 +36,7 @@ ** Added --single-transaction option 06/06/2002 by Peter Zaitsev */ -#define DUMP_VERSION "9.10" +#define DUMP_VERSION "9.11" #include #include @@ -938,18 +938,32 @@ static char *field_escape(char *to,const char *from,uint length) } /* field_escape */ +static char *alloc_query_str(ulong size) +{ + char *query; + + if (!(query= (char*) my_malloc(size, MYF(MY_WME)))) + { + ignore_errors= 0; /* Fatal error */ + safe_exit(EX_MYSQLERR); /* Force exit */ + } + return query; +} + /* ** dumpTable saves database contents as a series of INSERT statements. */ static void dumpTable(uint numFields, char *table) { - char query[QUERY_LENGTH], *end, buff[256],table_buff[NAME_LEN+3]; + char query_buf[QUERY_LENGTH], *end, buff[256],table_buff[NAME_LEN+3]; char *result_table, table_buff2[NAME_LEN*2+3], *opt_quoted_table; + char *query= query_buf; MYSQL_RES *res; MYSQL_FIELD *field; MYSQL_ROW row; ulong rownr, row_break, total_length, init_length; const char *table_type; + int error= 0; result_table= quote_name(table,table_buff, 1); opt_quoted_table= quote_name(table, table_buff2, 0); @@ -995,8 +1009,11 @@ static void dumpTable(uint numFields, char *table) sprintf(buff," FROM %s", result_table); end= strmov(end,buff); if (where) - end= strxmov(end, " WHERE ",where,NullS); - if (mysql_query(sock, query)) + { + query= alloc_query_str((ulong) (strlen(where) + (end - query) + 10)); + end= strxmov(query, query_buf, " WHERE ", where, NullS); + } + if (mysql_real_query(sock, query, (uint) (end - query))) { DBerror(sock, "when executing 'SELECT INTO OUTFILE'"); return; @@ -1013,14 +1030,16 @@ static void dumpTable(uint numFields, char *table) { if (!opt_xml && opt_comments) fprintf(md_result_file,"-- WHERE: %s\n",where); - strxmov(strend(query), " WHERE ",where,NullS); + query= alloc_query_str((ulong) (strlen(where) + strlen(query) + 10)); + strxmov(query, query_buf, " WHERE ", where, NullS); } if (!opt_xml) fputs("\n", md_result_file); if (mysql_query(sock, query)) { DBerror(sock, "when retrieving data from server"); - return; + error= EX_CONSCHECK; + goto err; } if (quick) res=mysql_use_result(sock); @@ -1029,7 +1048,8 @@ static void dumpTable(uint numFields, char *table) if (!res) { DBerror(sock, "when retrieving data from server"); - return; + error= EX_CONSCHECK; + goto err; } if (verbose) fprintf(stderr, "-- Retrieving rows...\n"); @@ -1037,8 +1057,8 @@ static void dumpTable(uint numFields, char *table) { fprintf(stderr,"%s: Error in field count for table: %s ! Aborting.\n", my_progname, result_table); - safe_exit(EX_CONSCHECK); - return; + error= EX_CONSCHECK; + goto err; } if (opt_disable_keys) @@ -1076,8 +1096,8 @@ static void dumpTable(uint numFields, char *table) sprintf(query,"%s: Not enough fields from table %s! Aborting.\n", my_progname, result_table); fputs(query,stderr); - safe_exit(EX_CONSCHECK); - return; + error= EX_CONSCHECK; + goto err; } if (extended_insert) { @@ -1096,7 +1116,8 @@ static void dumpTable(uint numFields, char *table) if (dynstr_realloc(&extended_row,length * 2+2)) { fputs("Aborting dump (out of memory)",stderr); - safe_exit(EX_EOM); + error= EX_EOM; + goto err; } dynstr_append(&extended_row,"\'"); extended_row.length += @@ -1131,7 +1152,8 @@ static void dumpTable(uint numFields, char *table) else if (dynstr_append(&extended_row,"NULL")) { fputs("Aborting dump (out of memory)",stderr); - safe_exit(EX_EOM); + error= EX_EOM; + goto err; } } else @@ -1229,8 +1251,8 @@ static void dumpTable(uint numFields, char *table) result_table, rownr); fputs(query,stderr); - safe_exit(EX_CONSCHECK); - return; + error= EX_CONSCHECK; + goto err; } if (opt_lock) fputs("UNLOCK TABLES;\n", md_result_file); @@ -1240,7 +1262,16 @@ static void dumpTable(uint numFields, char *table) if (opt_autocommit) fprintf(md_result_file, "commit;\n"); mysql_free_result(res); - } + if (query != query_buf) + my_free(query, MYF(MY_ALLOW_ZERO_PTR)); + } + return; + +err: + if (query != query_buf) + my_free(query, MYF(MY_ALLOW_ZERO_PTR)); + safe_exit(error); + return; } /* dumpTable */ From eef6e474ad04f8f6c57735396a0d833bafeaa726 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 7 May 2004 08:39:42 +0200 Subject: [PATCH 018/162] introduced ndb_global.h/my_global.h to replace sytem lib includes e.g. stdio, stdlib --- ndb/include/kernel/signaldata/SignalData.hpp | 3 +-- ndb/include/mgmcommon/MgmtErrorReporter.hpp | 2 +- ndb/include/ndb_global.h | 7 ++++-- ndb/include/ndb_types.h | 2 ++ ndb/include/ndb_version.h | 3 --- ndb/include/ndbapi/Ndb.hpp | 6 ++--- ndb/include/ndbapi/NdbConnection.hpp | 3 +-- ndb/include/ndbapi/NdbEventOperation.hpp | 6 ++--- ndb/include/ndbapi/NdbOperation.hpp | 17 ++++++-------- ndb/include/ndbapi/NdbRecAttr.hpp | 17 ++++++-------- ndb/include/ndbapi/NdbReceiver.hpp | 2 +- ndb/include/ndbapi/NdbScanOperation.hpp | 19 ---------------- ndb/include/ndbapi/NdbSchemaOp.hpp | 4 +--- ndb/include/ndbapi/ndberror.h | 4 +--- ndb/include/newtonapi/dba.h | 4 +--- ndb/include/portlib/NdbStdio.h | 2 +- .../transporter/TransporterDefinitions.hpp | 2 +- ndb/include/util/BaseString.hpp | 4 +--- ndb/include/util/Bitmask.hpp | 4 +--- ndb/include/util/InputStream.hpp | 2 +- ndb/include/util/NdbAutoPtr.hpp | 2 +- ndb/include/util/OutputStream.hpp | 2 +- ndb/include/util/Properties.hpp | 5 +---- ndb/include/util/UtilBuffer.hpp | 4 +--- ndb/include/util/Vector.hpp | 3 +-- ndb/include/util/uucode.h | 2 +- ndb/src/common/debugger/DebuggerNames.cpp | 6 ++--- .../common/debugger/SignalLoggerManager.cpp | 5 ++--- ndb/src/common/editline/editline_internal.h | 5 ++--- ndb/src/common/editline/editline_win32.c | 3 +-- ndb/src/common/editline/test/testit.c | 6 +---- .../listtest/LogHandlerListUnitTest.cpp | 6 ++--- ndb/src/common/mgmcommon/ConfigRetriever.cpp | 10 ++++----- .../common/mgmcommon/InitConfigFileParser.hpp | 3 ++- ndb/src/common/mgmcommon/LocalConfig.hpp | 4 +--- ndb/src/common/mgmcommon/NdbConfig.c | 3 +-- .../mgmcommon/printConfig/printConfig.cpp | 3 ++- ndb/src/common/portlib/memtest/memtest.c | 3 +-- .../portlib/memtest/munmaptest/munmaptest.cpp | 10 +++------ ndb/src/common/portlib/mmstest/mmslist.cpp | 4 ++-- ndb/src/common/portlib/mmstest/mmstest.cpp | 4 ++-- .../common/portlib/test/NdbPortLibTest.cpp | 7 +----- ndb/src/common/portlib/unix/NdbDaemon.c | 22 ++----------------- ndb/src/common/transporter/Packer.cpp | 4 ++-- .../common/transporter/SCI_Transporter.cpp | 9 +++----- ndb/src/common/transporter/SHM_Buffer.hpp | 6 ++--- .../common/transporter/SHM_Transporter.cpp | 5 ++--- .../transporter/SHM_Transporter.unix.cpp | 5 ++--- .../transporter/SHM_Transporter.win32.cpp | 4 ++-- ndb/src/common/transporter/SendBuffer.hpp | 3 +-- .../common/transporter/TCP_Transporter.cpp | 6 ++--- .../transporter/TransporterRegistry.cpp | 6 ++--- .../basictest/basicTransporterTest.cpp | 5 ++--- ndb/src/common/transporter/buddy.cpp | 3 --- ndb/src/common/transporter/buddy.hpp | 3 +-- .../transporter/failoverSCI/failoverSCI.cpp | 9 +++----- .../perftest/perfTransporterTest.cpp | 5 ++--- .../priotest/prioTransporterTest.cpp | 4 ++-- ndb/src/common/util/Base64.cpp | 3 +-- ndb/src/common/util/BaseString.cpp | 6 ++--- ndb/src/common/util/File.cpp | 2 -- ndb/src/common/util/Parser.cpp | 10 ++++----- ndb/src/common/util/Properties.cpp | 8 +++---- ndb/src/common/util/SimpleProperties.cpp | 3 +-- ndb/src/common/util/SocketServer.cpp | 7 +++--- ndb/src/common/util/getarg.c | 4 ---- ndb/src/common/util/new.cpp | 3 +-- ndb/src/common/util/random.c | 10 +-------- ndb/src/common/util/strdup.c | 1 - .../util/testProperties/testProperties.cpp | 3 +-- .../util/testSimpleProperties/sp_test.cpp | 5 +++-- ndb/src/common/util/uucode.c | 3 +-- ndb/src/common/util/version.c | 4 +--- ndb/src/cw/cpcc-win32/C++/StdAfx.h | 5 +---- ndb/src/cw/cpcd/Process.cpp | 6 +---- ndb/src/cw/cpcd/common.hpp | 2 +- .../cw/test/socketclient/socketClientTest.cpp | 3 +-- ndb/src/cw/util/ClientInterface.hpp | 4 +--- ndb/src/kernel/blocks/backup/FsBuffer.hpp | 4 +--- ndb/src/kernel/blocks/backup/read.cpp | 4 +--- .../printSchemafile/printSchemafile.cpp | 7 +++--- .../dbdih/printSysfile/printSysfile.cpp | 7 +++--- .../dblqh/redoLogReader/redoLogFileReader.cpp | 7 +++--- ndb/src/kernel/blocks/ndbfs/Filename.cpp | 6 ++--- ndb/src/kernel/error/ErrorReporter.hpp | 3 ++- ndb/src/kernel/vm/Emulator.cpp | 3 ++- ndb/src/kernel/vm/GlobalData.hpp | 4 ++-- ndb/src/kernel/vm/TransporterCallback.cpp | 3 ++- ndb/src/kernel/vm/VMSignal.hpp | 7 +++--- ndb/src/kernel/vm/al_test/arrayListTest.cpp | 5 +++-- ndb/src/kernel/vm/al_test/arrayPoolTest.cpp | 6 ++--- ndb/src/kernel/vm/al_test/main.cpp | 5 +++-- ndb/src/kernel/vm/testCopy/rr.cpp | 5 ++--- ndb/src/kernel/vm/testCopy/testCopy.cpp | 4 +--- .../vm/testDataBuffer/testDataBuffer.cpp | 6 +++-- ndb/src/kernel/vm/testLongSig/testLongSig.cpp | 4 ++-- .../vm/testSimplePropertiesSection/test.cpp | 5 +++-- ndb/src/mgmapi/mgmapi.cpp | 8 ++----- ndb/src/mgmapi/test/keso.c | 5 ++--- ndb/src/mgmapi/test/mgmSrvApi.cpp | 4 +--- ndb/src/mgmclient/CommandInterpreter.cpp | 9 +------- ndb/src/mgmclient/CommandInterpreter.hpp | 3 +-- ndb/src/mgmclient/CpcClient.cpp | 6 +---- ndb/src/mgmclient/main.cpp | 4 +--- ndb/src/mgmclient/test_cpcd/test_cpcd.cpp | 2 +- ndb/src/mgmsrv/CommandInterpreter.hpp | 3 +-- ndb/src/mgmsrv/convertStrToInt.cpp | 4 +--- ndb/src/mgmsrv/mkconfig/mkconfig.cpp | 8 +++---- ndb/src/ndbapi/ClusterMgr.cpp | 7 +++--- ndb/src/ndbapi/DictCache.cpp | 2 +- ndb/src/ndbapi/Ndb.cpp | 8 +++---- ndb/src/ndbapi/NdbConnectionScan.cpp | 12 +++++----- ndb/src/ndbapi/NdbEventOperationImpl.cpp | 13 ++--------- ndb/src/ndbapi/NdbOperationExec.cpp | 10 +++++---- ndb/src/ndbapi/NdbRecAttr.cpp | 2 +- ndb/src/ndbapi/NdbScanOperation.cpp | 21 ++++++++++++++++-- ndb/src/ndbapi/NdbUtil.hpp | 3 +-- ndb/src/ndbapi/ObjectMap.hpp | 4 +--- ndb/src/ndbapi/TransporterFacade.cpp | 4 ++-- ndb/src/ndbapi/ndberror.c | 9 ++++---- ndb/src/ndbapi/signal-sender/SignalSender.hpp | 2 +- ndb/src/newtonapi/dba_internal.hpp | 5 ++--- ndb/src/rep/RepMain.cpp | 2 +- ndb/src/rep/Requestor.hpp | 3 ++- ndb/src/rep/adapters/ExtNDB.hpp | 3 ++- ndb/src/rep/dbug_hack.cpp | 2 ++ ndb/src/rep/repapi/repapi.cpp | 7 +----- ndb/src/rep/state/Interval.cpp | 2 ++ ndb/src/rep/storage/GCIBuffer.cpp | 2 +- ndb/src/rep/storage/GCIBuffer.hpp | 2 +- ndb/src/rep/storage/GCIContainer.hpp | 3 +-- ndb/src/rep/storage/LogRecord.hpp | 3 +-- ndb/test/include/NDBT_Table.hpp | 5 +++-- .../ndbapi/bank/bankCreator/bankCreator.cpp | 3 +-- .../ndbapi/bank/bankMakeGL/bankMakeGL.cpp | 3 +-- .../bank/bankSumAccounts/bankSumAccounts.cpp | 3 +-- ndb/test/ndbapi/bank/bankTimer/bankTimer.cpp | 4 ++-- .../bankTransactionMaker.cpp | 4 ++-- .../bankValidateAllGLs/bankValidateAllGLs.cpp | 4 ++-- .../create_all_tabs/create_all_tabs.cpp | 2 +- ndb/test/ndbapi/create_tab/create_tab.cpp | 2 +- .../ndbapi/drop_all_tabs/drop_all_tabs.cpp | 2 +- ndb/test/ndbapi/flexTT/flexTT.cpp | 7 +++--- ndb/test/ndbapi/indexTest/index.cpp | 5 ++--- ndb/test/ndbapi/indexTest2/index2.cpp | 5 ++--- .../async-src/generator/asyncGenerator.cpp | 3 +-- .../generator/mainAsyncGenerator.cpp | 5 +---- .../ndbapi/lmc-bench/async-src/user/macros.h | 3 +-- .../lmc-bench/async-src/user/ndb_error.hpp | 2 +- .../async-src/user/userInterface.cpp | 5 +---- .../lmc-bench/include/testDefinitions.h | 20 ++++++----------- .../lmc-bench/src/generator/dbGenerator.c | 3 +-- .../lmc-bench/src/generator/mainGenerator.c | 6 +---- .../lmc-bench/src/populator/dbPopulate.c | 4 +--- .../lmc-bench/src/populator/mainPopulate.c | 4 +--- .../lmc-bench/src/user/localDbPrepare.c | 2 +- ndb/test/ndbapi/lmc-bench/src/user/macros.h | 3 +-- .../ndbapi/lmc-bench/src/user/ndb_error.hpp | 1 - .../lmc-bench/src/user/ndb_user_populate.cpp | 2 +- .../lmc-bench/src/user/old/userInterface.c | 5 +---- .../lmc-bench/src/user/old/userTransaction.c | 3 +-- .../lmc-bench/src/user/userInterface.cpp | 4 +--- .../lmc-bench/src/user/userTransaction.c | 3 +-- .../ndbapi/ronja/benchronja/benchronja.cpp | 7 ++---- ndb/test/ndbapi/testBlobs/testBlobs.cpp | 8 +++---- .../testDataBuffers/testDataBuffers.cpp | 5 ++--- ndb/test/ndbapi/testOIBasic/testOIBasic.cpp | 5 +---- ndb/test/ndbapi/vw_test/bcd.h | 3 +-- ndb/test/ndbapi/vw_test/cdrserver.cpp | 12 +++------- ndb/test/ndbapi/vw_test/size.cpp | 2 +- ndb/test/newtonapi/basic_test/common.cpp | 4 ---- ndb/test/newtonapi/basic_test/common.hpp | 3 ++- ndb/test/newtonapi/basic_test/too_basic.cpp | 10 +++------ ndb/test/newtonapi/perf_test/perf.cpp | 10 +++++---- ndb/test/run-test/main.cpp | 2 +- ndb/test/run-test/run-test.hpp | 2 ++ ndb/test/src/NDBT_ResultRow.cpp | 5 ++--- ndb/test/src/NDBT_ReturnCodes.cpp | 6 ++--- .../tools/hugoCalculator/hugoCalculator.cpp | 4 +++- ndb/test/tools/hugoFill/hugoFill.cpp | 2 +- .../tools/hugoLockRecords/hugoLockRecords.cpp | 4 ++-- ndb/test/tools/hugoPkDelete/hugoPkDel.cpp | 4 ++-- ndb/test/tools/hugoPkRead/hugoPkRead.cpp | 4 ++-- .../hugoPkReadRecord/hugoPkReadRecord.cpp | 3 ++- ndb/test/tools/hugoPkUpdate/hugoPkUpd.cpp | 4 ++-- ndb/test/tools/hugoScanRead/hugoScanRead.cpp | 4 ++-- ndb/test/tools/hugoScanUpdate/hugoScanUpd.cpp | 4 ++-- ndb/tools/copy_tab/copy_tab.cpp | 2 +- ndb/tools/create_index/create_index.cpp | 2 +- ndb/tools/delete_all/delete_all.cpp | 2 +- ndb/tools/drop_index/drop_index.cpp | 2 +- ndb/tools/drop_tab/drop_tab.cpp | 2 +- ndb/tools/select_all/select_all.cpp | 4 ++-- ndb/tools/select_count/select_count.cpp | 4 ++-- ndb/tools/transproxy/transproxy.cpp | 8 +------ ndb/tools/verify_index/verify_index.cpp | 3 +-- 196 files changed, 373 insertions(+), 586 deletions(-) diff --git a/ndb/include/kernel/signaldata/SignalData.hpp b/ndb/include/kernel/signaldata/SignalData.hpp index 071bd9b9104..8237d7ffad0 100644 --- a/ndb/include/kernel/signaldata/SignalData.hpp +++ b/ndb/include/kernel/signaldata/SignalData.hpp @@ -17,11 +17,10 @@ #ifndef SIGNAL_DATA_H #define SIGNAL_DATA_H +#include #include #include -#include #include -#include #ifndef NDB_ASSERT #ifdef VM_TRACE diff --git a/ndb/include/mgmcommon/MgmtErrorReporter.hpp b/ndb/include/mgmcommon/MgmtErrorReporter.hpp index acc44b14d8e..925d9e6407a 100644 --- a/ndb/include/mgmcommon/MgmtErrorReporter.hpp +++ b/ndb/include/mgmcommon/MgmtErrorReporter.hpp @@ -22,8 +22,8 @@ //****************************************************************************** +#include // exit #include -#include // exit #define REPORT_WARNING(message) \ ndbout << "WARNING: " << message << endl diff --git a/ndb/include/ndb_global.h b/ndb/include/ndb_global.h index eb52ea4268f..a1aa292a2f6 100644 --- a/ndb/include/ndb_global.h +++ b/ndb/include/ndb_global.h @@ -1,3 +1,6 @@ #include -/*#include */ - +#include +#include +#include +#include +#include diff --git a/ndb/include/ndb_types.h b/ndb/include/ndb_types.h index 40d73b0f230..697d5f73473 100644 --- a/ndb/include/ndb_types.h +++ b/ndb/include/ndb_types.h @@ -21,8 +21,10 @@ #ifndef SYS_TYPES_H #define SYS_TYPES_H +#if 0 #include #include +#endif typedef char Int8; typedef unsigned char Uint8; diff --git a/ndb/include/ndb_version.h b/ndb/include/ndb_version.h index 958dd339f74..7a23cec1a47 100644 --- a/ndb/include/ndb_version.h +++ b/ndb/include/ndb_version.h @@ -17,9 +17,6 @@ #ifndef NDB_VERSION_H #define NDB_VERSION_H -#include -#include - #include #define MAKE_VERSION(A,B,C) (((A) << 16) | ((B) << 8) | ((C) << 0)) diff --git a/ndb/include/ndbapi/Ndb.hpp b/ndb/include/ndbapi/Ndb.hpp index 59bdd212919..fd6e827ceb4 100644 --- a/ndb/include/ndbapi/Ndb.hpp +++ b/ndb/include/ndbapi/Ndb.hpp @@ -860,9 +860,9 @@ #include #include -#include "AttrType.hpp" +#include #include -#include "NdbDictionary.hpp" +#include class NdbObjectIdMap; class NdbOperation; @@ -1673,7 +1673,7 @@ private: */ struct StartTransactionNodeSelectionData { StartTransactionNodeSelectionData(): - fragment2PrimaryNodeMap(NULL) {}; + fragment2PrimaryNodeMap(0) {}; Uint32 kValue; Uint32 hashValueMask; Uint32 hashpointerValue; diff --git a/ndb/include/ndbapi/NdbConnection.hpp b/ndb/include/ndbapi/NdbConnection.hpp index a1532bb2f0e..c775dd5e33d 100644 --- a/ndb/include/ndbapi/NdbConnection.hpp +++ b/ndb/include/ndbapi/NdbConnection.hpp @@ -18,9 +18,8 @@ #define NdbConnection_H #include -#include "AttrType.hpp" +#include #include -#include class NdbConnection; class NdbOperation; diff --git a/ndb/include/ndbapi/NdbEventOperation.hpp b/ndb/include/ndbapi/NdbEventOperation.hpp index 911b00b02c4..056e9a58c74 100644 --- a/ndb/include/ndbapi/NdbEventOperation.hpp +++ b/ndb/include/ndbapi/NdbEventOperation.hpp @@ -157,8 +157,8 @@ public: * the attribute, or a NULL pointer * (indicating error). */ - NdbRecAttr *getValue(const char *anAttrName, char *aValue = NULL); - NdbRecAttr *getPreValue(const char *anAttrName, char *aValue = NULL); + NdbRecAttr *getValue(const char *anAttrName, char *aValue = 0); + NdbRecAttr *getPreValue(const char *anAttrName, char *aValue = 0); /** * Retrieves event resultset if available, inserted into the NdbRecAttrs @@ -172,7 +172,7 @@ public: * overflow and *pOverRun will indicate the number of events that have * overwritten. */ - int next(int *pOverRun=NULL); + int next(int *pOverRun=0); /** * In the current implementation a nodefailiure may cause loss of events, diff --git a/ndb/include/ndbapi/NdbOperation.hpp b/ndb/include/ndbapi/NdbOperation.hpp index 4f5f4597937..3c515fe84ef 100644 --- a/ndb/include/ndbapi/NdbOperation.hpp +++ b/ndb/include/ndbapi/NdbOperation.hpp @@ -17,14 +17,11 @@ #ifndef NdbOperation_H #define NdbOperation_H -#include -#include - #include -#include "AttrType.hpp" -#include "NdbError.hpp" -#include "NdbReceiver.hpp" -#include + +#include +#include +#include class Ndb; class NdbApiSignal; @@ -480,8 +477,8 @@ public: * the attribute, or a NULL pointer * (indicating error). */ - NdbRecAttr* getValue(const char* anAttrName, char* aValue = NULL); - NdbRecAttr* getValue(Uint32 anAttrId, char* aValue = NULL); + NdbRecAttr* getValue(const char* anAttrName, char* aValue = 0); + NdbRecAttr* getValue(Uint32 anAttrId, char* aValue = 0); /** * Define an attribute to set or update in query. @@ -925,7 +922,7 @@ protected: virtual int equal_impl(const NdbColumnImpl* anAttrObject, const char* aValue, Uint32 len); - NdbRecAttr* getValue(const NdbColumnImpl* anAttrObject, char* aValue = NULL); + NdbRecAttr* getValue(const NdbColumnImpl* anAttrObject, char* aValue = 0); int setValue(const NdbColumnImpl* anAttrObject, const char* aValue, Uint32 len); int incValue(const NdbColumnImpl* anAttrObject, Uint32 aValue); int incValue(const NdbColumnImpl* anAttrObject, Uint64 aValue); diff --git a/ndb/include/ndbapi/NdbRecAttr.hpp b/ndb/include/ndbapi/NdbRecAttr.hpp index a5595096bf6..7eeff88671d 100644 --- a/ndb/include/ndbapi/NdbRecAttr.hpp +++ b/ndb/include/ndbapi/NdbRecAttr.hpp @@ -17,9 +17,6 @@ #ifndef NdbRecAttr_H #define NdbRecAttr_H -#include - -#include #include #include "AttrType.hpp" @@ -427,9 +424,9 @@ inline void NdbRecAttr::release() { - if (theStorageX != NULL) { + if (theStorageX != 0) { delete [] theStorageX; - theStorageX = NULL; + theStorageX = 0; } } @@ -437,10 +434,10 @@ inline void NdbRecAttr::init() { - theStorageX = NULL; - theValue = NULL; - theRef = NULL; - theNext = NULL; + theStorageX = 0; + theValue = 0; + theRef = 0; + theNext = 0; theAttrId = 0xFFFF; theNULLind = -1; } @@ -470,7 +467,7 @@ inline bool NdbRecAttr::copyoutRequired() const { - return theRef != theValue && theValue != NULL; + return theRef != theValue && theValue != 0; } inline diff --git a/ndb/include/ndbapi/NdbReceiver.hpp b/ndb/include/ndbapi/NdbReceiver.hpp index 952803f8e70..bc11207a112 100644 --- a/ndb/include/ndbapi/NdbReceiver.hpp +++ b/ndb/include/ndbapi/NdbReceiver.hpp @@ -18,7 +18,7 @@ #define NdbReceiver_H #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL // Not part of public interface -#include +#include class Ndb; class NdbReceiver diff --git a/ndb/include/ndbapi/NdbScanOperation.hpp b/ndb/include/ndbapi/NdbScanOperation.hpp index e041c79d96f..f83669fb616 100644 --- a/ndb/include/ndbapi/NdbScanOperation.hpp +++ b/ndb/include/ndbapi/NdbScanOperation.hpp @@ -172,25 +172,6 @@ SetValueRec::SetValueRec() : { } -inline -SetValueRec::~SetValueRec() -{ - if ((stype == SET_STRING_ATTR1) || - (stype == SET_INT32_ATTR1) || - (stype == SET_UINT32_ATTR1) || - (stype == SET_INT64_ATTR1) || - (stype == SET_UINT64_ATTR1) || - (stype == SET_FLOAT_ATTR1) || - (stype == SET_DOUBLE_ATTR1)) - free(anAttrName); - - if ((stype == SET_STRING_ATTR1) || - (stype == SET_STRING_ATTR2)) - free(stringStruct.aStringValue); - if (next) delete next; - next = 0; -} - class SetValueRecList { public: SetValueRecList(); diff --git a/ndb/include/ndbapi/NdbSchemaOp.hpp b/ndb/include/ndbapi/NdbSchemaOp.hpp index 90837bbc66b..c3a3827a6b4 100644 --- a/ndb/include/ndbapi/NdbSchemaOp.hpp +++ b/ndb/include/ndbapi/NdbSchemaOp.hpp @@ -18,11 +18,9 @@ #define NdbSchemaOp_H #ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED -#include +#include "NdbDictionary.hpp" #include "AttrType.hpp" #include "NdbSchemaCon.hpp" -#include -#include "NdbDictionary.hpp" class NdbApiSignal; class Ndb; diff --git a/ndb/include/ndbapi/ndberror.h b/ndb/include/ndbapi/ndberror.h index 3d950ddaa8d..5c2d85b82a6 100644 --- a/ndb/include/ndbapi/ndberror.h +++ b/ndb/include/ndbapi/ndberror.h @@ -17,8 +17,6 @@ #ifndef NDBERROR_H #define NDBERROR_H -#include - #ifdef __cplusplus extern "C" { #endif @@ -91,7 +89,7 @@ typedef ndberror_classification_enum ndberror_classification; const char *ndberror_status_message(ndberror_status); const char *ndberror_classification_message(ndberror_classification); void ndberror_update(ndberror_struct *); -int ndb_error_string(int err_no, char *str, size_t size); +int ndb_error_string(int err_no, char *str, unsigned int size); #ifdef __cplusplus } diff --git a/ndb/include/newtonapi/dba.h b/ndb/include/newtonapi/dba.h index eb5b3f9b5c2..4cfc0ec8eb9 100644 --- a/ndb/include/newtonapi/dba.h +++ b/ndb/include/newtonapi/dba.h @@ -102,11 +102,9 @@ /* --- Include files ---- */ +#include #include -#include - - /* --- Types and definitions --- */ /** diff --git a/ndb/include/portlib/NdbStdio.h b/ndb/include/portlib/NdbStdio.h index 163b7eeef6f..2b01e4d4dc8 100644 --- a/ndb/include/portlib/NdbStdio.h +++ b/ndb/include/portlib/NdbStdio.h @@ -26,7 +26,7 @@ #include #endif -#include +#include #ifdef NDB_WIN32 #define snprintf _snprintf diff --git a/ndb/include/transporter/TransporterDefinitions.hpp b/ndb/include/transporter/TransporterDefinitions.hpp index 5bbf7c79491..cb859e310db 100644 --- a/ndb/include/transporter/TransporterDefinitions.hpp +++ b/ndb/include/transporter/TransporterDefinitions.hpp @@ -17,8 +17,8 @@ #ifndef TransporterDefinitions_H #define TransporterDefinitions_H +#include #include -#include #include /** diff --git a/ndb/include/util/BaseString.hpp b/ndb/include/util/BaseString.hpp index a88bd97ffc5..75a1c291594 100644 --- a/ndb/include/util/BaseString.hpp +++ b/ndb/include/util/BaseString.hpp @@ -17,9 +17,7 @@ #ifndef __UTIL_BASESTRING_HPP_INCLUDED__ #define __UTIL_BASESTRING_HPP_INCLUDED__ -#include -#include - +#include #include /** diff --git a/ndb/include/util/Bitmask.hpp b/ndb/include/util/Bitmask.hpp index 1f95d62bcb6..7a7d140ffe8 100644 --- a/ndb/include/util/Bitmask.hpp +++ b/ndb/include/util/Bitmask.hpp @@ -17,12 +17,10 @@ #ifndef NDB_BITMASK_H #define NDB_BITMASK_H -#include +#include #include #ifndef NDB_ASSERT -#include -#include #define NDB_ASSERT(x, s) \ do { if (!(x)) { printf("%s\n", s); abort(); } } while (0) #endif diff --git a/ndb/include/util/InputStream.hpp b/ndb/include/util/InputStream.hpp index 6b4cf262db4..b2a56b1e433 100644 --- a/ndb/include/util/InputStream.hpp +++ b/ndb/include/util/InputStream.hpp @@ -17,7 +17,7 @@ #ifndef INPUT_STREAM_HPP #define INPUT_STREAM_HPP -#include +#include #include /** diff --git a/ndb/include/util/NdbAutoPtr.hpp b/ndb/include/util/NdbAutoPtr.hpp index 2078714d98d..c01650ffc7e 100644 --- a/ndb/include/util/NdbAutoPtr.hpp +++ b/ndb/include/util/NdbAutoPtr.hpp @@ -17,7 +17,7 @@ #ifndef __NDB_AUTO_PTR_HPP #define __NDB_AUTO_PTR_HPP -#include +#include template class NdbAutoPtr { diff --git a/ndb/include/util/OutputStream.hpp b/ndb/include/util/OutputStream.hpp index 9d33ead7eb9..c7e009d4537 100644 --- a/ndb/include/util/OutputStream.hpp +++ b/ndb/include/util/OutputStream.hpp @@ -17,7 +17,7 @@ #ifndef OUTPUT_STREAM_HPP #define OUTPUT_STREAM_HPP -#include +#include #include /** diff --git a/ndb/include/util/Properties.hpp b/ndb/include/util/Properties.hpp index dbdc5f2b480..ff5d1338c79 100644 --- a/ndb/include/util/Properties.hpp +++ b/ndb/include/util/Properties.hpp @@ -17,10 +17,7 @@ #ifndef PROPERTIES_HPP #define PROPERTIES_HPP -#include -#include -#include -#include +#include #include #include diff --git a/ndb/include/util/UtilBuffer.hpp b/ndb/include/util/UtilBuffer.hpp index 97821ee3f9b..b357fa0fdf2 100644 --- a/ndb/include/util/UtilBuffer.hpp +++ b/ndb/include/util/UtilBuffer.hpp @@ -17,9 +17,7 @@ #ifndef __BUFFER_HPP_INCLUDED__ #define __BUFFER_HPP_INCLUDED__ -#include -#include -#include +#include /* This class represents a buffer of binary data, where you can append * data at the end, and later read the entire bunch. diff --git a/ndb/include/util/Vector.hpp b/ndb/include/util/Vector.hpp index a717dfecd7e..f60817dab67 100644 --- a/ndb/include/util/Vector.hpp +++ b/ndb/include/util/Vector.hpp @@ -17,9 +17,8 @@ #ifndef NDB_VECTOR_HPP #define NDB_VECTOR_HPP -#include +#include #include -#include template struct Vector { diff --git a/ndb/include/util/uucode.h b/ndb/include/util/uucode.h index 138a79fa3ae..f5569d033a5 100644 --- a/ndb/include/util/uucode.h +++ b/ndb/include/util/uucode.h @@ -17,7 +17,7 @@ #ifndef UUCODE_H #define UUCODE_H -#include +#include #ifdef __cplusplus extern "C" { diff --git a/ndb/src/common/debugger/DebuggerNames.cpp b/ndb/src/common/debugger/DebuggerNames.cpp index fdee978ab54..ebe94a6059f 100644 --- a/ndb/src/common/debugger/DebuggerNames.cpp +++ b/ndb/src/common/debugger/DebuggerNames.cpp @@ -14,16 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "DebuggerNames.hpp" #include #include #include -#include -#include -#include - static const char * localSignalNames[MAX_GSN+1]; static SignalDataPrintFunction localPrintFunctions[MAX_GSN+1]; static const char * localBlockNames[NO_OF_BLOCKS]; diff --git a/ndb/src/common/debugger/SignalLoggerManager.cpp b/ndb/src/common/debugger/SignalLoggerManager.cpp index ae6edd5ed71..35e49f3c1eb 100644 --- a/ndb/src/common/debugger/SignalLoggerManager.cpp +++ b/ndb/src/common/debugger/SignalLoggerManager.cpp @@ -14,14 +14,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "SignalLoggerManager.hpp" #include -#include -#include #include #include -#include #include diff --git a/ndb/src/common/editline/editline_internal.h b/ndb/src/common/editline/editline_internal.h index 93c13e55edc..5ed2b32a873 100644 --- a/ndb/src/common/editline/editline_internal.h +++ b/ndb/src/common/editline/editline_internal.h @@ -19,9 +19,8 @@ ** Internal header file for editline library. */ -#include -#include -#include +#include + #if defined(SYS_UNIX) #include "unix.h" #endif /* defined(SYS_UNIX) */ diff --git a/ndb/src/common/editline/editline_win32.c b/ndb/src/common/editline/editline_win32.c index feef0108523..5083edb7fae 100644 --- a/ndb/src/common/editline/editline_win32.c +++ b/ndb/src/common/editline/editline_win32.c @@ -15,8 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include char* readline(const char* prompt) diff --git a/ndb/src/common/editline/test/testit.c b/ndb/src/common/editline/test/testit.c index 9a7dfb7bbdf..4058f8ae660 100644 --- a/ndb/src/common/editline/test/testit.c +++ b/ndb/src/common/editline/test/testit.c @@ -20,11 +20,7 @@ ** A "micro-shell" to test editline library. ** If given any arguments, commands aren't executed. */ -#include -#include -#include - -#include +#include #include int diff --git a/ndb/src/common/logger/listtest/LogHandlerListUnitTest.cpp b/ndb/src/common/logger/listtest/LogHandlerListUnitTest.cpp index 22f67d15659..36aac5d0e15 100644 --- a/ndb/src/common/logger/listtest/LogHandlerListUnitTest.cpp +++ b/ndb/src/common/logger/listtest/LogHandlerListUnitTest.cpp @@ -14,6 +14,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include +#include + #include "LogHandlerListUnitTest.hpp" #include @@ -22,9 +25,6 @@ #include -#include -#include - typedef bool (*TESTFUNC)(const char*); typedef struct { diff --git a/ndb/src/common/mgmcommon/ConfigRetriever.cpp b/ndb/src/common/mgmcommon/ConfigRetriever.cpp index a3f26454df6..ef6861ef291 100644 --- a/ndb/src/common/mgmcommon/ConfigRetriever.cpp +++ b/ndb/src/common/mgmcommon/ConfigRetriever.cpp @@ -14,6 +14,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include +#include +#include + #include #include "LocalConfig.hpp" @@ -21,21 +25,15 @@ #include #include -#include -#include #include #include "MgmtErrorReporter.hpp" #include #include -#include -#include -#include #include #include -#include //**************************************************************************** //**************************************************************************** diff --git a/ndb/src/common/mgmcommon/InitConfigFileParser.hpp b/ndb/src/common/mgmcommon/InitConfigFileParser.hpp index 1e85067396c..f4f27abb055 100644 --- a/ndb/src/common/mgmcommon/InitConfigFileParser.hpp +++ b/ndb/src/common/mgmcommon/InitConfigFileParser.hpp @@ -17,7 +17,8 @@ #ifndef InitConfigFileParser_H #define InitConfigFileParser_H -#include +#include + #include class Config; diff --git a/ndb/src/common/mgmcommon/LocalConfig.hpp b/ndb/src/common/mgmcommon/LocalConfig.hpp index ec7b572e92d..eb676bf9bed 100644 --- a/ndb/src/common/mgmcommon/LocalConfig.hpp +++ b/ndb/src/common/mgmcommon/LocalConfig.hpp @@ -17,10 +17,8 @@ #ifndef LocalConfig_H #define LocalConfig_H -#include -#include +#include #include -#include //**************************************************************************** // Description: The class LocalConfig corresponds to the information possible diff --git a/ndb/src/common/mgmcommon/NdbConfig.c b/ndb/src/common/mgmcommon/NdbConfig.c index b12d9fcfaf9..827ef34a840 100644 --- a/ndb/src/common/mgmcommon/NdbConfig.c +++ b/ndb/src/common/mgmcommon/NdbConfig.c @@ -14,10 +14,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include -#include -#include const char* NdbConfig_HomePath(char* buf, int buflen){ diff --git a/ndb/src/common/mgmcommon/printConfig/printConfig.cpp b/ndb/src/common/mgmcommon/printConfig/printConfig.cpp index 7260a84ce7a..daa287cc44d 100644 --- a/ndb/src/common/mgmcommon/printConfig/printConfig.cpp +++ b/ndb/src/common/mgmcommon/printConfig/printConfig.cpp @@ -15,10 +15,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include #include #include -#include #include void usage(const char * prg){ diff --git a/ndb/src/common/portlib/memtest/memtest.c b/ndb/src/common/portlib/memtest/memtest.c index d23235b7aa2..fb525c2f19f 100644 --- a/ndb/src/common/portlib/memtest/memtest.c +++ b/ndb/src/common/portlib/memtest/memtest.c @@ -16,8 +16,7 @@ -#include -#include +#include #include #include long long getMilli(); diff --git a/ndb/src/common/portlib/memtest/munmaptest/munmaptest.cpp b/ndb/src/common/portlib/memtest/munmaptest/munmaptest.cpp index 9e396cd98ee..f5d0c6a0a4c 100644 --- a/ndb/src/common/portlib/memtest/munmaptest/munmaptest.cpp +++ b/ndb/src/common/portlib/memtest/munmaptest/munmaptest.cpp @@ -17,6 +17,9 @@ +#include +#include + #include #include #include @@ -27,13 +30,6 @@ #include #include #include -#include -#include -#include -#include -#include -#include - struct ThreadData { diff --git a/ndb/src/common/portlib/mmstest/mmslist.cpp b/ndb/src/common/portlib/mmstest/mmslist.cpp index bd00211445c..05538785293 100644 --- a/ndb/src/common/portlib/mmstest/mmslist.cpp +++ b/ndb/src/common/portlib/mmstest/mmslist.cpp @@ -14,14 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include #include #include #include #include -#include -#include #include /** diff --git a/ndb/src/common/portlib/mmstest/mmstest.cpp b/ndb/src/common/portlib/mmstest/mmstest.cpp index 6ebb5064aaf..9cc7d810985 100644 --- a/ndb/src/common/portlib/mmstest/mmstest.cpp +++ b/ndb/src/common/portlib/mmstest/mmstest.cpp @@ -14,13 +14,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include #include "NdbThread.h" #include #include -#include - NDB_COMMAND(ndbmem, "ndbmem", "ndbmem", "Test the ndbmem functionality", 4096){ ndbout << "Starting test of NdbMem" << endl; diff --git a/ndb/src/common/portlib/test/NdbPortLibTest.cpp b/ndb/src/common/portlib/test/NdbPortLibTest.cpp index 8a5c8f4a878..55b9ccec5f2 100644 --- a/ndb/src/common/portlib/test/NdbPortLibTest.cpp +++ b/ndb/src/common/portlib/test/NdbPortLibTest.cpp @@ -20,7 +20,7 @@ * TODO - Add tests for NdbMem */ - +#include #include "NdbOut.hpp" #include "NdbThread.h" @@ -32,11 +32,6 @@ #include "NdbHost.h" #include "NdbMain.h" -#include -#include -#include -#include - int TestHasFailed; int verbose = 0; diff --git a/ndb/src/common/portlib/unix/NdbDaemon.c b/ndb/src/common/portlib/unix/NdbDaemon.c index fc114266c9d..eb3ca339fa4 100644 --- a/ndb/src/common/portlib/unix/NdbDaemon.c +++ b/ndb/src/common/portlib/unix/NdbDaemon.c @@ -14,28 +14,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "NdbDaemon.h" +#include #include - -#ifdef NDB_LINUX -#include -#include -#include -#include -#include #include -#include -#endif - -#ifdef NDB_SOLARIS -#include -#include -#include -#include -#include -#include -#include -#endif +#include "NdbDaemon.h" #define NdbDaemon_ErrorSize 500 #if defined(NDB_LINUX) || defined(NDB_SOLARIS) diff --git a/ndb/src/common/transporter/Packer.cpp b/ndb/src/common/transporter/Packer.cpp index 77bd66d1ba9..fa72af12dac 100644 --- a/ndb/src/common/transporter/Packer.cpp +++ b/ndb/src/common/transporter/Packer.cpp @@ -14,13 +14,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "Packer.hpp" #include #include #include -#include - Uint32 TransporterRegistry::unpack(Uint32 * readPtr, Uint32 sizeOfData, diff --git a/ndb/src/common/transporter/SCI_Transporter.cpp b/ndb/src/common/transporter/SCI_Transporter.cpp index 2be857e8115..c52c8a9d8c0 100644 --- a/ndb/src/common/transporter/SCI_Transporter.cpp +++ b/ndb/src/common/transporter/SCI_Transporter.cpp @@ -14,17 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "SCI_Transporter.hpp" -#include #include #include #include -#include #include -#if 0 -#include -#include -#endif + #include "TransporterInternalDefinitions.hpp" #include diff --git a/ndb/src/common/transporter/SHM_Buffer.hpp b/ndb/src/common/transporter/SHM_Buffer.hpp index 43250853fee..6dd6b4672a1 100644 --- a/ndb/src/common/transporter/SHM_Buffer.hpp +++ b/ndb/src/common/transporter/SHM_Buffer.hpp @@ -17,11 +17,11 @@ #ifndef SHM_BUFFER_HPP #define SHM_BUFFER_HPP -#include -#include -#include +#include #include +#include + /** * These classes implement a circular buffer * diff --git a/ndb/src/common/transporter/SHM_Transporter.cpp b/ndb/src/common/transporter/SHM_Transporter.cpp index f18b775efa4..525194db3a6 100644 --- a/ndb/src/common/transporter/SHM_Transporter.cpp +++ b/ndb/src/common/transporter/SHM_Transporter.cpp @@ -15,15 +15,14 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "SHM_Transporter.hpp" #include "TransporterInternalDefinitions.hpp" #include #include #include -#include -#include - #ifdef NDB_WIN32 #include #else diff --git a/ndb/src/common/transporter/SHM_Transporter.unix.cpp b/ndb/src/common/transporter/SHM_Transporter.unix.cpp index 975c1191aea..afbf124432e 100644 --- a/ndb/src/common/transporter/SHM_Transporter.unix.cpp +++ b/ndb/src/common/transporter/SHM_Transporter.unix.cpp @@ -15,15 +15,14 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "SHM_Transporter.hpp" #include "TransporterInternalDefinitions.hpp" #include #include #include -#include - - #include #include diff --git a/ndb/src/common/transporter/SHM_Transporter.win32.cpp b/ndb/src/common/transporter/SHM_Transporter.win32.cpp index 4ba52c9179d..c289a85da0e 100644 --- a/ndb/src/common/transporter/SHM_Transporter.win32.cpp +++ b/ndb/src/common/transporter/SHM_Transporter.win32.cpp @@ -15,14 +15,14 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "SHM_Transporter.hpp" #include "TransporterInternalDefinitions.hpp" #include #include #include -#include - #include diff --git a/ndb/src/common/transporter/SendBuffer.hpp b/ndb/src/common/transporter/SendBuffer.hpp index 75ef0708e83..63a01f3de24 100644 --- a/ndb/src/common/transporter/SendBuffer.hpp +++ b/ndb/src/common/transporter/SendBuffer.hpp @@ -33,10 +33,9 @@ #include "TransporterDefinitions.hpp" #include -#include #ifdef DEBUG_TRANSPORTER -#include +#include #endif class SendBuffer { diff --git a/ndb/src/common/transporter/TCP_Transporter.cpp b/ndb/src/common/transporter/TCP_Transporter.cpp index 8a7d1741636..99b6a137797 100644 --- a/ndb/src/common/transporter/TCP_Transporter.cpp +++ b/ndb/src/common/transporter/TCP_Transporter.cpp @@ -14,6 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include #include "TCP_Transporter.hpp" #include @@ -23,13 +25,9 @@ #if defined NDB_OSE || defined NDB_SOFTOSE #define inet_send inet_send #else -#include #define inet_send send #endif -#include - - #ifdef NDB_WIN32 class ndbstrerror { diff --git a/ndb/src/common/transporter/TransporterRegistry.cpp b/ndb/src/common/transporter/TransporterRegistry.cpp index dcd957f40ce..482e8d40b9b 100644 --- a/ndb/src/common/transporter/TransporterRegistry.cpp +++ b/ndb/src/common/transporter/TransporterRegistry.cpp @@ -14,14 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include +#include + #include "TransporterRegistry.hpp" #include "TransporterInternalDefinitions.hpp" #include "Transporter.hpp" -#include -#include - #ifdef NDB_TCP_TRANSPORTER #include "TCP_Transporter.hpp" #endif diff --git a/ndb/src/common/transporter/basictest/basicTransporterTest.cpp b/ndb/src/common/transporter/basictest/basicTransporterTest.cpp index 5d8186badb8..c0a437c4907 100644 --- a/ndb/src/common/transporter/basictest/basicTransporterTest.cpp +++ b/ndb/src/common/transporter/basictest/basicTransporterTest.cpp @@ -14,18 +14,17 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "TransporterRegistry.hpp" #include "TransporterDefinitions.hpp" #include "TransporterCallback.hpp" #include -#include -#include #include #include #include #include -#include int basePortTCP = 17000; diff --git a/ndb/src/common/transporter/buddy.cpp b/ndb/src/common/transporter/buddy.cpp index c65aad1df2c..dc25e2dc66c 100644 --- a/ndb/src/common/transporter/buddy.cpp +++ b/ndb/src/common/transporter/buddy.cpp @@ -15,9 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "buddy.hpp" -#include -#include - void Chunk256::setFree(bool free){ // Bit 0 of allocationTimeStamp represents if the segment is free or not diff --git a/ndb/src/common/transporter/buddy.hpp b/ndb/src/common/transporter/buddy.hpp index 7272ac884ec..f720e9e61a1 100644 --- a/ndb/src/common/transporter/buddy.hpp +++ b/ndb/src/common/transporter/buddy.hpp @@ -17,8 +17,7 @@ #ifndef BUDDY_H #define BUDDY_H -#include -#include +#include typedef unsigned int Uint32; typedef unsigned short Uint16; diff --git a/ndb/src/common/transporter/failoverSCI/failoverSCI.cpp b/ndb/src/common/transporter/failoverSCI/failoverSCI.cpp index 03ce7ea6df3..803029ee565 100644 --- a/ndb/src/common/transporter/failoverSCI/failoverSCI.cpp +++ b/ndb/src/common/transporter/failoverSCI/failoverSCI.cpp @@ -14,17 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include +#include + #include "sisci_types.h" #include "sisci_api.h" #include "sisci_error.h" //#include "sisci_demolib.h" -#include -#include #include -#include "NdbSleep.h" +#include #define NO_CALLBACK NULL #define NO_FLAGS 0 #define DATA_TRANSFER_READY 8 diff --git a/ndb/src/common/transporter/perftest/perfTransporterTest.cpp b/ndb/src/common/transporter/perftest/perfTransporterTest.cpp index 6d7f7083a48..d33221c2835 100644 --- a/ndb/src/common/transporter/perftest/perfTransporterTest.cpp +++ b/ndb/src/common/transporter/perftest/perfTransporterTest.cpp @@ -14,18 +14,17 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "TransporterRegistry.hpp" #include "TransporterDefinitions.hpp" #include "TransporterCallback.hpp" #include -#include -#include #include #include #include #include -#include int basePortTCP = 17000; diff --git a/ndb/src/common/transporter/priotest/prioTransporterTest.cpp b/ndb/src/common/transporter/priotest/prioTransporterTest.cpp index 919cc9d7511..0fce6aaad39 100644 --- a/ndb/src/common/transporter/priotest/prioTransporterTest.cpp +++ b/ndb/src/common/transporter/priotest/prioTransporterTest.cpp @@ -14,6 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "TransporterRegistry.hpp" #include "TransporterDefinitions.hpp" #include "TransporterCallback.hpp" @@ -21,8 +23,6 @@ #include "prioTransporterTest.hpp" -#include -#include #include #include #include diff --git a/ndb/src/common/util/Base64.cpp b/ndb/src/common/util/Base64.cpp index 5f4bbc8645a..482d0b10ad2 100644 --- a/ndb/src/common/util/Base64.cpp +++ b/ndb/src/common/util/Base64.cpp @@ -14,8 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include #include static char base64_table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" diff --git a/ndb/src/common/util/BaseString.cpp b/ndb/src/common/util/BaseString.cpp index 1b0eaa1b83c..186642cbfa8 100644 --- a/ndb/src/common/util/BaseString.cpp +++ b/ndb/src/common/util/BaseString.cpp @@ -15,11 +15,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* -*- c-basic-offset: 4; -*- */ -#include -#include +#include +#include #include -#include "BaseString.hpp" -#include BaseString::BaseString() { diff --git a/ndb/src/common/util/File.cpp b/ndb/src/common/util/File.cpp index bbd2067f424..ccd6ba24916 100644 --- a/ndb/src/common/util/File.cpp +++ b/ndb/src/common/util/File.cpp @@ -16,8 +16,6 @@ #include -#include -#include #include #if defined NDB_OSE || defined NDB_SOFTOSE diff --git a/ndb/src/common/util/Parser.cpp b/ndb/src/common/util/Parser.cpp index d5c23fe14c1..ff6d290ae52 100644 --- a/ndb/src/common/util/Parser.cpp +++ b/ndb/src/common/util/Parser.cpp @@ -15,12 +15,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "Parser.hpp" -#include -#include -#include -#include +#include #include + +#include "Parser.hpp" +#include +#include #include #define DEBUG(x) ndbout << x << endl; diff --git a/ndb/src/common/util/Properties.cpp b/ndb/src/common/util/Properties.cpp index 4841d6e5e9e..05d8b56329b 100644 --- a/ndb/src/common/util/Properties.cpp +++ b/ndb/src/common/util/Properties.cpp @@ -14,14 +14,12 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include +#include + #include #include -#include -#include -#include -#include - #include /** diff --git a/ndb/src/common/util/SimpleProperties.cpp b/ndb/src/common/util/SimpleProperties.cpp index a118478ba6c..34a9d2719b6 100644 --- a/ndb/src/common/util/SimpleProperties.cpp +++ b/ndb/src/common/util/SimpleProperties.cpp @@ -14,9 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include -#include -#include #include #include #include diff --git a/ndb/src/common/util/SocketServer.cpp b/ndb/src/common/util/SocketServer.cpp index 39f46eceed9..21f4cd513b9 100644 --- a/ndb/src/common/util/SocketServer.cpp +++ b/ndb/src/common/util/SocketServer.cpp @@ -15,17 +15,16 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include +#include + #include "SocketServer.hpp" #include -#include #include #include #include -#include -#include - #define DEBUG(x) ndbout << x << endl; SocketServer::SocketServer(int maxSessions) : diff --git a/ndb/src/common/util/getarg.c b/ndb/src/common/util/getarg.c index 7d627a92d18..131d6a8b3d9 100644 --- a/ndb/src/common/util/getarg.c +++ b/ndb/src/common/util/getarg.c @@ -33,11 +33,7 @@ */ #include -#include -#include -#include -#include #include #include #include "getarg.h" diff --git a/ndb/src/common/util/new.cpp b/ndb/src/common/util/new.cpp index a0709a3fa13..889e83edf6f 100644 --- a/ndb/src/common/util/new.cpp +++ b/ndb/src/common/util/new.cpp @@ -1,6 +1,5 @@ -#include -#include +#include extern "C" { void (* ndb_new_handler)() = 0; diff --git a/ndb/src/common/util/random.c b/ndb/src/common/util/random.c index 91da19572e2..286ab093a26 100644 --- a/ndb/src/common/util/random.c +++ b/ndb/src/common/util/random.c @@ -18,16 +18,8 @@ * I N C L U D E D F I L E S * ***************************************************************/ -#include -#include -#include -#include +#include -#ifndef NDB_WIN32 -#include -#endif - -#include #include #include diff --git a/ndb/src/common/util/strdup.c b/ndb/src/common/util/strdup.c index c7fb8002ff0..afe2306427e 100644 --- a/ndb/src/common/util/strdup.c +++ b/ndb/src/common/util/strdup.c @@ -16,7 +16,6 @@ #include -#include #ifndef HAVE_STRDUP char * diff --git a/ndb/src/common/util/testProperties/testProperties.cpp b/ndb/src/common/util/testProperties/testProperties.cpp index 4a2999b89c1..3aa2af92c5b 100644 --- a/ndb/src/common/util/testProperties/testProperties.cpp +++ b/ndb/src/common/util/testProperties/testProperties.cpp @@ -14,10 +14,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include "Properties.hpp" #include -#include -#include #include "uucode.h" diff --git a/ndb/src/common/util/testSimpleProperties/sp_test.cpp b/ndb/src/common/util/testSimpleProperties/sp_test.cpp index d6dbe2a1502..22b92c9a80c 100644 --- a/ndb/src/common/util/testSimpleProperties/sp_test.cpp +++ b/ndb/src/common/util/testSimpleProperties/sp_test.cpp @@ -14,10 +14,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include +#include + #include "SimpleProperties.hpp" #include -#include -#include Uint32 page[8192]; diff --git a/ndb/src/common/util/uucode.c b/ndb/src/common/util/uucode.c index f862d982204..da34d565153 100644 --- a/ndb/src/common/util/uucode.c +++ b/ndb/src/common/util/uucode.c @@ -15,8 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include /* ENC is the basic 1 character encoding function to make a char printing */ /* DEC is single character decode */ diff --git a/ndb/src/common/util/version.c b/ndb/src/common/util/version.c index 2ff10f51932..91aba6404d4 100644 --- a/ndb/src/common/util/version.c +++ b/ndb/src/common/util/version.c @@ -14,9 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include +#include #include #include diff --git a/ndb/src/cw/cpcc-win32/C++/StdAfx.h b/ndb/src/cw/cpcc-win32/C++/StdAfx.h index d84b5811f8d..370d04fb466 100644 --- a/ndb/src/cw/cpcc-win32/C++/StdAfx.h +++ b/ndb/src/cw/cpcc-win32/C++/StdAfx.h @@ -48,15 +48,12 @@ #include // C RunTime Header Files -#include -#include +#include #include #include #include #include #include -#include -#include // Local Header Files #include "resource.h" diff --git a/ndb/src/cw/cpcd/Process.cpp b/ndb/src/cw/cpcd/Process.cpp index a54c6b8e475..e35f9d6037a 100644 --- a/ndb/src/cw/cpcd/Process.cpp +++ b/ndb/src/cw/cpcd/Process.cpp @@ -14,13 +14,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include #include #include -#include -#include #include #include @@ -28,8 +26,6 @@ #include "CPCD.hpp" #include -#include -#include #include #include diff --git a/ndb/src/cw/cpcd/common.hpp b/ndb/src/cw/cpcd/common.hpp index 65fcce05f66..c3d87b8b9f5 100644 --- a/ndb/src/cw/cpcd/common.hpp +++ b/ndb/src/cw/cpcd/common.hpp @@ -17,7 +17,7 @@ #ifndef __CPCD_COMMON_HPP_INCLUDED__ #define __CPCD_COMMON_HPP_INCLUDED__ -#include +#include #include #include diff --git a/ndb/src/cw/test/socketclient/socketClientTest.cpp b/ndb/src/cw/test/socketclient/socketClientTest.cpp index a4a0ed1e933..423c196aa43 100644 --- a/ndb/src/cw/test/socketclient/socketClientTest.cpp +++ b/ndb/src/cw/test/socketclient/socketClientTest.cpp @@ -15,11 +15,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include #include -#include -#include #include #include #include diff --git a/ndb/src/cw/util/ClientInterface.hpp b/ndb/src/cw/util/ClientInterface.hpp index 764705afacd..66ecfe05197 100644 --- a/ndb/src/cw/util/ClientInterface.hpp +++ b/ndb/src/cw/util/ClientInterface.hpp @@ -16,6 +16,7 @@ #ifndef CLIENT_IF_HPP #define CLIENT_IF_HPP +#include #include #include #include @@ -23,9 +24,6 @@ #include #include "SocketRegistry.hpp" #include "SocketService.hpp" -#include "string.h" -#include -#include class ClientInterface { private: diff --git a/ndb/src/kernel/blocks/backup/FsBuffer.hpp b/ndb/src/kernel/blocks/backup/FsBuffer.hpp index 4b5d95a19a5..cbc03ffd11b 100644 --- a/ndb/src/kernel/blocks/backup/FsBuffer.hpp +++ b/ndb/src/kernel/blocks/backup/FsBuffer.hpp @@ -17,10 +17,8 @@ #ifndef FS_BUFFER_HPP #define FS_BUFFER_HPP +#include #include -#include -#include -#include #define DEBUG(x) diff --git a/ndb/src/kernel/blocks/backup/read.cpp b/ndb/src/kernel/blocks/backup/read.cpp index 8300c74ab43..921c352ea13 100644 --- a/ndb/src/kernel/blocks/backup/read.cpp +++ b/ndb/src/kernel/blocks/backup/read.cpp @@ -15,9 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include +#include #include #include diff --git a/ndb/src/kernel/blocks/dbdict/printSchemafile/printSchemafile.cpp b/ndb/src/kernel/blocks/dbdict/printSchemafile/printSchemafile.cpp index b16990bda6c..51f05ae1d6e 100644 --- a/ndb/src/kernel/blocks/dbdict/printSchemafile/printSchemafile.cpp +++ b/ndb/src/kernel/blocks/dbdict/printSchemafile/printSchemafile.cpp @@ -15,13 +15,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include +#include + #include #include #include -#include -#include -#include void usage(const char * prg){ diff --git a/ndb/src/kernel/blocks/dbdih/printSysfile/printSysfile.cpp b/ndb/src/kernel/blocks/dbdih/printSysfile/printSysfile.cpp index 4c55425bdd7..90bb1ded490 100644 --- a/ndb/src/kernel/blocks/dbdih/printSysfile/printSysfile.cpp +++ b/ndb/src/kernel/blocks/dbdih/printSysfile/printSysfile.cpp @@ -15,13 +15,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include +#include + #include #include #include -#include -#include -#include void usage(const char * prg){ diff --git a/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp b/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp index d2d166fa03e..540df7b507e 100644 --- a/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp +++ b/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp @@ -25,11 +25,10 @@ //---------------------------------------------------------------- +#include + #include "records.hpp" -#include -#include -#include -#include + #define RETURN_ERROR 1 #define RETURN_OK 0 diff --git a/ndb/src/kernel/blocks/ndbfs/Filename.cpp b/ndb/src/kernel/blocks/ndbfs/Filename.cpp index c0bc52b4501..494c9c74eb9 100644 --- a/ndb/src/kernel/blocks/ndbfs/Filename.cpp +++ b/ndb/src/kernel/blocks/ndbfs/Filename.cpp @@ -14,10 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include -#include +#include + #include #include "Filename.hpp" diff --git a/ndb/src/kernel/error/ErrorReporter.hpp b/ndb/src/kernel/error/ErrorReporter.hpp index f1428821ab0..20340a9602f 100644 --- a/ndb/src/kernel/error/ErrorReporter.hpp +++ b/ndb/src/kernel/error/ErrorReporter.hpp @@ -17,9 +17,10 @@ #ifndef ERRORREPORTER_H #define ERRORREPORTER_H +#include + #include "TimeModule.hpp" #include "Error.hpp" -#include #include diff --git a/ndb/src/kernel/vm/Emulator.cpp b/ndb/src/kernel/vm/Emulator.cpp index a852e045c6e..7eae1f519c0 100644 --- a/ndb/src/kernel/vm/Emulator.cpp +++ b/ndb/src/kernel/vm/Emulator.cpp @@ -14,6 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "Emulator.hpp" #include #include @@ -31,7 +33,6 @@ #include #include #include -#include #include extern "C" { diff --git a/ndb/src/kernel/vm/GlobalData.hpp b/ndb/src/kernel/vm/GlobalData.hpp index ca7dd467750..3d312154c35 100644 --- a/ndb/src/kernel/vm/GlobalData.hpp +++ b/ndb/src/kernel/vm/GlobalData.hpp @@ -17,11 +17,11 @@ #ifndef GLOBAL_DATA_H #define GLOBAL_DATA_H +#include #include +#include #include "Prio.hpp" #include "VMSignal.hpp" -#include -#include #include #include diff --git a/ndb/src/kernel/vm/TransporterCallback.cpp b/ndb/src/kernel/vm/TransporterCallback.cpp index 1fec4ea86bd..3798e4040c8 100644 --- a/ndb/src/kernel/vm/TransporterCallback.cpp +++ b/ndb/src/kernel/vm/TransporterCallback.cpp @@ -14,12 +14,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include #include #include #include #include -#include #include "LongSignal.hpp" diff --git a/ndb/src/kernel/vm/VMSignal.hpp b/ndb/src/kernel/vm/VMSignal.hpp index d436143c055..45e731f2079 100644 --- a/ndb/src/kernel/vm/VMSignal.hpp +++ b/ndb/src/kernel/vm/VMSignal.hpp @@ -17,14 +17,15 @@ #ifndef VMSignal_H #define VMSignal_H +#include +#include +#include + #include #include -#include -#include #include #include -#include /** * Struct used when sending to multiple blocks diff --git a/ndb/src/kernel/vm/al_test/arrayListTest.cpp b/ndb/src/kernel/vm/al_test/arrayListTest.cpp index 39d8170cfc5..6f2bb7fc312 100644 --- a/ndb/src/kernel/vm/al_test/arrayListTest.cpp +++ b/ndb/src/kernel/vm/al_test/arrayListTest.cpp @@ -16,11 +16,12 @@ +#include +#include + #include -#include #include #include -#include struct A_Listable_Object { Uint32 next; diff --git a/ndb/src/kernel/vm/al_test/arrayPoolTest.cpp b/ndb/src/kernel/vm/al_test/arrayPoolTest.cpp index 8b554d5bb41..01cc5ede5f7 100644 --- a/ndb/src/kernel/vm/al_test/arrayPoolTest.cpp +++ b/ndb/src/kernel/vm/al_test/arrayPoolTest.cpp @@ -16,12 +16,12 @@ +#include +#include + #include -#include #include #include -#include -#include struct A_Poolable_Object { Uint32 next; diff --git a/ndb/src/kernel/vm/al_test/main.cpp b/ndb/src/kernel/vm/al_test/main.cpp index 42c36173b56..48f6d71f4cf 100644 --- a/ndb/src/kernel/vm/al_test/main.cpp +++ b/ndb/src/kernel/vm/al_test/main.cpp @@ -14,11 +14,12 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include +#include + #include -#include #include #include -#include #include #include "arrayListTest.cpp" diff --git a/ndb/src/kernel/vm/testCopy/rr.cpp b/ndb/src/kernel/vm/testCopy/rr.cpp index 2da8383f523..1e8305dfe4c 100644 --- a/ndb/src/kernel/vm/testCopy/rr.cpp +++ b/ndb/src/kernel/vm/testCopy/rr.cpp @@ -15,10 +15,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include -#include -#include -#include int main(int argc, char * const argv[]){ diff --git a/ndb/src/kernel/vm/testCopy/testCopy.cpp b/ndb/src/kernel/vm/testCopy/testCopy.cpp index 1b4b24f5934..78a1dab2619 100644 --- a/ndb/src/kernel/vm/testCopy/testCopy.cpp +++ b/ndb/src/kernel/vm/testCopy/testCopy.cpp @@ -15,11 +15,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include -#include -#include -#include #ifdef __NDB_FORTE6 #define HAND diff --git a/ndb/src/kernel/vm/testDataBuffer/testDataBuffer.cpp b/ndb/src/kernel/vm/testDataBuffer/testDataBuffer.cpp index def8387e343..5ba59418223 100644 --- a/ndb/src/kernel/vm/testDataBuffer/testDataBuffer.cpp +++ b/ndb/src/kernel/vm/testDataBuffer/testDataBuffer.cpp @@ -14,10 +14,12 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include #include #include -#include -#include + +#undef test struct Buffer { Buffer(Uint32 size){ m_sz = size; buffer = new Uint32[m_sz]; m_len = 0;} diff --git a/ndb/src/kernel/vm/testLongSig/testLongSig.cpp b/ndb/src/kernel/vm/testLongSig/testLongSig.cpp index 6d421268a0a..7a1e6a3e93d 100644 --- a/ndb/src/kernel/vm/testLongSig/testLongSig.cpp +++ b/ndb/src/kernel/vm/testLongSig/testLongSig.cpp @@ -15,10 +15,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include +#include #include #include -#include -#include void print_help(){ diff --git a/ndb/src/kernel/vm/testSimplePropertiesSection/test.cpp b/ndb/src/kernel/vm/testSimplePropertiesSection/test.cpp index 20a5d5230fb..e16870edf11 100644 --- a/ndb/src/kernel/vm/testSimplePropertiesSection/test.cpp +++ b/ndb/src/kernel/vm/testSimplePropertiesSection/test.cpp @@ -14,12 +14,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include #include #include -#include -#include + +#undef test struct Buffer { Buffer(Uint32 size){ m_sz = size; buffer = new Uint32[m_sz]; m_len = 0;} diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp index 4c1355e8e46..fcdfe943fb1 100644 --- a/ndb/src/mgmapi/mgmapi.cpp +++ b/ndb/src/mgmapi/mgmapi.cpp @@ -14,17 +14,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include #include "mgmapi.h" #include "mgmapi_debug.h" #include -#include - -#include -#include -#include -#include #include #include #include diff --git a/ndb/src/mgmapi/test/keso.c b/ndb/src/mgmapi/test/keso.c index f4b192e3db8..8a9a8e88d66 100644 --- a/ndb/src/mgmapi/test/keso.c +++ b/ndb/src/mgmapi/test/keso.c @@ -15,6 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include #ifdef VM_TRACE @@ -22,9 +24,6 @@ #endif #include -#include - -#include static int testConnect(NdbMgmHandle h, struct ndb_mgm_reply* reply); static int testDisconnect(NdbMgmHandle h, struct ndb_mgm_reply* reply); diff --git a/ndb/src/mgmapi/test/mgmSrvApi.cpp b/ndb/src/mgmapi/test/mgmSrvApi.cpp index e93c54ae5a7..4a8e38c9ba5 100644 --- a/ndb/src/mgmapi/test/mgmSrvApi.cpp +++ b/ndb/src/mgmapi/test/mgmSrvApi.cpp @@ -25,11 +25,9 @@ * Server API" document * *****************************************************/ +#include #include "mgmapi.h" #include "mgmapi_commands.h" -#include -#include -#include #include #include diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index 29d25ebf7d3..fba5fda32dd 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -14,13 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include -#include -#include - -#include +#include "CommandInterpreter.hpp" #include #include @@ -34,7 +28,6 @@ #endif // HAVE_GLOBAL_REPLICATION #include "MgmtErrorReporter.hpp" -#include "CommandInterpreter.hpp" #include "CpcClient.hpp" #ifdef NDB_SOLARIS // XXX fix me diff --git a/ndb/src/mgmclient/CommandInterpreter.hpp b/ndb/src/mgmclient/CommandInterpreter.hpp index 9049ef39915..104da3ce254 100644 --- a/ndb/src/mgmclient/CommandInterpreter.hpp +++ b/ndb/src/mgmclient/CommandInterpreter.hpp @@ -22,9 +22,8 @@ // Author: Peter Lind //***************************************************************************** +#include #include -#include -#include #include #include diff --git a/ndb/src/mgmclient/CpcClient.cpp b/ndb/src/mgmclient/CpcClient.cpp index 24eab7194e9..74fa1a828ed 100644 --- a/ndb/src/mgmclient/CpcClient.cpp +++ b/ndb/src/mgmclient/CpcClient.cpp @@ -14,14 +14,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include #include -#include -#include -#include #include -#include #include #include diff --git a/ndb/src/mgmclient/main.cpp b/ndb/src/mgmclient/main.cpp index bbadaeb5206..2dcadf9369d 100644 --- a/ndb/src/mgmclient/main.cpp +++ b/ndb/src/mgmclient/main.cpp @@ -14,9 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include +#include #include #include diff --git a/ndb/src/mgmclient/test_cpcd/test_cpcd.cpp b/ndb/src/mgmclient/test_cpcd/test_cpcd.cpp index 6b6dc9f1077..b8429c6b7d7 100644 --- a/ndb/src/mgmclient/test_cpcd/test_cpcd.cpp +++ b/ndb/src/mgmclient/test_cpcd/test_cpcd.cpp @@ -15,10 +15,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include "../CpcClient.hpp" #include #include -#include SimpleCpcClient g_client("localhost", 1234); Vector g_procs; diff --git a/ndb/src/mgmsrv/CommandInterpreter.hpp b/ndb/src/mgmsrv/CommandInterpreter.hpp index e68aa7da084..2989f31bd36 100644 --- a/ndb/src/mgmsrv/CommandInterpreter.hpp +++ b/ndb/src/mgmsrv/CommandInterpreter.hpp @@ -21,9 +21,8 @@ // Author: Peter Lind //***************************************************************************** +#include #include -#include -#include #include #include #include diff --git a/ndb/src/mgmsrv/convertStrToInt.cpp b/ndb/src/mgmsrv/convertStrToInt.cpp index 82bdb8e4f2f..e5216047d10 100644 --- a/ndb/src/mgmsrv/convertStrToInt.cpp +++ b/ndb/src/mgmsrv/convertStrToInt.cpp @@ -14,9 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include +#include bool convert(const char* s, int& val) { diff --git a/ndb/src/mgmsrv/mkconfig/mkconfig.cpp b/ndb/src/mgmsrv/mkconfig/mkconfig.cpp index 0e9397e43c0..c3f247bced6 100644 --- a/ndb/src/mgmsrv/mkconfig/mkconfig.cpp +++ b/ndb/src/mgmsrv/mkconfig/mkconfig.cpp @@ -14,15 +14,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include +#include + #include #include -#include #include "InitConfigFileParser.hpp" -#include "Config.hpp" +#include #include -#include -#include void usage(const char * prg){ ndbout << "Usage " << prg << ": " << endl; diff --git a/ndb/src/ndbapi/ClusterMgr.cpp b/ndb/src/ndbapi/ClusterMgr.cpp index 93fb0109669..744dec62881 100644 --- a/ndb/src/ndbapi/ClusterMgr.cpp +++ b/ndb/src/ndbapi/ClusterMgr.cpp @@ -14,6 +14,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include +#include +#include + #include "TransporterFacade.hpp" #include "ClusterMgr.hpp" #include @@ -23,12 +27,9 @@ #include #include #include -#include -#include #include -#include #include #include #include diff --git a/ndb/src/ndbapi/DictCache.cpp b/ndb/src/ndbapi/DictCache.cpp index 36fbc85a875..f6f2106f2aa 100644 --- a/ndb/src/ndbapi/DictCache.cpp +++ b/ndb/src/ndbapi/DictCache.cpp @@ -14,12 +14,12 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include "DictCache.hpp" #include "NdbDictionaryImpl.hpp" #include #include #include -#include LocalDictCache::LocalDictCache(){ m_tableHash.createHashTable(); diff --git a/ndb/src/ndbapi/Ndb.cpp b/ndb/src/ndbapi/Ndb.cpp index d7930f32d72..c45c43b2638 100644 --- a/ndb/src/ndbapi/Ndb.cpp +++ b/ndb/src/ndbapi/Ndb.cpp @@ -25,10 +25,10 @@ Name: Ndb.cpp #include "NdbImpl.hpp" #include "NdbSchemaOp.hpp" #include "NdbSchemaCon.hpp" -#include "NdbOperation.hpp" -#include "NdbConnection.hpp" -#include "NdbEventOperation.hpp" -#include "NdbRecAttr.hpp" +#include +#include +#include +#include #include #include #include diff --git a/ndb/src/ndbapi/NdbConnectionScan.cpp b/ndb/src/ndbapi/NdbConnectionScan.cpp index 67f07d2a8c0..5810dd8942a 100644 --- a/ndb/src/ndbapi/NdbConnectionScan.cpp +++ b/ndb/src/ndbapi/NdbConnectionScan.cpp @@ -27,10 +27,13 @@ * Documentation: * Adjust: 2000-06-12 UABRONM First version. ****************************************************************************/ -#include "Ndb.hpp" -#include "NdbConnection.hpp" -#include "NdbOperation.hpp" -#include "NdbScanOperation.hpp" +#include +#include + +#include +#include +#include +#include #include "NdbScanReceiver.hpp" #include "NdbApiSignal.hpp" #include "TransporterFacade.hpp" @@ -41,7 +44,6 @@ #include #include -#include // time out for next scan result (-1 is infinite) // XXX should change default only if non-trivial interpreted program is used diff --git a/ndb/src/ndbapi/NdbEventOperationImpl.cpp b/ndb/src/ndbapi/NdbEventOperationImpl.cpp index d167b8205a2..acc726e28c5 100644 --- a/ndb/src/ndbapi/NdbEventOperationImpl.cpp +++ b/ndb/src/ndbapi/NdbEventOperationImpl.cpp @@ -15,8 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include - +#include +#include #include "NdbDictionaryImpl.hpp" #include "API.hpp" @@ -24,21 +24,12 @@ #include #include "NdbApiSignal.hpp" #include "TransporterFacade.hpp" -#include -#include -#include -#include #include #include -#include -#include -#include #include #include #include #include -#include -#include #include #include #include diff --git a/ndb/src/ndbapi/NdbOperationExec.cpp b/ndb/src/ndbapi/NdbOperationExec.cpp index 1b0ad68b1eb..c0ec1b0aeb9 100644 --- a/ndb/src/ndbapi/NdbOperationExec.cpp +++ b/ndb/src/ndbapi/NdbOperationExec.cpp @@ -25,11 +25,13 @@ Version: 1.2 Description: Documentation: ***************************************************************************/ -#include "NdbOperation.hpp" -#include "NdbConnection.hpp" +#include + +#include +#include #include "NdbApiSignal.hpp" -#include "Ndb.hpp" -#include "NdbRecAttr.hpp" +#include +#include #include "NdbUtil.hpp" #include "Interpreter.hpp" diff --git a/ndb/src/ndbapi/NdbRecAttr.cpp b/ndb/src/ndbapi/NdbRecAttr.cpp index 11f36fbd2c4..0f7baeac4f5 100644 --- a/ndb/src/ndbapi/NdbRecAttr.cpp +++ b/ndb/src/ndbapi/NdbRecAttr.cpp @@ -26,8 +26,8 @@ Description: Interface between TIS and NDB Documentation: Adjust: 971206 UABRONM First version ************************************************************************************************/ +#include #include "NdbRecAttr.hpp" -#include #include "NdbDictionaryImpl.hpp" NdbRecAttr::NdbRecAttr() : diff --git a/ndb/src/ndbapi/NdbScanOperation.cpp b/ndb/src/ndbapi/NdbScanOperation.cpp index f753d2f6b34..0f2154edec3 100644 --- a/ndb/src/ndbapi/NdbScanOperation.cpp +++ b/ndb/src/ndbapi/NdbScanOperation.cpp @@ -26,6 +26,7 @@ * Adjust: 2002-04-01 UABMASD First version. ****************************************************************************/ +#include #include #include #include @@ -36,8 +37,6 @@ #include #ifndef NDB_MACOSX #include -#else -#include #endif NdbScanOperation::NdbScanOperation(Ndb* aNdb) : @@ -637,6 +636,24 @@ SetValueRecList::callSetValueFn(SetValueRec& aSetValueRec, NdbOperation& oper) } } +SetValueRec::~SetValueRec() +{ + if ((stype == SET_STRING_ATTR1) || + (stype == SET_INT32_ATTR1) || + (stype == SET_UINT32_ATTR1) || + (stype == SET_INT64_ATTR1) || + (stype == SET_UINT64_ATTR1) || + (stype == SET_FLOAT_ATTR1) || + (stype == SET_DOUBLE_ATTR1)) + free(anAttrName); + + if ((stype == SET_STRING_ATTR1) || + (stype == SET_STRING_ATTR2)) + free(stringStruct.aStringValue); + if (next) delete next; + next = 0; +} + int NdbScanOperation::equal_impl(const NdbColumnImpl* anAttrObject, const char* aValue, diff --git a/ndb/src/ndbapi/NdbUtil.hpp b/ndb/src/ndbapi/NdbUtil.hpp index eeee087d548..6a82af85987 100644 --- a/ndb/src/ndbapi/NdbUtil.hpp +++ b/ndb/src/ndbapi/NdbUtil.hpp @@ -29,8 +29,7 @@ Comment: #ifndef NdbUtil_H #define NdbUtil_H -#include -#include +#include #include "AttrType.hpp" class NdbApiSignal; diff --git a/ndb/src/ndbapi/ObjectMap.hpp b/ndb/src/ndbapi/ObjectMap.hpp index a2a8d00b48f..4abb54b5081 100644 --- a/ndb/src/ndbapi/ObjectMap.hpp +++ b/ndb/src/ndbapi/ObjectMap.hpp @@ -17,10 +17,8 @@ #ifndef NDB_OBJECT_ID_MAP_HPP #define NDB_OBJECT_ID_MAP_HPP -#include +#include //#include -#include -#include #include //#define DEBUG_OBJECTMAP diff --git a/ndb/src/ndbapi/TransporterFacade.cpp b/ndb/src/ndbapi/TransporterFacade.cpp index 746ab169b41..843eab133bb 100644 --- a/ndb/src/ndbapi/TransporterFacade.cpp +++ b/ndb/src/ndbapi/TransporterFacade.cpp @@ -14,8 +14,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include -#include "AttrType.hpp" +#include #include "TransporterFacade.hpp" #include "ClusterMgr.hpp" #include @@ -32,7 +33,6 @@ #include #include #include -#include #if !defined NDB_OSE && !defined NDB_SOFTOSE #include diff --git a/ndb/src/ndbapi/ndberror.c b/ndb/src/ndbapi/ndberror.c index 4e5281ccfcf..6e732272bcf 100644 --- a/ndb/src/ndbapi/ndberror.c +++ b/ndb/src/ndbapi/ndberror.c @@ -15,11 +15,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include #include #include +#include + typedef struct ErrorBundle { int code; ndberror_classification classification; @@ -575,10 +576,10 @@ const char *ndberror_classification_message(ndberror_classification classificati return empty_string; } -int ndb_error_string(int err_no, char *str, size_t size) +int ndb_error_string(int err_no, char *str, unsigned int size) { ndberror_struct error; - size_t len; + unsigned int len; error.code = err_no; ndberror_update(&error); diff --git a/ndb/src/ndbapi/signal-sender/SignalSender.hpp b/ndb/src/ndbapi/signal-sender/SignalSender.hpp index fffe027dbdd..e4e6c1931d2 100644 --- a/ndb/src/ndbapi/signal-sender/SignalSender.hpp +++ b/ndb/src/ndbapi/signal-sender/SignalSender.hpp @@ -17,11 +17,11 @@ #ifndef SIGNAL_SENDER_HPP #define SIGNAL_SENDER_HPP +#include #include #include #include #include -#include struct SimpleSignal { public: diff --git a/ndb/src/newtonapi/dba_internal.hpp b/ndb/src/newtonapi/dba_internal.hpp index a021db40a7d..84ae7ba222b 100644 --- a/ndb/src/newtonapi/dba_internal.hpp +++ b/ndb/src/newtonapi/dba_internal.hpp @@ -17,17 +17,16 @@ #ifndef DBA_INTERNAL_HPP #define DBA_INTERNAL_HPP +#include + extern "C" { #include "dba.h" } #include #include -#include #include -#include - #ifndef INT_MAX #define INT_MAX 2147483647 #endif diff --git a/ndb/src/rep/RepMain.cpp b/ndb/src/rep/RepMain.cpp index e00f6c0040c..f454832bda8 100644 --- a/ndb/src/rep/RepMain.cpp +++ b/ndb/src/rep/RepMain.cpp @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include -#include #include #include diff --git a/ndb/src/rep/Requestor.hpp b/ndb/src/rep/Requestor.hpp index ba753be60f2..735d2094bde 100644 --- a/ndb/src/rep/Requestor.hpp +++ b/ndb/src/rep/Requestor.hpp @@ -17,12 +17,13 @@ #ifndef REQUESTOR_HPP #define REQUESTOR_HPP +#include + #include #include #include #include #include -#include #include #include diff --git a/ndb/src/rep/adapters/ExtNDB.hpp b/ndb/src/rep/adapters/ExtNDB.hpp index c69f94d9a7e..bcbf51393aa 100644 --- a/ndb/src/rep/adapters/ExtNDB.hpp +++ b/ndb/src/rep/adapters/ExtNDB.hpp @@ -17,12 +17,13 @@ #ifndef EXTNDB_HPP #define EXTNDB_HPP +#include + #include #include #include #include #include -#include #include #include diff --git a/ndb/src/rep/dbug_hack.cpp b/ndb/src/rep/dbug_hack.cpp index 364325b55ae..794852a3a23 100644 --- a/ndb/src/rep/dbug_hack.cpp +++ b/ndb/src/rep/dbug_hack.cpp @@ -25,6 +25,7 @@ int replogEnabled; /** * @todo This should be implemented using MySQLs dbug library */ +#if 0 extern "C" void DBUG_PRINT(const char * fmt, ...) @@ -40,6 +41,7 @@ DBUG_PRINT(const char * fmt, ...) va_end(ap); #endif } +#endif extern "C" void diff --git a/ndb/src/rep/repapi/repapi.cpp b/ndb/src/rep/repapi/repapi.cpp index 80274896004..d34ab098c9c 100644 --- a/ndb/src/rep/repapi/repapi.cpp +++ b/ndb/src/rep/repapi/repapi.cpp @@ -14,17 +14,12 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include "repapi.h" //#include "mgmapi_debug.h" #include -#include - -#include -#include -#include -#include #include #include #include diff --git a/ndb/src/rep/state/Interval.cpp b/ndb/src/rep/state/Interval.cpp index 75697fa7548..8266f19c58d 100644 --- a/ndb/src/rep/state/Interval.cpp +++ b/ndb/src/rep/state/Interval.cpp @@ -16,6 +16,8 @@ #include "Interval.hpp" +#undef min +#undef max Uint32 max(Uint32 a, Uint32 b) { return a > b ? a : b; } Uint32 min(Uint32 a, Uint32 b) { return a < b ? a : b; } diff --git a/ndb/src/rep/storage/GCIBuffer.cpp b/ndb/src/rep/storage/GCIBuffer.cpp index 5049e47ea66..5073e62c550 100644 --- a/ndb/src/rep/storage/GCIBuffer.cpp +++ b/ndb/src/rep/storage/GCIBuffer.cpp @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include "GCIBuffer.hpp" -#include #include /***************************************************************************** diff --git a/ndb/src/rep/storage/GCIBuffer.hpp b/ndb/src/rep/storage/GCIBuffer.hpp index 5a07b149f81..8a8473d1d49 100644 --- a/ndb/src/rep/storage/GCIBuffer.hpp +++ b/ndb/src/rep/storage/GCIBuffer.hpp @@ -18,7 +18,7 @@ #define GCI_BUFFER_HPP #include "GCIPage.hpp" -#include "Vector.hpp" +#include #include #include diff --git a/ndb/src/rep/storage/GCIContainer.hpp b/ndb/src/rep/storage/GCIContainer.hpp index bcea11aae0f..48cbc66bfbd 100644 --- a/ndb/src/rep/storage/GCIContainer.hpp +++ b/ndb/src/rep/storage/GCIContainer.hpp @@ -17,13 +17,12 @@ #ifndef GCI_CONTAINER_HPP #define GCI_CONTAINER_HPP -#undef swap - #include #include "LogRecord.hpp" #include "GCIBuffer.hpp" +#undef swap #include #include diff --git a/ndb/src/rep/storage/LogRecord.hpp b/ndb/src/rep/storage/LogRecord.hpp index ba2632e23c7..a0bf3d52372 100644 --- a/ndb/src/rep/storage/LogRecord.hpp +++ b/ndb/src/rep/storage/LogRecord.hpp @@ -17,8 +17,7 @@ #ifndef LOG_RECORD_HPP #define LOG_RECORD_HPP -#include -#include +#include #include /** diff --git a/ndb/test/include/NDBT_Table.hpp b/ndb/test/include/NDBT_Table.hpp index a4482fa8084..597cd0d55d6 100644 --- a/ndb/test/include/NDBT_Table.hpp +++ b/ndb/test/include/NDBT_Table.hpp @@ -17,11 +17,12 @@ #ifndef NDBT_TABLE_HPP #define NDBT_TABLE_HPP +#include +#include + #include #include -#include - class NDBT_Attribute : public NdbDictionary::Column { friend class NdbOut& operator <<(class NdbOut&, const NDBT_Attribute &); public: diff --git a/ndb/test/ndbapi/bank/bankCreator/bankCreator.cpp b/ndb/test/ndbapi/bank/bankCreator/bankCreator.cpp index ee724236855..d84818baf24 100644 --- a/ndb/test/ndbapi/bank/bankCreator/bankCreator.cpp +++ b/ndb/test/ndbapi/bank/bankCreator/bankCreator.cpp @@ -15,8 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include #include #include diff --git a/ndb/test/ndbapi/bank/bankMakeGL/bankMakeGL.cpp b/ndb/test/ndbapi/bank/bankMakeGL/bankMakeGL.cpp index 0b6fc9c1f97..55e9081a598 100644 --- a/ndb/test/ndbapi/bank/bankMakeGL/bankMakeGL.cpp +++ b/ndb/test/ndbapi/bank/bankMakeGL/bankMakeGL.cpp @@ -15,8 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include #include #include diff --git a/ndb/test/ndbapi/bank/bankSumAccounts/bankSumAccounts.cpp b/ndb/test/ndbapi/bank/bankSumAccounts/bankSumAccounts.cpp index 7071de9f63e..ab3e862e8d2 100644 --- a/ndb/test/ndbapi/bank/bankSumAccounts/bankSumAccounts.cpp +++ b/ndb/test/ndbapi/bank/bankSumAccounts/bankSumAccounts.cpp @@ -15,8 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include #include #include diff --git a/ndb/test/ndbapi/bank/bankTimer/bankTimer.cpp b/ndb/test/ndbapi/bank/bankTimer/bankTimer.cpp index cfb2c93e4ad..ba8de9e4af1 100644 --- a/ndb/test/ndbapi/bank/bankTimer/bankTimer.cpp +++ b/ndb/test/ndbapi/bank/bankTimer/bankTimer.cpp @@ -15,8 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include + #include #include diff --git a/ndb/test/ndbapi/bank/bankTransactionMaker/bankTransactionMaker.cpp b/ndb/test/ndbapi/bank/bankTransactionMaker/bankTransactionMaker.cpp index 155a35998bb..0c7d5d72473 100644 --- a/ndb/test/ndbapi/bank/bankTransactionMaker/bankTransactionMaker.cpp +++ b/ndb/test/ndbapi/bank/bankTransactionMaker/bankTransactionMaker.cpp @@ -15,8 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include + #include #include diff --git a/ndb/test/ndbapi/bank/bankValidateAllGLs/bankValidateAllGLs.cpp b/ndb/test/ndbapi/bank/bankValidateAllGLs/bankValidateAllGLs.cpp index cc8e2792cbf..13136755de8 100644 --- a/ndb/test/ndbapi/bank/bankValidateAllGLs/bankValidateAllGLs.cpp +++ b/ndb/test/ndbapi/bank/bankValidateAllGLs/bankValidateAllGLs.cpp @@ -15,8 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include + #include #include diff --git a/ndb/test/ndbapi/create_all_tabs/create_all_tabs.cpp b/ndb/test/ndbapi/create_all_tabs/create_all_tabs.cpp index eaa99e8a79d..55d04888144 100644 --- a/ndb/test/ndbapi/create_all_tabs/create_all_tabs.cpp +++ b/ndb/test/ndbapi/create_all_tabs/create_all_tabs.cpp @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include #include #include diff --git a/ndb/test/ndbapi/create_tab/create_tab.cpp b/ndb/test/ndbapi/create_tab/create_tab.cpp index 2f2911b4ef4..8bb1e7a9572 100644 --- a/ndb/test/ndbapi/create_tab/create_tab.cpp +++ b/ndb/test/ndbapi/create_tab/create_tab.cpp @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include #include #include diff --git a/ndb/test/ndbapi/drop_all_tabs/drop_all_tabs.cpp b/ndb/test/ndbapi/drop_all_tabs/drop_all_tabs.cpp index 8e67493c003..59c57396acd 100644 --- a/ndb/test/ndbapi/drop_all_tabs/drop_all_tabs.cpp +++ b/ndb/test/ndbapi/drop_all_tabs/drop_all_tabs.cpp @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include #include #include diff --git a/ndb/test/ndbapi/flexTT/flexTT.cpp b/ndb/test/ndbapi/flexTT/flexTT.cpp index 1705f20b706..c45cbd95762 100644 --- a/ndb/test/ndbapi/flexTT/flexTT.cpp +++ b/ndb/test/ndbapi/flexTT/flexTT.cpp @@ -15,7 +15,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "NdbApi.hpp" +#include + +#include #include #include @@ -24,9 +26,6 @@ #include #include #include -#include -#include -#include #include #include diff --git a/ndb/test/ndbapi/indexTest/index.cpp b/ndb/test/ndbapi/indexTest/index.cpp index d0eb490e1a0..508186de529 100644 --- a/ndb/test/ndbapi/indexTest/index.cpp +++ b/ndb/test/ndbapi/indexTest/index.cpp @@ -37,9 +37,8 @@ 1 - Invalid arguments * *************************************************** */ -#include -#include -#include +#include + #include #include #include diff --git a/ndb/test/ndbapi/indexTest2/index2.cpp b/ndb/test/ndbapi/indexTest2/index2.cpp index 5a3674f0bbf..e49113d2f1b 100644 --- a/ndb/test/ndbapi/indexTest2/index2.cpp +++ b/ndb/test/ndbapi/indexTest2/index2.cpp @@ -37,9 +37,8 @@ 1 - Invalid arguments * *************************************************** */ -#include -#include -#include +#include + #include #include #include diff --git a/ndb/test/ndbapi/lmc-bench/async-src/generator/asyncGenerator.cpp b/ndb/test/ndbapi/lmc-bench/async-src/generator/asyncGenerator.cpp index 25eb1830de9..84a93414712 100644 --- a/ndb/test/ndbapi/lmc-bench/async-src/generator/asyncGenerator.cpp +++ b/ndb/test/ndbapi/lmc-bench/async-src/generator/asyncGenerator.cpp @@ -18,8 +18,7 @@ * I N C L U D E D F I L E S * ***************************************************************/ -#include -#include +#include #include "dbGenerator.h" #include diff --git a/ndb/test/ndbapi/lmc-bench/async-src/generator/mainAsyncGenerator.cpp b/ndb/test/ndbapi/lmc-bench/async-src/generator/mainAsyncGenerator.cpp index d7506c9dd2c..f613c66d07b 100644 --- a/ndb/test/ndbapi/lmc-bench/async-src/generator/mainAsyncGenerator.cpp +++ b/ndb/test/ndbapi/lmc-bench/async-src/generator/mainAsyncGenerator.cpp @@ -14,10 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include -#include +#include #include #include diff --git a/ndb/test/ndbapi/lmc-bench/async-src/user/macros.h b/ndb/test/ndbapi/lmc-bench/async-src/user/macros.h index c049cdbad33..22b7f564490 100644 --- a/ndb/test/ndbapi/lmc-bench/async-src/user/macros.h +++ b/ndb/test/ndbapi/lmc-bench/async-src/user/macros.h @@ -17,8 +17,7 @@ #ifndef MACROS_H #define MACROS_H -#include -#include +#include #include #define ERROR(x) {ndbout_c((x));} diff --git a/ndb/test/ndbapi/lmc-bench/async-src/user/ndb_error.hpp b/ndb/test/ndbapi/lmc-bench/async-src/user/ndb_error.hpp index 91a061c7cf4..9e6c5e55e73 100644 --- a/ndb/test/ndbapi/lmc-bench/async-src/user/ndb_error.hpp +++ b/ndb/test/ndbapi/lmc-bench/async-src/user/ndb_error.hpp @@ -17,7 +17,7 @@ #ifndef NDB_ERROR_H #define NDB_ERROR_H -#include +#include #include #include "userInterface.h" #include diff --git a/ndb/test/ndbapi/lmc-bench/async-src/user/userInterface.cpp b/ndb/test/ndbapi/lmc-bench/async-src/user/userInterface.cpp index ece82628ba7..fdbc229cc98 100644 --- a/ndb/test/ndbapi/lmc-bench/async-src/user/userInterface.cpp +++ b/ndb/test/ndbapi/lmc-bench/async-src/user/userInterface.cpp @@ -18,9 +18,7 @@ * I N C L U D E D F I L E S * ***************************************************************/ -#include -#include -#include +#include #include #include "ndb_schema.hpp" @@ -31,7 +29,6 @@ #include #include #include -#include /*************************************************************** * L O C A L C O N S T A N T S * diff --git a/ndb/test/ndbapi/lmc-bench/include/testDefinitions.h b/ndb/test/ndbapi/lmc-bench/include/testDefinitions.h index c6ad11016b2..2f4aeb30975 100644 --- a/ndb/test/ndbapi/lmc-bench/include/testDefinitions.h +++ b/ndb/test/ndbapi/lmc-bench/include/testDefinitions.h @@ -23,12 +23,6 @@ #include -/*************************************************************** -* M A C R O S * -***************************************************************/ - -typedef Uint32 uint32; - /***************************************************************/ /* C O N S T A N T S */ /***************************************************************/ @@ -62,14 +56,14 @@ typedef char GroupName[GROUP_NAME_LENGTH]; typedef char ChangedBy[CHANGED_BY_LENGTH]; typedef char ChangedTime[CHANGED_TIME_LENGTH]; typedef char SessionDetails[SESSION_DETAILS_LENGTH]; -typedef uint32 ServerId; -typedef uint32 ServerBit; -typedef uint32 GroupId; -typedef uint32 Location; -typedef uint32 Permission; +typedef Uint32 ServerId; +typedef Uint32 ServerBit; +typedef Uint32 GroupId; +typedef Uint32 Location; +typedef Uint32 Permission; -typedef uint32 Counter; -typedef uint32 ActiveSessions; +typedef Uint32 Counter; +typedef Uint32 ActiveSessions; typedef unsigned int BranchExecuted; typedef unsigned int DoRollback; diff --git a/ndb/test/ndbapi/lmc-bench/src/generator/dbGenerator.c b/ndb/test/ndbapi/lmc-bench/src/generator/dbGenerator.c index eedcd914d85..7484c7647f5 100644 --- a/ndb/test/ndbapi/lmc-bench/src/generator/dbGenerator.c +++ b/ndb/test/ndbapi/lmc-bench/src/generator/dbGenerator.c @@ -18,8 +18,7 @@ * I N C L U D E D F I L E S * ***************************************************************/ -#include -#include +#include #include "dbGenerator.h" /*************************************************************** diff --git a/ndb/test/ndbapi/lmc-bench/src/generator/mainGenerator.c b/ndb/test/ndbapi/lmc-bench/src/generator/mainGenerator.c index 6ddf0a47775..4a31db0b4e9 100644 --- a/ndb/test/ndbapi/lmc-bench/src/generator/mainGenerator.c +++ b/ndb/test/ndbapi/lmc-bench/src/generator/mainGenerator.c @@ -14,11 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include -#include -#include +#include #include #include diff --git a/ndb/test/ndbapi/lmc-bench/src/populator/dbPopulate.c b/ndb/test/ndbapi/lmc-bench/src/populator/dbPopulate.c index 9f8629ec1f0..42fbb52f3b2 100644 --- a/ndb/test/ndbapi/lmc-bench/src/populator/dbPopulate.c +++ b/ndb/test/ndbapi/lmc-bench/src/populator/dbPopulate.c @@ -18,9 +18,7 @@ * I N C L U D E D F I L E S * ***************************************************************/ -#include -#include -#include +#include #include "userInterface.h" diff --git a/ndb/test/ndbapi/lmc-bench/src/populator/mainPopulate.c b/ndb/test/ndbapi/lmc-bench/src/populator/mainPopulate.c index 9dde902d006..838ac8a7196 100644 --- a/ndb/test/ndbapi/lmc-bench/src/populator/mainPopulate.c +++ b/ndb/test/ndbapi/lmc-bench/src/populator/mainPopulate.c @@ -14,9 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include +#include #include "userInterface.h" #include "dbPopulate.h" diff --git a/ndb/test/ndbapi/lmc-bench/src/user/localDbPrepare.c b/ndb/test/ndbapi/lmc-bench/src/user/localDbPrepare.c index ca8a64ab59c..dd100507016 100644 --- a/ndb/test/ndbapi/lmc-bench/src/user/localDbPrepare.c +++ b/ndb/test/ndbapi/lmc-bench/src/user/localDbPrepare.c @@ -18,7 +18,7 @@ * I N C L U D E D F I L E S * ***************************************************************/ -#include +#include #include "userInterface.h" #include "userHandle.h" diff --git a/ndb/test/ndbapi/lmc-bench/src/user/macros.h b/ndb/test/ndbapi/lmc-bench/src/user/macros.h index beb4352c269..363f247b93f 100644 --- a/ndb/test/ndbapi/lmc-bench/src/user/macros.h +++ b/ndb/test/ndbapi/lmc-bench/src/user/macros.h @@ -17,8 +17,7 @@ #ifndef MACROS_H #define MACROS_H -#include -#include +#include #include #define ERROR(x) {ndbout_c((x)); } diff --git a/ndb/test/ndbapi/lmc-bench/src/user/ndb_error.hpp b/ndb/test/ndbapi/lmc-bench/src/user/ndb_error.hpp index 5f792342ed9..b3aaeac822e 100644 --- a/ndb/test/ndbapi/lmc-bench/src/user/ndb_error.hpp +++ b/ndb/test/ndbapi/lmc-bench/src/user/ndb_error.hpp @@ -17,7 +17,6 @@ #ifndef NDB_ERROR_H #define NDB_ERROR_H -#include #include #define error_handler(x,y, z) { \ diff --git a/ndb/test/ndbapi/lmc-bench/src/user/ndb_user_populate.cpp b/ndb/test/ndbapi/lmc-bench/src/user/ndb_user_populate.cpp index 6a35bccd064..ce3a76cdd59 100644 --- a/ndb/test/ndbapi/lmc-bench/src/user/ndb_user_populate.cpp +++ b/ndb/test/ndbapi/lmc-bench/src/user/ndb_user_populate.cpp @@ -19,7 +19,7 @@ extern "C" { #include "user_populate.h" } -#include +#include #include #include "ndb_schema.hpp" diff --git a/ndb/test/ndbapi/lmc-bench/src/user/old/userInterface.c b/ndb/test/ndbapi/lmc-bench/src/user/old/userInterface.c index c68f287f5dd..bacf1861dde 100644 --- a/ndb/test/ndbapi/lmc-bench/src/user/old/userInterface.c +++ b/ndb/test/ndbapi/lmc-bench/src/user/old/userInterface.c @@ -18,10 +18,7 @@ * I N C L U D E D F I L E S * ***************************************************************/ -#include -#include -#include -#include +#include #include "userInterface.h" #include "userHandle.h" diff --git a/ndb/test/ndbapi/lmc-bench/src/user/old/userTransaction.c b/ndb/test/ndbapi/lmc-bench/src/user/old/userTransaction.c index 17069b0a042..a2f4787bb0c 100644 --- a/ndb/test/ndbapi/lmc-bench/src/user/old/userTransaction.c +++ b/ndb/test/ndbapi/lmc-bench/src/user/old/userTransaction.c @@ -18,8 +18,7 @@ * I N C L U D E D F I L E S * ***************************************************************/ -#include -#include +#include #include #include "sql.h" diff --git a/ndb/test/ndbapi/lmc-bench/src/user/userInterface.cpp b/ndb/test/ndbapi/lmc-bench/src/user/userInterface.cpp index fc3f6955a47..67c4e037215 100644 --- a/ndb/test/ndbapi/lmc-bench/src/user/userInterface.cpp +++ b/ndb/test/ndbapi/lmc-bench/src/user/userInterface.cpp @@ -18,9 +18,7 @@ * I N C L U D E D F I L E S * ***************************************************************/ -#include -#include -#include +#include #ifndef NDB_WIN32 #include #endif diff --git a/ndb/test/ndbapi/lmc-bench/src/user/userTransaction.c b/ndb/test/ndbapi/lmc-bench/src/user/userTransaction.c index 17069b0a042..a2f4787bb0c 100644 --- a/ndb/test/ndbapi/lmc-bench/src/user/userTransaction.c +++ b/ndb/test/ndbapi/lmc-bench/src/user/userTransaction.c @@ -18,8 +18,7 @@ * I N C L U D E D F I L E S * ***************************************************************/ -#include -#include +#include #include #include "sql.h" diff --git a/ndb/test/ndbapi/ronja/benchronja/benchronja.cpp b/ndb/test/ndbapi/ronja/benchronja/benchronja.cpp index 71fa286a21b..ce0aee35e8f 100644 --- a/ndb/test/ndbapi/ronja/benchronja/benchronja.cpp +++ b/ndb/test/ndbapi/ronja/benchronja/benchronja.cpp @@ -26,6 +26,8 @@ * *************************************************** */ +#include + #include #include #include @@ -36,11 +38,6 @@ #include #include -#include -#include -#include -#include - #define MAX_TIMERS 4 #define MAXSTRLEN 16 #define MAXATTR 64 diff --git a/ndb/test/ndbapi/testBlobs/testBlobs.cpp b/ndb/test/ndbapi/testBlobs/testBlobs.cpp index b8fe51dc1e4..461c7e22092 100644 --- a/ndb/test/ndbapi/testBlobs/testBlobs.cpp +++ b/ndb/test/ndbapi/testBlobs/testBlobs.cpp @@ -18,13 +18,11 @@ * testBlobs */ -#include -#include +#include #include #include -#include -#include -#include + +#include #include #include #include diff --git a/ndb/test/ndbapi/testDataBuffers/testDataBuffers.cpp b/ndb/test/ndbapi/testDataBuffers/testDataBuffers.cpp index fd6570fad0a..051e5ff702e 100644 --- a/ndb/test/ndbapi/testDataBuffers/testDataBuffers.cpp +++ b/ndb/test/ndbapi/testDataBuffers/testDataBuffers.cpp @@ -28,14 +28,13 @@ * Creates tables TB00 to TB15 */ -#include -#include +#include #include + #include #include #include #include -#include // limits static int const MaxAttr = 64; diff --git a/ndb/test/ndbapi/testOIBasic/testOIBasic.cpp b/ndb/test/ndbapi/testOIBasic/testOIBasic.cpp index 68fa6ec5474..ad63bc1cc6f 100644 --- a/ndb/test/ndbapi/testOIBasic/testOIBasic.cpp +++ b/ndb/test/ndbapi/testOIBasic/testOIBasic.cpp @@ -18,9 +18,7 @@ * testOIBasic - ordered index test */ -#include -#include -#include +#include #include #include #include @@ -28,7 +26,6 @@ #include #include #include -#include #include #include #include diff --git a/ndb/test/ndbapi/vw_test/bcd.h b/ndb/test/ndbapi/vw_test/bcd.h index ce1309693c8..d0aaffbd8b7 100644 --- a/ndb/test/ndbapi/vw_test/bcd.h +++ b/ndb/test/ndbapi/vw_test/bcd.h @@ -14,8 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include struct bcdtab { char tab[3]; diff --git a/ndb/test/ndbapi/vw_test/cdrserver.cpp b/ndb/test/ndbapi/vw_test/cdrserver.cpp index 3c3f32e8886..8354d28f53f 100644 --- a/ndb/test/ndbapi/vw_test/cdrserver.cpp +++ b/ndb/test/ndbapi/vw_test/cdrserver.cpp @@ -31,28 +31,22 @@ /* must also have the same entry (same port number) in its */ /* ./etc/services file. */ /* **************************************************************** */ + +#include + /******** NDB INCLUDE ******/ #include /***************************/ /*#include */ -#include -#include -#include #include #include -#include #include -#include -#include #include #include -#include #include #include #include #include -#include -#include extern "C" { #include "utv.h" diff --git a/ndb/test/ndbapi/vw_test/size.cpp b/ndb/test/ndbapi/vw_test/size.cpp index 397cc02f4f6..c506771ebde 100644 --- a/ndb/test/ndbapi/vw_test/size.cpp +++ b/ndb/test/ndbapi/vw_test/size.cpp @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include #include "utv.h" int main(void) diff --git a/ndb/test/newtonapi/basic_test/common.cpp b/ndb/test/newtonapi/basic_test/common.cpp index 6fd63730832..d4c4e6a74a7 100644 --- a/ndb/test/newtonapi/basic_test/common.cpp +++ b/ndb/test/newtonapi/basic_test/common.cpp @@ -16,10 +16,6 @@ #include "common.hpp" -#include -#include -#include -#include NdbOut & operator << (NdbOut & out, const Employee_t & emp){ diff --git a/ndb/test/newtonapi/basic_test/common.hpp b/ndb/test/newtonapi/basic_test/common.hpp index e081df723ef..0df8f7e078d 100644 --- a/ndb/test/newtonapi/basic_test/common.hpp +++ b/ndb/test/newtonapi/basic_test/common.hpp @@ -17,12 +17,13 @@ #ifndef COMMON_H #define COMMON_H +#include + extern "C" { #include } #include -#include typedef struct Employee { UInt32_t EmpNo; diff --git a/ndb/test/newtonapi/basic_test/too_basic.cpp b/ndb/test/newtonapi/basic_test/too_basic.cpp index 9099f0d9154..883aacf8841 100644 --- a/ndb/test/newtonapi/basic_test/too_basic.cpp +++ b/ndb/test/newtonapi/basic_test/too_basic.cpp @@ -18,6 +18,9 @@ /****** THIS LINE IS 80 CHARACTERS WIDE - DO *NOT* EXCEED 80 CHARACTERS! ****/ +#include +#include + //#include //#include //#include "pcn_types.h" @@ -27,13 +30,6 @@ extern "C" { #include } -#include -#include -#include -#include - - - typedef struct Employee { UInt32_t EmpNo; diff --git a/ndb/test/newtonapi/perf_test/perf.cpp b/ndb/test/newtonapi/perf_test/perf.cpp index 81d4cc5fd08..2edad572d11 100644 --- a/ndb/test/newtonapi/perf_test/perf.cpp +++ b/ndb/test/newtonapi/perf_test/perf.cpp @@ -15,14 +15,13 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include +#include + extern "C" { #include } -#include -#include -#include - #include #include #include @@ -31,6 +30,9 @@ extern "C" { #include #include +#undef min +#undef max + static const int NP_Insert = 0; static const int NP_Update = 1; static const int NP_WriteUpdate = 2; diff --git a/ndb/test/run-test/main.cpp b/ndb/test/run-test/main.cpp index 1ce9124431c..eb8a626dc2b 100644 --- a/ndb/test/run-test/main.cpp +++ b/ndb/test/run-test/main.cpp @@ -15,7 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include #include #include #include diff --git a/ndb/test/run-test/run-test.hpp b/ndb/test/run-test/run-test.hpp index 8387f8638ed..8d00a7b6a55 100644 --- a/ndb/test/run-test/run-test.hpp +++ b/ndb/test/run-test/run-test.hpp @@ -24,6 +24,8 @@ #include #include +#undef MYSQL_CLIENT + enum ErrorCodes { ERR_OK = 0, ERR_NDB_FAILED = 101, diff --git a/ndb/test/src/NDBT_ResultRow.cpp b/ndb/test/src/NDBT_ResultRow.cpp index 098e4cfb796..d8965dad8aa 100644 --- a/ndb/test/src/NDBT_ResultRow.cpp +++ b/ndb/test/src/NDBT_ResultRow.cpp @@ -14,10 +14,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "NDBT_ResultRow.hpp" +#include #include -#include -#include +#include "NDBT_ResultRow.hpp" #include NDBT_ResultRow::NDBT_ResultRow(const NdbDictionary::Table& tab, diff --git a/ndb/test/src/NDBT_ReturnCodes.cpp b/ndb/test/src/NDBT_ReturnCodes.cpp index 542547c7a48..5bffc00177f 100644 --- a/ndb/test/src/NDBT_ReturnCodes.cpp +++ b/ndb/test/src/NDBT_ReturnCodes.cpp @@ -14,14 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/* System include files */ +#include + #include "NDBT_ReturnCodes.h" /* Ndb include files */ #include -/* System include files */ -#include - const char* rcodeToChar(int rcode){ switch (rcode){ case NDBT_OK: diff --git a/ndb/test/tools/hugoCalculator/hugoCalculator.cpp b/ndb/test/tools/hugoCalculator/hugoCalculator.cpp index 4cb801d3d73..7f2751be2ba 100644 --- a/ndb/test/tools/hugoCalculator/hugoCalculator.cpp +++ b/ndb/test/tools/hugoCalculator/hugoCalculator.cpp @@ -14,8 +14,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include + #include -#include #include #include #include diff --git a/ndb/test/tools/hugoFill/hugoFill.cpp b/ndb/test/tools/hugoFill/hugoFill.cpp index 748623cb253..dee6ce2e6c8 100644 --- a/ndb/test/tools/hugoFill/hugoFill.cpp +++ b/ndb/test/tools/hugoFill/hugoFill.cpp @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include #include #include diff --git a/ndb/test/tools/hugoLockRecords/hugoLockRecords.cpp b/ndb/test/tools/hugoLockRecords/hugoLockRecords.cpp index 90c08649ec2..e2c2cd13f00 100644 --- a/ndb/test/tools/hugoLockRecords/hugoLockRecords.cpp +++ b/ndb/test/tools/hugoLockRecords/hugoLockRecords.cpp @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include + #include #include diff --git a/ndb/test/tools/hugoPkDelete/hugoPkDel.cpp b/ndb/test/tools/hugoPkDelete/hugoPkDel.cpp index f77dc21bd0b..1855f19796f 100644 --- a/ndb/test/tools/hugoPkDelete/hugoPkDel.cpp +++ b/ndb/test/tools/hugoPkDelete/hugoPkDel.cpp @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include + #include #include diff --git a/ndb/test/tools/hugoPkRead/hugoPkRead.cpp b/ndb/test/tools/hugoPkRead/hugoPkRead.cpp index 2e9c2c35260..50351f08195 100644 --- a/ndb/test/tools/hugoPkRead/hugoPkRead.cpp +++ b/ndb/test/tools/hugoPkRead/hugoPkRead.cpp @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include + #include #include diff --git a/ndb/test/tools/hugoPkReadRecord/hugoPkReadRecord.cpp b/ndb/test/tools/hugoPkReadRecord/hugoPkReadRecord.cpp index 6335c391bc3..ac17ffffee8 100644 --- a/ndb/test/tools/hugoPkReadRecord/hugoPkReadRecord.cpp +++ b/ndb/test/tools/hugoPkReadRecord/hugoPkReadRecord.cpp @@ -14,8 +14,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include -#include #include #include #include diff --git a/ndb/test/tools/hugoPkUpdate/hugoPkUpd.cpp b/ndb/test/tools/hugoPkUpdate/hugoPkUpd.cpp index 141d01e3aee..e7edc3a991d 100644 --- a/ndb/test/tools/hugoPkUpdate/hugoPkUpd.cpp +++ b/ndb/test/tools/hugoPkUpdate/hugoPkUpd.cpp @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include + #include #include diff --git a/ndb/test/tools/hugoScanRead/hugoScanRead.cpp b/ndb/test/tools/hugoScanRead/hugoScanRead.cpp index 2376280d004..47ea8f4a8a7 100644 --- a/ndb/test/tools/hugoScanRead/hugoScanRead.cpp +++ b/ndb/test/tools/hugoScanRead/hugoScanRead.cpp @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include + #include #include diff --git a/ndb/test/tools/hugoScanUpdate/hugoScanUpd.cpp b/ndb/test/tools/hugoScanUpdate/hugoScanUpd.cpp index 56cd3b8c969..3e2255ca0f3 100644 --- a/ndb/test/tools/hugoScanUpdate/hugoScanUpd.cpp +++ b/ndb/test/tools/hugoScanUpdate/hugoScanUpd.cpp @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include + #include #include diff --git a/ndb/tools/copy_tab/copy_tab.cpp b/ndb/tools/copy_tab/copy_tab.cpp index 32cfb0b35ff..33ce8e01d9a 100644 --- a/ndb/tools/copy_tab/copy_tab.cpp +++ b/ndb/tools/copy_tab/copy_tab.cpp @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include #include #include diff --git a/ndb/tools/create_index/create_index.cpp b/ndb/tools/create_index/create_index.cpp index 32da39a5208..dc9e6c606d6 100644 --- a/ndb/tools/create_index/create_index.cpp +++ b/ndb/tools/create_index/create_index.cpp @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include #include #include diff --git a/ndb/tools/delete_all/delete_all.cpp b/ndb/tools/delete_all/delete_all.cpp index e78ad4a2e1e..9cbba503e68 100644 --- a/ndb/tools/delete_all/delete_all.cpp +++ b/ndb/tools/delete_all/delete_all.cpp @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include #include #include diff --git a/ndb/tools/drop_index/drop_index.cpp b/ndb/tools/drop_index/drop_index.cpp index 146f01113b2..327f15741c9 100644 --- a/ndb/tools/drop_index/drop_index.cpp +++ b/ndb/tools/drop_index/drop_index.cpp @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include #include #include diff --git a/ndb/tools/drop_tab/drop_tab.cpp b/ndb/tools/drop_tab/drop_tab.cpp index 5946ada5956..70e5d85aabe 100644 --- a/ndb/tools/drop_tab/drop_tab.cpp +++ b/ndb/tools/drop_tab/drop_tab.cpp @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include #include #include diff --git a/ndb/tools/select_all/select_all.cpp b/ndb/tools/select_all/select_all.cpp index 32e9d1c6872..34f63a095bb 100644 --- a/ndb/tools/select_all/select_all.cpp +++ b/ndb/tools/select_all/select_all.cpp @@ -15,8 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include + #include #include diff --git a/ndb/tools/select_count/select_count.cpp b/ndb/tools/select_count/select_count.cpp index 4d281b9bdd5..b1513ad4135 100644 --- a/ndb/tools/select_count/select_count.cpp +++ b/ndb/tools/select_count/select_count.cpp @@ -15,8 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include + #include #include diff --git a/ndb/tools/transproxy/transproxy.cpp b/ndb/tools/transproxy/transproxy.cpp index 4c1308e63e7..a9046737d37 100644 --- a/ndb/tools/transproxy/transproxy.cpp +++ b/ndb/tools/transproxy/transproxy.cpp @@ -14,14 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include #include -#include -#include -#include -#include -#include #include #include diff --git a/ndb/tools/verify_index/verify_index.cpp b/ndb/tools/verify_index/verify_index.cpp index 324bb11cfe4..1295b657e9b 100644 --- a/ndb/tools/verify_index/verify_index.cpp +++ b/ndb/tools/verify_index/verify_index.cpp @@ -14,9 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include -#include -#include #include #include From 95600183df8678f6b158d91e11d018fe24678696 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 7 May 2004 12:13:45 +0300 Subject: [PATCH 019/162] Fix auto_inc locking bug introduced in ChangeSet@1.1794.1.1 innobase/row/row0mysql.c: Revert accidental modification to row_lock_table_autoinc_for_mysql() made in ChangeSet@1.1794.1.1 mysql-test/r/innodb.result: Revert ChangeSet@1.1794.1.1 --- innobase/row/row0mysql.c | 2 +- mysql-test/r/innodb.result | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c index f53a8de2080..bdc47ca0e8e 100644 --- a/innobase/row/row0mysql.c +++ b/innobase/row/row0mysql.c @@ -696,7 +696,7 @@ run_again: trx_start_if_not_started(trx); - err = lock_table(0, prebuilt->table, prebuilt->select_lock_type, thr); + err = lock_table(0, prebuilt->table, LOCK_AUTO_INC, thr); trx->error_state = err; diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 1a92946bfcd..6a67bbc6f8b 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -431,7 +431,7 @@ Duplicate entry 'test2' for key 2 select * from t1; id ggid email passwd 1 this will work -4 test2 this will work +3 test2 this will work select * from t1 where id=1; id ggid email passwd 1 this will work From c6bc3cfb8457332b4519efcd10339c2632626acb Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 7 May 2004 14:50:10 +0200 Subject: [PATCH 020/162] Added additional parameter userdata for mysql_set_local_infile_handler to allow binding of userland functions in PHP. include/mysql.h: added new last parameter (void *) for mysql_set_local_infile_handler st_mysql_options: added void *local_infile_userdata added last parameter (void *) for local_infile_init function pointer libmysql/libmysql.c: added parameter userdata in mysql_set_local_infile_handler added parameter (void *userdata __attribute__ ((unused))) in mysql_local_infile_init passed additional parameter userdata to init function in handle_local_infile BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + include/mysql.h | 9 ++++++--- libmysql/libmysql.c | 13 +++++++++---- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index 44593cef0af..a8379b3d338 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -33,6 +33,7 @@ dlenev@build.mysql.com dlenev@jabberwock.localdomain dlenev@mysql.com ejonore@mc03.ndb.mysql.com +georg@beethoven.local gerberb@ou800.zenez.com gluh@gluh.(none) gluh@gluh.mysql.r18.ru diff --git a/include/mysql.h b/include/mysql.h index 537467336f8..51540a7d89f 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -188,10 +188,11 @@ struct st_mysql_options { my_bool secure_auth; /* function pointers for local infile support */ - int (*local_infile_init)(void **, const char *); + int (*local_infile_init)(void **, const char *, void *); int (*local_infile_read)(void *, char *, unsigned int); void (*local_infile_end)(void *); int (*local_infile_error)(void *, char *, unsigned int); + void *local_infile_userdata; }; enum mysql_status @@ -397,12 +398,14 @@ my_bool STDCALL mysql_slave_send_query(MYSQL *mysql, const char *q, void mysql_set_local_infile_handler(MYSQL *mysql, - int (*local_infile_init)(void **, const char *), + int (*local_infile_init)(void **, const char *, + void *), int (*local_infile_read)(void *, char *, unsigned int), void (*local_infile_end)(void *), int (*local_infile_error)(void *, char*, - unsigned int)); + unsigned int), + void *); void mysql_set_local_infile_default(MYSQL *mysql); diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 4ecc1bd0584..a467b7fc9fd 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -831,7 +831,8 @@ my_bool handle_local_infile(MYSQL *mysql, const char *net_filename) } /* initialize local infile (open file, usually) */ - if ((*options->local_infile_init)(&li_ptr, net_filename)) + if ((*options->local_infile_init)(&li_ptr, net_filename, + options->local_infile_userdata)) { my_net_write(net,"",0); /* Server needs one packet */ net_flush(net); @@ -915,7 +916,8 @@ typedef struct st_default_local_infile 1 error */ -static int default_local_infile_init(void **ptr, const char *filename) +static int default_local_infile_init(void **ptr, const char *filename, + void *userdata __attribute__ ((unused))) { default_local_infile_data *data; char tmp_name[FN_REFLEN]; @@ -1025,15 +1027,18 @@ default_local_infile_error(void *ptr, char *error_msg, uint error_msg_len) void mysql_set_local_infile_handler(MYSQL *mysql, - int (*local_infile_init)(void **, const char *), + int (*local_infile_init)(void **, const char *, + void *), int (*local_infile_read)(void *, char *, uint), void (*local_infile_end)(void *), - int (*local_infile_error)(void *, char *, uint)) + int (*local_infile_error)(void *, char *, uint), + void *userdata) { mysql->options.local_infile_init= local_infile_init; mysql->options.local_infile_read= local_infile_read; mysql->options.local_infile_end= local_infile_end; mysql->options.local_infile_error= local_infile_error; + mysql->options.local_infile_userdata = userdata; } From 551ac8d69c7077b6deb4095bcb372c1239cc7254 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 7 May 2004 15:34:12 +0200 Subject: [PATCH 021/162] more removing of "system" files and introducing ndb_global/my_global BitKeeper/deleted/.del-NdbStdio.h~17be17a4f591c671: Delete: ndb/include/portlib/NdbStdio.h BitKeeper/deleted/.del-NdbString.h~1f9f26341ce5f5f: Delete: ndb/include/util/NdbString.h BitKeeper/deleted/.del-NdbConstant.hpp~de1038c1758cc1f9: Delete: ndb/include/portlib/NdbConstant.hpp BitKeeper/deleted/.del-NdbUnistd.h~a1b3840adcd49985: Delete: ndb/include/portlib/NdbUnistd.h --- .../ndbapi_async_example/ndbapi_async.cpp | 12 +--- .../ndbapi_scan_example/ndbapi_scan.cpp | 12 +--- ndb/include/debugger/SignalLoggerManager.hpp | 1 - ndb/include/kernel/LogLevel.hpp | 3 +- ndb/include/kernel/signaldata/BuildIndx.hpp | 1 - ndb/include/kernel/signaldata/SignalData.hpp | 1 - .../kernel/signaldata/SignalDataPrint.hpp | 2 +- ndb/include/logger/LogHandler.hpp | 1 - ndb/include/logger/Logger.hpp | 2 +- ndb/include/ndb_global.h | 66 +++++++++++++++++++ ndb/include/ndb_types.h | 5 -- ndb/include/newtonapi/defs/pcn_types.h | 3 +- ndb/include/portlib/NdbConstant.hpp | 28 -------- ndb/include/portlib/NdbMem.h | 3 +- ndb/include/portlib/NdbStdio.h | 36 ---------- ndb/include/portlib/NdbTCP.h | 37 +---------- ndb/include/portlib/NdbUnistd.h | 39 ----------- ndb/include/util/Bitmask.hpp | 1 - ndb/include/util/File.hpp | 3 +- ndb/include/util/NdbString.h | 49 -------------- ndb/include/util/SimpleProperties.hpp | 3 +- ndb/include/util/getarg.h | 2 +- ndb/include/util/socket_io.h | 3 +- ndb/src/client/odbc/common/Ctx.cpp | 6 +- ndb/src/client/odbc/common/DataField.cpp | 8 +-- ndb/src/client/odbc/common/DataType.cpp | 1 - ndb/src/client/odbc/common/OdbcData.cpp | 4 +- ndb/src/common/debugger/EventLogger.cpp | 6 +- .../common/debugger/SignalLoggerManager.cpp | 3 - .../debugger/signaldata/CloseComReqConf.cpp | 1 - .../common/debugger/signaldata/ContinueB.cpp | 1 - .../debugger/signaldata/PrepFailReqRef.cpp | 1 - .../debugger/signaldata/SystemError.cpp | 1 - ndb/src/common/logger/FileLogHandler.cpp | 6 -- ndb/src/common/logger/LogHandler.cpp | 3 - ndb/src/common/logger/LogHandlerList.cpp | 2 - ndb/src/common/logger/Logger.cpp | 8 +-- ndb/src/common/logger/SysLogHandler.cpp | 1 - .../listtest/LogHandlerListUnitTest.cpp | 1 - .../logger/loggertest/LoggerUnitTest.cpp | 4 -- ndb/src/common/mgmcommon/Config.hpp | 2 - .../common/mgmcommon/InitConfigFileParser.cpp | 7 +- ndb/src/common/portlib/ose/NdbCondition.c | 1 - ndb/src/common/portlib/ose/NdbMem.c | 2 - ndb/src/common/portlib/ose/NdbMutex.c | 1 - ndb/src/common/portlib/ose/NdbOut.cpp | 7 +- ndb/src/common/portlib/ose/NdbThread.c | 1 - ndb/src/common/portlib/unix/NdbCondition.c | 12 +--- ndb/src/common/portlib/unix/NdbDaemon.c | 2 - ndb/src/common/portlib/unix/NdbEnv.c | 6 +- ndb/src/common/portlib/unix/NdbMem.c | 9 +-- ndb/src/common/portlib/unix/NdbMutex.c | 7 +- ndb/src/common/portlib/unix/NdbThread.c | 10 +-- ndb/src/common/portlib/win32/NdbCondition.c | 1 - ndb/src/common/portlib/win32/NdbMem.c | 2 - ndb/src/common/portlib/win32/NdbMutex.c | 1 - ndb/src/common/portlib/win32/NdbThread.c | 1 - ndb/src/common/transporter/OSE_Receiver.cpp | 1 - .../common/transporter/OSE_Transporter.cpp | 2 - ndb/src/common/transporter/SHM_Buffer.hpp | 1 - ndb/src/common/transporter/Transporter.cpp | 1 - .../transporter/TransporterRegistry.cpp | 1 - ndb/src/common/util/BaseString.cpp | 2 - ndb/src/common/util/InputStream.cpp | 4 +- ndb/src/common/util/NdbErrHnd.cpp | 1 - ndb/src/common/util/NdbOut.cpp | 8 +-- ndb/src/common/util/NdbSqlUtil.cpp | 1 - ndb/src/common/util/OutputStream.cpp | 3 +- ndb/src/common/util/Parser.cpp | 1 - ndb/src/common/util/Properties.cpp | 1 - ndb/src/common/util/SimpleProperties.cpp | 1 - ndb/src/common/util/SocketServer.cpp | 1 - ndb/src/common/util/filetest/FileUnitTest.cpp | 1 - ndb/src/common/util/socket_io.cpp | 6 +- ndb/src/common/util/strlcat.c | 1 - .../util/testSimpleProperties/sp_test.cpp | 1 - ndb/src/cw/cpcd/APIService.cpp | 1 - ndb/src/cw/cpcd/CPCD.cpp | 5 +- ndb/src/cw/cpcd/Monitor.cpp | 3 +- ndb/src/cw/cpcd/Process.cpp | 1 - ndb/src/kernel/blocks/backup/FsBuffer.hpp | 1 - .../kernel/blocks/backup/restore/Restore.cpp | 2 - .../kernel/blocks/backup/restore/Restore.hpp | 5 +- ndb/src/kernel/blocks/backup/restore/main.cpp | 1 - ndb/src/kernel/blocks/dbutil/DbUtil.cpp | 4 +- ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp | 9 +-- ndb/src/kernel/blocks/ndbfs/Filename.hpp | 2 +- ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp | 1 - .../kernel/blocks/ndbfs/MemoryChannelOSE.hpp | 1 - ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp | 3 +- ndb/src/kernel/error/ErrorReporter.cpp | 5 +- ndb/src/kernel/ndb-main/Main.cpp | 4 +- ndb/src/kernel/vm/ArrayPool.hpp | 4 +- ndb/src/kernel/vm/ClusterConfiguration.cpp | 5 +- ndb/src/kernel/vm/Configuration.cpp | 1 - ndb/src/kernel/vm/DLHashTable.hpp | 3 +- ndb/src/kernel/vm/DLHashTable2.hpp | 5 +- ndb/src/kernel/vm/GlobalData.hpp | 1 - ndb/src/kernel/vm/SimulatedBlock.cpp | 4 +- ndb/src/kernel/vm/al_test/arrayListTest.cpp | 1 - ndb/src/kernel/vm/al_test/arrayPoolTest.cpp | 1 - ndb/src/kernel/vm/al_test/main.cpp | 1 - ndb/src/kernel/vm/testLongSig/testLongSig.cpp | 1 - ndb/src/mgmclient/CommandInterpreter.hpp | 1 - ndb/src/mgmclient/test_cpcd/test_cpcd.cpp | 1 - ndb/src/mgmsrv/CommandInterpreter.hpp | 1 - ndb/src/mgmsrv/MgmtSrvr.hpp | 1 - ndb/src/mgmsrv/NodeLogLevel.hpp | 3 +- ndb/src/mgmsrv/NodeLogLevelList.cpp | 4 +- ndb/src/mgmsrv/mkconfig/mkconfig.cpp | 1 - ndb/src/ndbapi/ClusterMgr.cpp | 1 - ndb/src/ndbapi/Ndb.cpp | 3 +- ndb/src/ndbapi/NdbConnectionScan.cpp | 1 - ndb/src/ndbapi/NdbDictionary.cpp | 1 - ndb/src/ndbapi/NdbDictionaryImpl.cpp | 1 - ndb/src/ndbapi/NdbErrorOut.cpp | 5 +- ndb/src/ndbapi/NdbOperation.cpp | 1 - ndb/src/ndbapi/NdbOperationExec.cpp | 1 - ndb/src/ndbapi/NdbPoolImpl.cpp | 2 - ndb/src/ndbapi/NdbScanOperation.cpp | 4 -- ndb/src/ndbapi/NdbScanReceiver.hpp | 1 - ndb/src/ndbapi/Ndbif.cpp | 1 - ndb/src/ndbapi/TransporterFacade.cpp | 1 - ndb/src/ndbapi/ndberror.c | 2 - ndb/src/ndbapi/signal-sender/SignalSender.cpp | 1 - ndb/src/newtonapi/dba_error.cpp | 4 +- ndb/src/rep/RepApiService.cpp | 2 - ndb/src/rep/RepMain.cpp | 1 - ndb/src/rep/Requestor.cpp | 1 - ndb/src/rep/adapters/AppNDB.hpp | 4 -- ndb/src/rep/adapters/ExtNDB.cpp | 1 - ndb/src/rep/dbug_hack.cpp | 4 +- ndb/src/rep/storage/GCIBuffer.cpp | 1 - ndb/src/rep/storage/NodeGroupInfo.hpp | 2 - ndb/src/rep/transfer/TransPS.cpp | 1 - ndb/src/rep/transfer/TransPS.hpp | 2 - ndb/src/rep/transfer/TransSS.cpp | 1 - ndb/src/rep/transfer/TransSS.hpp | 2 - ndb/test/include/NDBT_Stats.hpp | 4 +- ndb/test/include/NDBT_Table.hpp | 1 - ndb/test/include/NDBT_Test.hpp | 1 - ndb/test/include/NdbTimer.hpp | 1 - ndb/test/ndbapi/acid2/acid2.cpp | 1 - ndb/test/ndbapi/bulk_copy/bulk_copy.cpp | 1 - ndb/test/ndbapi/flexAsynch/flexAsynch.cpp | 2 - ndb/test/ndbapi/flexBench/flexBench.cpp | 4 -- ndb/test/ndbapi/flexHammer/flexHammer.cpp | 2 - ndb/test/ndbapi/flexScan/flexScan.cpp | 3 - .../flex_bench_mysql/flex_bench_mysql.cpp | 4 -- .../interpreterInTup/interpreterInTup.cpp | 3 - ndb/test/ndbapi/restarter/restarter.cpp | 2 - ndb/test/ndbapi/restarter2/restarter2.cpp | 2 - ndb/test/ndbapi/restarts/restarts.cpp | 2 - ndb/test/ndbapi/telco/msa.cpp | 5 +- ndb/test/ndbapi/testBlobs/testBlobs.cpp | 3 - .../testDataBuffers/testDataBuffers.cpp | 1 - .../ndbapi/testGrep/verify/testGrepVerify.cpp | 2 - ndb/test/ndbapi/testOIBasic/testOIBasic.cpp | 4 +- ndb/test/newtonapi/basic_test/basic/basic.cpp | 1 - .../basic_test/bulk_read/br_test.cpp | 1 - .../ptr_binding/ptr_binding_test.cpp | 1 - ndb/test/newtonapi/perf_test/perf.cpp | 1 - ndb/test/odbc/driver/testOdbcDriver.cpp | 9 +-- ndb/test/src/HugoCalculator.cpp | 2 - ndb/test/src/NDBT_Error.cpp | 4 +- ndb/test/src/NDBT_ResultRow.cpp | 1 - ndb/test/src/NDBT_Table.cpp | 2 - ndb/test/src/NDBT_Tables.cpp | 1 - ndb/test/src/NdbBackup.cpp | 1 - ndb/test/src/NdbConfig.cpp | 1 - ndb/test/src/NdbGrep.cpp | 1 - ndb/test/src/NdbRestarter.cpp | 1 - ndb/test/tools/restart/restart.cpp | 5 +- ndb/test/tools/waiter/waiter.cpp | 1 - ndb/tools/cpcc/cpcc.cpp | 2 +- ndb/tools/list_tables/listTables.cpp | 3 +- ndb/tools/transproxy/transproxy.cpp | 1 - 177 files changed, 159 insertions(+), 547 deletions(-) delete mode 100644 ndb/include/portlib/NdbConstant.hpp delete mode 100644 ndb/include/portlib/NdbStdio.h delete mode 100644 ndb/include/portlib/NdbUnistd.h delete mode 100644 ndb/include/util/NdbString.h diff --git a/ndb/examples/ndbapi_async_example/ndbapi_async.cpp b/ndb/examples/ndbapi_async_example/ndbapi_async.cpp index 685c853c5d5..7abebcc832d 100644 --- a/ndb/examples/ndbapi_async_example/ndbapi_async.cpp +++ b/ndb/examples/ndbapi_async_example/ndbapi_async.cpp @@ -63,20 +63,12 @@ */ +#include + #include #include #include // Used for cout -#ifdef SOLARIS -#include -#include -#endif - -#if defined LINUX || defined MACOSX -#include -#include -#endif - /** * Helper sleep function */ diff --git a/ndb/examples/ndbapi_scan_example/ndbapi_scan.cpp b/ndb/examples/ndbapi_scan_example/ndbapi_scan.cpp index 186afdb9471..7c3a66326c6 100644 --- a/ndb/examples/ndbapi_scan_example/ndbapi_scan.cpp +++ b/ndb/examples/ndbapi_scan_example/ndbapi_scan.cpp @@ -85,21 +85,13 @@ */ +#include + #include #include // Used for cout #include -#ifdef SOLARIS -#include -#include -#endif - -#if defined LINUX || defined MACOSX -#include -#include -#endif - /** * Helper sleep function */ diff --git a/ndb/include/debugger/SignalLoggerManager.hpp b/ndb/include/debugger/SignalLoggerManager.hpp index 3d89b399f3b..093a2de762e 100644 --- a/ndb/include/debugger/SignalLoggerManager.hpp +++ b/ndb/include/debugger/SignalLoggerManager.hpp @@ -24,7 +24,6 @@ #define SignalLoggerManager_H -#include #include #include #include diff --git a/ndb/include/kernel/LogLevel.hpp b/ndb/include/kernel/LogLevel.hpp index 0902f3e488b..3363dc2befd 100644 --- a/ndb/include/kernel/LogLevel.hpp +++ b/ndb/include/kernel/LogLevel.hpp @@ -17,8 +17,7 @@ #ifndef _LOG_LEVEL_HPP #define _LOG_LEVEL_HPP -#include -#include +#include /** * diff --git a/ndb/include/kernel/signaldata/BuildIndx.hpp b/ndb/include/kernel/signaldata/BuildIndx.hpp index 9cf1123cc61..29dfaeb79a6 100644 --- a/ndb/include/kernel/signaldata/BuildIndx.hpp +++ b/ndb/include/kernel/signaldata/BuildIndx.hpp @@ -19,7 +19,6 @@ #include "SignalData.hpp" #include -#include #include /** diff --git a/ndb/include/kernel/signaldata/SignalData.hpp b/ndb/include/kernel/signaldata/SignalData.hpp index 8237d7ffad0..511e7d30c21 100644 --- a/ndb/include/kernel/signaldata/SignalData.hpp +++ b/ndb/include/kernel/signaldata/SignalData.hpp @@ -20,7 +20,6 @@ #include #include #include -#include #ifndef NDB_ASSERT #ifdef VM_TRACE diff --git a/ndb/include/kernel/signaldata/SignalDataPrint.hpp b/ndb/include/kernel/signaldata/SignalDataPrint.hpp index 588e2893214..17ab07acd4e 100644 --- a/ndb/include/kernel/signaldata/SignalDataPrint.hpp +++ b/ndb/include/kernel/signaldata/SignalDataPrint.hpp @@ -17,8 +17,8 @@ #ifndef SIGNAL_DATA_PRINT_H #define SIGNAL_DATA_PRINT_H +#include #include -#include /** * Typedef for a Signal Data Print Function diff --git a/ndb/include/logger/LogHandler.hpp b/ndb/include/logger/LogHandler.hpp index 8c5c9298f69..8f76783e6b0 100644 --- a/ndb/include/logger/LogHandler.hpp +++ b/ndb/include/logger/LogHandler.hpp @@ -19,7 +19,6 @@ #include "Logger.hpp" -#include // Defines NULL /** * This class is the base class for all log handlers. A log handler is diff --git a/ndb/include/logger/Logger.hpp b/ndb/include/logger/Logger.hpp index 2d12a5b8a6e..d4937c11744 100644 --- a/ndb/include/logger/Logger.hpp +++ b/ndb/include/logger/Logger.hpp @@ -17,8 +17,8 @@ #ifndef Logger_H #define Logger_H +#include #include -#include class LogHandler; class LogHandlerList; diff --git a/ndb/include/ndb_global.h b/ndb/include/ndb_global.h index a1aa292a2f6..028f1fdeea4 100644 --- a/ndb/include/ndb_global.h +++ b/ndb/include/ndb_global.h @@ -1,6 +1,72 @@ + +#ifndef NDBGLOBAL_H +#define NDBGLOBAL_H + #include #include #include #include #include +#include +#include +#include #include +#include + +#ifndef NDB_MACOSX +#include +#endif + +#ifdef NDB_WIN32 +#include +#include +#include + +#define DIR_SEPARATOR "\\" +#define PATH_MAX 256 + +#pragma warning(disable: 4503 4786) +#else + +#define DIR_SEPARATOR "/" + +#endif + +#ifdef NDB_VC98 +#define STATIC_CONST(x) enum { x } +#else +#define STATIC_CONST(x) static const Uint32 x +#endif + +#ifdef __cplusplus +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +#ifndef HAVE_STRDUP +extern char * strdup(const char *s); +#endif + +#ifndef HAVE_STRLCPY +extern size_t strlcpy (char *dst, const char *src, size_t dst_sz); +#endif + +#ifndef HAVE_STRLCAT +extern size_t strlcat (char *dst, const char *src, size_t dst_sz); +#endif + +#ifndef HAVE_STRCASECMP +extern int strcasecmp(const char *s1, const char *s2); +extern int strncasecmp(const char *s1, const char *s2, size_t n); +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/ndb/include/ndb_types.h b/ndb/include/ndb_types.h index 697d5f73473..166368b99c5 100644 --- a/ndb/include/ndb_types.h +++ b/ndb/include/ndb_types.h @@ -21,11 +21,6 @@ #ifndef SYS_TYPES_H #define SYS_TYPES_H -#if 0 -#include -#include -#endif - typedef char Int8; typedef unsigned char Uint8; typedef short Int16; diff --git a/ndb/include/newtonapi/defs/pcn_types.h b/ndb/include/newtonapi/defs/pcn_types.h index a823846d7be..1c5de22e518 100644 --- a/ndb/include/newtonapi/defs/pcn_types.h +++ b/ndb/include/newtonapi/defs/pcn_types.h @@ -17,8 +17,7 @@ #ifndef PCN_TYPES_H #define PCN_TYPES_H -#include -#include +#include #ifdef NDB_MACOSX typedef unsigned int Size_t; diff --git a/ndb/include/portlib/NdbConstant.hpp b/ndb/include/portlib/NdbConstant.hpp deleted file mode 100644 index bd45209d2b5..00000000000 --- a/ndb/include/portlib/NdbConstant.hpp +++ /dev/null @@ -1,28 +0,0 @@ -/* Copyright (C) 2003 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -#ifndef NDB_CONSTANT_HPP -#define NDB_CONSTANT_HPP - -#include - -#ifdef NDB_VC98 -#define STATIC_CONST(x) enum { x } -#else -#define STATIC_CONST(x) static const Uint32 x -#endif - -#endif diff --git a/ndb/include/portlib/NdbMem.h b/ndb/include/portlib/NdbMem.h index 38ad3f60448..0f2de80200e 100644 --- a/ndb/include/portlib/NdbMem.h +++ b/ndb/include/portlib/NdbMem.h @@ -17,8 +17,7 @@ #ifndef NDB_MEM_H #define NDB_MEM_H -#include - +#include #ifdef __cplusplus extern "C" { diff --git a/ndb/include/portlib/NdbStdio.h b/ndb/include/portlib/NdbStdio.h deleted file mode 100644 index 2b01e4d4dc8..00000000000 --- a/ndb/include/portlib/NdbStdio.h +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright (C) 2003 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -/* - * NdbStdio.h - stdio.h for ndb - * - * - */ - - -#if defined NDB_OSE || defined NDB_SOFTOSE -/* On OSE Delta the snprintf is declare in outfmt.h */ -#include -#endif - -#include - -#ifdef NDB_WIN32 -#define snprintf _snprintf -#define vsnprintf _vsnprintf -#define strtok_r(s1, s2, l) strtok(s1, s2) -#endif - diff --git a/ndb/include/portlib/NdbTCP.h b/ndb/include/portlib/NdbTCP.h index 6e2f18b61b2..e7538b1ed7f 100644 --- a/ndb/include/portlib/NdbTCP.h +++ b/ndb/include/portlib/NdbTCP.h @@ -17,6 +17,8 @@ #ifndef NDB_TCP_H #define NDB_TCP_H +#include + #if defined NDB_OSE || defined NDB_SOFTOSE /** * Include files needed @@ -24,7 +26,6 @@ #include "inet.h" #include -#include #define NDB_NONBLOCK FNDELAY #define NDB_SOCKET_TYPE int @@ -40,20 +41,15 @@ typedef int socklen_t; #endif -#if defined NDB_SOLARIS || defined NDB_HPUX || defined NDB_IBMAIX || defined NDB_TRU64X +#if defined NDB_SOLARIS || defined NDB_HPUX || defined NDB_IBMAIX || defined NDB_TRU64X || NDB_LINUX || defined NDB_MACOSX /** * Include files needed */ -#include -#include #include #include #include -#include #include -#include -#include #define NDB_NONBLOCK O_NONBLOCK #define NDB_SOCKET_TYPE int @@ -64,39 +60,12 @@ typedef int socklen_t; #endif -#if defined NDB_LINUX || defined NDB_MACOSX -/** - * Include files needed - */ -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#define NDB_NONBLOCK O_NONBLOCK -#define NDB_SOCKET_TYPE int -#define NDB_INVALID_SOCKET -1 -#define NDB_CLOSE_SOCKET(x) close(x) - -#define InetErrno errno - -#endif - - #ifdef NDB_WIN32 /** * Include files needed */ #include #include -#include #define InetErrno WSAGetLastError() #define EWOULDBLOCK WSAEWOULDBLOCK diff --git a/ndb/include/portlib/NdbUnistd.h b/ndb/include/portlib/NdbUnistd.h deleted file mode 100644 index 42f67e2aeb3..00000000000 --- a/ndb/include/portlib/NdbUnistd.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright (C) 2003 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -#ifndef NDB_UNISTD_H -#define NDB_UNISTD_H - -#ifdef NDB_WIN32 -#include -#include -#include -#include - -#define DIR_SEPARATOR "\\" -#define PATH_MAX 256 - -#pragma warning(disable: 4503 4786) - -#else -#include -#include - -#define DIR_SEPARATOR "/" - -#endif - -#endif diff --git a/ndb/include/util/Bitmask.hpp b/ndb/include/util/Bitmask.hpp index 7a7d140ffe8..ed981743512 100644 --- a/ndb/include/util/Bitmask.hpp +++ b/ndb/include/util/Bitmask.hpp @@ -18,7 +18,6 @@ #define NDB_BITMASK_H #include -#include #ifndef NDB_ASSERT #define NDB_ASSERT(x, s) \ diff --git a/ndb/include/util/File.hpp b/ndb/include/util/File.hpp index 8418ea015bf..3ed0ad7a6f9 100644 --- a/ndb/include/util/File.hpp +++ b/ndb/include/util/File.hpp @@ -17,8 +17,7 @@ #ifndef FILE_H #define FILE_H -#include -#include +#include /** * This class provides a file abstraction . It has operations diff --git a/ndb/include/util/NdbString.h b/ndb/include/util/NdbString.h deleted file mode 100644 index 9d910605e16..00000000000 --- a/ndb/include/util/NdbString.h +++ /dev/null @@ -1,49 +0,0 @@ -/* Copyright (C) 2003 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -#ifndef __NDBSTRING_H_INCLUDED__ -#define __NDBSTRING_H_INCLUDED__ - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef HAVE_STRDUP -extern char * strdup(const char *s); -#endif - -#ifndef HAVE_STRLCPY -extern size_t strlcpy (char *dst, const char *src, size_t dst_sz); -#endif - -#ifndef HAVE_STRLCAT -extern size_t strlcat (char *dst, const char *src, size_t dst_sz); -#endif - -#ifndef HAVE_STRCASECMP -extern int strcasecmp(const char *s1, const char *s2); -extern int strncasecmp(const char *s1, const char *s2, size_t n); -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* !__NDBSTRING_H_INCLUDED__ */ diff --git a/ndb/include/util/SimpleProperties.hpp b/ndb/include/util/SimpleProperties.hpp index 37e28ea91d8..d5ebb16bb09 100644 --- a/ndb/include/util/SimpleProperties.hpp +++ b/ndb/include/util/SimpleProperties.hpp @@ -17,8 +17,7 @@ #ifndef SIMPLE_PROPERTIES_HPP #define SIMPLE_PROPERTIES_HPP -#include -#include // offsetof +#include #include /** diff --git a/ndb/include/util/getarg.h b/ndb/include/util/getarg.h index 713cf6e4b32..03ed25f6828 100644 --- a/ndb/include/util/getarg.h +++ b/ndb/include/util/getarg.h @@ -52,7 +52,7 @@ #ifndef __GETARG_H__ #define __GETARG_H__ -#include +#include #ifdef __cplusplus extern "C" { diff --git a/ndb/include/util/socket_io.h b/ndb/include/util/socket_io.h index bbd1bf115ae..a0e6c4e369d 100644 --- a/ndb/include/util/socket_io.h +++ b/ndb/include/util/socket_io.h @@ -17,8 +17,9 @@ #ifndef _SOCKET_IO_H #define _SOCKET_IO_H +#include + #include -#include #ifdef __cplusplus extern "C" { diff --git a/ndb/src/client/odbc/common/Ctx.cpp b/ndb/src/client/odbc/common/Ctx.cpp index 85edbd1a63f..44689657788 100644 --- a/ndb/src/client/odbc/common/Ctx.cpp +++ b/ndb/src/client/odbc/common/Ctx.cpp @@ -14,11 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include -#include -#include +#include #include #include #include "DiagArea.hpp" diff --git a/ndb/src/client/odbc/common/DataField.cpp b/ndb/src/client/odbc/common/DataField.cpp index 5853f90c08f..dfd4137ffd9 100644 --- a/ndb/src/client/odbc/common/DataField.cpp +++ b/ndb/src/client/odbc/common/DataField.cpp @@ -14,14 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include -#include -#include -#include +#include #include "DataField.hpp" -#include #ifndef INT_MAX #define INT_MAX (2147483647) diff --git a/ndb/src/client/odbc/common/DataType.cpp b/ndb/src/client/odbc/common/DataType.cpp index 62bd622b9b5..9c9629f1d24 100644 --- a/ndb/src/client/odbc/common/DataType.cpp +++ b/ndb/src/client/odbc/common/DataType.cpp @@ -15,7 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "DataType.hpp" -#include // SqlType diff --git a/ndb/src/client/odbc/common/OdbcData.cpp b/ndb/src/client/odbc/common/OdbcData.cpp index d2402c7e0ab..2e1bd768aec 100644 --- a/ndb/src/client/odbc/common/OdbcData.cpp +++ b/ndb/src/client/odbc/common/OdbcData.cpp @@ -14,9 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include +#include #include "OdbcData.hpp" OdbcData::OdbcData() : diff --git a/ndb/src/common/debugger/EventLogger.cpp b/ndb/src/common/debugger/EventLogger.cpp index 12f01890c54..dd957d67383 100644 --- a/ndb/src/common/debugger/EventLogger.cpp +++ b/ndb/src/common/debugger/EventLogger.cpp @@ -14,6 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "EventLogger.hpp" #include @@ -22,10 +24,6 @@ #include #include #include -#include - -#include -#include // // PUBLIC diff --git a/ndb/src/common/debugger/SignalLoggerManager.cpp b/ndb/src/common/debugger/SignalLoggerManager.cpp index 35e49f3c1eb..3839a348222 100644 --- a/ndb/src/common/debugger/SignalLoggerManager.cpp +++ b/ndb/src/common/debugger/SignalLoggerManager.cpp @@ -19,9 +19,6 @@ #include "SignalLoggerManager.hpp" #include -#include -#include - #include SignalLoggerManager::SignalLoggerManager() diff --git a/ndb/src/common/debugger/signaldata/CloseComReqConf.cpp b/ndb/src/common/debugger/signaldata/CloseComReqConf.cpp index 11ee0948c17..84410a2b2db 100644 --- a/ndb/src/common/debugger/signaldata/CloseComReqConf.cpp +++ b/ndb/src/common/debugger/signaldata/CloseComReqConf.cpp @@ -15,7 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include #include #include #include diff --git a/ndb/src/common/debugger/signaldata/ContinueB.cpp b/ndb/src/common/debugger/signaldata/ContinueB.cpp index 054909d961e..1be6da86cb1 100644 --- a/ndb/src/common/debugger/signaldata/ContinueB.cpp +++ b/ndb/src/common/debugger/signaldata/ContinueB.cpp @@ -15,7 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include #include #include #include diff --git a/ndb/src/common/debugger/signaldata/PrepFailReqRef.cpp b/ndb/src/common/debugger/signaldata/PrepFailReqRef.cpp index f3b4b97f0fd..2e900de8f70 100644 --- a/ndb/src/common/debugger/signaldata/PrepFailReqRef.cpp +++ b/ndb/src/common/debugger/signaldata/PrepFailReqRef.cpp @@ -15,7 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include #include #include #include diff --git a/ndb/src/common/debugger/signaldata/SystemError.cpp b/ndb/src/common/debugger/signaldata/SystemError.cpp index 5ed7dc6b18d..549c34710a0 100644 --- a/ndb/src/common/debugger/signaldata/SystemError.cpp +++ b/ndb/src/common/debugger/signaldata/SystemError.cpp @@ -15,7 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include #include #include #include diff --git a/ndb/src/common/logger/FileLogHandler.cpp b/ndb/src/common/logger/FileLogHandler.cpp index 8e83510788b..d13dd7b2a78 100644 --- a/ndb/src/common/logger/FileLogHandler.cpp +++ b/ndb/src/common/logger/FileLogHandler.cpp @@ -18,12 +18,6 @@ #include -#include -#include - -#include -#include - // // PUBLIC // diff --git a/ndb/src/common/logger/LogHandler.cpp b/ndb/src/common/logger/LogHandler.cpp index d1445555e87..83d479c82fd 100644 --- a/ndb/src/common/logger/LogHandler.cpp +++ b/ndb/src/common/logger/LogHandler.cpp @@ -17,9 +17,6 @@ #include "LogHandler.hpp" #include -#include - -#include // // PUBLIC diff --git a/ndb/src/common/logger/LogHandlerList.cpp b/ndb/src/common/logger/LogHandlerList.cpp index f020ad23e56..62495d7566b 100644 --- a/ndb/src/common/logger/LogHandlerList.cpp +++ b/ndb/src/common/logger/LogHandlerList.cpp @@ -17,8 +17,6 @@ #include "LogHandlerList.hpp" #include -#include -#include // // PUBLIC diff --git a/ndb/src/common/logger/Logger.cpp b/ndb/src/common/logger/Logger.cpp index 6eaafd91854..9c9f1eece18 100644 --- a/ndb/src/common/logger/Logger.cpp +++ b/ndb/src/common/logger/Logger.cpp @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include #include "Logger.hpp" @@ -27,12 +27,6 @@ #include #endif -#include -#include -#include - -#include - // // PUBLIC // diff --git a/ndb/src/common/logger/SysLogHandler.cpp b/ndb/src/common/logger/SysLogHandler.cpp index f3511bf5638..a300c487eb9 100644 --- a/ndb/src/common/logger/SysLogHandler.cpp +++ b/ndb/src/common/logger/SysLogHandler.cpp @@ -17,7 +17,6 @@ #include "SysLogHandler.hpp" #include -#include // // PUBLIC diff --git a/ndb/src/common/logger/listtest/LogHandlerListUnitTest.cpp b/ndb/src/common/logger/listtest/LogHandlerListUnitTest.cpp index 36aac5d0e15..44ee11717b4 100644 --- a/ndb/src/common/logger/listtest/LogHandlerListUnitTest.cpp +++ b/ndb/src/common/logger/listtest/LogHandlerListUnitTest.cpp @@ -15,7 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include -#include #include "LogHandlerListUnitTest.hpp" diff --git a/ndb/src/common/logger/loggertest/LoggerUnitTest.cpp b/ndb/src/common/logger/loggertest/LoggerUnitTest.cpp index 4b0241a0b03..017dcb79c1f 100644 --- a/ndb/src/common/logger/loggertest/LoggerUnitTest.cpp +++ b/ndb/src/common/logger/loggertest/LoggerUnitTest.cpp @@ -25,12 +25,8 @@ #endif #include -#include #include -#include -#include - typedef bool (*TESTFUNC)(const char*); typedef struct { diff --git a/ndb/src/common/mgmcommon/Config.hpp b/ndb/src/common/mgmcommon/Config.hpp index 1314abe004a..284256d9ed6 100644 --- a/ndb/src/common/mgmcommon/Config.hpp +++ b/ndb/src/common/mgmcommon/Config.hpp @@ -23,9 +23,7 @@ #include #include -#include #include -#include #include /** diff --git a/ndb/src/common/mgmcommon/InitConfigFileParser.cpp b/ndb/src/common/mgmcommon/InitConfigFileParser.cpp index 33652fa472c..62c4bd28857 100644 --- a/ndb/src/common/mgmcommon/InitConfigFileParser.cpp +++ b/ndb/src/common/mgmcommon/InitConfigFileParser.cpp @@ -14,16 +14,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "InitConfigFileParser.hpp" -#include -#include #include "Config.hpp" #include "MgmtErrorReporter.hpp" #include #include "ConfigInfo.hpp" -#include -#include -#include const int MAX_LINE_LENGTH = 120; // Max length of line of text in config file static void trim(char *); diff --git a/ndb/src/common/portlib/ose/NdbCondition.c b/ndb/src/common/portlib/ose/NdbCondition.c index 2ab6e49006b..73a2dbc5d66 100644 --- a/ndb/src/common/portlib/ose/NdbCondition.c +++ b/ndb/src/common/portlib/ose/NdbCondition.c @@ -17,7 +17,6 @@ #include "NdbCondition.h" #include -#include #include #include diff --git a/ndb/src/common/portlib/ose/NdbMem.c b/ndb/src/common/portlib/ose/NdbMem.c index 6d922e4c073..0e38024bbb4 100644 --- a/ndb/src/common/portlib/ose/NdbMem.c +++ b/ndb/src/common/portlib/ose/NdbMem.c @@ -17,7 +17,6 @@ #include "NdbMem.h" -#include #if defined NDB_OSE #include @@ -134,7 +133,6 @@ int NdbMem_MemUnlockAll(){ } #else -#include #include diff --git a/ndb/src/common/portlib/ose/NdbMutex.c b/ndb/src/common/portlib/ose/NdbMutex.c index 859ddefd536..253c0e412ff 100644 --- a/ndb/src/common/portlib/ose/NdbMutex.c +++ b/ndb/src/common/portlib/ose/NdbMutex.c @@ -19,7 +19,6 @@ #include #include -#include NdbMutex* NdbMutex_Create(void) diff --git a/ndb/src/common/portlib/ose/NdbOut.cpp b/ndb/src/common/portlib/ose/NdbOut.cpp index 0ee12249ff5..eb81bc9d971 100644 --- a/ndb/src/common/portlib/ose/NdbOut.cpp +++ b/ndb/src/common/portlib/ose/NdbOut.cpp @@ -14,12 +14,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "NdbOut.hpp" -#include -#include -#include -#include +#include +#include "NdbOut.hpp" #if defined NDB_SOFTOSE #include diff --git a/ndb/src/common/portlib/ose/NdbThread.c b/ndb/src/common/portlib/ose/NdbThread.c index 41a5f181c40..e46903a5cce 100644 --- a/ndb/src/common/portlib/ose/NdbThread.c +++ b/ndb/src/common/portlib/ose/NdbThread.c @@ -18,7 +18,6 @@ #include "NdbThread.h" #include #include -#include #include #include diff --git a/ndb/src/common/portlib/unix/NdbCondition.c b/ndb/src/common/portlib/unix/NdbCondition.c index 35b80821052..024c6b433f3 100644 --- a/ndb/src/common/portlib/unix/NdbCondition.c +++ b/ndb/src/common/portlib/unix/NdbCondition.c @@ -15,16 +15,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include -#include -#if defined NDB_MACOSX -#include -#else -#include -#endif +#include +#include +#include #include struct NdbCondition diff --git a/ndb/src/common/portlib/unix/NdbDaemon.c b/ndb/src/common/portlib/unix/NdbDaemon.c index eb3ca339fa4..fbe684598f2 100644 --- a/ndb/src/common/portlib/unix/NdbDaemon.c +++ b/ndb/src/common/portlib/unix/NdbDaemon.c @@ -15,8 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include -#include -#include #include "NdbDaemon.h" #define NdbDaemon_ErrorSize 500 diff --git a/ndb/src/common/portlib/unix/NdbEnv.c b/ndb/src/common/portlib/unix/NdbEnv.c index b01e3b239ca..d294e0b52ca 100644 --- a/ndb/src/common/portlib/unix/NdbEnv.c +++ b/ndb/src/common/portlib/unix/NdbEnv.c @@ -15,9 +15,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "NdbEnv.h" -#include -#include +#include + +#include const char* NdbEnv_GetEnv(const char* name, char * buf, int buflen) { diff --git a/ndb/src/common/portlib/unix/NdbMem.c b/ndb/src/common/portlib/unix/NdbMem.c index 3b47494967f..cdc5412815d 100644 --- a/ndb/src/common/portlib/unix/NdbMem.c +++ b/ndb/src/common/portlib/unix/NdbMem.c @@ -15,14 +15,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "NdbMem.h" +#include -#include -#include -#include -#ifndef NDB_MACOSX -#include -#endif +#include void NdbMem_Create() { diff --git a/ndb/src/common/portlib/unix/NdbMutex.c b/ndb/src/common/portlib/unix/NdbMutex.c index 3cadc0667e7..50f314d2683 100644 --- a/ndb/src/common/portlib/unix/NdbMutex.c +++ b/ndb/src/common/portlib/unix/NdbMutex.c @@ -15,11 +15,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "NdbMutex.h" +#include -#include -#include -#include +#include +#include NdbMutex* NdbMutex_Create(void) { diff --git a/ndb/src/common/portlib/unix/NdbThread.c b/ndb/src/common/portlib/unix/NdbThread.c index 3665c4c9159..d18c0769b98 100644 --- a/ndb/src/common/portlib/unix/NdbThread.c +++ b/ndb/src/common/portlib/unix/NdbThread.c @@ -15,16 +15,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "NdbThread.h" #include -#ifdef NDB_MACOSX -#include -#else -#include -#endif -#include -#include -#include #define MAX_THREAD_NAME 16 diff --git a/ndb/src/common/portlib/win32/NdbCondition.c b/ndb/src/common/portlib/win32/NdbCondition.c index 12b508cf33b..77869b673de 100644 --- a/ndb/src/common/portlib/win32/NdbCondition.c +++ b/ndb/src/common/portlib/win32/NdbCondition.c @@ -18,7 +18,6 @@ #include #include #include -#include #include #include "NdbCondition.h" diff --git a/ndb/src/common/portlib/win32/NdbMem.c b/ndb/src/common/portlib/win32/NdbMem.c index 274dc31353f..ab7123b0a29 100644 --- a/ndb/src/common/portlib/win32/NdbMem.c +++ b/ndb/src/common/portlib/win32/NdbMem.c @@ -16,8 +16,6 @@ #include -#include -#include #include "NdbMem.h" diff --git a/ndb/src/common/portlib/win32/NdbMutex.c b/ndb/src/common/portlib/win32/NdbMutex.c index c93384d91db..e797024d5bb 100644 --- a/ndb/src/common/portlib/win32/NdbMutex.c +++ b/ndb/src/common/portlib/win32/NdbMutex.c @@ -19,7 +19,6 @@ #include #include #include -#include #include "NdbMutex.h" diff --git a/ndb/src/common/portlib/win32/NdbThread.c b/ndb/src/common/portlib/win32/NdbThread.c index ae3c74be70d..1f052f034e8 100644 --- a/ndb/src/common/portlib/win32/NdbThread.c +++ b/ndb/src/common/portlib/win32/NdbThread.c @@ -17,7 +17,6 @@ #include #include -#include #include "NdbThread.h" diff --git a/ndb/src/common/transporter/OSE_Receiver.cpp b/ndb/src/common/transporter/OSE_Receiver.cpp index 558dee92d8d..b7d47b2f88c 100644 --- a/ndb/src/common/transporter/OSE_Receiver.cpp +++ b/ndb/src/common/transporter/OSE_Receiver.cpp @@ -20,7 +20,6 @@ #include "TransporterCallback.hpp" #include #include "TransporterInternalDefinitions.hpp" -#include OSE_Receiver::OSE_Receiver(TransporterRegistry * tr, int _recBufSize, diff --git a/ndb/src/common/transporter/OSE_Transporter.cpp b/ndb/src/common/transporter/OSE_Transporter.cpp index a7a5ed81ce2..c9b0f777319 100644 --- a/ndb/src/common/transporter/OSE_Transporter.cpp +++ b/ndb/src/common/transporter/OSE_Transporter.cpp @@ -23,11 +23,9 @@ #include -#include #include #include #include -#include OSE_Transporter::OSE_Transporter(int _prioASignalSize, int _prioBSignalSize, diff --git a/ndb/src/common/transporter/SHM_Buffer.hpp b/ndb/src/common/transporter/SHM_Buffer.hpp index 6dd6b4672a1..32e59dd57a2 100644 --- a/ndb/src/common/transporter/SHM_Buffer.hpp +++ b/ndb/src/common/transporter/SHM_Buffer.hpp @@ -18,7 +18,6 @@ #define SHM_BUFFER_HPP #include -#include #include diff --git a/ndb/src/common/transporter/Transporter.cpp b/ndb/src/common/transporter/Transporter.cpp index 1e19a8375ba..5ca523d5185 100644 --- a/ndb/src/common/transporter/Transporter.cpp +++ b/ndb/src/common/transporter/Transporter.cpp @@ -17,7 +17,6 @@ #include "Transporter.hpp" #include "TransporterInternalDefinitions.hpp" -#include #include Transporter::Transporter(NodeId lNodeId, NodeId rNodeId, diff --git a/ndb/src/common/transporter/TransporterRegistry.cpp b/ndb/src/common/transporter/TransporterRegistry.cpp index 482e8d40b9b..3f98eeed89e 100644 --- a/ndb/src/common/transporter/TransporterRegistry.cpp +++ b/ndb/src/common/transporter/TransporterRegistry.cpp @@ -15,7 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include -#include #include "TransporterRegistry.hpp" #include "TransporterInternalDefinitions.hpp" diff --git a/ndb/src/common/util/BaseString.cpp b/ndb/src/common/util/BaseString.cpp index 186642cbfa8..d15249adf72 100644 --- a/ndb/src/common/util/BaseString.cpp +++ b/ndb/src/common/util/BaseString.cpp @@ -17,7 +17,6 @@ /* -*- c-basic-offset: 4; -*- */ #include #include -#include BaseString::BaseString() { @@ -338,7 +337,6 @@ BaseString::trim(char * str, const char * delim){ #ifdef TEST_BASE_STRING -#include /* g++ -g -Wall -o tbs -DTEST_BASE_STRING -I$NDB_TOP/include/util \ diff --git a/ndb/src/common/util/InputStream.cpp b/ndb/src/common/util/InputStream.cpp index c52b594225d..410e9a70e9c 100644 --- a/ndb/src/common/util/InputStream.cpp +++ b/ndb/src/common/util/InputStream.cpp @@ -15,10 +15,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "InputStream.hpp" #include -#include -#include FileInputStream Stdin(stdin); diff --git a/ndb/src/common/util/NdbErrHnd.cpp b/ndb/src/common/util/NdbErrHnd.cpp index 53df5d702ca..f1c28a7bbdd 100644 --- a/ndb/src/common/util/NdbErrHnd.cpp +++ b/ndb/src/common/util/NdbErrHnd.cpp @@ -18,7 +18,6 @@ #if defined NDB_OSE || defined NDB_SOFTOSE #include -#include #include #include "ose.h" diff --git a/ndb/src/common/util/NdbOut.cpp b/ndb/src/common/util/NdbOut.cpp index 2624bfa04bd..6d76cf22402 100644 --- a/ndb/src/common/util/NdbOut.cpp +++ b/ndb/src/common/util/NdbOut.cpp @@ -14,11 +14,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "NdbOut.hpp" -#include -#include -#include -#include +#include + +#include #include static FileOutputStream ndbouts_fileoutputstream(stdout); diff --git a/ndb/src/common/util/NdbSqlUtil.cpp b/ndb/src/common/util/NdbSqlUtil.cpp index dba7012cc0f..e91ade374cf 100644 --- a/ndb/src/common/util/NdbSqlUtil.cpp +++ b/ndb/src/common/util/NdbSqlUtil.cpp @@ -286,7 +286,6 @@ NdbSqlUtil::cmpTimespec(const Uint32* p1, const Uint32* p2, Uint32 full, Uint32 #ifdef NDB_SQL_UTIL_TEST -#include #include #include diff --git a/ndb/src/common/util/OutputStream.cpp b/ndb/src/common/util/OutputStream.cpp index 1143fe00fd1..bf3599dbac9 100644 --- a/ndb/src/common/util/OutputStream.cpp +++ b/ndb/src/common/util/OutputStream.cpp @@ -15,8 +15,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include -#include #include FileOutputStream::FileOutputStream(FILE * file){ diff --git a/ndb/src/common/util/Parser.cpp b/ndb/src/common/util/Parser.cpp index ff6d290ae52..cd8cae29a7c 100644 --- a/ndb/src/common/util/Parser.cpp +++ b/ndb/src/common/util/Parser.cpp @@ -16,7 +16,6 @@ #include -#include #include "Parser.hpp" #include diff --git a/ndb/src/common/util/Properties.cpp b/ndb/src/common/util/Properties.cpp index 05d8b56329b..2ab008142ba 100644 --- a/ndb/src/common/util/Properties.cpp +++ b/ndb/src/common/util/Properties.cpp @@ -15,7 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include -#include #include diff --git a/ndb/src/common/util/SimpleProperties.cpp b/ndb/src/common/util/SimpleProperties.cpp index 34a9d2719b6..c3980f03c4d 100644 --- a/ndb/src/common/util/SimpleProperties.cpp +++ b/ndb/src/common/util/SimpleProperties.cpp @@ -18,7 +18,6 @@ #include #include #include -#include #include bool diff --git a/ndb/src/common/util/SocketServer.cpp b/ndb/src/common/util/SocketServer.cpp index 21f4cd513b9..a0ec0aaa676 100644 --- a/ndb/src/common/util/SocketServer.cpp +++ b/ndb/src/common/util/SocketServer.cpp @@ -16,7 +16,6 @@ #include -#include #include "SocketServer.hpp" diff --git a/ndb/src/common/util/filetest/FileUnitTest.cpp b/ndb/src/common/util/filetest/FileUnitTest.cpp index ebcca26d3d2..b6e7b7e8ec0 100644 --- a/ndb/src/common/util/filetest/FileUnitTest.cpp +++ b/ndb/src/common/util/filetest/FileUnitTest.cpp @@ -18,7 +18,6 @@ #include #include -#include typedef bool (*TESTFUNC)(const char*); diff --git a/ndb/src/common/util/socket_io.cpp b/ndb/src/common/util/socket_io.cpp index 878a9059512..8def7ebe91b 100644 --- a/ndb/src/common/util/socket_io.cpp +++ b/ndb/src/common/util/socket_io.cpp @@ -14,13 +14,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include #include -#include -#include -#include #include -#include extern "C" int diff --git a/ndb/src/common/util/strlcat.c b/ndb/src/common/util/strlcat.c index 0235e9adf55..3da47dee6f5 100644 --- a/ndb/src/common/util/strlcat.c +++ b/ndb/src/common/util/strlcat.c @@ -36,7 +36,6 @@ /* RCSID("$KTH: strlcat.c,v 1.1 2000/08/16 01:23:47 lha Exp $"); */ -//#include #ifndef HAVE_STRLCAT diff --git a/ndb/src/common/util/testSimpleProperties/sp_test.cpp b/ndb/src/common/util/testSimpleProperties/sp_test.cpp index 22b92c9a80c..d4052b64132 100644 --- a/ndb/src/common/util/testSimpleProperties/sp_test.cpp +++ b/ndb/src/common/util/testSimpleProperties/sp_test.cpp @@ -15,7 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include -#include #include "SimpleProperties.hpp" #include diff --git a/ndb/src/cw/cpcd/APIService.cpp b/ndb/src/cw/cpcd/APIService.cpp index 9cf17addcc2..caf19ddba0e 100644 --- a/ndb/src/cw/cpcd/APIService.cpp +++ b/ndb/src/cw/cpcd/APIService.cpp @@ -23,7 +23,6 @@ #include "APIService.hpp" #include "CPCD.hpp" #include -#include #include /** diff --git a/ndb/src/cw/cpcd/CPCD.cpp b/ndb/src/cw/cpcd/CPCD.cpp index 8864ccf6e4e..f2878b7dea1 100644 --- a/ndb/src/cw/cpcd/CPCD.cpp +++ b/ndb/src/cw/cpcd/CPCD.cpp @@ -15,11 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include #include -#include -#include -#include #include "APIService.hpp" #include "CPCD.hpp" diff --git a/ndb/src/cw/cpcd/Monitor.cpp b/ndb/src/cw/cpcd/Monitor.cpp index a96f3509ee8..2935cd0a648 100644 --- a/ndb/src/cw/cpcd/Monitor.cpp +++ b/ndb/src/cw/cpcd/Monitor.cpp @@ -14,9 +14,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include #include -#include #include #include "CPCD.hpp" diff --git a/ndb/src/cw/cpcd/Process.cpp b/ndb/src/cw/cpcd/Process.cpp index e35f9d6037a..2c9a74ed20b 100644 --- a/ndb/src/cw/cpcd/Process.cpp +++ b/ndb/src/cw/cpcd/Process.cpp @@ -17,7 +17,6 @@ #include #include -#include #include #include diff --git a/ndb/src/kernel/blocks/backup/FsBuffer.hpp b/ndb/src/kernel/blocks/backup/FsBuffer.hpp index cbc03ffd11b..2f3c7daae43 100644 --- a/ndb/src/kernel/blocks/backup/FsBuffer.hpp +++ b/ndb/src/kernel/blocks/backup/FsBuffer.hpp @@ -18,7 +18,6 @@ #define FS_BUFFER_HPP #include -#include #define DEBUG(x) diff --git a/ndb/src/kernel/blocks/backup/restore/Restore.cpp b/ndb/src/kernel/blocks/backup/restore/Restore.cpp index 50eb0df7c56..4a4c861993b 100644 --- a/ndb/src/kernel/blocks/backup/restore/Restore.cpp +++ b/ndb/src/kernel/blocks/backup/restore/Restore.cpp @@ -14,11 +14,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include #include "Restore.hpp" #include "BackupFormat.hpp" #include -#include #include #include diff --git a/ndb/src/kernel/blocks/backup/restore/Restore.hpp b/ndb/src/kernel/blocks/backup/restore/Restore.hpp index f1a73bb18b9..0c075e18933 100644 --- a/ndb/src/kernel/blocks/backup/restore/Restore.hpp +++ b/ndb/src/kernel/blocks/backup/restore/Restore.hpp @@ -17,16 +17,13 @@ #ifndef RESTORE_H #define RESTORE_H -#include +#include #include #include #include #include #include "myVector.hpp" -#include -#include -#include #include #include diff --git a/ndb/src/kernel/blocks/backup/restore/main.cpp b/ndb/src/kernel/blocks/backup/restore/main.cpp index b38f6ab751b..4c15785d5c2 100644 --- a/ndb/src/kernel/blocks/backup/restore/main.cpp +++ b/ndb/src/kernel/blocks/backup/restore/main.cpp @@ -14,7 +14,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include #include "Restore.hpp" #include #include diff --git a/ndb/src/kernel/blocks/dbutil/DbUtil.cpp b/ndb/src/kernel/blocks/dbutil/DbUtil.cpp index 2cb129bc591..d1859396289 100644 --- a/ndb/src/kernel/blocks/dbutil/DbUtil.cpp +++ b/ndb/src/kernel/blocks/dbutil/DbUtil.cpp @@ -14,10 +14,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "DbUtil.hpp" -#include -#include #include #include diff --git a/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp b/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp index 0e2aa4c6903..bb09956832a 100644 --- a/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp +++ b/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp @@ -23,20 +23,17 @@ #endif #endif +#include + #include "Error.hpp" #include "AsyncFile.hpp" #include #include -#include #include #include #include -#include -#include -#include - #ifdef NDB_LINUX // This is for pread and pwrite #ifndef __USE_UNIX98 @@ -44,9 +41,7 @@ #endif #endif -#include #if defined NDB_WIN32 || defined NDB_OSE || defined NDB_SOFTOSE -#include #else // For readv and writev #include diff --git a/ndb/src/kernel/blocks/ndbfs/Filename.hpp b/ndb/src/kernel/blocks/ndbfs/Filename.hpp index 4c3569b5485..29aba79c9dc 100644 --- a/ndb/src/kernel/blocks/ndbfs/Filename.hpp +++ b/ndb/src/kernel/blocks/ndbfs/Filename.hpp @@ -52,8 +52,8 @@ // //=========================================================================== +#include #include -#include class Filename { diff --git a/ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp b/ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp index 6e0c2721ca0..435a6a6b208 100644 --- a/ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp +++ b/ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp @@ -76,7 +76,6 @@ #include "NdbCondition.h" #include -#include template class MemoryChannel diff --git a/ndb/src/kernel/blocks/ndbfs/MemoryChannelOSE.hpp b/ndb/src/kernel/blocks/ndbfs/MemoryChannelOSE.hpp index 9f70efcadf7..ca90bc60153 100644 --- a/ndb/src/kernel/blocks/ndbfs/MemoryChannelOSE.hpp +++ b/ndb/src/kernel/blocks/ndbfs/MemoryChannelOSE.hpp @@ -65,7 +65,6 @@ #include "NdbMutex.h" #include "NdbCondition.h" -#include diff --git a/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp b/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp index 8992a2104e9..9c1cf5021b3 100644 --- a/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp +++ b/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp @@ -14,8 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include #include "Ndbfs.hpp" #include "AsyncFile.hpp" diff --git a/ndb/src/kernel/error/ErrorReporter.cpp b/ndb/src/kernel/error/ErrorReporter.cpp index 1aa937f4675..56627cba46f 100644 --- a/ndb/src/kernel/error/ErrorReporter.cpp +++ b/ndb/src/kernel/error/ErrorReporter.cpp @@ -15,17 +15,16 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "Error.hpp" #include "ErrorReporter.hpp" #include "ErrorMessages.hpp" #include #include -#include -#include #include #include -#include #include #define MESSAGE_LENGTH 400 diff --git a/ndb/src/kernel/ndb-main/Main.cpp b/ndb/src/kernel/ndb-main/Main.cpp index 88fd9d177de..aa66de583a9 100644 --- a/ndb/src/kernel/ndb-main/Main.cpp +++ b/ndb/src/kernel/ndb-main/Main.cpp @@ -14,6 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include #include "Configuration.hpp" #include @@ -32,7 +34,6 @@ #include #if defined NDB_SOLARIS -#include // For system information #include // For system informatio #endif @@ -42,7 +43,6 @@ extern EventLogger g_eventLogger; #if defined (NDB_LINUX) || defined (NDB_SOLARIS) -#include #include #endif diff --git a/ndb/src/kernel/vm/ArrayPool.hpp b/ndb/src/kernel/vm/ArrayPool.hpp index 4a84047b614..284d29dcefa 100644 --- a/ndb/src/kernel/vm/ArrayPool.hpp +++ b/ndb/src/kernel/vm/ArrayPool.hpp @@ -17,12 +17,12 @@ #ifndef ARRAY_POOL_HPP #define ARRAY_POOL_HPP +#include + #include #include #include #include -#include -#include template class Array; template class SLList; diff --git a/ndb/src/kernel/vm/ClusterConfiguration.cpp b/ndb/src/kernel/vm/ClusterConfiguration.cpp index f04081ee3c1..3a6478380d1 100644 --- a/ndb/src/kernel/vm/ClusterConfiguration.cpp +++ b/ndb/src/kernel/vm/ClusterConfiguration.cpp @@ -14,6 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "ClusterConfiguration.hpp" #include @@ -27,9 +29,6 @@ #include #include -#include -#include - ClusterConfiguration::ClusterConfiguration() { for (unsigned i= 0; i< MAX_SIZEALT_BLOCKS; i++) // initialize diff --git a/ndb/src/kernel/vm/Configuration.cpp b/ndb/src/kernel/vm/Configuration.cpp index 03495449787..706d75509f2 100644 --- a/ndb/src/kernel/vm/Configuration.cpp +++ b/ndb/src/kernel/vm/Configuration.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #include diff --git a/ndb/src/kernel/vm/DLHashTable.hpp b/ndb/src/kernel/vm/DLHashTable.hpp index f7cd7ae5228..13a9632f8da 100644 --- a/ndb/src/kernel/vm/DLHashTable.hpp +++ b/ndb/src/kernel/vm/DLHashTable.hpp @@ -17,9 +17,8 @@ #ifndef DL_HASHTABLE_HPP #define DL_HASHTABLE_HPP +#include #include "ArrayList.hpp" -#include -#include /** * DLHashTable implements a hashtable using chaining diff --git a/ndb/src/kernel/vm/DLHashTable2.hpp b/ndb/src/kernel/vm/DLHashTable2.hpp index 8386790b0a6..6b166331631 100644 --- a/ndb/src/kernel/vm/DLHashTable2.hpp +++ b/ndb/src/kernel/vm/DLHashTable2.hpp @@ -17,10 +17,9 @@ #ifndef DL_HASHTABLE2_HPP #define DL_HASHTABLE2_HPP +#include + #include "ArrayList.hpp" -#include -#include -#include /** * DLHashTable2 is a DLHashTable variant meant for cases where different diff --git a/ndb/src/kernel/vm/GlobalData.hpp b/ndb/src/kernel/vm/GlobalData.hpp index 3d312154c35..99b65727374 100644 --- a/ndb/src/kernel/vm/GlobalData.hpp +++ b/ndb/src/kernel/vm/GlobalData.hpp @@ -19,7 +19,6 @@ #include #include -#include #include "Prio.hpp" #include "VMSignal.hpp" diff --git a/ndb/src/kernel/vm/SimulatedBlock.cpp b/ndb/src/kernel/vm/SimulatedBlock.cpp index f36b3e43d42..e3f087d7d74 100644 --- a/ndb/src/kernel/vm/SimulatedBlock.cpp +++ b/ndb/src/kernel/vm/SimulatedBlock.cpp @@ -14,6 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "SimulatedBlock.hpp" #include #include @@ -24,8 +26,6 @@ #include #include #include -#include -#include #include #include #include diff --git a/ndb/src/kernel/vm/al_test/arrayListTest.cpp b/ndb/src/kernel/vm/al_test/arrayListTest.cpp index 6f2bb7fc312..bb320106653 100644 --- a/ndb/src/kernel/vm/al_test/arrayListTest.cpp +++ b/ndb/src/kernel/vm/al_test/arrayListTest.cpp @@ -17,7 +17,6 @@ #include -#include #include #include diff --git a/ndb/src/kernel/vm/al_test/arrayPoolTest.cpp b/ndb/src/kernel/vm/al_test/arrayPoolTest.cpp index 01cc5ede5f7..e80905121e1 100644 --- a/ndb/src/kernel/vm/al_test/arrayPoolTest.cpp +++ b/ndb/src/kernel/vm/al_test/arrayPoolTest.cpp @@ -17,7 +17,6 @@ #include -#include #include #include diff --git a/ndb/src/kernel/vm/al_test/main.cpp b/ndb/src/kernel/vm/al_test/main.cpp index 48f6d71f4cf..23193b50725 100644 --- a/ndb/src/kernel/vm/al_test/main.cpp +++ b/ndb/src/kernel/vm/al_test/main.cpp @@ -15,7 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include -#include #include #include diff --git a/ndb/src/kernel/vm/testLongSig/testLongSig.cpp b/ndb/src/kernel/vm/testLongSig/testLongSig.cpp index 7a1e6a3e93d..af4e2ca6e24 100644 --- a/ndb/src/kernel/vm/testLongSig/testLongSig.cpp +++ b/ndb/src/kernel/vm/testLongSig/testLongSig.cpp @@ -16,7 +16,6 @@ #include -#include #include #include diff --git a/ndb/src/mgmclient/CommandInterpreter.hpp b/ndb/src/mgmclient/CommandInterpreter.hpp index 104da3ce254..796a4e4838e 100644 --- a/ndb/src/mgmclient/CommandInterpreter.hpp +++ b/ndb/src/mgmclient/CommandInterpreter.hpp @@ -23,7 +23,6 @@ //***************************************************************************** #include -#include #include #include diff --git a/ndb/src/mgmclient/test_cpcd/test_cpcd.cpp b/ndb/src/mgmclient/test_cpcd/test_cpcd.cpp index b8429c6b7d7..6c030b102bc 100644 --- a/ndb/src/mgmclient/test_cpcd/test_cpcd.cpp +++ b/ndb/src/mgmclient/test_cpcd/test_cpcd.cpp @@ -18,7 +18,6 @@ #include #include "../CpcClient.hpp" #include -#include SimpleCpcClient g_client("localhost", 1234); Vector g_procs; diff --git a/ndb/src/mgmsrv/CommandInterpreter.hpp b/ndb/src/mgmsrv/CommandInterpreter.hpp index 2989f31bd36..3466ee76226 100644 --- a/ndb/src/mgmsrv/CommandInterpreter.hpp +++ b/ndb/src/mgmsrv/CommandInterpreter.hpp @@ -22,7 +22,6 @@ //***************************************************************************** #include -#include #include #include #include diff --git a/ndb/src/mgmsrv/MgmtSrvr.hpp b/ndb/src/mgmsrv/MgmtSrvr.hpp index 4fdf3c99d43..ce8765d6c73 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.hpp +++ b/ndb/src/mgmsrv/MgmtSrvr.hpp @@ -20,7 +20,6 @@ #include #include "Config.hpp" #include -#include #include diff --git a/ndb/src/mgmsrv/NodeLogLevel.hpp b/ndb/src/mgmsrv/NodeLogLevel.hpp index 3e631e57901..3ad758cde99 100644 --- a/ndb/src/mgmsrv/NodeLogLevel.hpp +++ b/ndb/src/mgmsrv/NodeLogLevel.hpp @@ -17,7 +17,8 @@ #ifndef NODELOGLEVEL_H #define NODELOGLEVEL_H -#include +#include + #include /** diff --git a/ndb/src/mgmsrv/NodeLogLevelList.cpp b/ndb/src/mgmsrv/NodeLogLevelList.cpp index 7cf6dcc4b7e..6c7c091c1a8 100644 --- a/ndb/src/mgmsrv/NodeLogLevelList.cpp +++ b/ndb/src/mgmsrv/NodeLogLevelList.cpp @@ -14,10 +14,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "NodeLogLevelList.hpp" +#include +#include "NodeLogLevelList.hpp" #include "NodeLogLevel.hpp" -#include "NdbStdio.h" // // PUBLIC diff --git a/ndb/src/mgmsrv/mkconfig/mkconfig.cpp b/ndb/src/mgmsrv/mkconfig/mkconfig.cpp index c3f247bced6..224c82aa8a1 100644 --- a/ndb/src/mgmsrv/mkconfig/mkconfig.cpp +++ b/ndb/src/mgmsrv/mkconfig/mkconfig.cpp @@ -22,7 +22,6 @@ #include "InitConfigFileParser.hpp" #include -#include void usage(const char * prg){ ndbout << "Usage " << prg << ": " << endl; diff --git a/ndb/src/ndbapi/ClusterMgr.cpp b/ndb/src/ndbapi/ClusterMgr.cpp index 744dec62881..1b536b6d741 100644 --- a/ndb/src/ndbapi/ClusterMgr.cpp +++ b/ndb/src/ndbapi/ClusterMgr.cpp @@ -28,7 +28,6 @@ #include #include -#include #include #include diff --git a/ndb/src/ndbapi/Ndb.cpp b/ndb/src/ndbapi/Ndb.cpp index c45c43b2638..68f49b975ee 100644 --- a/ndb/src/ndbapi/Ndb.cpp +++ b/ndb/src/ndbapi/Ndb.cpp @@ -21,6 +21,8 @@ Name: Ndb.cpp ******************************************************************************/ +#include + #include "NdbApiSignal.hpp" #include "NdbImpl.hpp" #include "NdbSchemaOp.hpp" @@ -1221,7 +1223,6 @@ Ndb::pollEvents(int aMillisecondNumber) #ifdef VM_TRACE #include -#include static NdbMutex print_state_mutex = NDB_MUTEX_INITIALIZER; static bool checkdups(NdbConnection** list, unsigned no) diff --git a/ndb/src/ndbapi/NdbConnectionScan.cpp b/ndb/src/ndbapi/NdbConnectionScan.cpp index 5810dd8942a..962acc0bdac 100644 --- a/ndb/src/ndbapi/NdbConnectionScan.cpp +++ b/ndb/src/ndbapi/NdbConnectionScan.cpp @@ -28,7 +28,6 @@ * Adjust: 2000-06-12 UABRONM First version. ****************************************************************************/ #include -#include #include #include diff --git a/ndb/src/ndbapi/NdbDictionary.cpp b/ndb/src/ndbapi/NdbDictionary.cpp index ec9a56cda62..b068ea6460f 100644 --- a/ndb/src/ndbapi/NdbDictionary.cpp +++ b/ndb/src/ndbapi/NdbDictionary.cpp @@ -646,7 +646,6 @@ NdbDictionary::Dictionary::Dictionary(NdbDictionaryImpl & impl) : m_impl(impl) { } -#include NdbDictionary::Dictionary::~Dictionary(){ NdbDictionaryImpl * tmp = &m_impl; if(this != tmp){ diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp index bd94ba9b080..02e3ee23f9c 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp @@ -35,7 +35,6 @@ #include #include #include "NdbEventOperationImpl.hpp" -#include #define DEBUG_PRINT 0 #define INCOMPATIBLE_VERSION -2 diff --git a/ndb/src/ndbapi/NdbErrorOut.cpp b/ndb/src/ndbapi/NdbErrorOut.cpp index 01d5f63599b..07e0b2fe6e8 100644 --- a/ndb/src/ndbapi/NdbErrorOut.cpp +++ b/ndb/src/ndbapi/NdbErrorOut.cpp @@ -15,10 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include - -#include +#include #include diff --git a/ndb/src/ndbapi/NdbOperation.cpp b/ndb/src/ndbapi/NdbOperation.cpp index eaa2b35965b..ccbfa767542 100644 --- a/ndb/src/ndbapi/NdbOperation.cpp +++ b/ndb/src/ndbapi/NdbOperation.cpp @@ -37,7 +37,6 @@ #include "API.hpp" #include -#include /****************************************************************************** diff --git a/ndb/src/ndbapi/NdbOperationExec.cpp b/ndb/src/ndbapi/NdbOperationExec.cpp index c0ec1b0aeb9..b2a6f99880c 100644 --- a/ndb/src/ndbapi/NdbOperationExec.cpp +++ b/ndb/src/ndbapi/NdbOperationExec.cpp @@ -25,7 +25,6 @@ Version: 1.2 Description: Documentation: ***************************************************************************/ -#include #include #include diff --git a/ndb/src/ndbapi/NdbPoolImpl.cpp b/ndb/src/ndbapi/NdbPoolImpl.cpp index 08252d26d79..131edc74246 100644 --- a/ndb/src/ndbapi/NdbPoolImpl.cpp +++ b/ndb/src/ndbapi/NdbPoolImpl.cpp @@ -15,8 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "NdbPoolImpl.hpp" -#include -#include NdbMutex *NdbPool::pool_mutex = NULL; NdbPool *the_pool = NULL; diff --git a/ndb/src/ndbapi/NdbScanOperation.cpp b/ndb/src/ndbapi/NdbScanOperation.cpp index 0f2154edec3..4db0f30f56c 100644 --- a/ndb/src/ndbapi/NdbScanOperation.cpp +++ b/ndb/src/ndbapi/NdbScanOperation.cpp @@ -34,10 +34,6 @@ #include "NdbApiSignal.hpp" #include #include "NdbDictionaryImpl.hpp" -#include -#ifndef NDB_MACOSX -#include -#endif NdbScanOperation::NdbScanOperation(Ndb* aNdb) : NdbCursorOperation(aNdb), diff --git a/ndb/src/ndbapi/NdbScanReceiver.hpp b/ndb/src/ndbapi/NdbScanReceiver.hpp index 5e316719194..72f9e48f02c 100644 --- a/ndb/src/ndbapi/NdbScanReceiver.hpp +++ b/ndb/src/ndbapi/NdbScanReceiver.hpp @@ -24,7 +24,6 @@ #include "NdbReceiver.hpp" #include -#include class NdbScanReceiver { diff --git a/ndb/src/ndbapi/Ndbif.cpp b/ndb/src/ndbapi/Ndbif.cpp index e334c1bcc39..696dfe68e40 100644 --- a/ndb/src/ndbapi/Ndbif.cpp +++ b/ndb/src/ndbapi/Ndbif.cpp @@ -40,7 +40,6 @@ #include #include -#include /****************************************************************************** * int init( int aNrOfCon, int aNrOfOp ); diff --git a/ndb/src/ndbapi/TransporterFacade.cpp b/ndb/src/ndbapi/TransporterFacade.cpp index 843eab133bb..f4a3ae3e87d 100644 --- a/ndb/src/ndbapi/TransporterFacade.cpp +++ b/ndb/src/ndbapi/TransporterFacade.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include "API.hpp" #include diff --git a/ndb/src/ndbapi/ndberror.c b/ndb/src/ndbapi/ndberror.c index 6e732272bcf..ea7cf4de426 100644 --- a/ndb/src/ndbapi/ndberror.c +++ b/ndb/src/ndbapi/ndberror.c @@ -16,8 +16,6 @@ #include -#include -#include #include diff --git a/ndb/src/ndbapi/signal-sender/SignalSender.cpp b/ndb/src/ndbapi/signal-sender/SignalSender.cpp index d60f6240a9c..e642848dcee 100644 --- a/ndb/src/ndbapi/signal-sender/SignalSender.cpp +++ b/ndb/src/ndbapi/signal-sender/SignalSender.cpp @@ -14,7 +14,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include #include "SignalSender.hpp" #include "ConfigRetriever.hpp" #include diff --git a/ndb/src/newtonapi/dba_error.cpp b/ndb/src/newtonapi/dba_error.cpp index 0a154ac1314..f05446522b0 100644 --- a/ndb/src/newtonapi/dba_error.cpp +++ b/ndb/src/newtonapi/dba_error.cpp @@ -15,9 +15,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "dba_internal.hpp" -#include -#include static DBA_Error_t latestError = DBA_NO_ERROR; static DBA_ErrorCode_t latestNdbError = 0; diff --git a/ndb/src/rep/RepApiService.cpp b/ndb/src/rep/RepApiService.cpp index f5d51f7990e..d07f7a59375 100644 --- a/ndb/src/rep/RepApiService.cpp +++ b/ndb/src/rep/RepApiService.cpp @@ -23,10 +23,8 @@ #include "RepApiInterpreter.hpp" #include "repapi/repapi.h" #include -#include #include -#include /** const char * name; const char * realName; diff --git a/ndb/src/rep/RepMain.cpp b/ndb/src/rep/RepMain.cpp index f454832bda8..d9f057be9a1 100644 --- a/ndb/src/rep/RepMain.cpp +++ b/ndb/src/rep/RepMain.cpp @@ -15,7 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include -#include #include #include diff --git a/ndb/src/rep/Requestor.cpp b/ndb/src/rep/Requestor.cpp index af16fc33844..3c93a6394a4 100644 --- a/ndb/src/rep/Requestor.cpp +++ b/ndb/src/rep/Requestor.cpp @@ -14,7 +14,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include #include "Requestor.hpp" #include "ConfigRetriever.hpp" diff --git a/ndb/src/rep/adapters/AppNDB.hpp b/ndb/src/rep/adapters/AppNDB.hpp index c24774d4ed3..9563a1e41ab 100644 --- a/ndb/src/rep/adapters/AppNDB.hpp +++ b/ndb/src/rep/adapters/AppNDB.hpp @@ -18,13 +18,9 @@ #define APPNDB_HPP #include "NdbApi.hpp" -#include -#include - #include #include #include -#include #include #include diff --git a/ndb/src/rep/adapters/ExtNDB.cpp b/ndb/src/rep/adapters/ExtNDB.cpp index 5ba6bfbbe6e..eb541cdced9 100644 --- a/ndb/src/rep/adapters/ExtNDB.cpp +++ b/ndb/src/rep/adapters/ExtNDB.cpp @@ -14,7 +14,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include #include "ExtNDB.hpp" #include "ConfigRetriever.hpp" #include diff --git a/ndb/src/rep/dbug_hack.cpp b/ndb/src/rep/dbug_hack.cpp index 794852a3a23..74e5f080777 100644 --- a/ndb/src/rep/dbug_hack.cpp +++ b/ndb/src/rep/dbug_hack.cpp @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include + #include #include "NdbOut.hpp" #include "rep_version.hpp" diff --git a/ndb/src/rep/storage/GCIBuffer.cpp b/ndb/src/rep/storage/GCIBuffer.cpp index 5073e62c550..013600b30a5 100644 --- a/ndb/src/rep/storage/GCIBuffer.cpp +++ b/ndb/src/rep/storage/GCIBuffer.cpp @@ -16,7 +16,6 @@ #include #include "GCIBuffer.hpp" -#include /***************************************************************************** * Constructor / Destructor diff --git a/ndb/src/rep/storage/NodeGroupInfo.hpp b/ndb/src/rep/storage/NodeGroupInfo.hpp index 605ccf76a38..3d0499d4425 100644 --- a/ndb/src/rep/storage/NodeGroupInfo.hpp +++ b/ndb/src/rep/storage/NodeGroupInfo.hpp @@ -18,12 +18,10 @@ #define NODE_GROUPINFO_HPP #include -#include #include #include #include //#include -#include #include "NodeGroup.hpp" #include diff --git a/ndb/src/rep/transfer/TransPS.cpp b/ndb/src/rep/transfer/TransPS.cpp index 7af53f24415..1f65e95850d 100644 --- a/ndb/src/rep/transfer/TransPS.cpp +++ b/ndb/src/rep/transfer/TransPS.cpp @@ -14,7 +14,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include #include "ConfigRetriever.hpp" #include diff --git a/ndb/src/rep/transfer/TransPS.hpp b/ndb/src/rep/transfer/TransPS.hpp index 35823f1eb19..b47f1acfca2 100644 --- a/ndb/src/rep/transfer/TransPS.hpp +++ b/ndb/src/rep/transfer/TransPS.hpp @@ -17,12 +17,10 @@ #ifndef TransPS_HPP #define TransPS_HPP -#include #include #include #include #include -#include #include #include diff --git a/ndb/src/rep/transfer/TransSS.cpp b/ndb/src/rep/transfer/TransSS.cpp index 5399bfb4e3f..83f4b570330 100644 --- a/ndb/src/rep/transfer/TransSS.cpp +++ b/ndb/src/rep/transfer/TransSS.cpp @@ -14,7 +14,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include #include "ConfigRetriever.hpp" diff --git a/ndb/src/rep/transfer/TransSS.hpp b/ndb/src/rep/transfer/TransSS.hpp index 90f320a079e..6f2089e46ac 100644 --- a/ndb/src/rep/transfer/TransSS.hpp +++ b/ndb/src/rep/transfer/TransSS.hpp @@ -17,12 +17,10 @@ #ifndef TransSS_HPP #define TransSS_HPP -#include #include #include #include #include -#include #include #include diff --git a/ndb/test/include/NDBT_Stats.hpp b/ndb/test/include/NDBT_Stats.hpp index 15a125dea86..28212bdba17 100644 --- a/ndb/test/include/NDBT_Stats.hpp +++ b/ndb/test/include/NDBT_Stats.hpp @@ -17,9 +17,7 @@ #ifndef NDBT_STATS_HPP #define NDBT_STATS_HPP -#include -#include -#include +#include class NDBT_Stats { public: diff --git a/ndb/test/include/NDBT_Table.hpp b/ndb/test/include/NDBT_Table.hpp index 597cd0d55d6..950c1f15ff7 100644 --- a/ndb/test/include/NDBT_Table.hpp +++ b/ndb/test/include/NDBT_Table.hpp @@ -18,7 +18,6 @@ #define NDBT_TABLE_HPP #include -#include #include #include diff --git a/ndb/test/include/NDBT_Test.hpp b/ndb/test/include/NDBT_Test.hpp index 41332bb570c..7a5d14689bc 100644 --- a/ndb/test/include/NDBT_Test.hpp +++ b/ndb/test/include/NDBT_Test.hpp @@ -24,7 +24,6 @@ #include #include #include -#include #include #include diff --git a/ndb/test/include/NdbTimer.hpp b/ndb/test/include/NdbTimer.hpp index 8d9a088b7b5..b0d500b5c2c 100644 --- a/ndb/test/include/NdbTimer.hpp +++ b/ndb/test/include/NdbTimer.hpp @@ -17,7 +17,6 @@ #ifndef NDBTIMER_H #define NDBTIMER_H -#include #include #include diff --git a/ndb/test/ndbapi/acid2/acid2.cpp b/ndb/test/ndbapi/acid2/acid2.cpp index 5835b76453e..434a0450daa 100644 --- a/ndb/test/ndbapi/acid2/acid2.cpp +++ b/ndb/test/ndbapi/acid2/acid2.cpp @@ -17,7 +17,6 @@ #include #include -#include #include #include #include diff --git a/ndb/test/ndbapi/bulk_copy/bulk_copy.cpp b/ndb/test/ndbapi/bulk_copy/bulk_copy.cpp index f2b28d8b057..18881cae216 100644 --- a/ndb/test/ndbapi/bulk_copy/bulk_copy.cpp +++ b/ndb/test/ndbapi/bulk_copy/bulk_copy.cpp @@ -14,7 +14,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include #include #include diff --git a/ndb/test/ndbapi/flexAsynch/flexAsynch.cpp b/ndb/test/ndbapi/flexAsynch/flexAsynch.cpp index 3938cd21f78..0822f3ee999 100644 --- a/ndb/test/ndbapi/flexAsynch/flexAsynch.cpp +++ b/ndb/test/ndbapi/flexAsynch/flexAsynch.cpp @@ -24,8 +24,6 @@ #include #include #include -#include -#include #include #include diff --git a/ndb/test/ndbapi/flexBench/flexBench.cpp b/ndb/test/ndbapi/flexBench/flexBench.cpp index 17d9be73925..852944fd471 100644 --- a/ndb/test/ndbapi/flexBench/flexBench.cpp +++ b/ndb/test/ndbapi/flexBench/flexBench.cpp @@ -51,13 +51,9 @@ Arguments: #include "NdbApi.hpp" -#include -#include - #include #include #include -#include #include #include #include diff --git a/ndb/test/ndbapi/flexHammer/flexHammer.cpp b/ndb/test/ndbapi/flexHammer/flexHammer.cpp index f8a519f021a..057efb31e74 100644 --- a/ndb/test/ndbapi/flexHammer/flexHammer.cpp +++ b/ndb/test/ndbapi/flexHammer/flexHammer.cpp @@ -57,8 +57,6 @@ Revision history: #include #include #include -#include -#include #include ErrorData * flexHammerErrorData; diff --git a/ndb/test/ndbapi/flexScan/flexScan.cpp b/ndb/test/ndbapi/flexScan/flexScan.cpp index 55163a99fbe..19fb6dc5ab0 100644 --- a/ndb/test/ndbapi/flexScan/flexScan.cpp +++ b/ndb/test/ndbapi/flexScan/flexScan.cpp @@ -59,12 +59,9 @@ #include #include #include -#include -#include #include #include #include -#include #define PKSIZE 1 #define FOREVER 1 diff --git a/ndb/test/ndbapi/flex_bench_mysql/flex_bench_mysql.cpp b/ndb/test/ndbapi/flex_bench_mysql/flex_bench_mysql.cpp index 6a00463339b..7cc883ab3e6 100644 --- a/ndb/test/ndbapi/flex_bench_mysql/flex_bench_mysql.cpp +++ b/ndb/test/ndbapi/flex_bench_mysql/flex_bench_mysql.cpp @@ -57,13 +57,9 @@ Arguments: #include "NdbApi.hpp" -#include -#include - #include #include #include -#include #include #include #include diff --git a/ndb/test/ndbapi/interpreterInTup/interpreterInTup.cpp b/ndb/test/ndbapi/interpreterInTup/interpreterInTup.cpp index b9d1eca1cc9..a2352edf707 100644 --- a/ndb/test/ndbapi/interpreterInTup/interpreterInTup.cpp +++ b/ndb/test/ndbapi/interpreterInTup/interpreterInTup.cpp @@ -54,9 +54,6 @@ * *************************************************** */ -#include -#include -#include #include #include #include diff --git a/ndb/test/ndbapi/restarter/restarter.cpp b/ndb/test/ndbapi/restarter/restarter.cpp index ad3507df98a..9a522f5dcac 100644 --- a/ndb/test/ndbapi/restarter/restarter.cpp +++ b/ndb/test/ndbapi/restarter/restarter.cpp @@ -26,8 +26,6 @@ #include #include #include -#include -#include int main(int argc, const char** argv){ diff --git a/ndb/test/ndbapi/restarter2/restarter2.cpp b/ndb/test/ndbapi/restarter2/restarter2.cpp index 71eaf1a9b0f..f2bcf6f8e7b 100644 --- a/ndb/test/ndbapi/restarter2/restarter2.cpp +++ b/ndb/test/ndbapi/restarter2/restarter2.cpp @@ -24,8 +24,6 @@ #include #include -#include -#include int main(int argc, const char** argv){ diff --git a/ndb/test/ndbapi/restarts/restarts.cpp b/ndb/test/ndbapi/restarts/restarts.cpp index 2f9bab3b233..0ec2883d53c 100644 --- a/ndb/test/ndbapi/restarts/restarts.cpp +++ b/ndb/test/ndbapi/restarts/restarts.cpp @@ -25,8 +25,6 @@ #include #include -#include -#include int main(int argc, const char** argv){ diff --git a/ndb/test/ndbapi/telco/msa.cpp b/ndb/test/ndbapi/telco/msa.cpp index f074733dce4..39ddaac2019 100644 --- a/ndb/test/ndbapi/telco/msa.cpp +++ b/ndb/test/ndbapi/telco/msa.cpp @@ -14,17 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include #include #include #include #include -#include #include #include -#include const char* const c_szDatabaseName = "TEST_DB"; diff --git a/ndb/test/ndbapi/testBlobs/testBlobs.cpp b/ndb/test/ndbapi/testBlobs/testBlobs.cpp index 461c7e22092..9f959702402 100644 --- a/ndb/test/ndbapi/testBlobs/testBlobs.cpp +++ b/ndb/test/ndbapi/testBlobs/testBlobs.cpp @@ -19,10 +19,7 @@ */ #include -#include -#include -#include #include #include #include diff --git a/ndb/test/ndbapi/testDataBuffers/testDataBuffers.cpp b/ndb/test/ndbapi/testDataBuffers/testDataBuffers.cpp index 051e5ff702e..b8e0fef6cef 100644 --- a/ndb/test/ndbapi/testDataBuffers/testDataBuffers.cpp +++ b/ndb/test/ndbapi/testDataBuffers/testDataBuffers.cpp @@ -29,7 +29,6 @@ */ #include -#include #include #include diff --git a/ndb/test/ndbapi/testGrep/verify/testGrepVerify.cpp b/ndb/test/ndbapi/testGrep/verify/testGrepVerify.cpp index 056aa9bf173..7fd2c19d9f7 100644 --- a/ndb/test/ndbapi/testGrep/verify/testGrepVerify.cpp +++ b/ndb/test/ndbapi/testGrep/verify/testGrepVerify.cpp @@ -31,8 +31,6 @@ #include #include #include -#include -#include #define CHECK(b) if (!(b)) { \ diff --git a/ndb/test/ndbapi/testOIBasic/testOIBasic.cpp b/ndb/test/ndbapi/testOIBasic/testOIBasic.cpp index ad63bc1cc6f..a47d9d2099e 100644 --- a/ndb/test/ndbapi/testOIBasic/testOIBasic.cpp +++ b/ndb/test/ndbapi/testOIBasic/testOIBasic.cpp @@ -19,9 +19,7 @@ */ #include -#include -#include -#include + #include #include #include diff --git a/ndb/test/newtonapi/basic_test/basic/basic.cpp b/ndb/test/newtonapi/basic_test/basic/basic.cpp index 90f5bf14acf..bc33400078d 100644 --- a/ndb/test/newtonapi/basic_test/basic/basic.cpp +++ b/ndb/test/newtonapi/basic_test/basic/basic.cpp @@ -26,7 +26,6 @@ extern "C" { #include #include #include -#include static const DBA_ColumnDesc_t EmpColDesc[] = { diff --git a/ndb/test/newtonapi/basic_test/bulk_read/br_test.cpp b/ndb/test/newtonapi/basic_test/bulk_read/br_test.cpp index fb26abc65aa..4120cfba864 100644 --- a/ndb/test/newtonapi/basic_test/bulk_read/br_test.cpp +++ b/ndb/test/newtonapi/basic_test/bulk_read/br_test.cpp @@ -26,7 +26,6 @@ extern "C" { #include #include #include -#include static const DBA_ColumnDesc_t EmpColDesc[] = { diff --git a/ndb/test/newtonapi/basic_test/ptr_binding/ptr_binding_test.cpp b/ndb/test/newtonapi/basic_test/ptr_binding/ptr_binding_test.cpp index fc6dfc40372..2c9cee5be87 100644 --- a/ndb/test/newtonapi/basic_test/ptr_binding/ptr_binding_test.cpp +++ b/ndb/test/newtonapi/basic_test/ptr_binding/ptr_binding_test.cpp @@ -26,7 +26,6 @@ extern "C" { #include #include #include -#include static const DBA_ColumnDesc_t ColDesc[] = { diff --git a/ndb/test/newtonapi/perf_test/perf.cpp b/ndb/test/newtonapi/perf_test/perf.cpp index 2edad572d11..7b818e93a2a 100644 --- a/ndb/test/newtonapi/perf_test/perf.cpp +++ b/ndb/test/newtonapi/perf_test/perf.cpp @@ -16,7 +16,6 @@ #include -#include extern "C" { #include diff --git a/ndb/test/odbc/driver/testOdbcDriver.cpp b/ndb/test/odbc/driver/testOdbcDriver.cpp index 9731c00eeaf..b856b6a21f2 100644 --- a/ndb/test/odbc/driver/testOdbcDriver.cpp +++ b/ndb/test/odbc/driver/testOdbcDriver.cpp @@ -36,12 +36,7 @@ * Test of ODBC and SQL using a fixed set of tables. */ -#include -#include -#include -#include -#include -#include +#include #include #include #include @@ -49,9 +44,7 @@ #ifdef ndbODBC #include #endif -#include #include -#include #undef BOOL diff --git a/ndb/test/src/HugoCalculator.cpp b/ndb/test/src/HugoCalculator.cpp index 9e2ba9f143e..246dde09c00 100644 --- a/ndb/test/src/HugoCalculator.cpp +++ b/ndb/test/src/HugoCalculator.cpp @@ -15,8 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "HugoCalculator.hpp" -#include -#include #include /* ************************************************************* diff --git a/ndb/test/src/NDBT_Error.cpp b/ndb/test/src/NDBT_Error.cpp index 92c0b2e5c1f..ffacb3eb928 100644 --- a/ndb/test/src/NDBT_Error.cpp +++ b/ndb/test/src/NDBT_Error.cpp @@ -17,11 +17,9 @@ /* NDBT_Error.cpp */ /* This program deals with error handling */ -#include -#include +#include #include #include -#include #include #include #include diff --git a/ndb/test/src/NDBT_ResultRow.cpp b/ndb/test/src/NDBT_ResultRow.cpp index d8965dad8aa..87694aabb2b 100644 --- a/ndb/test/src/NDBT_ResultRow.cpp +++ b/ndb/test/src/NDBT_ResultRow.cpp @@ -15,7 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include -#include #include "NDBT_ResultRow.hpp" #include diff --git a/ndb/test/src/NDBT_Table.cpp b/ndb/test/src/NDBT_Table.cpp index 2bd2c265f10..c520b01c990 100644 --- a/ndb/test/src/NDBT_Table.cpp +++ b/ndb/test/src/NDBT_Table.cpp @@ -15,8 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "NDBT_Table.hpp" -#include -#include #include #include diff --git a/ndb/test/src/NDBT_Tables.cpp b/ndb/test/src/NDBT_Tables.cpp index 41a38e4fe44..548e755a3fb 100644 --- a/ndb/test/src/NDBT_Tables.cpp +++ b/ndb/test/src/NDBT_Tables.cpp @@ -18,7 +18,6 @@ #include #include -#include /* ******************************************************* */ // Define Ndb standard tables // diff --git a/ndb/test/src/NdbBackup.cpp b/ndb/test/src/NdbBackup.cpp index 689aae64c81..3f73369f488 100644 --- a/ndb/test/src/NdbBackup.cpp +++ b/ndb/test/src/NdbBackup.cpp @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include diff --git a/ndb/test/src/NdbConfig.cpp b/ndb/test/src/NdbConfig.cpp index d61b74cf62b..aa0bb252f58 100644 --- a/ndb/test/src/NdbConfig.cpp +++ b/ndb/test/src/NdbConfig.cpp @@ -17,7 +17,6 @@ #include "NdbConfig.hpp" #include #include -#include #include #include #include diff --git a/ndb/test/src/NdbGrep.cpp b/ndb/test/src/NdbGrep.cpp index 747c62d5bc6..8b7442b0e77 100644 --- a/ndb/test/src/NdbGrep.cpp +++ b/ndb/test/src/NdbGrep.cpp @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include diff --git a/ndb/test/src/NdbRestarter.cpp b/ndb/test/src/NdbRestarter.cpp index 1df214572c7..252fa28feec 100644 --- a/ndb/test/src/NdbRestarter.cpp +++ b/ndb/test/src/NdbRestarter.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #define MGMERR(h) \ ndbout << "latest_error="< +#include + #include #include #include @@ -24,8 +25,6 @@ #include #include -#include -#include int main(int argc, const char** argv){ diff --git a/ndb/test/tools/waiter/waiter.cpp b/ndb/test/tools/waiter/waiter.cpp index 14803fec71d..d57daff3aea 100644 --- a/ndb/test/tools/waiter/waiter.cpp +++ b/ndb/test/tools/waiter/waiter.cpp @@ -25,7 +25,6 @@ #include #include -#include int main(int argc, const char** argv){ diff --git a/ndb/tools/cpcc/cpcc.cpp b/ndb/tools/cpcc/cpcc.cpp index 5a826f250c0..745f897a096 100644 --- a/ndb/tools/cpcc/cpcc.cpp +++ b/ndb/tools/cpcc/cpcc.cpp @@ -15,7 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include #include #include "CpcClient.hpp" #include diff --git a/ndb/tools/list_tables/listTables.cpp b/ndb/tools/list_tables/listTables.cpp index c14808050c6..41433862304 100644 --- a/ndb/tools/list_tables/listTables.cpp +++ b/ndb/tools/list_tables/listTables.cpp @@ -21,8 +21,9 @@ * */ -#include +#include #include + #include #include diff --git a/ndb/tools/transproxy/transproxy.cpp b/ndb/tools/transproxy/transproxy.cpp index a9046737d37..384a8a34f03 100644 --- a/ndb/tools/transproxy/transproxy.cpp +++ b/ndb/tools/transproxy/transproxy.cpp @@ -15,7 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include -#include #include #include From e54ca13b666b48226b7a54d6847d6437ac32ae74 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 7 May 2004 23:06:11 +0300 Subject: [PATCH 022/162] keep old engine & JOIN if we changed subquery Item (Bug #3646) mysql-test/r/subselect.result: ALL/ANY test mysql-test/t/subselect.test: ALL/ANY test sql/item_subselect.cc: keep old engine & JOIN if we changed subquery Item, which allow avoid second all SELECT items fix_fields call with pervios clean up (because of second setup_tables which remove table->key_use and maybe something else) keep list when we change Item in SELECT list processing inserted max/min function (now JOIN::prepare will be called only once) methods of changing item for subselect engines sql/item_subselect.h: change item & results procedure sql/item_sum.cc: Item_sum_hybrid::clear moved to .cc file (to keep .h clean and to make inserving/removing debug info easy) sql/item_sum.h: Item_sum_hybrid::clear moved to .cc file (to keep .h clean and to make inserving/removing debug info easy) sql/sql_lex.cc: note about new method sql/sql_lex.h: method for changing result of UNION JOINs sql/sql_select.cc: method for changing result in JOIN sql/sql_select.h: method for changing result in JOIN sql/sql_union.cc: method for changing result in JOIN --- mysql-test/r/subselect.result | 89 ++++++++++++++++++++++++++++ mysql-test/t/subselect.test | 34 ++++++++++- sql/item_subselect.cc | 107 +++++++++++++++++++++++++++++++--- sql/item_subselect.h | 4 ++ sql/item_sum.cc | 8 +++ sql/item_sum.h | 8 +-- sql/sql_lex.cc | 3 +- sql/sql_lex.h | 1 + sql/sql_select.cc | 27 ++++++++- sql/sql_select.h | 1 + sql/sql_union.cc | 29 +++++++++ 11 files changed, 291 insertions(+), 20 deletions(-) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index a2210fde222..690d5006c72 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -1719,3 +1719,92 @@ SELECT t1.id, ( SELECT COUNT(t.id) FROM t2 AS t WHERE t.id = t1.id ) AS c FROM t id c 1 1 2 0 +DROP TABLE t1,t2; +CREATE TABLE t1 ( a int, b int ); +INSERT INTO t1 VALUES (1,1),(2,2),(3,3); +SELECT a FROM t1 WHERE a > ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +3 +SELECT a FROM t1 WHERE a < ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +SELECT a FROM t1 WHERE a = ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +2 +SELECT a FROM t1 WHERE a >= ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +2 +3 +SELECT a FROM t1 WHERE a <= ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +2 +SELECT a FROM t1 WHERE a <> ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +3 +SELECT a FROM t1 WHERE a > ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +3 +SELECT a FROM t1 WHERE a < ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +SELECT a FROM t1 WHERE a = ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +2 +SELECT a FROM t1 WHERE a >= ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +2 +3 +SELECT a FROM t1 WHERE a <= ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +2 +SELECT a FROM t1 WHERE a <> ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +3 +ALTER TABLE t1 ADD INDEX (a); +SELECT a FROM t1 WHERE a > ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +3 +SELECT a FROM t1 WHERE a < ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +SELECT a FROM t1 WHERE a = ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +2 +SELECT a FROM t1 WHERE a >= ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +2 +3 +SELECT a FROM t1 WHERE a <= ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +2 +SELECT a FROM t1 WHERE a <> ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +3 +SELECT a FROM t1 WHERE a > ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +3 +SELECT a FROM t1 WHERE a < ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +SELECT a FROM t1 WHERE a = ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +2 +SELECT a FROM t1 WHERE a >= ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +2 +3 +SELECT a FROM t1 WHERE a <= ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +2 +SELECT a FROM t1 WHERE a <> ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +3 +DROP TABLE t1; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 1b5bb807b97..94389963ae6 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -1125,4 +1125,36 @@ INSERT INTO t1 VALUES (1), (2); INSERT INTO t2 VALUES (1); SELECT t1.id, ( SELECT COUNT(t.id) FROM t2 AS t WHERE t.id = t1.id ) AS c FROM t1 LEFT JOIN t2 USING (id); SELECT t1.id, ( SELECT COUNT(t.id) FROM t2 AS t WHERE t.id = t1.id ) AS c FROM t1 LEFT JOIN t2 USING (id) ORDER BY t1.id; -DROP TABLE t1,t2 +DROP TABLE t1,t2; + +# +# ALL/ANY test +# +CREATE TABLE t1 ( a int, b int ); +INSERT INTO t1 VALUES (1,1),(2,2),(3,3); +SELECT a FROM t1 WHERE a > ANY ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a < ANY ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a = ANY ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a >= ANY ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a <= ANY ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a <> ANY ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a > ALL ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a < ALL ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a = ALL ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a >= ALL ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a <= ALL ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a <> ALL ( SELECT a FROM t1 WHERE b = 2 ); +ALTER TABLE t1 ADD INDEX (a); +SELECT a FROM t1 WHERE a > ANY ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a < ANY ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a = ANY ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a >= ANY ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a <= ANY ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a <> ANY ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a > ALL ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a < ALL ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a = ALL ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a >= ALL ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a <= ALL ( SELECT a FROM t1 WHERE b = 2 ); +SELECT a FROM t1 WHERE a <> ALL ( SELECT a FROM t1 WHERE b = 2 ); +DROP TABLE t1; diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 2d10be62d53..4503c1b63a9 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -56,10 +56,24 @@ void Item_subselect::init(st_select_lex *select_lex, DBUG_PRINT("subs", ("select_lex 0x%xl", (ulong) select_lex)); unit= select_lex->master_unit(); - if (select_lex->next_select()) - engine= new subselect_union_engine(unit, result, this); + if (unit->item) + { + /* + Item can be changed in JOIN::prepare while engine in JOIN::optimize + => we do not copy old_engine here + */ + engine= unit->item->engine; + unit->item->engine= 0; + unit->item= this; + engine->change_item(this, result); + } else - engine= new subselect_single_select_engine(select_lex, result, this); + { + if (select_lex->next_select()) + engine= new subselect_union_engine(unit, result, this); + else + engine= new subselect_single_select_engine(select_lex, result, this); + } DBUG_VOID_RETURN; } @@ -69,11 +83,13 @@ void Item_subselect::cleanup() Item_result_field::cleanup(); if (old_engine) { - engine->cleanup(); + if (engine) + engine->cleanup(); engine= old_engine; old_engine= 0; } - engine->cleanup(); + if (engine) + engine->cleanup(); reset(); value_assigned= 0; DBUG_VOID_RETURN; @@ -127,7 +143,6 @@ bool Item_subselect::fix_fields(THD *thd_param, TABLE_LIST *tables, Item **ref) if (have_to_be_excluded) engine->exclude(); substitution= 0; - fixed= 1; thd->where= "checking transformed subquery"; if (!(*ref)->fixed) ret= (*ref)->fix_fields(thd, tables, ref); @@ -660,10 +675,20 @@ Item_in_subselect::single_value_transformer(JOIN *join, item= new Item_sum_min(*select_lex->ref_pointer_array); } *select_lex->ref_pointer_array= item; - select_lex->item_list.empty(); - select_lex->item_list.push_back(item); + { + List_iterator it(select_lex->item_list); + it++; + it.replace(item); + } - // fix_fields call for 'item' will be made during new subquery fix_fields + /* + Item_sum_(max|min) can't substitute other item => we can use 0 as + reference + */ + if (item->fix_fields(thd, join->tables_list, 0)) + goto err; + /* we added aggregate function => we have to change statistic */ + count_field_types(&join->tmp_table_param, join->all_fields, 0); subs= new Item_singlerow_subselect(select_lex); } @@ -1428,3 +1453,67 @@ void subselect_indexsubquery_engine::print(String *str) } str->append(')'); } + +/* + change select_result object of engine + + SINOPSYS + subselect_single_select_engine::change_result() + si new subselect Item + res new select_result object + + RETURN + 0 OK + -1 error +*/ + +int subselect_single_select_engine::change_item(Item_subselect *si, + select_subselect *res) +{ + item= si; + result= res; + return select_lex->join->change_result(result); +} + + +/* + change select_result object of engine + + SINOPSYS + subselect_single_select_engine::change_result() + si new subselect Item + res new select_result object + + RETURN + 0 OK + -1 error +*/ + +int subselect_union_engine::change_item(Item_subselect *si, + select_subselect *res) +{ + item= si; + int rc= unit->change_result(res, result); + result= res; + return rc; +} + + +/* + change select_result emulation, never should be called + + SINOPSYS + subselect_single_select_engine::change_result() + si new subselect Item + res new select_result object + + RETURN + -1 error +*/ + +int subselect_uniquesubquery_engine::change_item(Item_subselect *si, + select_subselect *res) +{ + DBUG_ASSERT(0); + return -1; +} diff --git a/sql/item_subselect.h b/sql/item_subselect.h index 6d8f5353695..364781de362 100644 --- a/sql/item_subselect.h +++ b/sql/item_subselect.h @@ -290,6 +290,7 @@ public: virtual table_map upper_select_const_tables()= 0; static table_map calc_const_tables(TABLE_LIST *); virtual void print(String *str)= 0; + virtual int change_item(Item_subselect *si, select_subselect *result)= 0; }; @@ -313,6 +314,7 @@ public: void exclude(); table_map upper_select_const_tables(); void print (String *str); + int change_item(Item_subselect *si, select_subselect *result); }; @@ -332,6 +334,7 @@ public: void exclude(); table_map upper_select_const_tables(); void print (String *str); + int change_item(Item_subselect *si, select_subselect *result); }; @@ -360,6 +363,7 @@ public: void exclude(); table_map upper_select_const_tables() { return 0; } void print (String *str); + int change_item(Item_subselect *si, select_subselect *result); }; diff --git a/sql/item_sum.cc b/sql/item_sum.cc index eac8d31b256..0c5b29fc069 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -502,6 +502,14 @@ void Item_sum_variance::update_field() /* min & max */ +void Item_sum_hybrid::clear() +{ + sum= 0.0; + sum_int= 0; + value.length(0); + null_value= 1; +} + double Item_sum_hybrid::val() { DBUG_ASSERT(fixed == 1); diff --git a/sql/item_sum.h b/sql/item_sum.h index 4cded41a9f6..ef947900fd2 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -415,13 +415,7 @@ class Item_sum_hybrid :public Item_sum table_map used_tables() const { return used_table_cache; } bool const_item() const { return !used_table_cache; } - void clear() - { - sum=0.0; - sum_int=0; - value.length(0); - null_value=1; - } + void clear(); double val(); longlong val_int(); void reset_field(); diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 5fa8b37285e..1038066f6ef 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -1710,6 +1710,7 @@ TABLE_LIST *st_lex::link_first_table_back(TABLE_LIST *tables, st_select_lex::print is in sql_select.h st_select_lex_unit::prepare, st_select_lex_unit::exec, - st_select_lex_unit::cleanup, st_select_lex_unit::reinit_exec_mechanism + st_select_lex_unit::cleanup, st_select_lex_unit::reinit_exec_mechanism, + st_select_lex_unit::change_result are in sql_union.cc */ diff --git a/sql/sql_lex.h b/sql/sql_lex.h index aa3e81fd9c9..557c037c799 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -371,6 +371,7 @@ public: void print(String *str); ulong init_prepare_fake_select_lex(THD *thd); + int change_result(select_subselect *result, select_subselect *old_result); friend void mysql_init_query(THD *thd); friend int subselect_union_engine::exec(); diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 5db4a0042ea..aeab7a9719c 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1585,8 +1585,7 @@ mysql_select(THD *thd, Item ***rref_pointer_array, if (select_lex->linkage != GLOBAL_OPTIONS_TYPE) { //here is EXPLAIN of subselect or derived table - join->result= result; - if (!join->procedure && result->prepare(join->fields_list, unit)) + if (join->change_result(result)) { DBUG_RETURN(-1); } @@ -9514,3 +9513,27 @@ void st_select_lex::print(THD *thd, String *str) // PROCEDURE unsupported here } + + +/* + change select_result object of JOIN + + SYNOPSIS + JOIN::change_result() + res new select_result object + + RETURN + 0 - OK + -1 - error +*/ + +int JOIN::change_result(select_result *res) +{ + DBUG_ENTER("JOIN::change_result"); + result= res; + if (!procedure && result->prepare(fields_list, select_lex->master_unit())) + { + DBUG_RETURN(-1); + } + DBUG_RETURN(0); +} diff --git a/sql/sql_select.h b/sql/sql_select.h index 5a246a477cf..8aca43484d2 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -304,6 +304,7 @@ class JOIN :public Sql_alloc return (do_send_rows && tmp_table_param.sum_func_count != 0 && !group_list); } + int change_result(select_result *result); }; diff --git a/sql/sql_union.cc b/sql/sql_union.cc index 63638b618d9..de3eeec0db0 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -555,3 +555,32 @@ void st_select_lex_unit::reinit_exec_mechanism() } #endif } + + +/* + change select_result object of unit + + SYNOPSIS + st_select_lex_unit::change_result() + result new select_result object + old_result old select_result object + + RETURN + 0 - OK + -1 - error +*/ + +int st_select_lex_unit::change_result(select_subselect *result, + select_subselect *old_result) +{ + int res= 0; + for (SELECT_LEX *sl= first_select_in_union(); sl; sl= sl->next_select()) + { + if (sl->join && sl->join->result == old_result) + if ((res= sl->join->change_result(result))) + return (res); + } + if (fake_select_lex && fake_select_lex->join) + res= fake_select_lex->join->change_result(result); + return (res); +} From 5edb391973f235890e3e6eb771e7d0fa3102b24a Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 9 May 2004 00:48:54 +0200 Subject: [PATCH 023/162] Stop entire process group (if child has forked) Impl. to handle "angle" process of ndb ndb/src/cw/cpcd/Process.cpp: Stop entire process group (if child has forked) (Does not handle child doing setsid) --- ndb/src/cw/cpcd/Process.cpp | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/ndb/src/cw/cpcd/Process.cpp b/ndb/src/cw/cpcd/Process.cpp index 2c9a74ed20b..76639a2a618 100644 --- a/ndb/src/cw/cpcd/Process.cpp +++ b/ndb/src/cw/cpcd/Process.cpp @@ -27,6 +27,8 @@ #include #include #include +#include +#include void CPCD::Process::print(FILE * f){ @@ -103,7 +105,7 @@ bool CPCD::Process::isRunning() { if(m_pid <= 1){ - logger.critical("isRunning(%d) invalid pid: %d", m_id, m_pid); + //logger.critical("isRunning(%d) invalid pid: %d", m_id, m_pid); return false; } /* Check if there actually exists a process with such a pid */ @@ -355,7 +357,7 @@ CPCD::Process::start() { */ switch(pid = fork()) { case 0: /* Child */ - + setsid(); writePid(getpid()); if(runas(m_runas.c_str()) == 0){ do_exec(); @@ -384,11 +386,11 @@ CPCD::Process::start() { pid_t pid; switch(pid = fork()) { case 0: /* Child */ + setsid(); writePid(getpid()); if(runas(m_runas.c_str()) != 0){ _exit(1); } - setsid(); do_exec(); _exit(1); /* NOTREACHED */ @@ -423,11 +425,11 @@ CPCD::Process::start() { while(readPid() < 0){ sched_yield(); } - + if(pid != -1 && pid != m_pid){ logger.error("pid and m_pid don't match: %d %d", pid, m_pid); } - + if(isRunning()){ m_status = RUNNING; return 0; @@ -449,28 +451,32 @@ CPCD::Process::stop() { } m_status = STOPPING; - int ret = kill((pid_t)m_pid, SIGTERM); + const pid_t pgid = - getpgid(m_pid); + int ret = kill(pgid, SIGTERM); switch(ret) { case 0: - logger.debug("Sent SIGTERM to pid %d", (int)m_pid); + logger.debug("Sent SIGTERM to pid %d", (int)pgid); break; default: - logger.debug("kill pid: %d : %s", (int)m_pid, strerror(errno)); + logger.debug("kill pid: %d : %s", (int)pgid, strerror(errno)); break; } - - if(isRunning()){ - ret = kill((pid_t)m_pid, SIGKILL); + + errno = 0; + ret = kill(pgid, 0); + if(ret == 0) { + errno = 0; + ret = kill(pgid, SIGKILL); switch(ret) { case 0: - logger.debug("Sent SIGKILL to pid %d", (int)m_pid); + logger.debug("Sent SIGKILL to pid %d", (int)pgid); break; default: - logger.debug("kill pid: %d : %s\n", (int)m_pid, strerror(errno)); + logger.debug("kill pid: %d : %s\n", (int)pgid, strerror(errno)); break; } - } - + } + m_pid = -1; m_status = STOPPED; } From 17652914693b83c04e0b63c10c7a90c7ec912241 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 May 2004 11:50:17 +0200 Subject: [PATCH 024/162] fix compiler warnings in ndb --- ndb/include/debugger/SignalLoggerManager.hpp | 2 +- ndb/include/mgmapi/mgmapi.h | 12 ++-- ndb/include/ndb_version.h | 2 +- ndb/include/portlib/NdbTick.h | 2 +- .../signaldata/CreateFragmentation.cpp | 2 +- ndb/src/common/portlib/unix/NdbMem.c | 1 - ndb/src/common/portlib/unix/NdbThread.c | 2 +- ndb/src/common/portlib/unix/NdbTick.c | 4 +- ndb/src/common/util/Parser.cpp | 1 + ndb/src/common/util/getarg.c | 4 +- ndb/src/common/util/version.c | 6 +- ndb/src/cw/cpcd/common.cpp | 5 +- .../kernel/blocks/backup/restore/Restore.cpp | 5 +- ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp | 2 +- ndb/src/kernel/blocks/dbutil/DbUtil.cpp | 61 ------------------- ndb/src/kernel/blocks/grep/Grep.cpp | 2 +- ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp | 5 +- ndb/src/kernel/blocks/suma/SumaInit.cpp | 4 +- ndb/src/kernel/ndb-main/Main.cpp | 2 +- ndb/src/mgmapi/Makefile | 2 +- ndb/src/mgmapi/test/keso.c | 4 +- ndb/src/mgmclient/test_cpcd/test_cpcd.cpp | 4 +- ndb/src/mgmsrv/CommandInterpreter.cpp | 2 + ndb/src/mgmsrv/main.cpp | 1 + ndb/src/ndbapi/NdbDictionaryImpl.hpp | 2 +- ndb/src/ndbapi/NdbOperationDefine.cpp | 2 - ndb/src/ndbapi/NdbOperationSearch.cpp | 2 +- ndb/src/ndbapi/NdbSchemaOp.cpp | 3 + ndb/src/ndbapi/Ndberror.cpp | 2 + ndb/src/ndbapi/Ndbinit.cpp | 4 +- ndb/src/newtonapi/dba_binding.cpp | 6 ++ ndb/src/rep/state/RepState.cpp | 8 ++- 32 files changed, 62 insertions(+), 104 deletions(-) diff --git a/ndb/include/debugger/SignalLoggerManager.hpp b/ndb/include/debugger/SignalLoggerManager.hpp index 3d89b399f3b..f213c711f3a 100644 --- a/ndb/include/debugger/SignalLoggerManager.hpp +++ b/ndb/include/debugger/SignalLoggerManager.hpp @@ -153,7 +153,7 @@ public: private: bool m_logDistributed; - int m_ownNodeId; + Uint32 m_ownNodeId; FILE * outputStream; int log(int cmd, BlockNumber bno, LogMode logMode); diff --git a/ndb/include/mgmapi/mgmapi.h b/ndb/include/mgmapi/mgmapi.h index c74a046b7e7..0ecb19eaa76 100644 --- a/ndb/include/mgmapi/mgmapi.h +++ b/ndb/include/mgmapi/mgmapi.h @@ -80,13 +80,13 @@ extern "C" { * NDB Cluster node types */ enum ndb_mgm_node_type { - NDB_MGM_NODE_TYPE_UNKNOWN = -1, ///< Node type not known - NDB_MGM_NODE_TYPE_API = 0, ///< An application node (API) - NDB_MGM_NODE_TYPE_NDB = 1, ///< A database node (DB) - NDB_MGM_NODE_TYPE_MGM = 2, ///< A management server node (MGM) + NDB_MGM_NODE_TYPE_UNKNOWN = -1, /*/< Node type not known*/ + NDB_MGM_NODE_TYPE_API = 0, /*/< An application node (API)*/ + NDB_MGM_NODE_TYPE_NDB = 1, /*/< A database node (DB)*/ + NDB_MGM_NODE_TYPE_MGM = 2, /*/< A management server node (MGM)*/ - NDB_MGM_NODE_TYPE_MIN = 0, ///< Min valid value - NDB_MGM_NODE_TYPE_MAX = 2 ///< Max valid value + NDB_MGM_NODE_TYPE_MIN = 0, /*/< Min valid value*/ + NDB_MGM_NODE_TYPE_MAX = 2 /*/< Max valid value*/ }; /** diff --git a/ndb/include/ndb_version.h b/ndb/include/ndb_version.h index 958dd339f74..ad60cab8cdb 100644 --- a/ndb/include/ndb_version.h +++ b/ndb/include/ndb_version.h @@ -47,7 +47,7 @@ * Used by transporter and when communicating with * managment server */ -//#define NDB_VERSION_ID 0 +/*#define NDB_VERSION_ID 0*/ #endif diff --git a/ndb/include/portlib/NdbTick.h b/ndb/include/portlib/NdbTick.h index 762f65331cc..9bd8eca22bd 100644 --- a/ndb/include/portlib/NdbTick.h +++ b/ndb/include/portlib/NdbTick.h @@ -42,7 +42,7 @@ NDB_TICKS NdbTick_CurrentMillisecond(void); */ int NdbTick_CurrentMicrosecond(NDB_TICKS * secs, Uint32 * micros); -//#define TIME_MEASUREMENT + /*#define TIME_MEASUREMENT*/ #ifdef TIME_MEASUREMENT struct MicroSecondTimer { diff --git a/ndb/src/common/debugger/signaldata/CreateFragmentation.cpp b/ndb/src/common/debugger/signaldata/CreateFragmentation.cpp index 6685345f17a..027f743b5ea 100644 --- a/ndb/src/common/debugger/signaldata/CreateFragmentation.cpp +++ b/ndb/src/common/debugger/signaldata/CreateFragmentation.cpp @@ -26,7 +26,7 @@ printCREATE_FRAGMENTATION_REQ(FILE * output, const Uint32 * theData, fprintf(output, " noOfFragments: %x\n", sig->noOfFragments); fprintf(output, " fragmentNode: %x\n", sig->fragmentNode); if (sig->primaryTableId == RNIL) - fprintf(output, " primaryTableId: none\n", sig->primaryTableId); + fprintf(output, " primaryTableId: none\n"); else fprintf(output, " primaryTableId: %x\n", sig->primaryTableId); return true; diff --git a/ndb/src/common/portlib/unix/NdbMem.c b/ndb/src/common/portlib/unix/NdbMem.c index 3b47494967f..5366b187ba6 100644 --- a/ndb/src/common/portlib/unix/NdbMem.c +++ b/ndb/src/common/portlib/unix/NdbMem.c @@ -62,7 +62,6 @@ int NdbMem_MemLockAll(){ #if defined NDB_MACOSX return 0; #else - //return mlockall(MCL_CURRENT | MCL_FUTURE); return mlockall(MCL_CURRENT); #endif } diff --git a/ndb/src/common/portlib/unix/NdbThread.c b/ndb/src/common/portlib/unix/NdbThread.c index 3665c4c9159..599bc9f3215 100644 --- a/ndb/src/common/portlib/unix/NdbThread.c +++ b/ndb/src/common/portlib/unix/NdbThread.c @@ -94,7 +94,7 @@ int NdbThread_WaitFor(struct NdbThread* p_wait_thread, void** status) if (p_wait_thread == NULL) return 0; - if (p_wait_thread->thread == NULL) + if (p_wait_thread->thread == 0) return 0; result = pthread_join(p_wait_thread->thread, status); diff --git a/ndb/src/common/portlib/unix/NdbTick.c b/ndb/src/common/portlib/unix/NdbTick.c index 5adb4ec80c2..f4cda6449d6 100644 --- a/ndb/src/common/portlib/unix/NdbTick.c +++ b/ndb/src/common/portlib/unix/NdbTick.c @@ -99,12 +99,12 @@ NdbTick_getMicrosPassed(struct MicroSecondTimer start, ret_value = ((NDB_TICKS)MICROSEC_PER_SEC) * sec_passed; } else if (start.seconds > stop.seconds) { return ret_value; - }//if + } if (start.micro_seconds < stop.micro_seconds) { ret_value += (stop.micro_seconds - start.micro_seconds); } else if (ret_value != (NDB_TICKS)0) { ret_value -= (start.micro_seconds - stop.micro_seconds); - }//if + } return ret_value; } #endif diff --git a/ndb/src/common/util/Parser.cpp b/ndb/src/common/util/Parser.cpp index d5c23fe14c1..2cb50b429b6 100644 --- a/ndb/src/common/util/Parser.cpp +++ b/ndb/src/common/util/Parser.cpp @@ -23,6 +23,7 @@ #include #include +#undef DEBUG #define DEBUG(x) ndbout << x << endl; static void trim(char * str); diff --git a/ndb/src/common/util/getarg.c b/ndb/src/common/util/getarg.c index 5f792437a65..79742656a8f 100644 --- a/ndb/src/common/util/getarg.c +++ b/ndb/src/common/util/getarg.c @@ -407,12 +407,12 @@ arg_match_long(struct getargs *args, size_t num_args, } case arg_string: { - *(char**)current->value = optarg + 1; + *(char**)current->value = (char*)optarg + 1; return 0; } case arg_strings: { - add_string((getarg_strings*)current->value, optarg + 1); + add_string((getarg_strings*)current->value, (char*)optarg + 1); return 0; } case arg_flag: diff --git a/ndb/src/common/util/version.c b/ndb/src/common/util/version.c index 2ff10f51932..ca8477fa7ac 100644 --- a/ndb/src/common/util/version.c +++ b/ndb/src/common/util/version.c @@ -61,7 +61,7 @@ struct NdbUpGradeCompatible { UG_MatchType matchType; }; -//#define TEST_VERSION +/*#define TEST_VERSION*/ #ifndef TEST_VERSION struct NdbUpGradeCompatible ndbCompatibleTable_full[] = { @@ -74,7 +74,7 @@ struct NdbUpGradeCompatible ndbCompatibleTable_upgrade[] = { void ndbSetOwnVersion() {} -#else // testing purposes +#else /* testing purposes */ struct NdbUpGradeCompatible ndbCompatibleTable_full[] = { { MAKE_VERSION(4,1,5), MAKE_VERSION(4,1,0), UG_Range }, @@ -122,7 +122,7 @@ ndbGetOwnVersion() { #ifndef TEST_VERSION return NDB_VERSION_D; -#else // testing purposes +#else /* testing purposes */ if (ndbOwnVersionTesting == 0) return NDB_VERSION_D; else diff --git a/ndb/src/cw/cpcd/common.cpp b/ndb/src/cw/cpcd/common.cpp index 731866b22fd..b2de90c468e 100644 --- a/ndb/src/cw/cpcd/common.cpp +++ b/ndb/src/cw/cpcd/common.cpp @@ -152,7 +152,10 @@ parse_config_file(struct getargs args[], int num_arg, const Properties& p){ break; } } - if(!found) + if(!found) { printf("Unknown parameter: %s\n", name); + return 1; + } } + return 0; } diff --git a/ndb/src/kernel/blocks/backup/restore/Restore.cpp b/ndb/src/kernel/blocks/backup/restore/Restore.cpp index 50eb0df7c56..b24bf7b1e1d 100644 --- a/ndb/src/kernel/blocks/backup/restore/Restore.cpp +++ b/ndb/src/kernel/blocks/backup/restore/Restore.cpp @@ -514,7 +514,8 @@ RestoreMetaData::parseTableDescriptor(const Uint32 * data, NdbDictionary::Column::Type type; if(getMajor(m_fileHeader.NdbVersion) < VERSION_3X) { tableImpl->setName(tableName); - for(Uint32 i = 0 ; i < tableImpl->getNoOfColumns(); i++) { + Uint32 noOfColumns = tableImpl->getNoOfColumns(); + for(Uint32 i = 0 ; i < noOfColumns; i++) { type = convertToV3x(tableImpl->getColumn(i)->m_extType, columnTypeMapping, -1); @@ -562,7 +563,7 @@ bool TupleS::prepareRecord(const TableS & tab){ m_currentTable = &tab; for(int i = 0; itheData[4]; Uint32 fragId = signal->theData[5]; Uint32 noOfNullAttr = signal->theData[7]; - Uint32 schemaVersion = signal->theData[8]; + /* Uint32 schemaVersion = signal->theData[8];*/ Uint32 noOfKeyAttr = signal->theData[9]; Uint32 noOfNewAttr = signal->theData[10]; diff --git a/ndb/src/kernel/blocks/dbutil/DbUtil.cpp b/ndb/src/kernel/blocks/dbutil/DbUtil.cpp index 2cb129bc591..a14caa47295 100644 --- a/ndb/src/kernel/blocks/dbutil/DbUtil.cpp +++ b/ndb/src/kernel/blocks/dbutil/DbUtil.cpp @@ -1303,26 +1303,6 @@ DbUtil::prepareOperation(Signal* signal, PreparePtr prepPtr) TcKeyReq::setAIInTcKeyReq(requestInfo, 0); // Attrinfo sent separately prepOpPtr.p->tckey.requestInfo = requestInfo; - if (operationType == UtilPrepareReq::Read) { - // ResultSet - AttrMappingBuffer::ConstDataBufferIterator tmpIt; -#if 0 //def EVENT_DEBUG - ResultSetBuffer & rs = prepOpPtr.p->rsInfo; - ResultSetInfoBuffer::DataBufferIterator it; - rs.first(it); - for (prepOpPtr.p->attrMapping.first(tmpIt); - tmpIt.curr.i != RNIL; - prepOpPtr.p->attrMapping.next(tmpIt)) { - AttributeHeader* ah = (AttributeHeader *) tmpIt.data; - ah->print(stdout); - AttributeHeader* rsah = (AttributeHeader *) it.data; - rsah->print(stdout); - rs.next(it,1); - printf("%d\n",it.data); - } -#endif - } - /**************************** * Confirm completed prepare ****************************/ @@ -1914,7 +1894,6 @@ DbUtil::runOperation(Signal* signal, TransactionPtr & transPtr, Operation * op = opPtr.p; const PreparedOperation * pop = op->prepOp; - Uint32 lastFlag = 0; if(!transPtr.p->operations.next(opPtr)){ TcKeyReq::setCommitFlag(start, 1); // Last operation TcKeyReq::setExecuteFlag(start, 1); @@ -2127,43 +2106,11 @@ DbUtil::execTRANSID_AI(Signal* signal){ /** * Save result */ - Uint32 srcSz = dataLen; const Uint32 *src = &signal->theData[3]; - const Uint32 segSize = opP->rs.getSegmentSize(); - -#if 0 //def EVENT_DEBUG - printf("rsRecv %u, dataLen %u, rsExpect %u\n", - opP->rsRecv, dataLen, opP->rsExpect); -#endif - ResultSetBuffer::DataBufferIterator rs = opP->rsIterator; -#if 0 //def EVENT_DEBUG - for(int i = 0; i < dataLen; i++) - printf("H'%.8x ", src[i]); -#endif - ndbrequire(opP->rs.import(rs,src,dataLen)); opP->rs.next(rs, dataLen); - -#if 0 // replaced this section with import() above - while(srcSz > segSize){ - ndbrequire(rs.curr.i != RNIL); - memcpy(rs.data, src, segSize << 2); - opP->rs.next(rs, segSize); - srcSz -= segSize; - // src += segSize * 4; // Bug? - src += segSize; - } - - if(srcSz > 0){ - jam(); - memcpy(rs.data, src, srcSz << 2); - rs.curr.i = RNIL; - rs.data = 0; - } -#endif - opP->rsIterator = rs; if(!opP->complete()){ @@ -2171,20 +2118,12 @@ DbUtil::execTRANSID_AI(Signal* signal){ return; } -#if 0 //def EVENT_DEBUG - printf("op complete\n"); -#endif - transPtr.p->recv++; if(!transPtr.p->complete()){ jam(); return; } -#if 0 //def EVENT_DEBUG - printf("trans complete\n"); -#endif - finishTransaction(signal, transPtr); } diff --git a/ndb/src/kernel/blocks/grep/Grep.cpp b/ndb/src/kernel/blocks/grep/Grep.cpp index 093e9a225e6..ee506ce922a 100644 --- a/ndb/src/kernel/blocks/grep/Grep.cpp +++ b/ndb/src/kernel/blocks/grep/Grep.cpp @@ -1294,7 +1294,7 @@ Grep::PSPart::execSUB_REMOVE_REF(Signal* signal) jamEntry(); SubRemoveRef * const ref = (SubRemoveRef *)signal->getDataPtr(); Uint32 subData = ref->subscriberData; - GrepError::Code err = (GrepError::Code)ref->err; + /* GrepError::Code err = (GrepError::Code)ref->err;*/ SubscriptionPtr subPtr; c_subscriptions.getPtr(subPtr, subData); diff --git a/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp b/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp index 0e2aa4c6903..68a474cb628 100644 --- a/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp +++ b/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp @@ -566,9 +566,8 @@ AsyncFile::writeReq( Request * request) if (((i + 1) < request->par.readWrite.numberOfPages)) { // There are more pages to write // Check that offsets are consequtive - if ((page_offset + request->par.readWrite.pages[i].size) - != - request->par.readWrite.pages[i+1].offset) { + off_t tmp = page_offset + request->par.readWrite.pages[i].size; + if (tmp != request->par.readWrite.pages[i+1].offset) { // Next page is not aligned with previous, not allowed DEBUG(ndbout_c("Page offsets are not aligned")); request->error = EINVAL; diff --git a/ndb/src/kernel/blocks/suma/SumaInit.cpp b/ndb/src/kernel/blocks/suma/SumaInit.cpp index e9fba5e789c..9f0659942a2 100644 --- a/ndb/src/kernel/blocks/suma/SumaInit.cpp +++ b/ndb/src/kernel/blocks/suma/SumaInit.cpp @@ -132,9 +132,9 @@ SumaParticipant::~SumaParticipant() Suma::Suma(const Configuration & conf) : SumaParticipant(conf), + Restart(*this), c_nodes(c_nodePool), - c_runningSubscriptions(c_subCoordinatorPool), - Restart(*this) + c_runningSubscriptions(c_subCoordinatorPool) { c_nodePool.setSize(MAX_NDB_NODES); diff --git a/ndb/src/kernel/ndb-main/Main.cpp b/ndb/src/kernel/ndb-main/Main.cpp index 88fd9d177de..fa986e5af85 100644 --- a/ndb/src/kernel/ndb-main/Main.cpp +++ b/ndb/src/kernel/ndb-main/Main.cpp @@ -188,9 +188,9 @@ NDB_MAIN(ndb_kernel){ void systemInfo(const Configuration & config, const LogLevel & logLevel){ +#ifdef NDB_WIN32 int processors = 0; int speed; -#ifdef NDB_WIN32 SYSTEM_INFO sinfo; GetSystemInfo(&sinfo); processors = sinfo.dwNumberOfProcessors; diff --git a/ndb/src/mgmapi/Makefile b/ndb/src/mgmapi/Makefile index fac852dbba8..9e7ba4f5ac7 100644 --- a/ndb/src/mgmapi/Makefile +++ b/ndb/src/mgmapi/Makefile @@ -9,7 +9,7 @@ A_LIB := Y SO_LIB := Y PIC_LIB := Y -DIRS := test +#DIRS := test LIB_TARGET := MGM_API LIB_TARGET_ARCHIVES := $(ARCHIVE_TARGET) general portlib diff --git a/ndb/src/mgmapi/test/keso.c b/ndb/src/mgmapi/test/keso.c index f4b192e3db8..4b3b365c94f 100644 --- a/ndb/src/mgmapi/test/keso.c +++ b/ndb/src/mgmapi/test/keso.c @@ -60,8 +60,8 @@ struct test_case test_connect_disconnect[] = { struct test_case tests[] = { { "testStatus", &testStatus }, { "testFilterClusterLog", &testFilterClusterLog }, - //{ "testSetLogLevelClusterLog", &testSetLogLevelClusterLog }, - //{ "testSetLogLevelNode", &testSetLogLevelNode }, + /*{ "testSetLogLevelClusterLog", &testSetLogLevelClusterLog },*/ + /*{ "testSetLogLevelNode", &testSetLogLevelNode },*/ { "testRestartNode", &testRestartNode }, { "testGetStatPort", &testGetStatPort }, #ifdef VM_TRACE diff --git a/ndb/src/mgmclient/test_cpcd/test_cpcd.cpp b/ndb/src/mgmclient/test_cpcd/test_cpcd.cpp index 6b6dc9f1077..984ffd952b2 100644 --- a/ndb/src/mgmclient/test_cpcd/test_cpcd.cpp +++ b/ndb/src/mgmclient/test_cpcd/test_cpcd.cpp @@ -136,7 +136,7 @@ void list(){ ABORT(); } - for(int i = 0; im_status = procs[i].m_status; @@ -144,7 +144,7 @@ void list(){ } } SimpleCpcClient::Process* find(int id){ - for(int i = 0; igetTupleIdFromNdb(m_currentTable->m_tableId); - if (tTupleId == ~0){ + if (tTupleId == ~(Uint64)0){ setErrorCodeAbort(theNdb->theError.code); return 0; } diff --git a/ndb/src/ndbapi/NdbSchemaOp.cpp b/ndb/src/ndbapi/NdbSchemaOp.cpp index 9f4d7fbcfd4..f0265e41cfc 100644 --- a/ndb/src/ndbapi/NdbSchemaOp.cpp +++ b/ndb/src/ndbapi/NdbSchemaOp.cpp @@ -29,6 +29,7 @@ Documentation: Handles createTable and createAttribute calls Adjust: 980125 UABMNST First version. 020826 EMIKRON New version for new DICT *****************************************************************************/ +#include #include "NdbSchemaOp.hpp" #include "NdbSchemaCon.hpp" #include "API.hpp" @@ -139,6 +140,8 @@ NdbSchemaOp::createAttribute( const char* anAttrName, case String: col.setType(NdbDictionary::Column::Char); break; + default: + assert(0); } col.setLength(anArraySize); col.setNullable(nullable); diff --git a/ndb/src/ndbapi/Ndberror.cpp b/ndb/src/ndbapi/Ndberror.cpp index ee668605f0d..f4fdbf31c4a 100644 --- a/ndb/src/ndbapi/Ndberror.cpp +++ b/ndb/src/ndbapi/Ndberror.cpp @@ -460,6 +460,7 @@ int Nb = sizeof(StatusClassificationMapping)/sizeof(ErrorStatusClassification); * Complete all fields of an NdbError given the error code * and details */ +#if 0 static void set(NdbError & error, int code, const char * details, ...){ @@ -470,6 +471,7 @@ set(NdbError & error, int code, const char * details, ...){ vsnprintf(error.details, sizeof(error.details), details, ap); va_end(ap); } +#endif static void diff --git a/ndb/src/ndbapi/Ndbinit.cpp b/ndb/src/ndbapi/Ndbinit.cpp index 9afbbf0df1f..be7acc48d7a 100644 --- a/ndb/src/ndbapi/Ndbinit.cpp +++ b/ndb/src/ndbapi/Ndbinit.cpp @@ -55,6 +55,7 @@ Parameters: aDataBase : Name of the database. Remark: Connect to the database. ***************************************************************************/ Ndb::Ndb( const char* aDataBase , const char* aDataBaseSchema) : + theNdbObjectIdMap(0), thePreparedTransactionsArray(NULL), theSentTransactionsArray(NULL), theCompletedTransactionsArray(NULL), @@ -89,8 +90,7 @@ Ndb::Ndb( const char* aDataBase , const char* aDataBaseSchema) : theFirstTransId(0), theRestartGCI(0), theNdbBlockNumber(-1), - theInitState(NotConstructed), - theNdbObjectIdMap(0) + theInitState(NotConstructed) { cgetSignals =0; cfreeSignals = 0; diff --git a/ndb/src/newtonapi/dba_binding.cpp b/ndb/src/newtonapi/dba_binding.cpp index 724f54c0e4b..63e48110b1d 100644 --- a/ndb/src/newtonapi/dba_binding.cpp +++ b/ndb/src/newtonapi/dba_binding.cpp @@ -367,6 +367,12 @@ matchSize(NdbDictionary::Column::Type t, unsigned b, Size_t s) { case NdbDictionary::Column::Datetime: case NdbDictionary::Column::Timespec: case NdbDictionary::Column::Blob: + case NdbDictionary::Column::Tinyint: + case NdbDictionary::Column::Tinyunsigned: + case NdbDictionary::Column::Smallint: + case NdbDictionary::Column::Smallunsigned: + case NdbDictionary::Column::Mediumint: + case NdbDictionary::Column::Mediumunsigned: case NdbDictionary::Column::Undefined: return false; } diff --git a/ndb/src/rep/state/RepState.cpp b/ndb/src/rep/state/RepState.cpp index a34bff25d7f..d8a50961a3c 100644 --- a/ndb/src/rep/state/RepState.cpp +++ b/ndb/src/rep/state/RepState.cpp @@ -681,7 +681,7 @@ Properties * RepState::query(QueryCounter counter, Uint32 replicationId) if(prop == NULL) return NULL; NdbMutex_Lock(m_mutex); - if(counter != (Uint32)-1) + if(counter != ~(Uint32)0) getEpochState((Channel::Position)counter, prop ); prop->put("no_of_nodegroups", m_channel.getNoOfNodeGroups()); prop->put("subid", m_channel.getNoOfNodeGroups()); @@ -714,9 +714,13 @@ RepState::getEpochState(Channel::Position pos, Properties * p) */ pos_first--; pos_last--; + first_buf[pos_first]= '\0'; + last_buf[pos_last]= '\0'; +#if 0 sprintf(first_buf+pos_first,"",""); sprintf(last_buf + pos_last,"",""); - +#endif + p->put("first", first_buf); p->put("last", last_buf); From 3f46a5fd600544347b6fd8de9febab11db145a55 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 May 2004 12:15:40 +0200 Subject: [PATCH 025/162] Fix replace_result of $MASTER_MYPORT instead of literal numbers. mysql-test/t/rpl000015.test: Fix replace_result of $MASTER_MYPORT instead of literal numbers. The test case rpl000015 needs one exlpicit literal number. It changes partial master settings, which seems to reset other settings to their defaults. To test this is obviously the intent of this case. --- mysql-test/t/rpl000015.test | 2 +- mysql-test/t/rpl_error_ignored_table.test | 2 +- mysql-test/t/rpl_log.test | 6 +++--- mysql-test/t/rpl_log_pos.test | 8 ++++---- mysql-test/t/rpl_max_relay_size.test | 12 ++++++------ mysql-test/t/rpl_rotate_logs.test | 10 +++++----- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/mysql-test/t/rpl000015.test b/mysql-test/t/rpl000015.test index 26d32ea3e11..7c5a8bf3743 100644 --- a/mysql-test/t/rpl000015.test +++ b/mysql-test/t/rpl000015.test @@ -11,7 +11,7 @@ show slave status; change master to master_host='127.0.0.1'; # The following needs to be cleaned up when change master is fixed ---replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT 3334 MASTER_PORT +--replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT show slave status; --replace_result $MASTER_MYPORT MASTER_PORT eval change master to master_host='127.0.0.1',master_user='root', diff --git a/mysql-test/t/rpl_error_ignored_table.test b/mysql-test/t/rpl_error_ignored_table.test index 4f15f9de0a2..a0b0f1fd599 100644 --- a/mysql-test/t/rpl_error_ignored_table.test +++ b/mysql-test/t/rpl_error_ignored_table.test @@ -14,7 +14,7 @@ connection slave; sync_with_master; # The port number is different when doing the release build with # Do-compile, hence we have to replace the port number here accordingly ---replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT +--replace_result $MASTER_MYPORT MASTER_PORT show slave status; # check that the table has been ignored, because otherwise the test is nonsense show tables like 't1'; diff --git a/mysql-test/t/rpl_log.test b/mysql-test/t/rpl_log.test index e01b3e4e09c..df2b9ecd0cb 100644 --- a/mysql-test/t/rpl_log.test +++ b/mysql-test/t/rpl_log.test @@ -79,11 +79,11 @@ connection slave; slave start; sync_with_master; show master logs; ---replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT $VERSION VERSION +--replace_result $MASTER_MYPORT MASTER_PORT $VERSION VERSION show binlog events in 'slave-bin.001' from 4; ---replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT $VERSION VERSION +--replace_result $MASTER_MYPORT MASTER_PORT $VERSION VERSION show binlog events in 'slave-bin.002' from 4; ---replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT +--replace_result $MASTER_MYPORT MASTER_PORT show slave status; # Need to recode the following diff --git a/mysql-test/t/rpl_log_pos.test b/mysql-test/t/rpl_log_pos.test index 859180d4e25..1a9a5bc3448 100644 --- a/mysql-test/t/rpl_log_pos.test +++ b/mysql-test/t/rpl_log_pos.test @@ -6,7 +6,7 @@ show master status; save_master_pos; connection slave; sync_with_master; ---replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT +--replace_result $MASTER_MYPORT MASTER_PORT show slave status; slave stop; change master to master_log_pos=73; @@ -15,17 +15,17 @@ sleep 5; slave stop; change master to master_log_pos=73; ---replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT +--replace_result $MASTER_MYPORT MASTER_PORT show slave status; slave start; sleep 5; ---replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT +--replace_result $MASTER_MYPORT MASTER_PORT show slave status; slave stop; change master to master_log_pos=173; slave start; sleep 2; ---replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT +--replace_result $MASTER_MYPORT MASTER_PORT show slave status; connection master; show master status; diff --git a/mysql-test/t/rpl_max_relay_size.test b/mysql-test/t/rpl_max_relay_size.test index 7e9a8a1872e..d2278b6d6df 100644 --- a/mysql-test/t/rpl_max_relay_size.test +++ b/mysql-test/t/rpl_max_relay_size.test @@ -28,7 +28,7 @@ set global max_relay_log_size=8192-1; # mapped to 4096 select @@global.max_relay_log_size; start slave; sync_with_master; ---replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT 3334 MASTER_PORT +--replace_result $MASTER_MYPORT MASTER_PORT show slave status; stop slave; reset slave; @@ -36,7 +36,7 @@ set global max_relay_log_size=(5*4096); select @@global.max_relay_log_size; start slave; sync_with_master; ---replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT 3334 MASTER_PORT +--replace_result $MASTER_MYPORT MASTER_PORT --replace_column 18 # show slave status; stop slave; @@ -45,7 +45,7 @@ set global max_relay_log_size=0; select @@global.max_relay_log_size; start slave; sync_with_master; ---replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT 3334 MASTER_PORT +--replace_result $MASTER_MYPORT MASTER_PORT show slave status; # Tests below are mainly to ensure that we have not coded with wrong assumptions @@ -55,7 +55,7 @@ reset slave; # test of relay log rotation when the slave is stopped # (to make sure it does not crash). flush logs; ---replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT 3334 MASTER_PORT +--replace_result $MASTER_MYPORT MASTER_PORT show slave status; reset slave; @@ -70,7 +70,7 @@ create table t1 (a int); save_master_pos; connection slave; sync_with_master; ---replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT 3334 MASTER_PORT +--replace_result $MASTER_MYPORT MASTER_PORT show slave status; # one more rotation, to be sure Relay_log_space is correctly updated flush logs; @@ -79,7 +79,7 @@ drop table t1; save_master_pos; connection slave; sync_with_master; ---replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT 3334 MASTER_PORT +--replace_result $MASTER_MYPORT MASTER_PORT show slave status; connection master; diff --git a/mysql-test/t/rpl_rotate_logs.test b/mysql-test/t/rpl_rotate_logs.test index 70366fc1749..76a06d01fa9 100644 --- a/mysql-test/t/rpl_rotate_logs.test +++ b/mysql-test/t/rpl_rotate_logs.test @@ -25,13 +25,13 @@ system chmod 600 var/slave-data/master.info; # init_strvar_from_file() in init_master_info()). --error 1201 slave start; ---replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT +--replace_result $MASTER_MYPORT MASTER_PORT # CHANGE MASTER will fail because it first parses master.info before changing it # (so when master.info is bad, people have to use RESET SLAVE first). --error 1201 eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root'; reset slave; ---replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT +--replace_result $MASTER_MYPORT MASTER_PORT eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root'; connection master; reset master; @@ -49,7 +49,7 @@ insert into t1 values('Could not break slave'),('Tried hard'); save_master_pos; connection slave; sync_with_master; ---replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT +--replace_result $MASTER_MYPORT MASTER_PORT --replace_column 18 # show slave status; select * from t1; @@ -101,7 +101,7 @@ insert into t2 values (65); save_master_pos; connection slave; sync_with_master; ---replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT +--replace_result $MASTER_MYPORT MASTER_PORT --replace_column 18 # show slave status; select * from t2; @@ -133,7 +133,7 @@ connection slave; sync_with_master; select * from t4; ---replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT +--replace_result $MASTER_MYPORT MASTER_PORT --replace_column 18 # show slave status; # because of concurrent insert, the table may not be up to date From f71f59731beaa2c911bdb3efc3b26fc6dcd19b1b Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 May 2004 13:29:02 +0300 Subject: [PATCH 026/162] treat parameter as constant in ORDER BY check of fields in SELECT list(Bug #3686) sql/sql_select.cc: treat parameter as constant in ORDER BY check of fields in SELECT list tests/client_test.c: test of using parameters in SELECT list with ORDER BY --- sql/sql_select.cc | 3 ++- tests/client_test.c | 48 ++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 5db4a0042ea..6a64665b4cc 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -367,7 +367,8 @@ JOIN::prepare(Item ***rref_pointer_array, { if (item->with_sum_func) flag|=1; - else if (!(flag & 2) && !item->const_item()) + else if (!(flag & 2) && + test(item->used_tables() & ~PARAM_TABLE_BIT)) flag|=2; } if (flag == 3) diff --git a/tests/client_test.c b/tests/client_test.c index d382377fe49..ba70bcd7fa7 100644 --- a/tests/client_test.c +++ b/tests/client_test.c @@ -9453,7 +9453,6 @@ select col1 FROM t1 where col1=2"); myquery(rc); } - /* This tests for various mysql_send_long_data bugs described in #1664 */ @@ -9595,6 +9594,51 @@ static void test_bug1664() myquery(rc); } + +static void test_order_param() +{ + MYSQL_STMT *stmt; + int rc; + + myheader("test_order_param"); + + rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1"); + myquery(rc); + + rc= mysql_query(mysql,"CREATE TABLE t1(a INT, b char(10))"); + myquery(rc); + + stmt= mysql_simple_prepare(mysql, + "select sum(a) + 200, 1 from t1 \ +union distinct \ +select sum(a) + 200, 1 from t1 \ +group by b "); + check_stmt(stmt); + + mysql_stmt_close(stmt); + + stmt= mysql_simple_prepare(mysql, + "select sum(a) + 200, ? from t1 \ +group by b \ +union distinct \ +select sum(a) + 200, 1 from t1 \ +group by b "); + check_stmt(stmt); + + stmt= mysql_simple_prepare(mysql, + "select sum(a) + 200, ? from t1 \ +union distinct \ +select sum(a) + 200, 1 from t1 \ +group by b "); + check_stmt(stmt); + + mysql_stmt_close(stmt); + + rc= mysql_query(mysql, "DROP TABLE t1"); + myquery(rc); +} + + /* Read and parse arguments and MySQL options from my.cnf */ @@ -9877,6 +9921,8 @@ int main(int argc, char **argv) test_union2(); /* repeatable execution of union (Bug #3577) */ test_bug1664(); /* test for bugs in mysql_stmt_send_long_data() call (Bug #1664) */ + test_order_param(); /* ORDER BY with parameters in select list + (Bug #3686 */ end_time= time((time_t *)0); total_time+= difftime(end_time, start_time); From 0bfea087af007309ce06d346ecfb0683a3d012e7 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 May 2004 12:39:01 +0200 Subject: [PATCH 027/162] backport from 4.1: "phrase search" should not match partial words (it should not match 'paraphrase searches') --- myisam/ft_boolean_search.c | 29 +++++++++++++++++++---------- myisam/ft_parser.c | 9 --------- myisam/ftdefs.h | 5 +++-- mysql-test/r/fulltext.result | 3 ++- mysql-test/t/fulltext.test | 1 + 5 files changed, 25 insertions(+), 22 deletions(-) diff --git a/myisam/ft_boolean_search.c b/myisam/ft_boolean_search.c index d728c379ea5..61381f80783 100644 --- a/myisam/ft_boolean_search.c +++ b/myisam/ft_boolean_search.c @@ -360,25 +360,34 @@ err: } -/* returns 1 if str0 contain str1 */ +/* returns 1 if str0 ~= /\/ */ static int _ftb_strstr(const byte *s0, const byte *e0, const byte *s1, const byte *e1, CHARSET_INFO *cs) { - const byte *p; + const byte *p0, *p1; + my_bool s_after, e_before; - while (s0 < e0) + s_after=true_word_char(s1[0]); + e_before=true_word_char(e1[-1]); + p0=s0; + + while (p0 < e0) { - while (s0 < e0 && cs->to_upper[(uint) (uchar) *s0++] != + while (p0 < e0 && cs->to_upper[(uint) (uchar) *p0++] != cs->to_upper[(uint) (uchar) *s1]) /* no-op */; - if (s0 >= e0) + if (p0 >= e0) return 0; - p=s1+1; - while (s0 < e0 && p < e1 && cs->to_upper[(uint) (uchar) *s0] == - cs->to_upper[(uint) (uchar) *p]) - s0++, p++; - if (p >= e1) + + if (s_after && p0-1 > s0 && true_word_char(p0[-2])) + continue; + + p1=s1+1; + while (p0 < e0 && p1 < e1 && cs->to_upper[(uint) (uchar) *p0] == + cs->to_upper[(uint) (uchar) *p1]) + p0++, p1++; + if (p1 == e1 && (!e_before || p0 == e0 || !true_word_char(p0[0]))) return 1; } return 0; diff --git a/myisam/ft_parser.c b/myisam/ft_parser.c index c25ed6022a0..f397660af6b 100644 --- a/myisam/ft_parser.c +++ b/myisam/ft_parser.c @@ -105,15 +105,6 @@ FT_WORD * ft_linearize(TREE *wtree) DBUG_RETURN(wlist); } -#define true_word_char(X) (isalnum(X) || (X)=='_') -#ifdef HYPHEN_IS_DELIM -#define misc_word_char(X) ((X)=='\'') -#else -#define misc_word_char(X) ((X)=='\'' || (X)=='-') -#endif -#define word_char(X) (true_word_char(X) || misc_word_char(X)) - - /* returns: * 0 - eof * 1 - word found diff --git a/myisam/ftdefs.h b/myisam/ftdefs.h index 62fa4362e19..46acf60d796 100644 --- a/myisam/ftdefs.h +++ b/myisam/ftdefs.h @@ -22,8 +22,9 @@ #include #include -#define HYPHEN_IS_DELIM -#define HYPHEN_IS_CONCAT /* not used for now */ +#define true_word_char(X) (isalnum(X) || (X)=='_') +#define misc_word_char(X) ((X)=='\'') +#define word_char(X) (true_word_char(X) || misc_word_char(X)) #define COMPILE_STOPWORDS_IN diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index 738941f63c7..baa3a834f6f 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -116,7 +116,8 @@ a b MySQL has now support for full-text search select * from t1 where MATCH a,b AGAINST ('"text i"' IN BOOLEAN MODE); a b -Full-text indexes are called collections +select * from t1 where MATCH a,b AGAINST ('"xt indexes"' IN BOOLEAN MODE); +a b select * from t1 where MATCH a,b AGAINST ('+(support collections) +foobar*' IN BOOLEAN MODE); a b select * from t1 where MATCH a,b AGAINST ('+(+(support collections)) +foobar*' IN BOOLEAN MODE); diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test index 774a3b42619..86d2cde370a 100644 --- a/mysql-test/t/fulltext.test +++ b/mysql-test/t/fulltext.test @@ -52,6 +52,7 @@ select * from t1 where MATCH a,b AGAINST ('"text search" "now support"' IN BOOL select * from t1 where MATCH a,b AGAINST ('"text search" -"now support"' IN BOOLEAN MODE); select * from t1 where MATCH a,b AGAINST ('"text search" +"now support"' IN BOOLEAN MODE); select * from t1 where MATCH a,b AGAINST ('"text i"' IN BOOLEAN MODE); +select * from t1 where MATCH a,b AGAINST ('"xt indexes"' IN BOOLEAN MODE); select * from t1 where MATCH a,b AGAINST ('+(support collections) +foobar*' IN BOOLEAN MODE); select * from t1 where MATCH a,b AGAINST ('+(+(support collections)) +foobar*' IN BOOLEAN MODE); From 7430ad7d64ba5e658f3a048756275488660dbf72 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 May 2004 14:10:04 +0200 Subject: [PATCH 028/162] more slim make of ndb tree --- ndb/Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ndb/Makefile b/ndb/Makefile index 586a430bb17..90dcc229b2f 100644 --- a/ndb/Makefile +++ b/ndb/Makefile @@ -6,6 +6,13 @@ DIRS := src test tools examples replace-targets := all clean NDB_RELEASE := $(shell ../scripts/mysql_config --version) +mysql: + $(MAKE) -C src + $(MAKE) -C test/src + $(MAKE) -C tools + $(MAKE) -C test/ndbapi/flexBench + $(MAKE) -C test/tools/waiter + include $(NDB_TOP)/Epilogue.mk _libs_test : _bins_src From c9f9cc24db9d0b48451e8a4ab04fff582faba138 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 May 2004 14:25:32 +0200 Subject: [PATCH 029/162] make warning fixes for ndb --- ndb/src/common/util/strlcat.c | 2 +- ndb/src/mgmsrv/CommandInterpreter.cpp | 2 +- ndb/src/ndbapi/NdbSchemaOp.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ndb/src/common/util/strlcat.c b/ndb/src/common/util/strlcat.c index ccff15da27f..bf8b0d9a5cb 100644 --- a/ndb/src/common/util/strlcat.c +++ b/ndb/src/common/util/strlcat.c @@ -39,7 +39,7 @@ /* RCSID("$KTH: strlcat.c,v 1.1 2000/08/16 01:23:47 lha Exp $"); */ -//#include +/*#include */ #ifndef HAVE_STRLCAT size_t diff --git a/ndb/src/mgmsrv/CommandInterpreter.cpp b/ndb/src/mgmsrv/CommandInterpreter.cpp index 1588e16b4e4..8a7293b8434 100644 --- a/ndb/src/mgmsrv/CommandInterpreter.cpp +++ b/ndb/src/mgmsrv/CommandInterpreter.cpp @@ -646,7 +646,7 @@ versionCallback(int nodeId, int version, void * anyData, int errCode){ } break; case NDB_MGM_NODE_TYPE_UNKNOWN: - assert(0); + abort(); }; } else { diff --git a/ndb/src/ndbapi/NdbSchemaOp.cpp b/ndb/src/ndbapi/NdbSchemaOp.cpp index f0265e41cfc..9e495229661 100644 --- a/ndb/src/ndbapi/NdbSchemaOp.cpp +++ b/ndb/src/ndbapi/NdbSchemaOp.cpp @@ -140,8 +140,8 @@ NdbSchemaOp::createAttribute( const char* anAttrName, case String: col.setType(NdbDictionary::Column::Char); break; - default: - assert(0); + case NoAttrTypeDef: + abort(); } col.setLength(anArraySize); col.setNullable(nullable); From c74fe82b75f07aa9d723ec2f0f4a04fb680a8d8c Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 May 2004 14:39:54 +0200 Subject: [PATCH 030/162] Makefile: slim make for ndb ndb/Makefile: slim make for ndb --- ndb/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ndb/Makefile b/ndb/Makefile index 90dcc229b2f..475914f6120 100644 --- a/ndb/Makefile +++ b/ndb/Makefile @@ -6,7 +6,7 @@ DIRS := src test tools examples replace-targets := all clean NDB_RELEASE := $(shell ../scripts/mysql_config --version) -mysql: +all: $(MAKE) -C src $(MAKE) -C test/src $(MAKE) -C tools @@ -22,7 +22,7 @@ _bins_src : _libs_src _bins_tools : _bins_src # always release compile except for ndbapi static lib -all: +old-all: $(MAKE) -C src/ndbapi libs $(MAKE) libs NDB_VERSION=RELEASE $(MAKE) bins NDB_VERSION=RELEASE From b89bb86751356b4fdc422bfd7f75f1f787da475f Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 May 2004 17:15:29 +0300 Subject: [PATCH 031/162] InnoDB: Fix assertion failure for orphaned tables in DROP DATABASE innobase/row/row0mysql.c: Compare database part of table name with memcmp(), not strcmp() --- innobase/row/row0mysql.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c index bdc47ca0e8e..228f19c865f 100644 --- a/innobase/row/row0mysql.c +++ b/innobase/row/row0mysql.c @@ -2208,10 +2208,11 @@ row_drop_database_for_mysql( dict_table_t* table; char* table_name; int err = DB_SUCCESS; + ulint namelen = strlen(name); ut_ad(trx->mysql_thread_id == os_thread_get_curr_id()); ut_a(name != NULL); - ut_a(name[strlen(name) - 1] == '/'); + ut_a(name[namelen - 1] == '/'); trx->op_info = (char *) "dropping database"; @@ -2220,7 +2221,7 @@ loop: row_mysql_lock_data_dictionary(trx); while ((table_name = dict_get_first_table_name_in_db(name))) { - ut_a(strcmp(table_name, name) == 0); + ut_a(memcmp(table_name, name, namelen) == 0); table = dict_table_get_low(table_name); From 3fd7554f06af54681e53595be52c30ae8462250c Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 May 2004 17:37:38 +0300 Subject: [PATCH 032/162] Add read_rnd_buffer_size in my.cnf example files Remove wrong redefine of vio_reset() (to compile libmysqld on windows) include/violite.h: Remove wrong redefine of vio_reset() support-files/my-huge.cnf.sh: Add read_rnd_buffer_size support-files/my-large.cnf.sh: Add read_rnd_buffer_size support-files/my-medium.cnf.sh: Add read_rnd_buffer_size support-files/my-small.cnf.sh: Add read_rnd_buffer_size --- include/violite.h | 10 ++-------- support-files/my-huge.cnf.sh | 1 + support-files/my-large.cnf.sh | 1 + support-files/my-medium.cnf.sh | 2 ++ support-files/my-small.cnf.sh | 2 ++ 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/violite.h b/include/violite.h index e8f30288d34..b4b9f724d89 100644 --- a/include/violite.h +++ b/include/violite.h @@ -55,14 +55,8 @@ int vio_close_pipe(Vio * vio); void vio_delete(Vio* vio); int vio_close(Vio* vio); - -#ifdef EMBEDDED_LIBRARY -void vio_reset(Vio *vio); -#else -void vio_reset(Vio* vio, enum enum_vio_type type, - my_socket sd, HANDLE hPipe, my_bool localhost); -#endif - +void vio_reset(Vio* vio, enum enum_vio_type type, + my_socket sd, HANDLE hPipe, my_bool localhost); int vio_read(Vio *vio, gptr buf, int size); int vio_write(Vio *vio, const gptr buf, int size); int vio_blocking(Vio *vio, my_bool onoff, my_bool *old_mode); diff --git a/support-files/my-huge.cnf.sh b/support-files/my-huge.cnf.sh index ba92856df0e..5fdde0d2963 100644 --- a/support-files/my-huge.cnf.sh +++ b/support-files/my-huge.cnf.sh @@ -31,6 +31,7 @@ max_allowed_packet = 1M table_cache = 512 sort_buffer_size = 2M read_buffer_size = 2M +read_rnd_buffer_size = 8M myisam_sort_buffer_size = 64M thread_cache = 8 query_cache_size = 32M diff --git a/support-files/my-large.cnf.sh b/support-files/my-large.cnf.sh index ba865a5bfd0..a17ec7b5227 100644 --- a/support-files/my-large.cnf.sh +++ b/support-files/my-large.cnf.sh @@ -31,6 +31,7 @@ max_allowed_packet = 1M table_cache = 256 sort_buffer_size = 1M read_buffer_size = 1M +read_rnd_buffer_size = 4M myisam_sort_buffer_size = 64M thread_cache = 8 query_cache_size= 16M diff --git a/support-files/my-medium.cnf.sh b/support-files/my-medium.cnf.sh index 4650ed06dc1..d50d0717c17 100644 --- a/support-files/my-medium.cnf.sh +++ b/support-files/my-medium.cnf.sh @@ -32,6 +32,8 @@ max_allowed_packet = 1M table_cache = 64 sort_buffer_size = 512K net_buffer_length = 8K +read_buffer_size = 256K +read_rnd_buffer_size = 512K myisam_sort_buffer_size = 8M # Don't listen on a TCP/IP port at all. This can be a security enhancement, diff --git a/support-files/my-small.cnf.sh b/support-files/my-small.cnf.sh index ca26a10a397..2ae62fb48f1 100644 --- a/support-files/my-small.cnf.sh +++ b/support-files/my-small.cnf.sh @@ -31,6 +31,8 @@ key_buffer = 16K max_allowed_packet = 1M table_cache = 4 sort_buffer_size = 64K +read_buffer_size = 256K +read_rnd_buffer_size = 256K net_buffer_length = 2K thread_stack = 64K From 70d6ddd08fb64fbd65d9b8e7e808a3b3dad86463 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 May 2004 20:32:44 +0200 Subject: [PATCH 033/162] - Renamed the Mac OS X StartupItem directory from /Library/StartupItems/MySQL to /Library/StartupItems/MySQLCOM to avoid a name space collision with the MySQL Startup Item shipped with Mac OS X Server, updated the MySQLStartupItem PKG version number to reflect the change. Build-tools/Do-pkg: - Renamed the StartupItem directory from /Library/StartupItems/MySQL to /Library/StartupItems/MySQLCOM to avoid a name space collision with the MySQL Startup Item in Mac OS X Server support-files/MacOSX/StartupItem.Description.plist: - Bumped up the StartupItem Package version to 1.1 to indicate the change in directory naming --- Build-tools/Do-pkg | 15 +++++++++------ .../MacOSX/StartupItem.Description.plist | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Build-tools/Do-pkg b/Build-tools/Do-pkg index 2fd1946ed0e..286e33f6dd4 100755 --- a/Build-tools/Do-pkg +++ b/Build-tools/Do-pkg @@ -95,6 +95,7 @@ $SI_DESC= <$SUPFILEDIR/StartupItem.Description.plist>; $SI_PARAMS= <$SUPFILEDIR/StartupParameters.plist>; $SI_POST= <$SUPFILEDIR/StartupItem.postinstall>; $SI_NAME= "MySQLStartupItem"; +$SI_DIR_NAME= "MySQLCOM"; $SI_SCRIPT= <$SUPFILEDIR/MySQL>; @RESOURCES= qw/ ReadMe.txt postinstall preinstall /; @LICENSES= ("$SRCBASEDIR/COPYING","$SRCBASEDIR/MySQLEULA.txt"); @@ -195,16 +196,18 @@ unless ($opt_skip_si) &logger("Cleaning up $RESOURCE_DIR"); &run_command("rm -rf $RESOURCE_DIR/*", "Unable to clean up $RESOURCE_DIR!"); - &logger("Installing MySQL StartupItem files into $PKGROOT/MySQL"); + my $SI_DIR= $PKGROOT . "/" . $SI_DIR_NAME; + &logger("Installing MySQL StartupItem files into $SI_DIR"); unless($opt_dry_run) { - mkdir("$PKGROOT/MySQL") or &abort("Error creating $PKGROOT/MySQL"); - copy("$SI_SCRIPT", "$PKGROOT/MySQL/") + mkdir("$SI_DIR") + or &abort("Error creating $SI_DIR"); + copy("$SI_SCRIPT", "$SI_DIR/") or &abort("Error copying $SI_SCRIPT!"); - chmod(0755, "$PKGROOT/MySQL/" . basename("$SI_SCRIPT")); - copy("$SI_PARAMS", "$PKGROOT/MySQL/") + chmod(0755, "$SI_DIR/" . basename("$SI_SCRIPT")); + copy("$SI_PARAMS", "$SI_DIR/") or &abort("Error copying $SI_PARAMS!"); - chmod(0644, "$PKGROOT/MySQL/" . basename("$SI_PARAMS")); + chmod(0644, "$SI_DIR/" . basename("$SI_PARAMS")); &run_command("chown -R root:wheel $PKGROOT/*", "Cannot chown $PKGROOT!"); copy("$SI_POST", "$RESOURCE_DIR/postinstall") or &abort("Error copying $SI_POST!"); diff --git a/support-files/MacOSX/StartupItem.Description.plist b/support-files/MacOSX/StartupItem.Description.plist index 1f0023bde0d..e8ceb1ee062 100644 --- a/support-files/MacOSX/StartupItem.Description.plist +++ b/support-files/MacOSX/StartupItem.Description.plist @@ -10,6 +10,6 @@ IFPkgDescriptionTitle MySQL Startup Item IFPkgDescriptionVersion - 1.0 + 1.1 From 5bd4cb870fd942fa5e7d9011917032773c43b42a Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 May 2004 21:52:24 +0200 Subject: [PATCH 034/162] Update casts from very old my_lock.c source. --- mysys/my_lock.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mysys/my_lock.c b/mysys/my_lock.c index 5058c301adb..8f915d6003a 100644 --- a/mysys/my_lock.c +++ b/mysys/my_lock.c @@ -117,10 +117,12 @@ int my_lock(File fd, int locktype, my_off_t start, my_off_t length, #if defined(HAVE_FCNTL) { struct flock lock; - lock.l_type= (short) locktype; - lock.l_whence=0L; - lock.l_start=(long) start; - lock.l_len=(long) length; + + lock.l_type= (short) locktype; + lock.l_whence= SEEK_SET; + lock.l_start= (off_t) start; + lock.l_len= (off_t) length; + if (MyFlags & MY_DONT_WAIT) { if (fcntl(fd,F_SETLK,&lock) != -1) /* Check if we can lock */ From d5c2e2b2d34e90250b3f24071ab718684e58f0b1 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 May 2004 23:19:50 +0200 Subject: [PATCH 035/162] logging_ok: Logging to logging@openlogging.org accepted item_cmpfunc.cc, ctype_recoding.test, ctype_recoding.result: Call Item_func_conv_charset::fix_fields() in Item_bool_func2::fix_length_and_dec() (but #3704) mysql-test/r/ctype_recoding.result: Call Item_func_conv_charset::fix_fields() in Item_bool_func2::fix_length_and_dec() mysql-test/t/ctype_recoding.test: Call Item_func_conv_charset::fix_fields() in Item_bool_func2::fix_length_and_dec() sql/item_cmpfunc.cc: Call Item_func_conv_charset::fix_fields() in Item_bool_func2::fix_length_and_dec() BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + mysql-test/r/ctype_recoding.result | 7 +++++++ mysql-test/t/ctype_recoding.test | 8 +++++++- sql/item_cmpfunc.cc | 1 + 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index a8379b3d338..b56e38f3d9c 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -163,6 +163,7 @@ tonu@hundin.mysql.fi tonu@volk.internalnet tonu@x153.internalnet tonu@x3.internalnet +tsmith@build.mysql.com ulli@morbus.(none) venu@hundin.mysql.fi venu@myvenu.com diff --git a/mysql-test/r/ctype_recoding.result b/mysql-test/r/ctype_recoding.result index 7209c86bb31..ed59de87395 100644 --- a/mysql-test/r/ctype_recoding.result +++ b/mysql-test/r/ctype_recoding.result @@ -82,6 +82,13 @@ Field Type Null Key Default Extra SET CHARACTER SET koi8r; DROP TABLE ÔÁÂÌÉÃÁ; SET CHARACTER SET default; +SET NAMES UTF8; +CREATE TABLE t1 (t text) DEFAULT CHARSET UTF8; +INSERT INTO t1 (t) VALUES ('x'); +SELECT 1 FROM t1 WHERE CONCAT(_latin1'x') = t; +1 +1 +DROP TABLE t1; SET CHARACTER SET koi8r; CREATE DATABASE ÔÅÓÔ; USE ÔÅÓÔ; diff --git a/mysql-test/t/ctype_recoding.test b/mysql-test/t/ctype_recoding.test index 40349da8aa9..8ac22e89c2d 100644 --- a/mysql-test/t/ctype_recoding.test +++ b/mysql-test/t/ctype_recoding.test @@ -56,6 +56,13 @@ SET CHARACTER SET koi8r; DROP TABLE ÔÁÂÌÉÃÁ; SET CHARACTER SET default; +# Test for Item_func_conv_charset::fix_fields (bug #3704) +SET NAMES UTF8; +CREATE TABLE t1 (t text) DEFAULT CHARSET UTF8; +INSERT INTO t1 (t) VALUES ('x'); +SELECT 1 FROM t1 WHERE CONCAT(_latin1'x') = t; +DROP TABLE t1; + SET CHARACTER SET koi8r; CREATE DATABASE ÔÅÓÔ; USE ÔÅÓÔ; @@ -71,4 +78,3 @@ SET NAMES koi8r; SELECT hex('ÔÅÓÔ'); SET character_set_connection=cp1251; SELECT hex('ÔÅÓÔ'); - diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index afbf0b7163e..446d72ac143 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -221,6 +221,7 @@ void Item_bool_func2::fix_length_and_dec() { conv= new Item_func_conv_charset(args[weak],args[strong]->collation.collation); conv->collation.set(args[weak]->collation.derivation); + conv->fix_fields(current_thd, 0, &conv); } args[weak]= conv ? conv : args[weak]; } From 4ea5cf8c5afb9f0e5f8deabb7cc2a025312279ef Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 May 2004 20:55:52 -0300 Subject: [PATCH 036/162] Fix VC++ compiler error (function redifinition) for embedded server --- libmysql/client_settings.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmysql/client_settings.h b/libmysql/client_settings.h index 1c1ff9bac10..1d4f45b729f 100644 --- a/libmysql/client_settings.h +++ b/libmysql/client_settings.h @@ -42,7 +42,7 @@ my_bool handle_local_infile(MYSQL *mysql, const char *net_filename); void mysql_read_default_options(struct st_mysql_options *options, const char *filename,const char *group); -MYSQL * +MYSQL * STDCALL cli_mysql_real_connect(MYSQL *mysql,const char *host, const char *user, const char *passwd, const char *db, uint port, const char *unix_socket,ulong client_flag); From 5063cbb9a642905e15edfa4d49f25d677c8b137f Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 May 2004 22:25:51 -0300 Subject: [PATCH 037/162] Removing VC++ compiler warnings --- libmysqld/emb_qcache.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libmysqld/emb_qcache.cc b/libmysqld/emb_qcache.cc index 0b6416632b7..7d83023abd5 100644 --- a/libmysqld/emb_qcache.cc +++ b/libmysqld/emb_qcache.cc @@ -295,7 +295,7 @@ uint emb_count_querycache_size(THD *thd) cur_row= thd->data->data; n_rows= thd->data->rows; } - result= 4+8 + (42 + 4*n_rows)*mysql->field_count; + result= (uint) (4+8 + (42 + 4*n_rows)*mysql->field_count); for(; field < field_end; field++) { @@ -414,8 +414,8 @@ int emb_load_querycache_result(THD *thd, Querycache_stream *src) goto err; thd->data= data; init_alloc_root(&data->alloc, 8192,0); - row= (MYSQL_ROWS *)alloc_root(&data->alloc, rows * sizeof(MYSQL_ROWS) + - rows * (mysql->field_count+1)*sizeof(char*)); + row= (MYSQL_ROWS *)alloc_root(&data->alloc, (uint) (rows * sizeof(MYSQL_ROWS) + + rows * (mysql->field_count+1)*sizeof(char*))); end_row= row + rows; columns= (MYSQL_ROW)end_row; From 5b00724963bfd1b8c7072df3130819a8afbf2f85 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 May 2004 11:05:02 +0300 Subject: [PATCH 038/162] InnoDB: Changed bug reporting address to http://bugs.mysql.com innobase/btr/btr0btr.c: Changed bug reporting address to http://bugs.mysql.com innobase/dict/dict0load.c: Changed bug reporting address to http://bugs.mysql.com innobase/ibuf/ibuf0ibuf.c: Changed bug reporting address to http://bugs.mysql.com innobase/lock/lock0lock.c: Changed bug reporting address to http://bugs.mysql.com innobase/row/row0ins.c: Changed bug reporting address to http://bugs.mysql.com innobase/row/row0sel.c: Changed bug reporting address to http://bugs.mysql.com innobase/row/row0umod.c: Changed bug reporting address to http://bugs.mysql.com innobase/row/row0upd.c: Changed bug reporting address to http://bugs.mysql.com innobase/trx/trx0rec.c: Changed bug reporting address to http://bugs.mysql.com innobase/ut/ut0dbg.c: Changed bug reporting address to http://bugs.mysql.com --- innobase/btr/btr0btr.c | 2 +- innobase/dict/dict0load.c | 2 +- innobase/ibuf/ibuf0ibuf.c | 7 +++---- innobase/lock/lock0lock.c | 6 ++++-- innobase/row/row0ins.c | 3 +-- innobase/row/row0sel.c | 3 +-- innobase/row/row0umod.c | 3 +-- innobase/row/row0upd.c | 3 +-- innobase/trx/trx0rec.c | 22 +++++++++------------- innobase/ut/ut0dbg.c | 2 +- 10 files changed, 23 insertions(+), 30 deletions(-) diff --git a/innobase/btr/btr0btr.c b/innobase/btr/btr0btr.c index 70bcd1eea1f..0b4c0dbfa94 100644 --- a/innobase/btr/btr0btr.c +++ b/innobase/btr/btr0btr.c @@ -882,7 +882,7 @@ btr_page_reorganize_low( fprintf(stderr, "InnoDB: Error: page old data size %lu new data size %lu\n" "InnoDB: Error: page old max ins size %lu new max ins size %lu\n" -"InnoDB: Make a detailed bug report and send it to mysql@lists.mysql.com\n", +"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n", data_size1, data_size2, max_ins_size1, max_ins_size2); } diff --git a/innobase/dict/dict0load.c b/innobase/dict/dict0load.c index 884ef95e183..6a4d4c86824 100644 --- a/innobase/dict/dict0load.c +++ b/innobase/dict/dict0load.c @@ -721,7 +721,7 @@ dict_load_table( "InnoDB: the foreign key table or the referenced table!\n" "InnoDB: The data dictionary of InnoDB is corrupt. You may need to drop\n" "InnoDB: and recreate the foreign key table or the referenced table.\n" -"InnoDB: Send a detailed bug report to mysql@lists.mysql.com\n" +"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n" "InnoDB: Latest foreign key error printout:\n%s\n", dict_foreign_err_buf); mutex_exit(&dict_foreign_err_mutex); diff --git a/innobase/ibuf/ibuf0ibuf.c b/innobase/ibuf/ibuf0ibuf.c index 83bb23b036f..4525cf7afef 100644 --- a/innobase/ibuf/ibuf0ibuf.c +++ b/innobase/ibuf/ibuf0ibuf.c @@ -2385,7 +2385,7 @@ ibuf_insert_to_index_page( fprintf(stderr, "Bitmap bits %lu\n", old_bits); fputs( -"InnoDB: Send a detailed bug report to mysql@lists.mysql.com!\n", stderr); +"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n", stderr); } } @@ -2443,7 +2443,7 @@ ibuf_delete_rec( if (!success) { fprintf(stderr, - "InnoDB: ERROR: Send the output to mysql@lists.mysql.com\n" + "InnoDB: ERROR: Submit the output to http://bugs.mysql.com\n" "InnoDB: ibuf cursor restoration fails!\n" "InnoDB: ibuf record inserted to page %lu\n", page_no); fflush(stderr); @@ -2597,8 +2597,7 @@ ibuf_merge_or_delete_for_page( "InnoDB: We try to resolve the problem by skipping the insert buffer\n" "InnoDB: merge for this page. Please run CHECK TABLE on your tables\n" "InnoDB: to determine if they are corrupt after this.\n\n" -"InnoDB: Please make a detailed bug report and send it to\n" -"InnoDB: mysql@lists.mysql.com\n\n", +"InnoDB: Please submit a detailed bug report to http://bugs.mysql.com\n\n", page_no, fil_page_get_type(page)); } } diff --git a/innobase/lock/lock0lock.c b/innobase/lock/lock0lock.c index 6534387c22c..4343496f6e1 100644 --- a/innobase/lock/lock0lock.c +++ b/innobase/lock/lock0lock.c @@ -1629,7 +1629,8 @@ lock_rec_enqueue_waiting( " InnoDB: Error: a record lock wait happens in a dictionary operation!\n" "InnoDB: Table name ", stderr); ut_print_name(stderr, index->table_name); - fputs(". Send a bug report to mysql@lists.mysql.com\n", + fputs(".\n" +"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n", stderr); } @@ -3269,7 +3270,8 @@ lock_table_enqueue_waiting( " InnoDB: Error: a table lock wait happens in a dictionary operation!\n" "InnoDB: Table name ", stderr); ut_print_name(stderr, table->name); - fputs(". Send a bug report to mysql@lists.mysql.com\n", + fputs(".\n" +"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n", stderr); } diff --git a/innobase/row/row0ins.c b/innobase/row/row0ins.c index 8bc6c9697c1..8f1c1370f25 100644 --- a/innobase/row/row0ins.c +++ b/innobase/row/row0ins.c @@ -803,8 +803,7 @@ row_ins_foreign_check_on_constraint( "InnoDB: clustered record ", stderr); rec_print(stderr, clust_rec); fputs("\n" - "InnoDB: Make a detailed bug report and send it\n" - "InnoDB: to mysql@lists.mysql.com\n", stderr); +"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n", stderr); err = DB_SUCCESS; diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c index 6f8ce120764..e0bf4684214 100644 --- a/innobase/row/row0sel.c +++ b/innobase/row/row0sel.c @@ -2358,8 +2358,7 @@ row_sel_get_clust_rec_for_mysql( trx_print(stderr, thr_get_trx(thr)); fputs("\n" - "InnoDB: Make a detailed bug report and send it\n" - "InnoDB: to mysql@lists.mysql.com\n", stderr); +"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n", stderr); } clust_rec = NULL; diff --git a/innobase/row/row0umod.c b/innobase/row/row0umod.c index 5975bb164b9..1f74cfb52be 100644 --- a/innobase/row/row0umod.c +++ b/innobase/row/row0umod.c @@ -441,8 +441,7 @@ row_undo_mod_del_unmark_sec_and_undo_update( putc('\n', stderr); trx_print(stderr, thr_get_trx(thr)); fputs("\n" - "InnoDB: Make a detailed bug report and send it\n" - "InnoDB: to mysql@lists.mysql.com\n", stderr); +"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n", stderr); } else { btr_cur_t* btr_cur = btr_pcur_get_btr_cur(&pcur); diff --git a/innobase/row/row0upd.c b/innobase/row/row0upd.c index 02fe245ce8b..e7894e543bc 100644 --- a/innobase/row/row0upd.c +++ b/innobase/row/row0upd.c @@ -1236,8 +1236,7 @@ row_upd_sec_index_entry( trx_print(stderr, thr_get_trx(thr)); fputs("\n" - "InnoDB: Make a detailed bug report and send it\n" - "InnoDB: to mysql@lists.mysql.com\n", stderr); +"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n", stderr); } else { /* Delete mark the old index record; it can already be delete marked if we return after a lock wait in diff --git a/innobase/trx/trx0rec.c b/innobase/trx/trx0rec.c index 4926c776ae9..79fad312e8e 100644 --- a/innobase/trx/trx0rec.c +++ b/innobase/trx/trx0rec.c @@ -823,17 +823,16 @@ trx_undo_update_rec_get_update( if (field_no >= dict_index_get_n_fields(index)) { fprintf(stderr, - "InnoDB: Error: trying to access" - " update undo rec field %lu in ", field_no); +"InnoDB: Error: trying to access update undo rec field %lu in ", field_no); dict_index_name_print(stderr, index); fprintf(stderr, "\n" - "InnoDB: but index has only %lu fields\n" - "InnoDB: Send a detailed bug report to mysql@lists.mysql.com\n" - "InnoDB: Run also CHECK TABLE ", +"InnoDB: but index has only %lu fields\n" +"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n" +"InnoDB: Run also CHECK TABLE ", dict_index_get_n_fields(index)); ut_print_name(stderr, index->table_name); fprintf(stderr, "\n" - "InnoDB: n_fields = %lu, i = %lu, ptr %p\n", +"InnoDB: n_fields = %lu, i = %lu, ptr %p\n", n_fields, i, ptr); return(NULL); } @@ -1271,8 +1270,7 @@ trx_undo_prev_version_build( " update undo rec for non-clustered ", stderr); dict_index_name_print(stderr, index); fputs("\n" - "InnoDB: Send a detailed bug report to" - " mysql@lists.mysql.com\n" +"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n" "InnoDB: index record ", stderr); rec_print(stderr, index_rec); fputs("\n" @@ -1320,11 +1318,9 @@ trx_undo_prev_version_build( " update undo rec for table ", stderr); ut_print_name(stderr, index->table_name); fputs("\n" - "InnoDB: but the table id in the" - " undo record is wrong\n" - "InnoDB: Send a detailed bug report to " - "mysql@lists.mysql.com\n" - "InnoDB: Run also CHECK TABLE ", stderr); +"InnoDB: but the table id in the undo record is wrong\n" +"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n" +"InnoDB: Run also CHECK TABLE ", stderr); ut_print_name(stderr, index->table_name); putc('\n', stderr); } diff --git a/innobase/ut/ut0dbg.c b/innobase/ut/ut0dbg.c index 3697e31050f..65703ec1c86 100644 --- a/innobase/ut/ut0dbg.c +++ b/innobase/ut/ut0dbg.c @@ -23,7 +23,7 @@ const char* ut_dbg_msg_assert_fail = "InnoDB: Assertion failure in thread %lu in file %s line %lu\n"; const char* ut_dbg_msg_trap = "InnoDB: We intentionally generate a memory trap.\n" -"InnoDB: Send a detailed bug report to mysql@lists.mysql.com.\n" +"InnoDB: Submit a detailed bug report to http://bugs.mysql.com.\n" "InnoDB: If you get repeated assertion failures or crashes, even\n" "InnoDB: immediately after the mysqld startup, there may be\n" "InnoDB: corruption in the InnoDB tablespace. See section 6.1 of\n" From 85723a7d5642490a52c4a96344cf96ba2e70ac02 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 May 2004 13:32:01 +0500 Subject: [PATCH 039/162] Use Windows code page 1252 instead of real ISO 8859-1 strings/dump_map.c: Produce better formatted dump. --- mysql-test/r/ctype_latin1.result | 298 +++++++++++++++++++++++++++ mysql-test/t/ctype_latin1.test | 55 +++++ strings/ctype-latin1.c | 340 ++++++++++++++++++++++++------- strings/ctype-sjis.c | 8 +- strings/dump_map.c | 10 +- 5 files changed, 638 insertions(+), 73 deletions(-) create mode 100644 mysql-test/r/ctype_latin1.result create mode 100644 mysql-test/t/ctype_latin1.test diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result new file mode 100644 index 00000000000..a8182438ac4 --- /dev/null +++ b/mysql-test/r/ctype_latin1.result @@ -0,0 +1,298 @@ +drop table if exists t1; +SET NAMES latin1; +CREATE TABLE t1 (a char(1) character set latin1); +INSERT INTO t1 VALUES (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07); +INSERT INTO t1 VALUES (0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F); +INSERT INTO t1 VALUES (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17); +INSERT INTO t1 VALUES (0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F); +INSERT INTO t1 VALUES (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27); +INSERT INTO t1 VALUES (0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F); +INSERT INTO t1 VALUES (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37); +INSERT INTO t1 VALUES (0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F); +INSERT INTO t1 VALUES (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47); +INSERT INTO t1 VALUES (0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F); +INSERT INTO t1 VALUES (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57); +INSERT INTO t1 VALUES (0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F); +INSERT INTO t1 VALUES (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67); +INSERT INTO t1 VALUES (0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F); +INSERT INTO t1 VALUES (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77); +INSERT INTO t1 VALUES (0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F); +INSERT INTO t1 VALUES (0x80),(0x81),(0x82),(0x83),(0x84),(0x85),(0x86),(0x87); +INSERT INTO t1 VALUES (0x88),(0x89),(0x8A),(0x8B),(0x8C),(0x8D),(0x8E),(0x8F); +INSERT INTO t1 VALUES (0x90),(0x91),(0x92),(0x93),(0x94),(0x95),(0x96),(0x97); +INSERT INTO t1 VALUES (0x98),(0x99),(0x9A),(0x9B),(0x9C),(0x9D),(0x9E),(0x9F); +INSERT INTO t1 VALUES (0xA0),(0xA1),(0xA2),(0xA3),(0xA4),(0xA5),(0xA6),(0xA7); +INSERT INTO t1 VALUES (0xA8),(0xA9),(0xAA),(0xAB),(0xAC),(0xAD),(0xAE),(0xAF); +INSERT INTO t1 VALUES (0xB0),(0xB1),(0xB2),(0xB3),(0xB4),(0xB5),(0xB6),(0xB7); +INSERT INTO t1 VALUES (0xB8),(0xB9),(0xBA),(0xBB),(0xBC),(0xBD),(0xBE),(0xBF); +INSERT INTO t1 VALUES (0xC0),(0xC1),(0xC2),(0xC3),(0xC4),(0xC5),(0xC6),(0xC7); +INSERT INTO t1 VALUES (0xC8),(0xC9),(0xCA),(0xCB),(0xCC),(0xCD),(0xCE),(0xCF); +INSERT INTO t1 VALUES (0xD0),(0xD1),(0xD2),(0xD3),(0xD4),(0xD5),(0xD6),(0xD7); +INSERT INTO t1 VALUES (0xD8),(0xD9),(0xDA),(0xDB),(0xDC),(0xDD),(0xDE),(0xDF); +INSERT INTO t1 VALUES (0xE0),(0xE1),(0xE2),(0xE3),(0xE4),(0xE5),(0xE6),(0xE7); +INSERT INTO t1 VALUES (0xE8),(0xE9),(0xEA),(0xEB),(0xEC),(0xED),(0xEE),(0xEF); +INSERT INTO t1 VALUES (0xF0),(0xF1),(0xF2),(0xF3),(0xF4),(0xF5),(0xF6),(0xF7); +INSERT INTO t1 VALUES (0xF8),(0xF9),(0xFA),(0xFB),(0xFC),(0xFD),(0xFE),(0xFF); +SELECT +hex(a), +hex(@u:=convert(a using utf8)), +hex(@l:=convert(@u using latin1)), +a=@l FROM t1; +hex(a) hex(@u:=convert(a using utf8)) hex(@l:=convert(@u using latin1)) a=@l +00 00 00 1 +01 01 01 1 +02 02 02 1 +03 03 03 1 +04 04 04 1 +05 05 05 1 +06 06 06 1 +07 07 07 1 +08 08 08 1 +09 09 09 1 +0A 0A 0A 1 +0B 0B 0B 1 +0C 0C 0C 1 +0D 0D 0D 1 +0E 0E 0E 1 +0F 0F 0F 1 +10 10 10 1 +11 11 11 1 +12 12 12 1 +13 13 13 1 +14 14 14 1 +15 15 15 1 +16 16 16 1 +17 17 17 1 +18 18 18 1 +19 19 19 1 +1A 1A 1A 1 +1B 1B 1B 1 +1C 1C 1C 1 +1D 1D 1D 1 +1E 1E 1E 1 +1F 1F 1F 1 + 1 +21 21 21 1 +22 22 22 1 +23 23 23 1 +24 24 24 1 +25 25 25 1 +26 26 26 1 +27 27 27 1 +28 28 28 1 +29 29 29 1 +2A 2A 2A 1 +2B 2B 2B 1 +2C 2C 2C 1 +2D 2D 2D 1 +2E 2E 2E 1 +2F 2F 2F 1 +30 30 30 1 +31 31 31 1 +32 32 32 1 +33 33 33 1 +34 34 34 1 +35 35 35 1 +36 36 36 1 +37 37 37 1 +38 38 38 1 +39 39 39 1 +3A 3A 3A 1 +3B 3B 3B 1 +3C 3C 3C 1 +3D 3D 3D 1 +3E 3E 3E 1 +3F 3F 3F 1 +40 40 40 1 +41 41 41 1 +42 42 42 1 +43 43 43 1 +44 44 44 1 +45 45 45 1 +46 46 46 1 +47 47 47 1 +48 48 48 1 +49 49 49 1 +4A 4A 4A 1 +4B 4B 4B 1 +4C 4C 4C 1 +4D 4D 4D 1 +4E 4E 4E 1 +4F 4F 4F 1 +50 50 50 1 +51 51 51 1 +52 52 52 1 +53 53 53 1 +54 54 54 1 +55 55 55 1 +56 56 56 1 +57 57 57 1 +58 58 58 1 +59 59 59 1 +5A 5A 5A 1 +5B 5B 5B 1 +5C 5C 5C 1 +5D 5D 5D 1 +5E 5E 5E 1 +5F 5F 5F 1 +60 60 60 1 +61 61 61 1 +62 62 62 1 +63 63 63 1 +64 64 64 1 +65 65 65 1 +66 66 66 1 +67 67 67 1 +68 68 68 1 +69 69 69 1 +6A 6A 6A 1 +6B 6B 6B 1 +6C 6C 6C 1 +6D 6D 6D 1 +6E 6E 6E 1 +6F 6F 6F 1 +70 70 70 1 +71 71 71 1 +72 72 72 1 +73 73 73 1 +74 74 74 1 +75 75 75 1 +76 76 76 1 +77 77 77 1 +78 78 78 1 +79 79 79 1 +7A 7A 7A 1 +7B 7B 7B 1 +7C 7C 7C 1 +7D 7D 7D 1 +7E 7E 7E 1 +7F 7F 7F 1 +80 E282AC 80 1 +81 3F 3F 0 +82 E2809A 82 1 +83 C692 83 1 +84 E2809E 84 1 +85 E280A6 85 1 +86 E280A0 86 1 +87 E280A1 87 1 +88 CB86 88 1 +89 E280B0 89 1 +8A C5A0 8A 1 +8B E280B9 8B 1 +8C C592 8C 1 +8D 3F 3F 0 +8E C5BD 8E 1 +8F 3F 3F 0 +90 3F 3F 0 +91 E28098 91 1 +92 E28099 92 1 +93 E2809C 93 1 +94 E2809D 94 1 +95 E280A2 95 1 +96 E28093 96 1 +97 E28094 97 1 +98 CB9C 98 1 +99 E284A2 99 1 +9A C5A1 9A 1 +9B E280BA 9B 1 +9C C593 9C 1 +9D 3F 3F 0 +9E C5BE 9E 1 +9F C5B8 9F 1 +A0 C2A0 A0 1 +A1 C2A1 A1 1 +A2 C2A2 A2 1 +A3 C2A3 A3 1 +A4 C2A4 A4 1 +A5 C2A5 A5 1 +A6 C2A6 A6 1 +A7 C2A7 A7 1 +A8 C2A8 A8 1 +A9 C2A9 A9 1 +AA C2AA AA 1 +AB C2AB AB 1 +AC C2AC AC 1 +AD C2AD AD 1 +AE C2AE AE 1 +AF C2AF AF 1 +B0 C2B0 B0 1 +B1 C2B1 B1 1 +B2 C2B2 B2 1 +B3 C2B3 B3 1 +B4 C2B4 B4 1 +B5 C2B5 B5 1 +B6 C2B6 B6 1 +B7 C2B7 B7 1 +B8 C2B8 B8 1 +B9 C2B9 B9 1 +BA C2BA BA 1 +BB C2BB BB 1 +BC C2BC BC 1 +BD C2BD BD 1 +BE C2BE BE 1 +BF C2BF BF 1 +C0 C380 C0 1 +C1 C381 C1 1 +C2 C382 C2 1 +C3 C383 C3 1 +C4 C384 C4 1 +C5 C385 C5 1 +C6 C386 C6 1 +C7 C387 C7 1 +C8 C388 C8 1 +C9 C389 C9 1 +CA C38A CA 1 +CB C38B CB 1 +CC C38C CC 1 +CD C38D CD 1 +CE C38E CE 1 +CF C38F CF 1 +D0 C390 D0 1 +D1 C391 D1 1 +D2 C392 D2 1 +D3 C393 D3 1 +D4 C394 D4 1 +D5 C395 D5 1 +D6 C396 D6 1 +D7 C397 D7 1 +D8 C398 D8 1 +D9 C399 D9 1 +DA C39A DA 1 +DB C39B DB 1 +DC C39C DC 1 +DD C39D DD 1 +DE C39E DE 1 +DF C39F DF 1 +E0 C3A0 E0 1 +E1 C3A1 E1 1 +E2 C3A2 E2 1 +E3 C3A3 E3 1 +E4 C3A4 E4 1 +E5 C3A5 E5 1 +E6 C3A6 E6 1 +E7 C3A7 E7 1 +E8 C3A8 E8 1 +E9 C3A9 E9 1 +EA C3AA EA 1 +EB C3AB EB 1 +EC C3AC EC 1 +ED C3AD ED 1 +EE C3AE EE 1 +EF C3AF EF 1 +F0 C3B0 F0 1 +F1 C3B1 F1 1 +F2 C3B2 F2 1 +F3 C3B3 F3 1 +F4 C3B4 F4 1 +F5 C3B5 F5 1 +F6 C3B6 F6 1 +F7 C3B7 F7 1 +F8 C3B8 F8 1 +F9 C3B9 F9 1 +FA C3BA FA 1 +FB C3BB FB 1 +FC C3BC FC 1 +FD C3BD FD 1 +FE C3BE FE 1 +FF C3BF FF 1 +DROP TABLE t1; diff --git a/mysql-test/t/ctype_latin1.test b/mysql-test/t/ctype_latin1.test new file mode 100644 index 00000000000..14062437428 --- /dev/null +++ b/mysql-test/t/ctype_latin1.test @@ -0,0 +1,55 @@ +# +# Tests with the latin1 character set +# +--disable_warnings +drop table if exists t1; +--enable_warnings + +# +# WL 1494: Treat latin1 as cp1252 for unicode conversion +# + +SET NAMES latin1; +CREATE TABLE t1 (a char(1) character set latin1); +INSERT INTO t1 VALUES (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07); +INSERT INTO t1 VALUES (0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F); +INSERT INTO t1 VALUES (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17); +INSERT INTO t1 VALUES (0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F); +INSERT INTO t1 VALUES (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27); +INSERT INTO t1 VALUES (0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F); +INSERT INTO t1 VALUES (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37); +INSERT INTO t1 VALUES (0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F); +INSERT INTO t1 VALUES (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47); +INSERT INTO t1 VALUES (0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F); +INSERT INTO t1 VALUES (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57); +INSERT INTO t1 VALUES (0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F); +INSERT INTO t1 VALUES (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67); +INSERT INTO t1 VALUES (0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F); +INSERT INTO t1 VALUES (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77); +INSERT INTO t1 VALUES (0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F); +INSERT INTO t1 VALUES (0x80),(0x81),(0x82),(0x83),(0x84),(0x85),(0x86),(0x87); +INSERT INTO t1 VALUES (0x88),(0x89),(0x8A),(0x8B),(0x8C),(0x8D),(0x8E),(0x8F); +INSERT INTO t1 VALUES (0x90),(0x91),(0x92),(0x93),(0x94),(0x95),(0x96),(0x97); +INSERT INTO t1 VALUES (0x98),(0x99),(0x9A),(0x9B),(0x9C),(0x9D),(0x9E),(0x9F); +INSERT INTO t1 VALUES (0xA0),(0xA1),(0xA2),(0xA3),(0xA4),(0xA5),(0xA6),(0xA7); +INSERT INTO t1 VALUES (0xA8),(0xA9),(0xAA),(0xAB),(0xAC),(0xAD),(0xAE),(0xAF); +INSERT INTO t1 VALUES (0xB0),(0xB1),(0xB2),(0xB3),(0xB4),(0xB5),(0xB6),(0xB7); +INSERT INTO t1 VALUES (0xB8),(0xB9),(0xBA),(0xBB),(0xBC),(0xBD),(0xBE),(0xBF); +INSERT INTO t1 VALUES (0xC0),(0xC1),(0xC2),(0xC3),(0xC4),(0xC5),(0xC6),(0xC7); +INSERT INTO t1 VALUES (0xC8),(0xC9),(0xCA),(0xCB),(0xCC),(0xCD),(0xCE),(0xCF); +INSERT INTO t1 VALUES (0xD0),(0xD1),(0xD2),(0xD3),(0xD4),(0xD5),(0xD6),(0xD7); +INSERT INTO t1 VALUES (0xD8),(0xD9),(0xDA),(0xDB),(0xDC),(0xDD),(0xDE),(0xDF); +INSERT INTO t1 VALUES (0xE0),(0xE1),(0xE2),(0xE3),(0xE4),(0xE5),(0xE6),(0xE7); +INSERT INTO t1 VALUES (0xE8),(0xE9),(0xEA),(0xEB),(0xEC),(0xED),(0xEE),(0xEF); +INSERT INTO t1 VALUES (0xF0),(0xF1),(0xF2),(0xF3),(0xF4),(0xF5),(0xF6),(0xF7); +INSERT INTO t1 VALUES (0xF8),(0xF9),(0xFA),(0xFB),(0xFC),(0xFD),(0xFE),(0xFF); + +# +# 0x81 0x8D 0x8F 0x90 0x9D are undefined in cp1252 +# +SELECT + hex(a), + hex(@u:=convert(a using utf8)), + hex(@l:=convert(@u using latin1)), + a=@l FROM t1; +DROP TABLE t1; diff --git a/strings/ctype-latin1.c b/strings/ctype-latin1.c index 7a010c3bef8..520fec676b1 100644 --- a/strings/ctype-latin1.c +++ b/strings/ctype-latin1.c @@ -18,60 +18,6 @@ #include "m_string.h" #include "m_ctype.h" - -static uint16 latin1_uni[256]={ - 0,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, -0x00A0,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7, -0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF, -0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7, -0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF, -0x00C0,0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7, -0x00C8,0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF, -0x00D0,0x00D1,0x00D2,0x00D3,0x00D4,0x00D5,0x00D6,0x00D7, -0x00D8,0x00D9,0x00DA,0x00DB,0x00DC,0x00DD,0x00DE,0x00DF, -0x00E0,0x00E1,0x00E2,0x00E3,0x00E4,0x00E5,0x00E6,0x00E7, -0x00E8,0x00E9,0x00EA,0x00EB,0x00EC,0x00ED,0x00EE,0x00EF, -0x00F0,0x00F1,0x00F2,0x00F3,0x00F4,0x00F5,0x00F6,0x00F7, -0x00F8,0x00F9,0x00FA,0x00FB,0x00FC,0x00FD,0x00FE,0x00FF -}; - -static uchar uni_latin1[]={ -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}; - static uchar ctype_latin1[] = { 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32, @@ -149,29 +95,287 @@ static uchar sort_order_latin1[] = { 68, 78, 79, 79, 79, 79, 93,247,216, 85, 85, 85, 89, 89,222,255 }; +/* + WL#1494 notes: + + We'll use cp1252 instead of iso-8859-1. + cp1252 contains printable characters in the range 0x80-0x9F. + In ISO 8859-1, these code points have no associated printable + characters. Therefore, by converting from CP1252 to ISO 8859-1, + one would lose the euro (for instance). Since most people are + unaware of the difference, and since we don't really want a + "Windows ANSI" to differ from a "Unix ANSI", we will: + + - continue to pretend the latin1 character set is ISO 8859-1 + - actually allow the storage of euro etc. so it's actually cp1252 +*/ + +unsigned short cs_to_uni[256]={ +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x20AC,0x0000,0x201A,0x0192,0x201E,0x2026,0x2020,0x2021, +0x02C6,0x2030,0x0160,0x2039,0x0152,0x0000,0x017D,0x0000, +0x0000,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014, +0x02DC,0x2122,0x0161,0x203A,0x0153,0x0000,0x017E,0x0178, +0x00A0,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7, +0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF, +0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7, +0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF, +0x00C0,0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7, +0x00C8,0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF, +0x00D0,0x00D1,0x00D2,0x00D3,0x00D4,0x00D5,0x00D6,0x00D7, +0x00D8,0x00D9,0x00DA,0x00DB,0x00DC,0x00DD,0x00DE,0x00DF, +0x00E0,0x00E1,0x00E2,0x00E3,0x00E4,0x00E5,0x00E6,0x00E7, +0x00E8,0x00E9,0x00EA,0x00EB,0x00EC,0x00ED,0x00EE,0x00EF, +0x00F0,0x00F1,0x00F2,0x00F3,0x00F4,0x00F5,0x00F6,0x00F7, +0x00F8,0x00F9,0x00FA,0x00FB,0x00FC,0x00FD,0x00FE,0x00FF +}; +unsigned char pl00[256]={ +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07, +0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17, +0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27, +0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37, +0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47, +0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57, +0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67, +0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77, +0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7, +0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7, +0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7, +0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7, +0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7, +0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7, +0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; +unsigned char pl01[256]={ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x8C,0x9C,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x8A,0x9A,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x9F,0x00,0x00,0x00,0x00,0x8E,0x9E,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x83,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +}; +unsigned char pl02[256]={ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x98,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +}; +unsigned char pl20[256]={ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x96,0x97,0x00,0x00,0x00, +0x91,0x92,0x82,0x00,0x93,0x94,0x84,0x00, +0x86,0x87,0x95,0x00,0x00,0x00,0x85,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x89,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x8B,0x9B,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +}; +unsigned char pl21[256]={ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x99,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +}; +unsigned char *uni_to_cs[256]={ +pl00,pl01,pl02,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +pl20,pl21,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL +}; static -int my_mb_wc_latin1(CHARSET_INFO *cs __attribute__((unused)), - my_wc_t *wc, - const unsigned char *str, - const unsigned char *end) +int my_mb_wc_latin1(CHARSET_INFO *cs __attribute__((unused)), + my_wc_t *wc, + const unsigned char *str, + const unsigned char *end __attribute__((unused))) { if (str >= end) return MY_CS_TOOFEW(0); - return ((wc[0]= latin1_uni[*str]) || (!str[0])) ? 1 : MY_CS_ILSEQ; + *wc=cs_to_uni[*str]; + return (!wc[0] && str[0]) ? MY_CS_ILSEQ : 1; } static -int my_wc_mb_latin1(CHARSET_INFO *cs __attribute__((unused)), - my_wc_t wc, - unsigned char *str, - unsigned char *end) +int my_wc_mb_latin1(CHARSET_INFO *cs __attribute__((unused)), + my_wc_t wc, + unsigned char *str, + unsigned char *end __attribute__((unused))) { + unsigned char *pl; + if (str >= end) return MY_CS_TOOSMALL; - - return ((wc < 256) && ((str[0]=uni_latin1[wc]) || (!wc))) ? 1 : MY_CS_ILUNI; + + pl= uni_to_cs[(wc>>8) & 0xFF]; + str[0]= pl ? pl[wc & 0xFF] : '\0'; + return (!str[0] && wc) ? MY_CS_ILUNI : 1; } static MY_CHARSET_HANDLER my_charset_handler= @@ -212,7 +416,7 @@ CHARSET_INFO my_charset_latin1= to_lower_latin1, to_upper_latin1, sort_order_latin1, - latin1_uni, /* tab_to_uni */ + cs_to_uni, /* tab_to_uni */ NULL, /* tab_from_uni */ "","", 1, /* strxfrm_multiply */ @@ -489,7 +693,7 @@ CHARSET_INFO my_charset_latin1_german2_ci= to_lower_latin1, to_upper_latin1, sort_order_latin1_de, - latin1_uni, /* tab_to_uni */ + cs_to_uni, /* tab_to_uni */ NULL, /* tab_from_uni */ "","", 2, /* strxfrm_multiply */ @@ -513,7 +717,7 @@ CHARSET_INFO my_charset_latin1_bin= to_lower_latin1, to_upper_latin1, sort_order_latin1_de, - latin1_uni, /* tab_to_uni */ + cs_to_uni, /* tab_to_uni */ NULL, /* tab_from_uni */ "", "", diff --git a/strings/ctype-sjis.c b/strings/ctype-sjis.c index 68cd77f96fc..5f413305c88 100644 --- a/strings/ctype-sjis.c +++ b/strings/ctype-sjis.c @@ -4474,6 +4474,11 @@ my_wc_mb_sjis(CHARSET_INFO *cs __attribute__((unused)), if ((int) wc < 0x80) { + if (wc == 0x5c) + { + code= 0x815f; + goto mb; + } s[0]= (uchar) wc; return 1; } @@ -4486,7 +4491,8 @@ my_wc_mb_sjis(CHARSET_INFO *cs __attribute__((unused)), s[0]= code; return 1; } - + +mb: if (s+2>e) return MY_CS_TOOSMALL; diff --git a/strings/dump_map.c b/strings/dump_map.c index f999160d0d4..708d9139f3c 100644 --- a/strings/dump_map.c +++ b/strings/dump_map.c @@ -1,13 +1,15 @@ #include #include -static void print_short_array(unsigned short *a) +static void print_short_array(unsigned short *a, size_t width) { int i; printf("{\n"); for (i=0; i<=0xFF; i++) { - printf("0x%04X%s%s",(int)a[i],i<0xFF?",":"",(i+1) % 8 ? "" :"\n"); + const char *fmt= (width==4) ? "0x%04X" : "0x%02X"; + printf(fmt,(int)a[i]); + printf("%s%s",i<0xFF?",":"",(i+1) % 8 ? "" :"\n"); } printf("};\n"); @@ -41,7 +43,7 @@ int main(void) } printf("unsigned short cs_to_uni[256]="); - print_short_array(touni); + print_short_array(touni, 4); for (i=0;i<=0xFF;i++) { @@ -53,7 +55,7 @@ int main(void) if (fromstat[i]) { printf("unsigned char pl%02X[256]=",i); - print_short_array(fromuni+i*256); + print_short_array(fromuni+i*256, 2); } } From 8d9ce860ba1d78705e42a639eb988b5223f88ac8 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 May 2004 12:51:42 +0300 Subject: [PATCH 040/162] InnoDB: Replace ut_strdup() with mem_strdup() innobase/include/ut0mem.h: Remove ut_strdup(), as it is a clone of mem_strdup() innobase/os/os0file.c: Replace ut_strdup() with mem_strdup() innobase/ut/ut0mem.c: Remove ut_strdup(), as it is a clone of mem_strdup() --- innobase/include/ut0mem.h | 10 ---------- innobase/os/os0file.c | 6 +++--- innobase/ut/ut0mem.c | 24 ------------------------ 3 files changed, 3 insertions(+), 37 deletions(-) diff --git a/innobase/include/ut0mem.h b/innobase/include/ut0mem.h index b208fac8691..bfc937eb212 100644 --- a/innobase/include/ut0mem.h +++ b/innobase/include/ut0mem.h @@ -129,16 +129,6 @@ ut_str_catenate( char* str1, /* in: null-terminated string */ char* str2); /* in: null-terminated string */ -/************************************************************************** -Return a copy of the given string. The returned string must be freed -using mem_free. */ - -char* -ut_strdup( -/*======*/ - /* out, own: cnull-terminated string */ - char* str); /* in: null-terminated string */ - #ifndef UNIV_NONINL #include "ut0mem.ic" #endif diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index 3f14a2158ed..aad8a911fd5 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -2314,18 +2314,18 @@ os_file_dirname( if (last_slash < 0) { /* no slash in the path, return "." */ - return(ut_strdup((char*)".")); + return(mem_strdup(".")); } /* ok, there is a slash */ if (last_slash == 0) { /* last slash is the first char of the path */ - return(ut_strdup((char*)"/")); + return(mem_strdup("/")); } /* non-trivial directory component */ - dir = ut_strdup(path); + dir = mem_strdup(path); dir[last_slash] = 0; return(dir); diff --git a/innobase/ut/ut0mem.c b/innobase/ut/ut0mem.c index 9d0e63e6099..f21bb752fac 100644 --- a/innobase/ut/ut0mem.c +++ b/innobase/ut/ut0mem.c @@ -299,27 +299,3 @@ ut_str_catenate( return(str); } - -/************************************************************************** -Return a copy of the given string. The returned string must be freed -using mem_free. */ - -char* -ut_strdup( -/*======*/ - /* out, own: cnull-terminated string */ - char* str) /* in: null-terminated string */ -{ - ulint len; - char* copy; - - len = ut_strlen(str); - - copy = mem_alloc(len + 1); - - ut_memcpy(copy, str, len); - - copy[len] = 0; - - return(copy); -} From 76bc67711723bfa0eeda33798c706d9e333bbb30 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 May 2004 12:19:37 +0200 Subject: [PATCH 041/162] bug#3612 - Item_func_div set decimals incorrectly --- mysql-test/r/type_float.result | 15 +++++++++++++++ mysql-test/t/type_float.test | 8 ++++++++ sql/item_func.cc | 1 + 3 files changed, 24 insertions(+) diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result index e85bced353a..c9996e9c9f3 100644 --- a/mysql-test/r/type_float.result +++ b/mysql-test/r/type_float.result @@ -67,6 +67,21 @@ select min(a) from t1; min(a) -0.010 drop table t1; +create table t1 (c1 double, c2 varchar(20)); +insert t1 values (121,"16"); +select c1 + c1 * (c2 / 100) as col from t1; +col +140.36 +create table t2 select c1 + c1 * (c2 / 100) as col from t1; +select * from t2; +col +140.36 +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `col` double default NULL +) TYPE=MyISAM +drop table t1,t2; create table t1 (f float, f2 float(24), f3 float(6,2), d double, d2 float(53), d3 double(10,3), de decimal, de2 decimal(6), de3 decimal(5,2), n numeric, n2 numeric(8), n3 numeric(5,6)); show full columns from t1; Field Type Null Key Default Extra Privileges diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test index 23941ad2913..65d594387b9 100644 --- a/mysql-test/t/type_float.test +++ b/mysql-test/t/type_float.test @@ -28,6 +28,14 @@ select a from t1 order by a; select min(a) from t1; drop table t1; +create table t1 (c1 double, c2 varchar(20)); +insert t1 values (121,"16"); +select c1 + c1 * (c2 / 100) as col from t1; +create table t2 select c1 + c1 * (c2 / 100) as col from t1; +select * from t2; +show create table t2; +drop table t1,t2; + # # FLOAT/DOUBLE/DECIMAL handling # diff --git a/sql/item_func.cc b/sql/item_func.cc index 9d1f784fc25..368c14cc8df 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -402,6 +402,7 @@ longlong Item_func_div::val_int() void Item_func_div::fix_length_and_dec() { decimals=max(args[0]->decimals,args[1]->decimals)+2; + set_if_smaller(decimals, NOT_FIXED_DEC); max_length=args[0]->max_length - args[0]->decimals + decimals; uint tmp=float_length(decimals); set_if_smaller(max_length,tmp); From a11e04c88bf94b669601163a794169d789bf7354 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 May 2004 12:39:00 +0200 Subject: [PATCH 042/162] out-of-bound array access fixed --- mysql-test/r/type_float.result | 12 ++++++++++++ mysql-test/t/type_float.test | 6 ++++++ sql/field.cc | 6 ++++-- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result index a0c0e0f5503..71ac229601d 100644 --- a/mysql-test/r/type_float.result +++ b/mysql-test/r/type_float.result @@ -105,6 +105,18 @@ select min(a) from t1; min(a) -0.010 drop table t1; +create table t1 (a float(200,100), b double(200,100)); +insert t1 values (1.0, 2.0); +select * from t1; +a b +1.000000000000000000000000000000 2.000000000000000000000000000000 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` float(200,30) default NULL, + `b` double(200,30) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; create table t1 (f float(54)); ERROR 42000: Incorrect column specifier for column 'f' drop table if exists t1; diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test index caccf31b32a..7d3b90aabeb 100644 --- a/mysql-test/t/type_float.test +++ b/mysql-test/t/type_float.test @@ -54,6 +54,12 @@ select a from t1 order by a; select min(a) from t1; drop table t1; +create table t1 (a float(200,100), b double(200,100)); +insert t1 values (1.0, 2.0); +select * from t1; +show create table t1; +drop table t1; + # Errors --error 1063 diff --git a/sql/field.cc b/sql/field.cc index fdf314972c8..edaa29dbaa0 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -2307,7 +2307,8 @@ int Field_float::store(double nr) } else { - max_value= (log_10[field_length]-1)/log_10[dec]; + uint tmp=min(field_length,array_elements(log_10)-1); + max_value= (log_10[tmp]-1)/log_10[dec]; /* The following comparison is needed to not get an overflow if nr is close to FLT_MAX @@ -2607,7 +2608,8 @@ int Field_double::store(double nr) } else { - max_value= (log_10[field_length]-1)/log_10[dec]; + uint tmp=min(field_length,array_elements(log_10)-1); + max_value= (log_10[tmp]-1)/log_10[dec]; if (fabs(nr) < DBL_MAX/10.0e+32) nr= floor(nr*log_10[dec]+0.5)/log_10[dec]; } From ce2d84ce40571d7bdff9ed9d1237a78b66729e30 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 May 2004 14:31:43 +0200 Subject: [PATCH 043/162] updated with HAV_ symbols in ndb_global --- ndb/include/ndb_global.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/ndb/include/ndb_global.h b/ndb/include/ndb_global.h index 028f1fdeea4..d79ffc07566 100644 --- a/ndb/include/ndb_global.h +++ b/ndb/include/ndb_global.h @@ -7,13 +7,24 @@ #include #include #include +#ifdef HAVE_STDARG_H #include +#endif +#ifdef TIME_WITH_SYS_TIME #include +#endif +#ifdef HAVE_FCNTL_H #include +#endif #include +#ifdef HAVE_SYS_STAT_H #include - -#ifndef NDB_MACOSX +#endif +#include +#ifdef HAVE_SYS_WAIT_H +#include +#endif +#ifdef HAVE_SYS_MMAN_H #include #endif From f23d1ad6c2f2fb9e4e6204936eb07e902320f03d Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 May 2004 14:39:17 +0200 Subject: [PATCH 044/162] lots of HAVE_ and some ndb_global fixes for ndb subtree ndb/include/portlib/NdbTCP.h: introduced ndb_net.h ndb/include/portlib/NdbThread.h: ndb_global ndb/src/common/portlib/unix/NdbCondition.c: Used HAVE_CLOCK_GETTIME ndb/src/common/portlib/unix/NdbMem.c: used HAVE_MLOCKALL ndb/src/common/portlib/unix/NdbSleep.c: ndb_global ndb/src/common/portlib/unix/NdbThread.c: . ndb/src/common/portlib/unix/NdbTick.c: HAVE_CLOCK_GETTIME ndb/src/kernel/vm/Emulator.cpp: ndb_global --- ndb/include/ndb_net.h | 7 ++++ ndb/include/portlib/NdbTCP.h | 12 +----- ndb/include/portlib/NdbThread.h | 3 +- ndb/src/common/portlib/unix/NdbCondition.c | 49 ++++------------------ ndb/src/common/portlib/unix/NdbMem.c | 8 ++-- ndb/src/common/portlib/unix/NdbSleep.c | 12 +----- ndb/src/common/portlib/unix/NdbThread.c | 5 +-- ndb/src/common/portlib/unix/NdbTick.c | 10 ++--- ndb/src/kernel/vm/Emulator.cpp | 6 --- 9 files changed, 29 insertions(+), 83 deletions(-) create mode 100644 ndb/include/ndb_net.h diff --git a/ndb/include/ndb_net.h b/ndb/include/ndb_net.h new file mode 100644 index 00000000000..279beb471a7 --- /dev/null +++ b/ndb/include/ndb_net.h @@ -0,0 +1,7 @@ + +#ifndef NDBNET_H +#define NDBNET_H + +#include + +#endif diff --git a/ndb/include/portlib/NdbTCP.h b/ndb/include/portlib/NdbTCP.h index e7538b1ed7f..04a52c7d033 100644 --- a/ndb/include/portlib/NdbTCP.h +++ b/ndb/include/portlib/NdbTCP.h @@ -18,6 +18,7 @@ #define NDB_TCP_H #include +#include #if defined NDB_OSE || defined NDB_SOFTOSE /** @@ -45,10 +46,6 @@ typedef int socklen_t; /** * Include files needed */ -#include -#include -#include - #include #define NDB_NONBLOCK O_NONBLOCK @@ -75,12 +72,7 @@ typedef int socklen_t; #endif -#ifndef NDB_MACOSX -#define NDB_SOCKLEN_T socklen_t -#else -#define NDB_SOCKLEN_T int -#endif - +#define NDB_SOCKLEN_T SOCKET_SIZE_TYPE #ifdef __cplusplus extern "C" { diff --git a/ndb/include/portlib/NdbThread.h b/ndb/include/portlib/NdbThread.h index 516022903e3..212f7de9384 100644 --- a/ndb/include/portlib/NdbThread.h +++ b/ndb/include/portlib/NdbThread.h @@ -17,8 +17,7 @@ #ifndef NDB_THREAD_H #define NDB_THREAD_H -#include - +#include #ifdef __cplusplus extern "C" { diff --git a/ndb/src/common/portlib/unix/NdbCondition.c b/ndb/src/common/portlib/unix/NdbCondition.c index 024c6b433f3..9615e107d0c 100644 --- a/ndb/src/common/portlib/unix/NdbCondition.c +++ b/ndb/src/common/portlib/unix/NdbCondition.c @@ -61,7 +61,6 @@ NdbCondition_Wait(struct NdbCondition* p_cond, return result; } -#if defined NDB_SOLARIS || defined NDB_HPUX #include int NdbCondition_WaitTimeout(struct NdbCondition* p_cond, @@ -74,7 +73,16 @@ NdbCondition_WaitTimeout(struct NdbCondition* p_cond, if (p_cond == NULL || p_mutex == NULL) return 1; +#ifdef HAVE_CLOCK_GETTIME clock_gettime(CLOCK_REALTIME, &abstime); +#else + { + struct timeval tick_time; + gettimeofday(&tick_time, 0); + abstime.tv_sec = tick_time.tv_sec; + abstime.tv_nsec = tick_time.tv_usec * 1000; + } +#endif if(msecs >= 1000){ secs = msecs / 1000; @@ -92,45 +100,6 @@ NdbCondition_WaitTimeout(struct NdbCondition* p_cond, return result; } -#endif - -#if defined NDB_LINUX || defined NDB_MACOSX -#include -#include - -int -NdbCondition_WaitTimeout(struct NdbCondition* p_cond, - NdbMutex* p_mutex, - int msecs){ - int result; - struct timespec abstime; - struct timeval tick_time; - int secs = 0; - - if (p_cond == NULL || p_mutex == NULL) - return 1; - - gettimeofday(&tick_time, 0); - - if(msecs >= 1000){ - secs = msecs / 1000; - msecs = msecs % 1000; - } - - - abstime.tv_sec = tick_time.tv_sec + secs; - abstime.tv_nsec = tick_time.tv_usec * 1000 + msecs * 1000000; - if (abstime.tv_nsec >= 1000000000) { - abstime.tv_sec += 1; - abstime.tv_nsec -= 1000000000; - } - - result = pthread_cond_timedwait(&p_cond->cond, p_mutex, &abstime); - - return result; -} -#endif - int NdbCondition_Signal(struct NdbCondition* p_cond){ diff --git a/ndb/src/common/portlib/unix/NdbMem.c b/ndb/src/common/portlib/unix/NdbMem.c index aa3663e064f..4ddb5b52ecd 100644 --- a/ndb/src/common/portlib/unix/NdbMem.c +++ b/ndb/src/common/portlib/unix/NdbMem.c @@ -54,16 +54,16 @@ void NdbMem_Free(void* ptr) int NdbMem_MemLockAll(){ -#if defined NDB_MACOSX - return 0; +#ifdef HAVE_MLOCKALL + return -1; #else return mlockall(MCL_CURRENT); #endif } int NdbMem_MemUnlockAll(){ -#if defined NDB_MACOSX - return 0; +#ifdef HAVE_MLOCKALL + return -1; #else return munlockall(); #endif diff --git a/ndb/src/common/portlib/unix/NdbSleep.c b/ndb/src/common/portlib/unix/NdbSleep.c index 35132d7f9c7..8702a25d1b1 100644 --- a/ndb/src/common/portlib/unix/NdbSleep.c +++ b/ndb/src/common/portlib/unix/NdbSleep.c @@ -15,19 +15,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include "NdbSleep.h" - -#ifdef NDB_SOLARIS -#include -#include -#endif - -#if defined NDB_LINUX || defined NDB_HPUX || defined NDB_MACOSX -#include -#include -#endif - int NdbSleep_MilliSleep(int milliseconds){ int result = 0; diff --git a/ndb/src/common/portlib/unix/NdbThread.c b/ndb/src/common/portlib/unix/NdbThread.c index dbb3da03eab..7f043bef56e 100644 --- a/ndb/src/common/portlib/unix/NdbThread.c +++ b/ndb/src/common/portlib/unix/NdbThread.c @@ -16,9 +16,8 @@ #include - -#include "NdbThread.h" -#include +#include +#include #define MAX_THREAD_NAME 16 diff --git a/ndb/src/common/portlib/unix/NdbTick.c b/ndb/src/common/portlib/unix/NdbTick.c index f4cda6449d6..d8f0b6ec27a 100644 --- a/ndb/src/common/portlib/unix/NdbTick.c +++ b/ndb/src/common/portlib/unix/NdbTick.c @@ -15,8 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include "NdbTick.h" -#include #define NANOSEC_PER_SEC 1000000000 #define MICROSEC_PER_SEC 1000000 @@ -25,7 +25,7 @@ #define MILLISEC_PER_NANOSEC 1000000 -#if defined NDB_SOLARIS || NDB_HPUX +#ifdef HAVE_CLOCK_GETTIME NDB_TICKS NdbTick_CurrentMillisecond(void) { struct timespec tick_time; @@ -44,11 +44,7 @@ NdbTick_CurrentMicrosecond(NDB_TICKS * secs, Uint32 * micros){ * micros = t.tv_nsec / 1000; return res; } -#endif - -#if defined NDB_LINUX || NDB_MACOSX -#include -#include +#else NDB_TICKS NdbTick_CurrentMillisecond(void) { struct timeval tick_time; diff --git a/ndb/src/kernel/vm/Emulator.cpp b/ndb/src/kernel/vm/Emulator.cpp index 7eae1f519c0..0d6d3f55acb 100644 --- a/ndb/src/kernel/vm/Emulator.cpp +++ b/ndb/src/kernel/vm/Emulator.cpp @@ -39,12 +39,6 @@ extern "C" { extern void (* ndb_new_handler)(); } - -#if defined (NDB_LINUX) || defined (NDB_SOLARIS) -#include -#include -#endif - /** * Declare the global variables */ From 23b508378858bb9570ba1981e7312d88ac23f521 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 May 2004 21:25:16 +0200 Subject: [PATCH 045/162] cpcd - setsid - angle fixes ndb/src/cw/cpcd/Process.cpp: Write pgrp in pid-file Always operate on process group instead of process ndb/src/mgmclient/test_cpcd/test_cpcd.cpp: Test using different programs --- ndb/src/cw/cpcd/Process.cpp | 41 +++++++++++------------ ndb/src/mgmclient/test_cpcd/test_cpcd.cpp | 14 +++++--- 2 files changed, 30 insertions(+), 25 deletions(-) diff --git a/ndb/src/cw/cpcd/Process.cpp b/ndb/src/cw/cpcd/Process.cpp index 76639a2a618..8a79669937d 100644 --- a/ndb/src/cw/cpcd/Process.cpp +++ b/ndb/src/cw/cpcd/Process.cpp @@ -110,7 +110,7 @@ CPCD::Process::isRunning() { } /* Check if there actually exists a process with such a pid */ errno = 0; - int s = kill((pid_t) m_pid, 0); /* Sending "signal" 0 to a process only + int s = kill((pid_t)-m_pid, 0); /* Sending "signal" 0 to a process only * checkes if the process actually exists */ if(s != 0) { switch(errno) { @@ -127,7 +127,6 @@ CPCD::Process::isRunning() { } return false; } - return true; } @@ -149,7 +148,6 @@ CPCD::Process::readPid() { f = fopen(filename, "r"); if(f == NULL){ - logger.debug("readPid - %s not found", filename); return -1; /* File didn't exist */ } @@ -358,7 +356,7 @@ CPCD::Process::start() { switch(pid = fork()) { case 0: /* Child */ setsid(); - writePid(getpid()); + writePid(getpgrp()); if(runas(m_runas.c_str()) == 0){ do_exec(); } @@ -383,11 +381,10 @@ CPCD::Process::start() { switch(fork()) { case 0: /* Child */ signal(SIGCHLD, SIG_IGN); - pid_t pid; switch(pid = fork()) { case 0: /* Child */ setsid(); - writePid(getpid()); + writePid(getpgrp()); if(runas(m_runas.c_str()) != 0){ _exit(1); } @@ -421,13 +418,16 @@ CPCD::Process::start() { logger.critical("Unknown process type"); return -1; } - + while(readPid() < 0){ sched_yield(); } - if(pid != -1 && pid != m_pid){ - logger.error("pid and m_pid don't match: %d %d", pid, m_pid); + errno = 0; + pid_t pgid = getpgid(pid); + + if(pgid != -1 && pgid != m_pid){ + logger.error("pgid and m_pid don't match: %d %d (%d)", pgid, m_pid, pid); } if(isRunning()){ @@ -446,33 +446,32 @@ CPCD::Process::stop() { unlink(filename); if(m_pid <= 1){ - logger.critical("Stopping process with bogus pid: %d", m_pid); + logger.critical("Stopping process with bogus pid: %d id: %d", + m_pid, m_id); return; } m_status = STOPPING; - - const pid_t pgid = - getpgid(m_pid); - int ret = kill(pgid, SIGTERM); + + errno = 0; + int ret = kill(-m_pid, SIGTERM); switch(ret) { case 0: - logger.debug("Sent SIGTERM to pid %d", (int)pgid); + logger.debug("Sent SIGTERM to pid %d", (int)-m_pid); break; default: - logger.debug("kill pid: %d : %s", (int)pgid, strerror(errno)); + logger.debug("kill pid: %d : %s", (int)-m_pid, strerror(errno)); break; } - errno = 0; - ret = kill(pgid, 0); - if(ret == 0) { + if(isRunning()){ errno = 0; - ret = kill(pgid, SIGKILL); + ret = kill(-m_pid, SIGKILL); switch(ret) { case 0: - logger.debug("Sent SIGKILL to pid %d", (int)pgid); + logger.debug("Sent SIGKILL to pid %d", (int)-m_pid); break; default: - logger.debug("kill pid: %d : %s\n", (int)pgid, strerror(errno)); + logger.debug("kill pid: %d : %s\n", (int)-m_pid, strerror(errno)); break; } } diff --git a/ndb/src/mgmclient/test_cpcd/test_cpcd.cpp b/ndb/src/mgmclient/test_cpcd/test_cpcd.cpp index 9ffd5ed6201..32f0adbcf26 100644 --- a/ndb/src/mgmclient/test_cpcd/test_cpcd.cpp +++ b/ndb/src/mgmclient/test_cpcd/test_cpcd.cpp @@ -88,10 +88,16 @@ void define(){ //proc.m_proc.m_stdout = "log.out"; //proc.m_proc.m_stderr = "2>&1"; //proc.m_proc.m_runas = proc.m_host->m_user; - //proc.m_proc.m_ulimit = "c:unlimited"; - m_proc.m_name.assfmt("%d-%d-%s", getpid(), name++, "test"); - m_proc.m_path.assign("/bin/sleep"); - m_proc.m_args = "600"; + m_proc.m_ulimit = "c:unlimited"; + if((rand() & 15) >= 0){ + m_proc.m_name.assfmt("%d-%d-%s", getpid(), name++, "sleep"); + m_proc.m_path.assign("/bin/sleep"); + m_proc.m_args = "600"; + } else { + m_proc.m_name.assfmt("%d-%d-%s", getpid(), name++, "test.sh"); + m_proc.m_path.assign("/home/jonas/run/cpcd/test.sh"); + m_proc.m_args = "600"; + } g_procs.push_back(m_proc); Properties reply; From c8875d5693b628b373e46762a752238ae6a15527 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 May 2004 22:23:29 +0200 Subject: [PATCH 046/162] Inverted #ifdef on HAVE_MLOCKALL BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + ndb/src/common/portlib/unix/NdbMem.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index 35ea9b2f778..809450042a1 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -112,6 +112,7 @@ mwagner@work.mysql.com mydev@mysql.com mysql@home.(none) mysqldev@build.mysql2.com +ndbdev@ndbmaster.mysql.com nick@mysql.com nick@nick.leippe.com papa@gbichot.local diff --git a/ndb/src/common/portlib/unix/NdbMem.c b/ndb/src/common/portlib/unix/NdbMem.c index 4ddb5b52ecd..ce422f45a9d 100644 --- a/ndb/src/common/portlib/unix/NdbMem.c +++ b/ndb/src/common/portlib/unix/NdbMem.c @@ -54,7 +54,7 @@ void NdbMem_Free(void* ptr) int NdbMem_MemLockAll(){ -#ifdef HAVE_MLOCKALL +#ifndef HAVE_MLOCKALL return -1; #else return mlockall(MCL_CURRENT); @@ -62,7 +62,7 @@ int NdbMem_MemLockAll(){ } int NdbMem_MemUnlockAll(){ -#ifdef HAVE_MLOCKALL +#ifndef HAVE_MLOCKALL return -1; #else return munlockall(); From d3fcd8d4c0e0425433924987afbd5b43bec8e93e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 May 2004 00:29:52 +0300 Subject: [PATCH 047/162] Don't automaticly generate a new key for a foreign key constraint if there is already a usable key. Prefer not automatic keys before automatic keys. If there is two conf BitKeeper/etc/ignore: added *.d include/my_base.h: Added flag for automaticly generated key mysql-test/r/constraints.result: Update tests after bug fix mysql-test/r/create.result: Update tests after bug fix mysql-test/r/innodb.result: Added test of automatic creation of foreign keys mysql-test/t/innodb.test: Added test of automatic creation of foreign keys mysql-test/t/key_cache.test: Portability fixes (64 BIT os) sql/sql_acl.cc: Indentation fixes sql/sql_class.cc: Fix key comparison to handle prefix and optionally key segments in different order. sql/sql_class.h: Added flag for automaticly generated keys sql/sql_parse.cc: Added flag for automaticly generated keys sql/sql_table.cc: Don't automaticly generate a new key for a foreign key constraint if there is already a usable key. Prefer not automatic keys before automatic keys. If there is two conflicting automatic keys, prefer the longer one. sql/sql_yacc.yy: Added flag for automaticly generated keys strings/strings-x86.s: Portability fix. --- .bzrignore | 5 ++ include/my_base.h | 2 +- mysql-test/r/constraints.result | 4 +- mysql-test/r/create.result | 32 ++++++++++- mysql-test/r/innodb.result | 99 +++++++++++++++++++++++++++++++++ mysql-test/t/innodb.test | 43 ++++++++++++++ mysql-test/t/key_cache.test | 6 +- sql/sql_acl.cc | 8 ++- sql/sql_class.cc | 79 ++++++++++++++++++++------ sql/sql_class.h | 10 ++-- sql/sql_parse.cc | 4 +- sql/sql_table.cc | 39 +++++++++---- sql/sql_yacc.yy | 12 ++-- strings/strings-x86.s | 4 +- 14 files changed, 298 insertions(+), 49 deletions(-) diff --git a/.bzrignore b/.bzrignore index ab096c20d6e..d116fd29c41 100644 --- a/.bzrignore +++ b/.bzrignore @@ -774,3 +774,8 @@ ndb/lib/libndbclient.so ndb/lib/libndbclient_extra.so libmysqld/discover.cc include/readline +ndb/config/autom4te.cache/* +ndb/config/config.mk +ndb/src/common/mgmcommon/printConfig/*.d +ndb/src/mgmclient/test_cpcd/*.d +*.d diff --git a/include/my_base.h b/include/my_base.h index 54c739bde23..4a2f3f85083 100644 --- a/include/my_base.h +++ b/include/my_base.h @@ -191,7 +191,7 @@ enum ha_base_keytype { #define HA_UNIQUE_CHECK 256 /* Check the key for uniqueness */ #define HA_SPATIAL 1024 /* For spatial search */ #define HA_NULL_ARE_EQUAL 2048 /* NULL in key are cmp as equal */ - +#define HA_GENERATED_KEY 8192 /* Automaticly generated key */ /* Automatic bits in key-flag */ diff --git a/mysql-test/r/constraints.result b/mysql-test/r/constraints.result index e2fb0607819..d4d525c8991 100644 --- a/mysql-test/r/constraints.result +++ b/mysql-test/r/constraints.result @@ -22,6 +22,8 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) default NULL, - UNIQUE KEY `constraint_1` (`a`) + UNIQUE KEY `constraint_1` (`a`), + UNIQUE KEY `key_1` (`a`), + UNIQUE KEY `key_2` (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index 81a222c482a..b5f7da30bb3 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -155,7 +155,37 @@ t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL default '0', `b` int(11) default NULL, PRIMARY KEY (`a`), - KEY `b` (`b`) + KEY `b` (`b`), + KEY `b_2` (`b`), + KEY `b_3` (`b`), + KEY `b_4` (`b`), + KEY `b_5` (`b`), + KEY `b_6` (`b`), + KEY `b_7` (`b`), + KEY `b_8` (`b`), + KEY `b_9` (`b`), + KEY `b_10` (`b`), + KEY `b_11` (`b`), + KEY `b_12` (`b`), + KEY `b_13` (`b`), + KEY `b_14` (`b`), + KEY `b_15` (`b`), + KEY `b_16` (`b`), + KEY `b_17` (`b`), + KEY `b_18` (`b`), + KEY `b_19` (`b`), + KEY `b_20` (`b`), + KEY `b_21` (`b`), + KEY `b_22` (`b`), + KEY `b_23` (`b`), + KEY `b_24` (`b`), + KEY `b_25` (`b`), + KEY `b_26` (`b`), + KEY `b_27` (`b`), + KEY `b_28` (`b`), + KEY `b_29` (`b`), + KEY `b_30` (`b`), + KEY `b_31` (`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 select if(1,'1','0'), month("2002-08-02"); diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 07445cc86d7..60280715911 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -371,6 +371,7 @@ t1 0 PRIMARY 2 b A # NULL NULL BTREE t1 0 c 1 c A # NULL NULL BTREE t1 0 b 1 b A # NULL NULL BTREE t1 1 a 1 a A # NULL NULL BTREE +t1 1 a_2 1 a A # NULL NULL BTREE drop table t1; create table t1 (col1 int not null, col2 char(4) not null, primary key(col1)); alter table t1 engine=innodb; @@ -1442,3 +1443,101 @@ drop table t1; create table t1 (a int) engine=innodb; create table t2 like t1; drop table t1,t2; +create table t1 (id int(11) not null, id2 int(11) not null, unique (id,id2)) engine=innodb; +create table t2 (id int(11) not null, constraint t1_id_fk foreign key ( id ) references t1 (id)) engine = innodb; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL default '0', + `id2` int(11) NOT NULL default '0', + UNIQUE KEY `id` (`id`,`id2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + KEY `t1_id_fk` (`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +create index id on t2 (id); +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + KEY `id` (`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +create index id2 on t2 (id); +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + KEY `id` (`id`), + KEY `id2` (`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop index id2 on t2; +drop index id on t2; +Got one of the listed errors +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + KEY `id` (`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id,id2) references t1 (id,id2)) engine = innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + `id2` int(11) NOT NULL default '0', + KEY `t1_id_fk` (`id`,`id2`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`, `id2`) REFERENCES `t1` (`id`, `id2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +create unique index id on t2 (id,id2); +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + `id2` int(11) NOT NULL default '0', + UNIQUE KEY `id` (`id`,`id2`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`, `id2`) REFERENCES `t1` (`id`, `id2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2),constraint t1_id_fk foreign key (id2,id) references t1 (id,id2)) engine = innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + `id2` int(11) NOT NULL default '0', + UNIQUE KEY `id` (`id`,`id2`), + KEY `t1_id_fk` (`id2`,`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id2`, `id`) REFERENCES `t1` (`id`, `id2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2), constraint t1_id_fk foreign key (id) references t1 (id)) engine = innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + `id2` int(11) NOT NULL default '0', + UNIQUE KEY `id` (`id`,`id2`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2),constraint t1_id_fk foreign key (id2,id) references t1 (id,id2)) engine = innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + `id2` int(11) NOT NULL default '0', + UNIQUE KEY `id` (`id`,`id2`), + KEY `t1_id_fk` (`id2`,`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id2`, `id`) REFERENCES `t1` (`id`, `id2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb; +ERROR HY000: Can't create table './test/t2.frm' (errno: 150) +drop table t1; diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index e20be83b4b6..a260ab1263d 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -1044,3 +1044,46 @@ drop table t1; create table t1 (a int) engine=innodb; create table t2 like t1; drop table t1,t2; + +# +# Test of automaticly created foreign keys +# + +create table t1 (id int(11) not null, id2 int(11) not null, unique (id,id2)) engine=innodb; +create table t2 (id int(11) not null, constraint t1_id_fk foreign key ( id ) references t1 (id)) engine = innodb; +show create table t1; +show create table t2; +create index id on t2 (id); +show create table t2; +create index id2 on t2 (id); +show create table t2; +drop index id2 on t2; +--error 1025,1025 +drop index id on t2; +show create table t2; +drop table t2; + +create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id,id2) references t1 (id,id2)) engine = innodb; +show create table t2; +create unique index id on t2 (id,id2); +show create table t2; +drop table t2; + +# Check foreign key columns created in different order than key columns +create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2),constraint t1_id_fk foreign key (id2,id) references t1 (id,id2)) engine = innodb; +show create table t2; +drop table t2; + +create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2), constraint t1_id_fk foreign key (id) references t1 (id)) engine = innodb; +show create table t2; +drop table t2; + +create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2),constraint t1_id_fk foreign key (id2,id) references t1 (id,id2)) engine = innodb; +show create table t2; +drop table t2; + +# Test error handling +--error 1005 +create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb; + +drop table t1; diff --git a/mysql-test/t/key_cache.test b/mysql-test/t/key_cache.test index b45df8eb58e..9d3125efa61 100644 --- a/mysql-test/t/key_cache.test +++ b/mysql-test/t/key_cache.test @@ -71,7 +71,7 @@ show status like 'key_blocks_used'; # Following results differs on 64 and 32 bit systems because of different # pointer sizes, which takes up different amount of space in key cache ---replace_result 1812 KEY_BLOCKS_UNUSED 1793 KEY_BLOCKS_UNUSED +--replace_result 1812 KEY_BLOCKS_UNUSED 1793 KEY_BLOCKS_UNUSED 1674 KEY_BLOCKS_UNUSED 1818 KEY_BLOCKS_UNUSED show status like 'key_blocks_unused'; insert into t1 values (1, 'qqqq'), (11, 'yyyy'); @@ -84,7 +84,7 @@ update t1 set p=2 where p=1; update t2 set i=2 where i=1; show status like 'key_blocks_used'; ---replace_result 1808 KEY_BLOCKS_UNUSED 1789 KEY_BLOCKS_UNUSED +--replace_result 1808 KEY_BLOCKS_UNUSED 1789 KEY_BLOCKS_UNUSED 1670 KEY_BLOCKS_UNUSED 1814 KEY_BLOCKS_UNUSED show status like 'key_blocks_unused'; cache index t1 key (`primary`) in keycache1; @@ -146,7 +146,7 @@ cache index t1,t2 in default; drop table t1,t2,t3; show status like 'key_blocks_used'; ---replace_result 1812 KEY_BLOCKS_UNUSED 1793 KEY_BLOCKS_UNUSED +--replace_result 1812 KEY_BLOCKS_UNUSED 1793 KEY_BLOCKS_UNUSED 1674 KEY_BLOCKS_UNUSED 1818 KEY_BLOCKS_UNUSED show status like 'key_blocks_unused'; # Cleanup diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index b2d030b523d..9c7fe3e2993 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1918,7 +1918,8 @@ static int replace_column_table(GRANT_TABLE *g_t, ulong privileges = xx->rights; bool old_row_exists=0; key_restore(table,key,0,key_length); - table->field[4]->store(xx->column.ptr(),xx->column.length(),&my_charset_latin1); + table->field[4]->store(xx->column.ptr(),xx->column.length(), + &my_charset_latin1); if (table->file->index_read(table->record[0],(byte*) table->field[0]->ptr, 0, HA_READ_KEY_EXACT)) @@ -1931,9 +1932,10 @@ static int replace_column_table(GRANT_TABLE *g_t, continue; /* purecov: inspected */ } old_row_exists = 0; - restore_record(table,default_values); // Get empty record + restore_record(table,default_values); // Get empty record key_restore(table,key,0,key_length); - table->field[4]->store(xx->column.ptr(),xx->column.length(), &my_charset_latin1); + table->field[4]->store(xx->column.ptr(),xx->column.length(), + &my_charset_latin1); } else { diff --git a/sql/sql_class.cc b/sql/sql_class.cc index f297ddf2917..03d67c4f300 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -84,26 +84,71 @@ bool key_part_spec::operator==(const key_part_spec& other) const return length == other.length && !strcmp(field_name, other.field_name); } -/* Equality comparison of keys (ignoring name) */ -bool Key::operator==(Key& other) + +/* + Test if a foreign key is a prefix of the given key + (ignoring key name, key type and order of columns) + + NOTES: + This is only used to test if an index for a FOREIGN KEY exists + + IMPLEMENTATION + We only compare field names + + RETURN + 0 Generated key is a prefix of other key + 1 Not equal +*/ + +bool foreign_key_prefix(Key *a, Key *b) { - if (type == other.type && - algorithm == other.algorithm && - columns.elements == other.columns.elements) + /* Ensure that 'a' is the generated key */ + if (a->generated) { - List_iterator col_it1(columns); - List_iterator col_it2(other.columns); - const key_part_spec *col1, *col2; - while ((col1 = col_it1++)) - { - col2 = col_it2++; - DBUG_ASSERT(col2 != NULL); - if (!(*col1 == *col2)) - return false; - } - return true; + if (b->generated && a->columns.elements > b->columns.elements) + swap(Key*, a, b); // Put shorter key in 'a' } - return false; + else + { + if (!b->generated) + return TRUE; // No foreign key + swap(Key*, a, b); // Put generated key in 'a' + } + + /* Test if 'a' is a prefix of 'b' */ + if (a->columns.elements > b->columns.elements) + return TRUE; // Can't be prefix + + List_iterator col_it1(a->columns); + List_iterator col_it2(b->columns); + const key_part_spec *col1, *col2; + +#ifdef ENABLE_WHEN_INNODB_CAN_HANDLE_SWAPED_FOREIGN_KEY_COLUMNS + while ((col1= col_it1++)) + { + bool found= 0; + col_it2.rewind(); + while ((col2= col_it2++)) + { + if (*col1 == *col2) + { + found= TRUE; + break; + } + } + if (!found) + return TRUE; // Error + } + return FALSE; // Is prefix +#else + while ((col1= col_it1++)) + { + col2= col_it2++; + if (!(*col1 == *col2)) + return TRUE; + } + return FALSE; // Is prefix +#endif } diff --git a/sql/sql_class.h b/sql/sql_class.h index a2094d8fe7c..e602b7d6d5f 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -240,14 +240,16 @@ public: enum ha_key_alg algorithm; List columns; const char *name; + bool generated; Key(enum Keytype type_par, const char *name_arg, enum ha_key_alg alg_par, - List &cols) - :type(type_par), algorithm(alg_par), columns(cols), name(name_arg) + bool generated_arg, List &cols) + :type(type_par), algorithm(alg_par), columns(cols), name(name_arg), + generated(generated_arg) {} ~Key() {} /* Equality comparison of keys (ignoring name) */ - bool operator==(Key& other); + friend bool foreign_key_prefix(Key *a, Key *b); }; class Table_ident; @@ -265,7 +267,7 @@ public: foreign_key(const char *name_arg, List &cols, Table_ident *table, List &ref_cols, uint delete_opt_arg, uint update_opt_arg, uint match_opt_arg) - :Key(FOREIGN_KEY, name_arg, HA_KEY_ALG_UNDEF, cols), + :Key(FOREIGN_KEY, name_arg, HA_KEY_ALG_UNDEF, 0, cols), ref_table(table), ref_columns(cols), delete_opt(delete_opt_arg), update_opt(update_opt_arg), match_opt(match_opt_arg) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 98f6a12ec64..e949d40625d 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -3958,13 +3958,13 @@ bool add_field_to_list(THD *thd, char *field_name, enum_field_types type, { lex->col_list.push_back(new key_part_spec(field_name,0)); lex->key_list.push_back(new Key(Key::PRIMARY, NullS, HA_KEY_ALG_UNDEF, - lex->col_list)); + 0, lex->col_list)); lex->col_list.empty(); } if (type_modifier & (UNIQUE_FLAG | UNIQUE_KEY_FLAG)) { lex->col_list.push_back(new key_part_spec(field_name,0)); - lex->key_list.push_back(new Key(Key::UNIQUE, NullS, HA_KEY_ALG_UNDEF, + lex->key_list.push_back(new Key(Key::UNIQUE, NullS, HA_KEY_ALG_UNDEF, 0, lex->col_list)); lex->col_list.empty(); } diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 55b726293c2..b90ff942cc6 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -679,14 +679,27 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, DBUG_RETURN(-1); } key_iterator2.rewind (); - while ((key2 = key_iterator2++) != key) + if (key->type != Key::FOREIGN_KEY) { - if (*key == *key2) + while ((key2 = key_iterator2++) != key) { - /* TO DO: issue warning message */ - /* mark that the key should be ignored */ - key->name=ignore_key; - break; + if ((key2->type != Key::FOREIGN_KEY && !foreign_key_prefix(key, key2))) + { + /* TO DO: issue warning message */ + /* mark that the generated key should be ignored */ + if (!key2->generated || + (key->generated && key->columns.elements < + key2->columns.elements)) + key->name= ignore_key; + else + { + /* Remove the previous, generated key */ + key2->name= ignore_key; + key_parts-= key2->columns.elements; + (*key_count)--; + } + break; + } } } if (key->name != ignore_key) @@ -731,14 +744,14 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, switch(key->type){ case Key::MULTIPLE: - key_info->flags = 0; + key_info->flags= 0; break; case Key::FULLTEXT: - key_info->flags = HA_FULLTEXT; + key_info->flags= HA_FULLTEXT; break; case Key::SPATIAL: #ifdef HAVE_SPATIAL - key_info->flags = HA_SPATIAL; + key_info->flags= HA_SPATIAL; break; #else my_printf_error(ER_FEATURE_DISABLED,ER(ER_FEATURE_DISABLED),MYF(0), @@ -749,8 +762,11 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, key_number--; // Skip this key continue; default: - key_info->flags = HA_NOSAME; + key_info->flags = HA_NOSAME; + break; } + if (key->generated) + key_info->flags|= HA_GENERATED_KEY; key_info->key_parts=(uint8) key->columns.elements; key_info->key_part=key_part_info; @@ -774,7 +790,7 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, */ /* TODO: Add proper checks if handler supports key_type and algorithm */ - if (key_info->flags == HA_SPATIAL) + if (key_info->flags & HA_SPATIAL) { if (key_info->key_parts != 1) { @@ -2824,6 +2840,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, Key::FULLTEXT : Key::MULTIPLE)), key_name, key_info->algorithm, + test(key_info->flags & HA_GENERATED_KEY), key_parts)); } { diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 0693d33c781..25344fe84cd 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -955,7 +955,7 @@ create: { LEX *lex=Lex; - lex->key_list.push_back(new Key($2,$4.str, $5, lex->col_list)); + lex->key_list.push_back(new Key($2,$4.str, $5, 0, lex->col_list)); lex->col_list.empty(); } | CREATE DATABASE opt_if_not_exists ident @@ -1187,14 +1187,15 @@ key_def: key_type opt_ident key_alg '(' key_list ')' { LEX *lex=Lex; - lex->key_list.push_back(new Key($1,$2, $3, lex->col_list)); + lex->key_list.push_back(new Key($1,$2, $3, 0, lex->col_list)); lex->col_list.empty(); /* Alloced by sql_alloc */ } | opt_constraint constraint_key_type opt_ident key_alg '(' key_list ')' { LEX *lex=Lex; const char *key_name= $3 ? $3:$1; - lex->key_list.push_back(new Key($2, key_name, $4, lex->col_list)); + lex->key_list.push_back(new Key($2, key_name, $4, 0, + lex->col_list)); lex->col_list.empty(); /* Alloced by sql_alloc */ } | opt_constraint FOREIGN KEY_SYM opt_ident '(' key_list ')' references @@ -1206,8 +1207,9 @@ key_def: lex->fk_delete_opt, lex->fk_update_opt, lex->fk_match_option)); - lex->key_list.push_back(new Key(Key::MULTIPLE, $4 ? $4:$1, - HA_KEY_ALG_UNDEF, lex->col_list)); + lex->key_list.push_back(new Key(Key::MULTIPLE, $4 ? $4 : $1, + HA_KEY_ALG_UNDEF, 1, + lex->col_list)); lex->col_list.empty(); /* Alloced by sql_alloc */ } | constraint opt_check_constraint diff --git a/strings/strings-x86.s b/strings/strings-x86.s index d316c34febb..30a7517a372 100644 --- a/strings/strings-x86.s +++ b/strings/strings-x86.s @@ -43,7 +43,9 @@ bmove_align: .ba_20: pop %esi movl %edx,%edi ret - .size bmove_align,.end-bmove_align + +.bmove_align_end: + .size bmove_align,.bmove_align_end-bmove_align # Move a string from higher to lower # Arg from_end+1,to_end+1,length From 1662e59626427c4bd5774a1d2ec8358d52cd881f Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 May 2004 15:59:20 -0700 Subject: [PATCH 048/162] Added comments to all methods. Added explanation for a sequential read through a storage engine. sql/examples/ha_example.cc: Documentation updates (lots of comments in the code). sql/examples/ha_example.h: Documenation update, lots of comments in the code. --- sql/examples/ha_example.cc | 370 ++++++++++++++++++++++++++++++++++++- sql/examples/ha_example.h | 40 +++- 2 files changed, 401 insertions(+), 9 deletions(-) diff --git a/sql/examples/ha_example.cc b/sql/examples/ha_example.cc index e2463761e67..b8ae5967475 100644 --- a/sql/examples/ha_example.cc +++ b/sql/examples/ha_example.cc @@ -14,6 +14,55 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/* + ha_example is a stubbed storage engine. It does nothing at this point. It + will let you create/open/delete tables but that is all. You can enable it + in your buld by doing the following during your build process: + ./configure --with-example-storage-engine + + Once this is done mysql will let you create tables with: + CREATE TABLE A (...) ENGINE=EXAMPLE; + + The example is setup to use table locks. It implements an example "SHARE" + that is inserted into a hash by table name. You can use this to store + information of state that any example handler object will be able to see + if it is using the same table. + + Please read the object definition in ha_example.h before reading the rest + if this file. + + To get an idea of what occurs here is an example select that would do a + scan of an entire table: + ha_example::store_lock + ha_example::external_lock + ha_example::info + ha_example::rnd_init + ha_example::extra + ENUM HA_EXTRA_CACHE Cash record in HA_rrnd() + ha_example::rnd_next + ha_example::rnd_next + ha_example::rnd_next + ha_example::rnd_next + ha_example::rnd_next + ha_example::rnd_next + ha_example::rnd_next + ha_example::rnd_next + ha_example::rnd_next + ha_example::extra + ENUM HA_EXTRA_NO_CACHE End cacheing of records (def) + ha_example::external_lock + ha_example::extra + ENUM HA_EXTRA_RESET Reset database to after open + + In the above example has 9 row called before rnd_next signalled that it was + at the end of its data. In the above example the table was already opened + (or you would have seen a call to ha_example::open(). Calls to + ha_example::extra() are hints as to what will be occuring to the request. + + Happy coding! + -Brian +*/ + #ifdef __GNUC__ #pragma implementation // gcc: Class implementation #endif @@ -24,10 +73,14 @@ #include "ha_example.h" /* Variables for example share methods */ -pthread_mutex_t example_mutex; -static HASH example_open_tables; -static int example_init= 0; +static HASH example_open_tables; // Hash used to track open tables +pthread_mutex_t example_mutex; // This is the mutex we use to init the hash +static int example_init= 0; // Variable for checking the init state of hash + +/* + Function we use in the creation of our hash to get key. +*/ static byte* example_get_key(EXAMPLE_SHARE *share,uint *length, my_bool not_used __attribute__((unused))) { @@ -37,7 +90,9 @@ static byte* example_get_key(EXAMPLE_SHARE *share,uint *length, /* - Example of simple lock controls. + Example of simple lock controls. The "share" it creates is structure we will + pass to each example handler. Do you have to have one of these? Well, you have + pieces that are used for locking, and they are needed to function. */ static EXAMPLE_SHARE *get_share(const char *table_name, TABLE *table) { @@ -45,6 +100,12 @@ static EXAMPLE_SHARE *get_share(const char *table_name, TABLE *table) uint length; char *tmp_name; + /* + So why does this exist? There is no way currently to init a storage engine. + Innodb and BDB both have modifications to the server to allow them to + do this. Since you will not want to do this, this is probably the next + best method. + */ if (!example_init) { /* Hijack a mutex for init'ing the storage engine */ @@ -101,7 +162,8 @@ error: /* - Free lock controls. + Free lock controls. We call this whenever we close a table. If the table had + the last reference to the share then we free memory associated with it. */ static int free_share(EXAMPLE_SHARE *share) { @@ -119,10 +181,24 @@ static int free_share(EXAMPLE_SHARE *share) } +/* + If frm_error() is called then we will use this to to find out what file extentions + exist for the storage engine. This is also used by the default rename_table and + delete_table method in handler.cc. +*/ const char **ha_example::bas_ext() const { static const char *ext[]= { NullS }; return ext; } +/* + Used for opening tables. The name will be the name of the file. + A table is opened when it needs to be opened. For instance + when a request comes in for a select on the table (tables are not + open and closed for each request, they are cached). + + Called from handler.cc by handler::ha_open(). The server opens all tables by + calling ha_open() which then calls the handler specific open(). +*/ int ha_example::open(const char *name, int mode, uint test_if_locked) { DBUG_ENTER("ha_example::open"); @@ -134,18 +210,66 @@ int ha_example::open(const char *name, int mode, uint test_if_locked) DBUG_RETURN(0); } + +/* + Closes a table. We call the free_share() function to free any resources + that we have allocated in the "shared" structure. + + Called from sql_base.cc, sql_select.cc, and table.cc. + In sql_select.cc it is only used to close up temporary tables or during + the process where a temporary table is converted over to being a + myisam table. + For sql_base.cc look at close_data_tables(). +*/ int ha_example::close(void) { DBUG_ENTER("ha_example::close"); DBUG_RETURN(free_share(share)); } + +/* + write_row() inserts a row. No extra() hint is given currently if a bulk load + is happeneding. buf() is a byte array of data. You can use the field + information to extract the data from the native byte array type. + Example of this would be: + for (Field **field=table->field ; *field ; field++) + { + ... + } + + See ha_tina.cc for an example of extracting all of the data as strings. + ha_berekly.cc has an example of how to store it intact by "packing" it + for ha_berkeley's own native storage type. + + See the note for update_row() on auto_increments and timestamps. This + case also applied to write_row(). + + Called from item_sum.cc, item_sum.cc, sql_acl.cc, sql_insert.cc, + sql_insert.cc, sql_select.cc, sql_table.cc, sql_udf.cc, and sql_update.cc. +*/ int ha_example::write_row(byte * buf) { DBUG_ENTER("ha_example::write_row"); DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED); } + +/* + Yes, update_row() does what you expect, it updates a row. old_data will have + the previous row record in it, while new_data will have the newest data in + it. + Keep in mind that the server can do updates based on ordering if an ORDER BY + clause was used. Consecutive ordering is not guarenteed. + Currently new_data will not have an updated auto_increament record, or + and updated timestamp field. You can do these for example by doing these: + if (table->timestamp_on_update_now) + update_timestamp(new_row+table->timestamp_on_update_now-1); + if (table->next_number_field && record == table->record[0]) + update_auto_increment(); + + Called from sql_select.cc, sql_acl.cc, sql_update.cc, and sql_insert.cc. +*/ int ha_example::update_row(const byte * old_data, byte * new_data) { @@ -153,12 +277,32 @@ int ha_example::update_row(const byte * old_data, byte * new_data) DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED); } + +/* + This will delete a row. buf will contain a copy of the row to be deleted. + The server will call this right after the current row has been called (from + either a previous rnd_nexT() or index call). + If you keep a pointer to the last row or can access a primary key it will + make doing the deletion quite a bit easier. + Keep in mind that the server does no guarentee consecutive deletions. ORDER BY + clauses can be used. + + Called in sql_acl.cc and sql_udf.cc to manage internal table information. + Called in sql_delete.cc, sql_insert.cc, and sql_select.cc. In sql_select it is + used for removing duplicates while in insert it is used for REPLACE calls. +*/ int ha_example::delete_row(const byte * buf) { DBUG_ENTER("ha_example::delete_row"); DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED); } + +/* + Positions an index cursor to the index specified in the handle. Fetches the + row if available. If the key value is null, begin at the first key of the + index. +*/ int ha_example::index_read(byte * buf, const byte * key, uint key_len __attribute__((unused)), enum ha_rkey_function find_flag @@ -168,6 +312,11 @@ int ha_example::index_read(byte * buf, const byte * key, DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED); } + +/* + Positions an index cursor to the index specified in key. Fetches the + row if any. This is only used to read whole keys. +*/ int ha_example::index_read_idx(byte * buf, uint index, const byte * key, uint key_len __attribute__((unused)), enum ha_rkey_function find_flag @@ -178,66 +327,187 @@ int ha_example::index_read_idx(byte * buf, uint index, const byte * key, } +/* + Used to read forward through the index. +*/ int ha_example::index_next(byte * buf) { DBUG_ENTER("ha_example::index_next"); DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED); } + +/* + Used to read backwards through the index. +*/ int ha_example::index_prev(byte * buf) { DBUG_ENTER("ha_example::index_prev"); DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED); } + +/* + index_first() asks for the first key in the index. + + Called from opt_range.cc, opt_sum.cc, sql_handler.cc, + and sql_select.cc. +*/ int ha_example::index_first(byte * buf) { DBUG_ENTER("ha_example::index_first"); DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED); } + +/* + index_last() asks for the last key in the index. + + Called from opt_range.cc, opt_sum.cc, sql_handler.cc, + and sql_select.cc. +*/ int ha_example::index_last(byte * buf) { DBUG_ENTER("ha_example::index_last"); DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED); } + +/* + rnd_init() is called when the system wants the storage engine to do a table + scan. + See the example in the introduction at the top of this file to see when + rnd_init() is called. + + Called from filesort.cc, records.cc, sql_handler.cc, sql_select.cc, sql_table.cc, + and sql_update.cc. +*/ int ha_example::rnd_init(bool scan) { DBUG_ENTER("ha_example::rnd_init"); DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED); } + +/* + This is called for each row of the table scan. When you run out of records + you should return HA_ERR_END_OF_FILE. Fill buff up with the row information. + The Field structure for the table is the key to getting data into buf + in a manner that will allow the server to understand it. + + Called from filesort.cc, records.cc, sql_handler.cc, sql_select.cc, sql_table.cc, + and sql_update.cc. +*/ int ha_example::rnd_next(byte *buf) { DBUG_ENTER("ha_example::rnd_next"); DBUG_RETURN(HA_ERR_END_OF_FILE); } + +/* + position() is called after each call to rnd_next() if the data needs + to be ordered. You can do something like the following to store + the position: + ha_store_ptr(ref, ref_length, current_position); + + The server uses ref to store data. ref_length in the above case is + the size needed to store current_position. ref is just a byte array + that the server will maintain. If you are using offsets to mark rows, then + current_position should be the offset. If it is a primary key like in + BDB, then it needs to be a primary key. + + Called from filesort.cc, sql_select.cc, sql_delete.cc and sql_update.cc. +*/ void ha_example::position(const byte *record) { DBUG_ENTER("ha_example::position"); DBUG_VOID_RETURN; } + +/* + This is like rnd_next, but you are given a position to use + to determine the row. The position will be of the type that you stored in + ref. You can use ha_get_ptr(pos,ref_length) to retrieve whatever key + or position you saved when position() was called. + Called from filesort.cc records.cc sql_insert.cc sql_select.cc sql_update.cc. +*/ int ha_example::rnd_pos(byte * buf, byte *pos) { DBUG_ENTER("ha_example::rnd_pos"); DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED); } + +/* + ::info() is used to return information to the optimizer. + Currently this table handler doesn't implement most of the fields + really needed. SHOW also makes use of this data + Another note, you will probably want to have the following in your + code: + if (records < 2) + records = 2; + The reason is that the server will optimize for cases of only a single + record. If in a table scan you don't know the number of records + it will probably be better to set records to two so you can return + as many records as you need. + Along with records a few more variables you may wish to set are: + records + deleted + data_file_length + index_file_length + delete_length + check_time + Take a look at the public variables in handler.h for more information. + + Called in: + filesort.cc + ha_heap.cc + item_sum.cc + opt_sum.cc + sql_delete.cc + sql_delete.cc + sql_derived.cc + sql_select.cc + sql_select.cc + sql_select.cc + sql_select.cc + sql_select.cc + sql_show.cc + sql_show.cc + sql_show.cc + sql_show.cc + sql_table.cc + sql_union.cc + sql_update.cc + +*/ void ha_example::info(uint flag) { DBUG_ENTER("ha_example::info"); DBUG_VOID_RETURN; } + +/* + extra() is called whenever the server wishes to send a hint to + the storage engine. The myisam engine implements the most hints. + ha_innodb.cc has the most exhaustive list of these hints. +*/ int ha_example::extra(enum ha_extra_function operation) { DBUG_ENTER("ha_example::extra"); DBUG_RETURN(0); } + +/* + Deprecated and likely to be removed in the future. Storage engines normally + just make a call like: + ha_example::extra(HA_EXTRA_RESET); + to handle it. +*/ int ha_example::reset(void) { DBUG_ENTER("ha_example::reset"); @@ -245,18 +515,71 @@ int ha_example::reset(void) } +/* + Used to delete all rows in a table. Both for cases of truncate and + for cases where the optimizer realizes that all rows will be + removed as a result of a SQL statement. + + Called from item_sum.cc by Item_func_group_concat::clear(), + Item_sum_count_distinct::clear(), and Item_func_group_concat::clear(). + Called from sql_delete.cc by mysql_delete(). + Called from sql_select.cc by JOIN::reinit(). + Called from sql_union.cc by st_select_lex_unit::exec(). +*/ int ha_example::delete_all_rows() { DBUG_ENTER("ha_example::delete_all_rows"); DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED); } + +/* + First you should go read the section "locking functions for mysql" in + lock.cc to understand this. + This create a lock on the table. If you are implementing a storage engine + that can handle transacations look at ha_berkely.cc to see how you will + want to goo about doing this. Otherwise you should consider calling flock() + here. + + Called from lock.cc by lock_external() and unlock_external(). Also called + from sql_table.cc by copy_data_between_tables(). +*/ int ha_example::external_lock(THD *thd, int lock_type) { DBUG_ENTER("ha_example::external_lock"); DBUG_RETURN(0); } + +/* + The idea with handler::store_lock() is the following: + + The statement decided which locks we should need for the table + for updates/deletes/inserts we get WRITE locks, for SELECT... we get + read locks. + + Before adding the lock into the table lock handler (see thr_lock.c) + mysqld calls store lock with the requested locks. Store lock can now + modify a write lock to a read lock (or some other lock), ignore the + lock (if we don't want to use MySQL table locks at all) or add locks + for many tables (like we do when we are using a MERGE handler). + + Berkeley DB for example changes all WRITE locks to TL_WRITE_ALLOW_WRITE + (which signals that we are doing WRITES, but we are still allowing other + reader's and writer's. + + When releasing locks, store_lock() are also called. In this case one + usually doesn't have to do anything. + + In some exceptional cases MySQL may send a request for a TL_IGNORE; + This means that we are requesting the same lock as last time and this + should also be ignored. (This may happen when someone does a flush + table when we have opened a part of the tables, in which case mysqld + closes and reopens the tables and tries to get the same locks at last + time). In the future we will probably try to remove this. + + Called from lock.cc by get_lock_data(). +*/ THR_LOCK_DATA **ha_example::store_lock(THD *thd, THR_LOCK_DATA **to, enum thr_lock_type lock_type) @@ -267,6 +590,16 @@ THR_LOCK_DATA **ha_example::store_lock(THD *thd, return to; } +/* + Used to delete a table. By the time delete_table() has been called all + opened references to this table will have been closed (and your globally + shared references released. The variable name will just be the name of + the table. You will need to remove any files you have created at this point. + + Called from handler.cc by delete_table and ha_create_table(). Only used + during create if the table_flag HA_DROP_BEFORE_CREATE was specified for + the storage engine. +*/ int ha_example::delete_table(const char *name) { DBUG_ENTER("ha_example::delete_table"); @@ -274,12 +607,24 @@ int ha_example::delete_table(const char *name) DBUG_RETURN(0); } +/* + Renames a table from one name to another from alter table call. + + Called from sql_table.cc by mysql_rename_table(). +*/ int ha_example::rename_table(const char * from, const char * to) { DBUG_ENTER("ha_example::rename_table "); DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED); } +/* + Given a starting key, and an ending key estimate the number of rows that + will exist between the two. end_key may be empty which in case determine + if start_key matches any rows. + + Called from opt_range.cc by check_quick_keys(). +*/ ha_rows ha_example::records_in_range(int inx, const byte *start_key,uint start_key_len, enum ha_rkey_function start_search_flag, @@ -287,11 +632,22 @@ ha_rows ha_example::records_in_range(int inx, enum ha_rkey_function end_search_flag) { DBUG_ENTER("ha_example::records_in_range "); - DBUG_RETURN(records); // HA_ERR_NOT_IMPLEMENTED + DBUG_RETURN(records); } -int ha_example::create(const char *name, TABLE *table_arg, HA_CREATE_INFO *create_info) +/* + create() is called to create a database. The variable name will have the name + of the table. When create() is called you do not need to worry about opening + the table. Also, the FRM file will have already been created so adjusting + create_info will not do you any good. You can overwrite the frm file at this + point if you wish to change the table definition, but there are no methods + currently provided for doing that. + + Called from handle.cc by ha_create_table(). +*/ +int ha_example::create(const char *name, TABLE *table_arg, + HA_CREATE_INFO *create_info) { DBUG_ENTER("ha_example::create"); /* This is not implemented but we want someone to be able that it works. */ diff --git a/sql/examples/ha_example.h b/sql/examples/ha_example.h index 466632a1795..ffc4f5b941c 100644 --- a/sql/examples/ha_example.h +++ b/sql/examples/ha_example.h @@ -14,6 +14,17 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/* + Please read ha_exmple.cc before reading this file. + Please keep in mind that the example storage engine implements all methods + that are required to be implemented. handler.h has a full list of methods + that you can implement. +*/ + +/* + EXAMPLE_SHARE is a structure that will be shared amoung all open handlers + The example implements the minimum of what you will probably need. +*/ typedef struct st_example_share { char *table_name; uint table_name_length,use_count; @@ -21,6 +32,9 @@ typedef struct st_example_share { THR_LOCK lock; } EXAMPLE_SHARE; +/* + Class definition for the storage engine +*/ class ha_example: public handler { THR_LOCK_DATA lock; /* MySQL lock */ @@ -33,17 +47,34 @@ public: ~ha_example() { } - const char *table_type() const { return "EXAMPLE"; } + /* The name that will be used for display purposes */ + const char *table_type() const { return "EXAMPLE"; } + /* The name of the index type that will be used for display */ const char *index_type(uint inx) { return "NONE"; } const char **bas_ext() const; + /* + This is a list of flags that says what the storage engine + implements. The current table flags are documented in + table_flags. + */ ulong table_flags() const { return 0; } + /* + This is a list of flags that says how the storage engine + implements indexes. The current index flags are documented in + handler.h. If you do not implement indexes, just return zero + here. + */ ulong index_flags(uint inx) const { return 0; } + /* + unireg.cc will call the following to make sure that the storage engine can + handle the data it is about to send. + */ uint max_record_length() const { return HA_MAX_REC_LENGTH; } uint max_keys() const { return 0; } uint max_key_parts() const { return 0; } @@ -52,10 +83,15 @@ public: Called in test_quick_select to determine if indexes should be used. */ virtual double scan_time() { return (double) (records+deleted) / 20.0+10; } - /* The next method will never be called */ + /* + The next method will never be called if you do not implement indexes. + */ virtual double read_time(ha_rows rows) { return (double) rows / 20.0+1; } virtual bool fast_key_read() { return 1;} + /* + Everything below are methods that we implment in ha_example.cc. + */ int open(const char *name, int mode, uint test_if_locked); int close(void); int write_row(byte * buf); From 64d2ddbf4ec888e71730cee0cf5efaccb0c8d3eb Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 May 2004 01:23:27 +0200 Subject: [PATCH 049/162] - Bumped up version number from 4.0.19 -> 4.0.20 - Tagged ChangeSet@1.1800.1.1 as "mysql-4.0.19" configure.in: - Bumped up version number from 4.0.19 -> 4.0.20 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index a50d89c8655..b8d279d2f27 100644 --- a/configure.in +++ b/configure.in @@ -4,7 +4,7 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! -AM_INIT_AUTOMAKE(mysql, 4.0.19) +AM_INIT_AUTOMAKE(mysql, 4.0.20) AM_CONFIG_HEADER(config.h) PROTOCOL_VERSION=10 From 47890151b47af55431a808e59af738a35d1a0bb7 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 May 2004 02:38:57 +0300 Subject: [PATCH 050/162] Portability fixes scripts/mysql_install_db.sh: Portability fix (! is not portable) sql/item_func.cc: Use my_strtoll10() instead of strtoull() sql/repl_failsafe.cc: Use my_strtoll10() instead of strtoull() sql/sql_analyse.cc: Use my_strtoll10() instead of strtoull() sql/sql_yacc.yy: Use my_strtoll10() instead of strtoull() strings/my_strtoll10.c: Fix compiler warnings --- scripts/mysql_install_db.sh | 10 +++++++--- sql/item_func.cc | 5 ++++- sql/repl_failsafe.cc | 4 +++- sql/sql_analyse.cc | 12 +++++++++--- sql/sql_yacc.yy | 22 ++++++++++++---------- strings/my_strtoll10.c | 6 +++--- 6 files changed, 38 insertions(+), 21 deletions(-) diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 61d173aac05..abde6ecbe73 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -10,6 +10,8 @@ in_rpm=0 windows=0 defaults="" +tmp_file=/tmp/mysql_install_db.$$ + case "$1" in --no-defaults|--defaults-file=*|--defaults-extra-file=*) defaults="$1"; shift @@ -212,9 +214,11 @@ then then echo "Fill help tables" fi - if ! (echo "use mysql; - " - cat $fill_help_tables) | eval "$mysqld_install_cmd_line" + echo "use mysql;" > $tmp_file + cat $tmp_file $fill_help_tables | eval "$mysqld_install_cmd_line" + res=$? + rm $tmp_file + if test $res != 0 then echo "" echo "WARNING: HELP FILES ARE NOT COMPLETELY INSTALLED!" diff --git a/sql/item_func.cc b/sql/item_func.cc index d7e778171a0..aaea676fee1 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -2376,7 +2376,10 @@ longlong user_var_entry::val_int(my_bool *null_value) case INT_RESULT: return *(longlong*) value; case STRING_RESULT: - return strtoull(value,NULL,10); // String is null terminated + { + int error; + return my_strtoll10(value, (char**) 0, &error);// String is null terminated + } case ROW_RESULT: DBUG_ASSERT(1); // Impossible break; diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc index f254ffb3df3..2a5381ae478 100644 --- a/sql/repl_failsafe.cc +++ b/sql/repl_failsafe.cc @@ -915,12 +915,14 @@ int load_master_data(THD* thd) setting active_mi, because init_master_info() sets active_mi with defaults. */ + int error; + if (init_master_info(active_mi, master_info_file, relay_log_info_file, 0)) send_error(thd, ER_MASTER_INFO); strmake(active_mi->master_log_name, row[0], sizeof(active_mi->master_log_name)); - active_mi->master_log_pos = strtoull(row[1], (char**) 0, 10); + active_mi->master_log_pos= my_strtoll10(row[1], (char**) 0, &error); /* at least in recent versions, the condition below should be false */ if (active_mi->master_log_pos < BIN_LOG_HEADER_SIZE) active_mi->master_log_pos = BIN_LOG_HEADER_SIZE; diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc index 3c9563165fe..68f7d45e81c 100644 --- a/sql/sql_analyse.cc +++ b/sql/sql_analyse.cc @@ -187,7 +187,9 @@ bool test_if_number(NUM_INFO *info, const char *str, uint str_len) } if (str == end && info->integers) { - info->ullval = (ulonglong) strtoull(begin ,NULL, 10); + char *endpos= (char*) end; + int error; + info->ullval= (ulonglong) my_strtoll10(begin, &endpos, &error); if (info->integers == 1) return 0; // a single number can't be zerofill info->maybe_zerofill = 1; @@ -199,7 +201,9 @@ bool test_if_number(NUM_INFO *info, const char *str, uint str_len) return 0; if ((str + 1) == end) // number was something like '123[.eE]' { - info->ullval = (ulonglong) strtoull(begin, NULL, 10); + char *endpos= (char*) str; + int error; + info->ullval= (ulonglong) my_strtoll10(begin, &endpos, &error); return 1; } if (*str == 'e' || *str == 'E') // number may be something like '1e+50' @@ -218,7 +222,9 @@ bool test_if_number(NUM_INFO *info, const char *str, uint str_len) for (str++; *(end - 1) == '0'; end--); // jump over zeros at the end if (str == end) // number was something like '123.000' { - info->ullval = (ulonglong) strtoull(begin, NULL, 10); + char *endpos= (char*) str; + int error; + info->ullval= (ulonglong) my_strtoll10(begin, &endpos, &error); return 1; } for (; str != end && my_isdigit(system_charset_info,*str); str++) diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 25344fe84cd..0f29289ac25 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -3636,18 +3636,20 @@ delete_limit_clause: }; ULONG_NUM: - NUM { $$= strtoul($1.str,NULL,10); } - | LONG_NUM { $$= (ulong) strtoll($1.str,NULL,10); } - | ULONGLONG_NUM { $$= (ulong) strtoull($1.str,NULL,10); } - | REAL_NUM { $$= strtoul($1.str,NULL,10); } - | FLOAT_NUM { $$= strtoul($1.str,NULL,10); }; + NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); } + | LONG_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); } + | ULONGLONG_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); } + | REAL_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); } + | FLOAT_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); } + ; ulonglong_num: - NUM { $$= (ulonglong) strtoul($1.str,NULL,10); } - | ULONGLONG_NUM { $$= strtoull($1.str,NULL,10); } - | LONG_NUM { $$= (ulonglong) strtoll($1.str,NULL,10); } - | REAL_NUM { $$= strtoull($1.str,NULL,10); } - | FLOAT_NUM { $$= strtoull($1.str,NULL,10); }; + NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); } + | ULONGLONG_NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); } + | LONG_NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); } + | REAL_NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); } + | FLOAT_NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); } + ; procedure_clause: /* empty */ diff --git a/strings/my_strtoll10.c b/strings/my_strtoll10.c index 6319fbb4d9f..349350c6c7a 100644 --- a/strings/my_strtoll10.c +++ b/strings/my_strtoll10.c @@ -196,15 +196,15 @@ longlong my_strtoll10(const char *nptr, char **endptr, int *error) goto overflow; /* Check that we didn't get an overflow with the last digit */ - if (i > cutoff || i == cutoff && (j > cutoff2 || j == cutoff2 && - k > cutoff3)) + if (i > cutoff || (i == cutoff && ((j > cutoff2 || j == cutoff2) && + k > cutoff3))) goto overflow; li=i*LFACTOR2+ (ulonglong) j*100 + k; return (longlong) li; overflow: /* *endptr is set here */ *error= MY_ERRNO_ERANGE; - return negative ? LONGLONG_MIN : ULONGLONG_MAX; + return negative ? LONGLONG_MIN : (longlong) ULONGLONG_MAX; end_i: *endptr= (char*) s; From efe5a75d7d8cc42b387e68d74359def0d8ea4f20 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 May 2004 06:24:12 +0200 Subject: [PATCH 051/162] portability/autoconf fixes and removed warnings ndb/include/newtonapi/defs/pcn_types.h: portability/autoconf fixes ndb/include/portlib/NdbMutex.h: portability/autoconf fixes ndb/src/common/editline/editline.c: portability/autoconf fixes ndb/src/common/mgmcommon/ConfigRetriever.cpp: portability/autoconf fixes ndb/src/common/portlib/memtest/munmaptest/munmaptest.cpp: portability/autoconf fixes ndb/src/common/portlib/unix/NdbCondition.c: portability/autoconf fixes ndb/src/common/portlib/unix/NdbDaemon.c: portability/autoconf fixes ndb/src/common/portlib/unix/NdbHost.c: portability/autoconf fixes ndb/src/common/util/File.cpp: portability/autoconf fixes ndb/src/common/util/getarg.c: portability/autoconf fixes ndb/src/common/util/strlcat.c: portability/autoconf fixes ndb/src/common/util/strlcpy.c: portability/autoconf fixes ndb/src/cw/cpcd/Process.cpp: portability/autoconf fixes ndb/src/cw/cpcd/common.cpp: portability/autoconf fixes ndb/src/cw/cpcd/main.cpp: portability/autoconf fixes ndb/src/kernel/blocks/dbdict/printSchemafile/printSchemafile.cpp: portability/autoconf fixes ndb/src/kernel/blocks/dbdih/printSysfile/printSysfile.cpp: portability/autoconf fixes ndb/src/kernel/blocks/ndbfs/AsyncFileTest/AsyncFileTest.cpp: portability/autoconf fixes ndb/src/kernel/error/TimeModule.cpp: portability/autoconf fixes ndb/src/kernel/ndb-main/Main.cpp: portability/autoconf fixes ndb/src/mgmsrv/MgmtSrvr.cpp: portability/autoconf fixes ndb/src/mgmsrv/main.cpp: portability/autoconf fixes ndb/test/ndbapi/flexBench/flexBench.cpp: removed warnings ndb/test/src/HugoCalculator.cpp: removed warnings ndb/test/src/HugoOperations.cpp: removed warnings ndb/test/src/HugoTransactions.cpp: removed warnings ndb/test/src/NDBT_ResultRow.cpp: removed warnings ndb/test/src/NdbBackup.cpp: removed warnings ndb/test/src/NdbConfig.cpp: removed warnings ndb/test/src/NdbRestarter.cpp: removed warnings ndb/tools/cpcc/cpcc.cpp: removed warnings --- ndb/include/newtonapi/defs/pcn_types.h | 6 ---- ndb/include/portlib/NdbMutex.h | 4 ++- ndb/src/common/editline/editline.c | 4 +-- ndb/src/common/mgmcommon/ConfigRetriever.cpp | 1 - .../portlib/memtest/munmaptest/munmaptest.cpp | 1 - ndb/src/common/portlib/unix/NdbCondition.c | 1 - ndb/src/common/portlib/unix/NdbDaemon.c | 15 +++++++--- ndb/src/common/portlib/unix/NdbHost.c | 2 +- ndb/src/common/util/File.cpp | 8 ++--- ndb/src/common/util/getarg.c | 2 -- ndb/src/common/util/strlcat.c | 1 - ndb/src/common/util/strlcpy.c | 5 ---- ndb/src/cw/cpcd/Process.cpp | 3 -- ndb/src/cw/cpcd/common.cpp | 4 +-- ndb/src/cw/cpcd/main.cpp | 4 +-- .../printSchemafile/printSchemafile.cpp | 1 - .../dbdih/printSysfile/printSysfile.cpp | 1 - .../ndbfs/AsyncFileTest/AsyncFileTest.cpp | 4 +-- ndb/src/kernel/error/TimeModule.cpp | 2 +- ndb/src/kernel/ndb-main/Main.cpp | 3 -- ndb/src/mgmsrv/MgmtSrvr.cpp | 8 ++--- ndb/src/mgmsrv/main.cpp | 5 ++-- ndb/test/ndbapi/flexBench/flexBench.cpp | 30 +++++++++---------- ndb/test/src/HugoCalculator.cpp | 2 +- ndb/test/src/HugoOperations.cpp | 6 ++-- ndb/test/src/HugoTransactions.cpp | 6 ++-- ndb/test/src/NDBT_ResultRow.cpp | 4 ++- ndb/test/src/NdbBackup.cpp | 1 - ndb/test/src/NdbConfig.cpp | 2 -- ndb/test/src/NdbRestarter.cpp | 4 +-- ndb/tools/cpcc/cpcc.cpp | 2 +- 31 files changed, 58 insertions(+), 84 deletions(-) diff --git a/ndb/include/newtonapi/defs/pcn_types.h b/ndb/include/newtonapi/defs/pcn_types.h index 1c5de22e518..eae6c67899d 100644 --- a/ndb/include/newtonapi/defs/pcn_types.h +++ b/ndb/include/newtonapi/defs/pcn_types.h @@ -19,13 +19,7 @@ #include -#ifdef NDB_MACOSX -typedef unsigned int Size_t; -#elif defined(NDB_SPARC_64) -typedef unsigned int Size_t; -#else typedef size_t Size_t; -#endif typedef int Boolean_t; diff --git a/ndb/include/portlib/NdbMutex.h b/ndb/include/portlib/NdbMutex.h index d2cb6328b03..9ca2bae8ce1 100644 --- a/ndb/include/portlib/NdbMutex.h +++ b/ndb/include/portlib/NdbMutex.h @@ -17,6 +17,8 @@ #ifndef NDB_MUTEX_H #define NDB_MUTEX_H +#include + #ifdef NDB_WIN32 #include #include @@ -34,7 +36,7 @@ typedef SEMAPHORE NdbMutex; #elif defined NDB_WIN32 typedef CRITICAL_SECTION NdbMutex; #else -#include +#include typedef pthread_mutex_t NdbMutex; #define NDB_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER #endif diff --git a/ndb/src/common/editline/editline.c b/ndb/src/common/editline/editline.c index 0529d18b952..1e4c1ecba76 100644 --- a/ndb/src/common/editline/editline.c +++ b/ndb/src/common/editline/editline.c @@ -19,10 +19,10 @@ ** ** Main editing routines for editline library. */ +#include + #include "editline_internal.h" #include -#include -#include /* ** Manifest constants. diff --git a/ndb/src/common/mgmcommon/ConfigRetriever.cpp b/ndb/src/common/mgmcommon/ConfigRetriever.cpp index ef6861ef291..04dc5466bbc 100644 --- a/ndb/src/common/mgmcommon/ConfigRetriever.cpp +++ b/ndb/src/common/mgmcommon/ConfigRetriever.cpp @@ -16,7 +16,6 @@ #include #include -#include #include diff --git a/ndb/src/common/portlib/memtest/munmaptest/munmaptest.cpp b/ndb/src/common/portlib/memtest/munmaptest/munmaptest.cpp index f5d0c6a0a4c..b1d84131810 100644 --- a/ndb/src/common/portlib/memtest/munmaptest/munmaptest.cpp +++ b/ndb/src/common/portlib/memtest/munmaptest/munmaptest.cpp @@ -18,7 +18,6 @@ #include -#include #include #include diff --git a/ndb/src/common/portlib/unix/NdbCondition.c b/ndb/src/common/portlib/unix/NdbCondition.c index 9615e107d0c..1d229bdcdef 100644 --- a/ndb/src/common/portlib/unix/NdbCondition.c +++ b/ndb/src/common/portlib/unix/NdbCondition.c @@ -61,7 +61,6 @@ NdbCondition_Wait(struct NdbCondition* p_cond, return result; } -#include int NdbCondition_WaitTimeout(struct NdbCondition* p_cond, NdbMutex* p_mutex, diff --git a/ndb/src/common/portlib/unix/NdbDaemon.c b/ndb/src/common/portlib/unix/NdbDaemon.c index fbe684598f2..6eb319e1fcf 100644 --- a/ndb/src/common/portlib/unix/NdbDaemon.c +++ b/ndb/src/common/portlib/unix/NdbDaemon.c @@ -19,15 +19,13 @@ #define NdbDaemon_ErrorSize 500 #if defined(NDB_LINUX) || defined(NDB_SOLARIS) + /* XXX fix other unixes */ long NdbDaemon_DaemonPid; int NdbDaemon_ErrorCode; char NdbDaemon_ErrorText[NdbDaemon_ErrorSize]; -#endif int NdbDaemon_Make(const char* lockfile, const char* logfile, unsigned flags) { - /* XXX fix other unixes */ -#if defined(NDB_LINUX) || defined(NDB_SOLARIS) int lockfd = -1, logfd = -1, n; char buf[64]; @@ -129,10 +127,19 @@ NdbDaemon_Make(const char* lockfile, const char* logfile, unsigned flags) dup2(logfd, 2); close(logfd); } -#endif /* Success */ return 0; } +#else +int +NdbDaemon_Make(const char* lockfile, const char* logfile, unsigned flags) +{ + /* Fail */ + snprintf(NdbDaemon_ErrorText, NdbDaemon_ErrorSize, + "Daemon mode not implemented"); + return -1; +} +#endif #ifdef NDB_DAEMON_TEST diff --git a/ndb/src/common/portlib/unix/NdbHost.c b/ndb/src/common/portlib/unix/NdbHost.c index 8d2a23fccda..4749bb39ea7 100644 --- a/ndb/src/common/portlib/unix/NdbHost.c +++ b/ndb/src/common/portlib/unix/NdbHost.c @@ -15,8 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include "NdbHost.h" -#include int NdbHost_GetHostName(char* buf) { diff --git a/ndb/src/common/util/File.cpp b/ndb/src/common/util/File.cpp index ccd6ba24916..22d262a0d27 100644 --- a/ndb/src/common/util/File.cpp +++ b/ndb/src/common/util/File.cpp @@ -14,14 +14,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include -#include - -#if defined NDB_OSE || defined NDB_SOFTOSE -#include -#endif - #include // diff --git a/ndb/src/common/util/getarg.c b/ndb/src/common/util/getarg.c index 136965ad89c..ae016746987 100644 --- a/ndb/src/common/util/getarg.c +++ b/ndb/src/common/util/getarg.c @@ -34,8 +34,6 @@ #include -#include -#include #include "getarg.h" #define ISFLAG(X) ((X).type == arg_flag || (X).type == arg_negative_flag) diff --git a/ndb/src/common/util/strlcat.c b/ndb/src/common/util/strlcat.c index 3da47dee6f5..aa282abe48d 100644 --- a/ndb/src/common/util/strlcat.c +++ b/ndb/src/common/util/strlcat.c @@ -32,7 +32,6 @@ */ #include -#include /* RCSID("$KTH: strlcat.c,v 1.1 2000/08/16 01:23:47 lha Exp $"); */ diff --git a/ndb/src/common/util/strlcpy.c b/ndb/src/common/util/strlcpy.c index 70233e3e239..97cff177d48 100644 --- a/ndb/src/common/util/strlcpy.c +++ b/ndb/src/common/util/strlcpy.c @@ -32,16 +32,11 @@ */ #include -#include /* RCSID("$KTH: strlcpy.c,v 1.1 2000/08/16 01:23:48 lha Exp $"); */ #ifndef HAVE_STRLCPY -#ifdef NDB_WIN32 -#include -#endif - size_t strlcpy (char *dst, const char *src, size_t dst_sz) { diff --git a/ndb/src/cw/cpcd/Process.cpp b/ndb/src/cw/cpcd/Process.cpp index 8a79669937d..4c6bf6ce0f6 100644 --- a/ndb/src/cw/cpcd/Process.cpp +++ b/ndb/src/cw/cpcd/Process.cpp @@ -25,10 +25,7 @@ #include "CPCD.hpp" #include -#include #include -#include -#include void CPCD::Process::print(FILE * f){ diff --git a/ndb/src/cw/cpcd/common.cpp b/ndb/src/cw/cpcd/common.cpp index b2de90c468e..cb1c0c37183 100644 --- a/ndb/src/cw/cpcd/common.cpp +++ b/ndb/src/cw/cpcd/common.cpp @@ -14,11 +14,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "common.hpp" #include #include -#include -#include #include #include diff --git a/ndb/src/cw/cpcd/main.cpp b/ndb/src/cw/cpcd/main.cpp index 8dd4f2b4608..11f6238d5f7 100644 --- a/ndb/src/cw/cpcd/main.cpp +++ b/ndb/src/cw/cpcd/main.cpp @@ -14,9 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include /* Needed for mkdir(2) */ -#include /* Needed for mkdir(2) */ -#include +#include /* Needed for mkdir(2) */ #include #include "CPCD.hpp" diff --git a/ndb/src/kernel/blocks/dbdict/printSchemafile/printSchemafile.cpp b/ndb/src/kernel/blocks/dbdict/printSchemafile/printSchemafile.cpp index 51f05ae1d6e..bf721a0b30a 100644 --- a/ndb/src/kernel/blocks/dbdict/printSchemafile/printSchemafile.cpp +++ b/ndb/src/kernel/blocks/dbdict/printSchemafile/printSchemafile.cpp @@ -16,7 +16,6 @@ #include -#include #include #include diff --git a/ndb/src/kernel/blocks/dbdih/printSysfile/printSysfile.cpp b/ndb/src/kernel/blocks/dbdih/printSysfile/printSysfile.cpp index 90bb1ded490..efa4b9c92c5 100644 --- a/ndb/src/kernel/blocks/dbdih/printSysfile/printSysfile.cpp +++ b/ndb/src/kernel/blocks/dbdih/printSysfile/printSysfile.cpp @@ -16,7 +16,6 @@ #include -#include #include #include diff --git a/ndb/src/kernel/blocks/ndbfs/AsyncFileTest/AsyncFileTest.cpp b/ndb/src/kernel/blocks/ndbfs/AsyncFileTest/AsyncFileTest.cpp index b9954ba130f..004752c9543 100644 --- a/ndb/src/kernel/blocks/ndbfs/AsyncFileTest/AsyncFileTest.cpp +++ b/ndb/src/kernel/blocks/ndbfs/AsyncFileTest/AsyncFileTest.cpp @@ -16,10 +16,8 @@ //#define TESTDEBUG 1 -#include -#include +#include -#include #include #include #include "AsyncFile.hpp" diff --git a/ndb/src/kernel/error/TimeModule.cpp b/ndb/src/kernel/error/TimeModule.cpp index c0f4e40858f..4bd8e3daf99 100644 --- a/ndb/src/kernel/error/TimeModule.cpp +++ b/ndb/src/kernel/error/TimeModule.cpp @@ -16,8 +16,8 @@ +#include #include "TimeModule.hpp" -#include static const char* cMonth[] = { "x", "January", "February", "Mars", "April", "May", "June", "July", "August", "September", "October", "November", "December"}; diff --git a/ndb/src/kernel/ndb-main/Main.cpp b/ndb/src/kernel/ndb-main/Main.cpp index 1c0f42dab76..1619ee417f5 100644 --- a/ndb/src/kernel/ndb-main/Main.cpp +++ b/ndb/src/kernel/ndb-main/Main.cpp @@ -42,9 +42,6 @@ #endif extern EventLogger g_eventLogger; -#if defined (NDB_LINUX) || defined (NDB_SOLARIS) -#include -#endif void catchsigs(bool ignore); // for process signal handling extern "C" void handler(int signo); // for process signal handling diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index 23ceeb15947..08bfe20aa95 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -14,10 +14,12 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include +#include + #include "MgmtSrvr.hpp" #include "MgmtErrorReporter.hpp" -#include #include #include #include @@ -42,15 +44,11 @@ #include #include #include -#include #include "SocketServer.hpp" #include "NodeLogLevel.hpp" #include -#include -#include - //#define MGM_SRV_DEBUG #ifdef MGM_SRV_DEBUG #define DEBUG(x) do ndbout << x << endl; while(0) diff --git a/ndb/src/mgmsrv/main.cpp b/ndb/src/mgmsrv/main.cpp index 2732d091655..91b443f61a2 100644 --- a/ndb/src/mgmsrv/main.cpp +++ b/ndb/src/mgmsrv/main.cpp @@ -14,8 +14,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include -#include #include "MgmtSrvr.hpp" #include "EventLogger.hpp" @@ -198,7 +199,6 @@ NDB_MAIN(mgmsrv){ goto error_end; } -#if defined (NDB_LINUX) || defined (NDB_SOLARIS) if (glob.daemon) { // Become a daemon char homePath[255],lockfile[255], logfile[255]; @@ -210,7 +210,6 @@ NDB_MAIN(mgmsrv){ return 1; } } -#endif if(!glob.mgmObject->start()){ ndbout_c("Unable to start management server."); diff --git a/ndb/test/ndbapi/flexBench/flexBench.cpp b/ndb/test/ndbapi/flexBench/flexBench.cpp index 852944fd471..809d11086bf 100644 --- a/ndb/test/ndbapi/flexBench/flexBench.cpp +++ b/ndb/test/ndbapi/flexBench/flexBench.cpp @@ -292,7 +292,7 @@ NDB_COMMAND(flexBench, "flexBench", "flexBench", "flexbench", 65535) if(useLongKeys){ longKeyAttrName = (char **) malloc(sizeof(char*) * tNoOfLongPK); - for (int i = 0; i < tNoOfLongPK; i++) { + for (Uint32 i = 0; i < tNoOfLongPK; i++) { longKeyAttrName[i] = (char *) malloc(strlen("KEYATTR ") + 1); memset(longKeyAttrName[i], 0, strlen("KEYATTR ") + 1); sprintf(longKeyAttrName[i], "KEYATTR%i", i); @@ -531,7 +531,7 @@ NDB_COMMAND(flexBench, "flexBench", "flexBench", "flexbench", 65535) waitForThreads(pThreadsData); void * tmp; - for(int i = 0; iequal(longKeyAttrName[i], (char *)longKeyAttrValue[count - 1][i], tSizeOfLongPK*4); } @@ -923,8 +923,8 @@ static void* flexBenchThread(void* pArg) if (useLongKeys == true) { // Only free these areas if they have been allocated // Otherwise cores will occur - for (int n = 0; n < tNoOfOperations; n++){ - for (int i = 0; i < tNoOfLongPK; i++) { + for (Uint32 n = 0; n < tNoOfOperations; n++){ + for (Uint32 i = 0; i < tNoOfLongPK; i++) { free(longKeyAttrValue[n][i]); } free(longKeyAttrValue[n]); @@ -1064,13 +1064,13 @@ static void sleepBeforeStartingTest(int seconds){ static int createTables(Ndb* pMyNdb){ - for (int i = 0; i < tNoOfAttributes; i++){ + for (Uint32 i = 0; i < tNoOfAttributes; i++){ snprintf(attrName[i], MAXSTRLEN, "COL%d", i); } // Note! Uses only uppercase letters in table name's // so that we can look at the tables with SQL - for (int i = 0; i < tNoOfTables; i++){ + for (Uint32 i = 0; i < tNoOfTables; i++){ if (theStdTableNameFlag == 0){ snprintf(tableName[i], MAXSTRLEN, "TAB%d_%d", i, (int)(NdbTick_CurrentMillisecond() / 1000)); @@ -1087,7 +1087,7 @@ createTables(Ndb* pMyNdb){ tmpTable.setStoredTable(!theTempTable); if(useLongKeys){ - for(int i = 0; i < tNoOfLongPK; i++) { + for(Uint32 i = 0; i < tNoOfLongPK; i++) { NdbDictionary::Column col(longKeyAttrName[i]); col.setType(NdbDictionary::Column::Unsigned); col.setLength(tSizeOfLongPK); diff --git a/ndb/test/src/HugoCalculator.cpp b/ndb/test/src/HugoCalculator.cpp index 246dde09c00..55aa96a4909 100644 --- a/ndb/test/src/HugoCalculator.cpp +++ b/ndb/test/src/HugoCalculator.cpp @@ -157,7 +157,7 @@ HugoCalculator::verifyRowValues(NDBT_ResultRow* const pRow) const{ << ", NdbDict::Column::getLength(): " << attr->getLength() << endl; const char* buf2 = pRow->attributeStore(i)->aRef(); - for (int j = 0; j < pRow->attributeStore(i)->arraySize(); j++) + for (Uint32 j = 0; j < pRow->attributeStore(i)->arraySize(); j++) { g_err << j << ":" << buf[j] << "[" << buf2[j] << "]"; if (buf[j] != buf2[j]) diff --git a/ndb/test/src/HugoOperations.cpp b/ndb/test/src/HugoOperations.cpp index edcec460ba0..91263aa29b4 100644 --- a/ndb/test/src/HugoOperations.cpp +++ b/ndb/test/src/HugoOperations.cpp @@ -652,7 +652,7 @@ void HugoOperations::deallocRows(){ int HugoOperations::saveCopyOfRecord(int numRecords ){ - if (numRecords > rows.size()) + if (numRecords > (int)rows.size()) return NDBT_FAILED; for (int i = 0; i < numRecords; i++){ @@ -662,7 +662,7 @@ int HugoOperations::saveCopyOfRecord(int numRecords ){ } BaseString HugoOperations::getRecordStr(int recordNum){ - if (recordNum > rows.size()) + if (recordNum > (int)rows.size()) return NULL; return rows[recordNum]->c_str(); } @@ -673,7 +673,7 @@ int HugoOperations::getRecordGci(int recordNum){ int HugoOperations::compareRecordToCopy(int numRecords ){ - if (numRecords > rows.size()) + if (numRecords > (int)rows.size()) return NDBT_FAILED; if ((unsigned)numRecords > savedRecords.size()) return NDBT_FAILED; diff --git a/ndb/test/src/HugoTransactions.cpp b/ndb/test/src/HugoTransactions.cpp index 1293d395974..7f12484ddc8 100644 --- a/ndb/test/src/HugoTransactions.cpp +++ b/ndb/test/src/HugoTransactions.cpp @@ -1253,9 +1253,11 @@ HugoTransactions::eventOperation(Ndb* pNdb, void* pstats, g_info << " UPDATE: "; recEvent = recUpdateEvent; break; + case NdbDictionary::Event::TE_ALL: + abort(); } - if (pk < records) { + if ((int)pk < records) { recEvent[pk].pk = pk; recEvent[pk].count++; } @@ -1304,7 +1306,7 @@ HugoTransactions::eventOperation(Ndb* pNdb, void* pstats, if (stats.n_updates > 0) { stats.n_consecutive++; } - for (Uint32 i = 0; i < records/3; i++) { + for (Uint32 i = 0; i < (Uint32)records/3; i++) { if (recInsertEvent[i].pk != i) { stats.n_consecutive ++; ndbout << "missing insert pk " << i << endl; diff --git a/ndb/test/src/NDBT_ResultRow.cpp b/ndb/test/src/NDBT_ResultRow.cpp index 87694aabb2b..ba46be203e1 100644 --- a/ndb/test/src/NDBT_ResultRow.cpp +++ b/ndb/test/src/NDBT_ResultRow.cpp @@ -66,6 +66,7 @@ NDBT_ResultRow::attributeStore(const char* name){ return data[i]; } assert(false); + return 0; } NdbOut & @@ -189,7 +190,8 @@ NDBT_ResultRow::clone () const { NDBT_ResultRow * row = new NDBT_ResultRow(m_table, ad[0]); row->m_ownData = true; - for(Uint32 i = 0; idata[i] = data[i]->clone(); } diff --git a/ndb/test/src/NdbBackup.cpp b/ndb/test/src/NdbBackup.cpp index 3f73369f488..6cbb69508f5 100644 --- a/ndb/test/src/NdbBackup.cpp +++ b/ndb/test/src/NdbBackup.cpp @@ -66,7 +66,6 @@ NdbBackup::getFileSystemPathForNode(int _node_id){ /** * Fetch configuration from management server */ - char buf[255]; ConfigRetriever cr; diff --git a/ndb/test/src/NdbConfig.cpp b/ndb/test/src/NdbConfig.cpp index aa0bb252f58..3a254bc1577 100644 --- a/ndb/test/src/NdbConfig.cpp +++ b/ndb/test/src/NdbConfig.cpp @@ -31,7 +31,6 @@ NdbConfig::getPropsForNode(unsigned int node_id, /** * Fetch configuration from management server */ - char buf[255]; ConfigRetriever cr; @@ -111,7 +110,6 @@ NdbConfig::getHostName(unsigned int node_id, /** * Fetch configuration from management server */ - char buf[255]; ConfigRetriever cr; diff --git a/ndb/test/src/NdbRestarter.cpp b/ndb/test/src/NdbRestarter.cpp index 252fa28feec..cc2fab46cc5 100644 --- a/ndb/test/src/NdbRestarter.cpp +++ b/ndb/test/src/NdbRestarter.cpp @@ -167,7 +167,7 @@ NdbRestarter::getRandomNotMasterNodeId(int rand){ if(master == -1) return -1; - int counter = 0; + Uint32 counter = 0; rand = rand % ndbNodes.size(); while(counter++ < ndbNodes.size() && ndbNodes[rand].node_id == master) rand = (rand + 1) % ndbNodes.size(); @@ -196,7 +196,7 @@ NdbRestarter::getRandomNodeOtherNodeGroup(int nodeId, int rand){ return -1; } - int counter = 0; + Uint32 counter = 0; rand = rand % ndbNodes.size(); while(counter++ < ndbNodes.size() && ndbNodes[rand].node_group == node_group) rand = (rand + 1) % ndbNodes.size(); diff --git a/ndb/tools/cpcc/cpcc.cpp b/ndb/tools/cpcc/cpcc.cpp index 745f897a096..e768d707bbc 100644 --- a/ndb/tools/cpcc/cpcc.cpp +++ b/ndb/tools/cpcc/cpcc.cpp @@ -116,7 +116,7 @@ public: } virtual bool evaluate(SimpleCpcClient* c,const SimpleCpcClient::Process & p){ - return p.m_id == id && c == host; + return p.m_id == (int)id && c == host; } }; From 69424ca9abd94729693a593a1ceb899d756ffbf7 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 May 2004 09:27:59 +0200 Subject: [PATCH 052/162] portability/autoconf fixes --- ndb/Defs.mk | 6 +++- ndb/config/GuessConfig.sh | 5 +++ ndb/include/ndb_global.h | 8 ++++- ndb/include/portlib/NdbTCP.h | 32 ++++++++--------- ndb/src/common/transporter/Makefile | 25 ++----------- .../TransporterInternalDefinitions.hpp | 35 ++++--------------- ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp | 10 ++++-- ndb/src/kernel/ndb-main/Main.cpp | 4 ++- ndb/test/src/HugoAsynchTransactions.cpp | 4 +++ 9 files changed, 56 insertions(+), 73 deletions(-) diff --git a/ndb/Defs.mk b/ndb/Defs.mk index 8ac9e28b721..cf891caa5c2 100644 --- a/ndb/Defs.mk +++ b/ndb/Defs.mk @@ -53,7 +53,11 @@ SHLIBEXT := so endif ifeq ($(NDB_SCI), Y) -CCFLAGS_TOP += -DHAVE_SCI +CCFLAGS_TOP += -DHAVE_NDB_SCI +endif + +ifeq ($(NDB_SHM), Y) +CCFLAGS_TOP += -DHAVE_NDB_SHM endif ifneq ($(findstring OSE, $(NDB_OS)),) diff --git a/ndb/config/GuessConfig.sh b/ndb/config/GuessConfig.sh index d2d8446c704..3caeeaae6d0 100755 --- a/ndb/config/GuessConfig.sh +++ b/ndb/config/GuessConfig.sh @@ -11,6 +11,11 @@ then NDB_SCI=N fi +if [ -z "$NDB_SHM" ] +then + NDB_SHM=N +fi + os=`uname -s` case $os in Linux) diff --git a/ndb/include/ndb_global.h b/ndb/include/ndb_global.h index d79ffc07566..5e03b972268 100644 --- a/ndb/include/ndb_global.h +++ b/ndb/include/ndb_global.h @@ -3,6 +3,13 @@ #define NDBGLOBAL_H #include + +#if defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(WIN32) +#define NDB_WIN32 +#else +#undef NDB_WIN32 +#endif + #include #include #include @@ -31,7 +38,6 @@ #ifdef NDB_WIN32 #include #include -#include #define DIR_SEPARATOR "\\" #define PATH_MAX 256 diff --git a/ndb/include/portlib/NdbTCP.h b/ndb/include/portlib/NdbTCP.h index 04a52c7d033..42c34855c39 100644 --- a/ndb/include/portlib/NdbTCP.h +++ b/ndb/include/portlib/NdbTCP.h @@ -40,24 +40,8 @@ typedef int socklen_t; #define InetErrno (* inet_errno()) -#endif +#elif NDB_WIN32 -#if defined NDB_SOLARIS || defined NDB_HPUX || defined NDB_IBMAIX || defined NDB_TRU64X || NDB_LINUX || defined NDB_MACOSX -/** - * Include files needed - */ -#include - -#define NDB_NONBLOCK O_NONBLOCK -#define NDB_SOCKET_TYPE int -#define NDB_INVALID_SOCKET -1 -#define NDB_CLOSE_SOCKET(x) close(x) - -#define InetErrno errno - -#endif - -#ifdef NDB_WIN32 /** * Include files needed */ @@ -70,6 +54,20 @@ typedef int socklen_t; #define NDB_INVALID_SOCKET INVALID_SOCKET #define NDB_CLOSE_SOCKET(x) closesocket(x) +#else + +/** + * Include files needed + */ +#include + +#define NDB_NONBLOCK O_NONBLOCK +#define NDB_SOCKET_TYPE int +#define NDB_INVALID_SOCKET -1 +#define NDB_CLOSE_SOCKET(x) close(x) + +#define InetErrno errno + #endif #define NDB_SOCKLEN_T SOCKET_SIZE_TYPE diff --git a/ndb/src/common/transporter/Makefile b/ndb/src/common/transporter/Makefile index 3bd23b627d3..5fb869e27eb 100644 --- a/ndb/src/common/transporter/Makefile +++ b/ndb/src/common/transporter/Makefile @@ -20,37 +20,18 @@ DIRS := basictest perftest CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/include/kernel) \ -I$(call fixpath,$(NDB_TOP)/include/transporter) + +ifeq ($(NDB_SHM), Y) ifeq ($(NDB_OS), WIN32) SOURCES += SHM_Transporter.win32.cpp -endif - -ifeq ($(NDB_OS), SOLARIS) +else SOURCES += SHM_Transporter.unix.cpp endif - -ifeq ($(NDB_OS), HPUX) -SOURCES += SHM_Transporter.unix.cpp endif -ifeq ($(NDB_OS), MACOSX) -SOURCES += SHM_Transporter.unix.cpp -endif - -ifeq ($(NDB_OS), IBMAIX) -SOURCES += SHM_Transporter.unix.cpp -endif - -ifeq ($(NDB_OS), TRU64X) -SOURCES += SHM_Transporter.unix.cpp -endif - -ifeq ($(NDB_OS), LINUX) -SOURCES += SHM_Transporter.unix.cpp ifeq ($(NDB_SCI), Y) SOURCES += SCI_Transporter.cpp endif -endif - ifneq ($(findstring OSE, $(NDB_OS)),) SOURCES += OSE_Transporter.cpp diff --git a/ndb/src/common/transporter/TransporterInternalDefinitions.hpp b/ndb/src/common/transporter/TransporterInternalDefinitions.hpp index 18d54ca1e89..624b495422f 100644 --- a/ndb/src/common/transporter/TransporterInternalDefinitions.hpp +++ b/ndb/src/common/transporter/TransporterInternalDefinitions.hpp @@ -21,39 +21,18 @@ #include #endif -#ifdef NDB_SOLARIS #define NDB_TCP_TRANSPORTER -//#define NDB_SCI_TRANSPORTER + +#ifdef HAVE_NDB_SHM #define NDB_SHM_TRANSPORTER -#elif defined NDB_OSE || defined NDB_SOFTOSE -#define NDB_TCP_TRANSPORTER -#define NDB_OSE_TRANSPORTER -#elif defined NDB_LINUX -#define NDB_TCP_TRANSPORTER -#define NDB_SCI_TRANSPORTER -#define NDB_SHM_TRANSPORTER -#elif defined NDB_WIN32 -#define NDB_TCP_TRANSPORTER -#elif defined NDB_HPUX -#define NDB_TCP_TRANSPORTER -#define NDB_SHM_TRANSPORTER -#elif defined NDB_MACOSX -#define NDB_TCP_TRANSPORTER -#define NDB_SHM_TRANSPORTER -#elif defined NDB_IBMAIX -#define NDB_TCP_TRANSPORTER -#define NDB_SHM_TRANSPORTER -#elif defined NDB_TRU64X -#define NDB_TCP_TRANSPORTER -#define NDB_SHM_TRANSPORTER -#else -#error unsupported platform #endif -#ifndef HAVE_SCI -#ifdef NDB_SCI_TRANSPORTER -#undef NDB_SCI_TRANSPORTER +#ifdef HAVE_NDB_SCI +#define NDB_SCI_TRANSPORTER #endif + +#ifdef HAVE_NDB_OSE +#define NDB_OSE_TRANSPORTER #endif #ifdef DEBUG_TRANSPORTER diff --git a/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp b/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp index 9c1cf5021b3..36322ffad1e 100644 --- a/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp +++ b/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp @@ -854,7 +854,7 @@ int Ndbfs::translateErrno(int aErrno) //no space left on device case ENFILE: case EDQUOT: -#ifndef NDB_MACOSX +#ifdef ENOSR case ENOSR: #endif case ENOSPC: @@ -872,12 +872,16 @@ int Ndbfs::translateErrno(int aErrno) return FsRef::fsErrInvalidParameters; //environment error case ELOOP: -#ifndef NDB_MACOSX +#ifdef ENOLINK case ENOLINK: +#endif +#ifdef EMULTIHOP case EMULTIHOP: #endif -#ifndef NDB_LINUX +#ifdef EOPNOTSUPP case EOPNOTSUPP: +#endif +#ifdef ESPIPE case ESPIPE: #endif case EPIPE: diff --git a/ndb/src/kernel/ndb-main/Main.cpp b/ndb/src/kernel/ndb-main/Main.cpp index 1619ee417f5..f936c630d50 100644 --- a/ndb/src/kernel/ndb-main/Main.cpp +++ b/ndb/src/kernel/ndb-main/Main.cpp @@ -257,8 +257,10 @@ handler(int sig){ case SIGINT: /* 2 - Interrupt */ case SIGQUIT: /* 3 - Quit */ case SIGTERM: /* 15 - Terminate */ -#ifndef NDB_MACOSX +#ifdef SIGPWR case SIGPWR: /* 19 - Power fail */ +#endif +#ifdef SIGPOLL case SIGPOLL: /* 22 */ #endif case SIGSTOP: /* 23 */ diff --git a/ndb/test/src/HugoAsynchTransactions.cpp b/ndb/test/src/HugoAsynchTransactions.cpp index d045032d455..2af22b5f48d 100644 --- a/ndb/test/src/HugoAsynchTransactions.cpp +++ b/ndb/test/src/HugoAsynchTransactions.cpp @@ -473,6 +473,10 @@ HugoAsynchTransactions::executeAsynchOperation(Ndb* pNdb, } } break; + case NO_INSERT: + case NO_UPDATE: + case NO_DELETE: + abort(); } // Close all transactions From 79229d6d42066ef027ee875146e7edc4a7e4be0c Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 May 2004 10:40:04 +0300 Subject: [PATCH 053/162] eval0eval.c: Backport suppression of MSVC++ warning from 4.1 innobase/eval/eval0eval.c: Backport suppression of MSVC++ warning from 4.1 --- innobase/eval/eval0eval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/innobase/eval/eval0eval.c b/innobase/eval/eval0eval.c index 053a10b3c23..a3cd60b86ae 100644 --- a/innobase/eval/eval0eval.c +++ b/innobase/eval/eval0eval.c @@ -725,7 +725,7 @@ eval_predefined( uint_val = (ulint) int_val; } for (tmp = int_len; uint_val > 0; uint_val /= 10) { - data[--tmp] = '0' + (uint_val % 10); + data[--tmp] = '0' + (byte)(uint_val % 10); } } From 01925fa550d93778cdf009fe5a5f59eed14d8652 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 May 2004 12:27:43 +0300 Subject: [PATCH 054/162] used item method (Bug #3686) --- sql/sql_select.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 6a64665b4cc..c330d1e6b54 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -367,8 +367,7 @@ JOIN::prepare(Item ***rref_pointer_array, { if (item->with_sum_func) flag|=1; - else if (!(flag & 2) && - test(item->used_tables() & ~PARAM_TABLE_BIT)) + else if (!(flag & 2) && !item->const_during_execution()) flag|=2; } if (flag == 3) From 2e9dee04e082c7b61b57d4754c72a2ecfd67c75e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 May 2004 12:14:54 +0200 Subject: [PATCH 055/162] portability/autoconf fixes ndb/config/Defs.LINUX.x86.GCC.mk: postability/autoconf fixes ndb/include/portlib/NdbMutex.h: postability/autoconf fixes ndb/src/common/editline/unix.h: postability/autoconf fixes ndb/src/common/portlib/memtest/memtest.c: postability/autoconf fixes ndb/src/common/portlib/unix/NdbTCP.c: postability/autoconf fixes ndb/src/common/portlib/unix/NdbThread.c: postability/autoconf fixes ndb/src/common/transporter/Makefile: postability/autoconf fixes ndb/src/common/transporter/SHM_Transporter.cpp: postability/autoconf fixes ndb/src/mgmsrv/MgmtSrvr.cpp: postability/autoconf fixes --- ndb/config/Defs.LINUX.x86.GCC.mk | 10 ++-- ndb/include/portlib/NdbMutex.h | 1 - ndb/src/common/editline/unix.h | 3 +- ndb/src/common/portlib/Makefile | 34 +++---------- ndb/src/common/portlib/memtest/memtest.c | 3 +- ndb/src/common/portlib/unix/NdbTCP.c | 48 +++++++++++-------- ndb/src/common/portlib/unix/NdbThread.c | 2 +- ndb/src/common/transporter/Makefile | 2 +- .../common/transporter/SHM_Transporter.cpp | 4 +- ndb/src/kernel/ndb-main/Main.cpp | 5 -- ndb/src/mgmsrv/Makefile | 2 - ndb/src/mgmsrv/MgmtSrvr.cpp | 2 +- ndb/src/ndbapi/Ndb.cpp | 3 +- ndb/src/rep/Makefile | 2 - 14 files changed, 48 insertions(+), 73 deletions(-) diff --git a/ndb/config/Defs.LINUX.x86.GCC.mk b/ndb/config/Defs.LINUX.x86.GCC.mk index 698b0eb8350..6167a30ff23 100644 --- a/ndb/config/Defs.LINUX.x86.GCC.mk +++ b/ndb/config/Defs.LINUX.x86.GCC.mk @@ -6,9 +6,11 @@ SHELL := /bin/sh C++ := gcc$(GCC_VERSION) CC := gcc$(GCC_VERSION) AR_RCS := $(PURE) ar rcs -SO := gcc$(GCC_VERSION) -shared -lpthread -o +SO := gcc$(GCC_VERSION) -shared -lpthread -o +#SO := gcc$(GCC_VERSION) -shared -o MAKEDEPEND := gcc$(GCC_VERSION) -M +#MAKEDEPEND := gcc$(GCC_VERSION) -M -nostdinc -nostdinc++ PIC := -fPIC RPCGENFLAGS := -M -C -N @@ -27,7 +29,8 @@ else CCFLAGS_WARNINGS = -Wno-long-long -Wall endif # Add these for more warnings -Weffc++ -W -CCFLAGS_TOP = -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS +CCFLAGS_TOP = +#CCFLAGS_TOP = -DSAFE_MUTEX CCFLAGS_TOP += -fno-rtti -fno-exceptions ifeq (RELEASE, $(NDB_VERSION)) @@ -53,4 +56,5 @@ LINK.cc = $(PURE) $(CC) $(CCFLAGS) $(LDFLAGS) LINK.c = $(PURE) $(CC) $(CFLAGS) $(LDFLAGS) -LDFLAGS_LAST = -lpthread -lrt $(NDB_TOP)/src/common/portlib/gcc.cpp +LDFLAGS_LAST = -lrt -lpthread $(NDB_TOP)/src/common/portlib/gcc.cpp +#LDFLAGS_LAST = -lrt $(NDB_TOP)/src/common/portlib/gcc.cpp $(NDB_TOP)/../mysys/libmysys.a $(NDB_TOP)/../dbug/libdbug.a $(NDB_TOP)/../regex/libregex.a $(NDB_TOP)/../strings/libmystrings.a -lpthread diff --git a/ndb/include/portlib/NdbMutex.h b/ndb/include/portlib/NdbMutex.h index 9ca2bae8ce1..52638b19c7e 100644 --- a/ndb/include/portlib/NdbMutex.h +++ b/ndb/include/portlib/NdbMutex.h @@ -22,7 +22,6 @@ #ifdef NDB_WIN32 #include #include -#include #endif #ifdef __cplusplus diff --git a/ndb/src/common/editline/unix.h b/ndb/src/common/editline/unix.h index 582c4888856..37f461b471d 100644 --- a/ndb/src/common/editline/unix.h +++ b/ndb/src/common/editline/unix.h @@ -21,6 +21,5 @@ #define CRLF "\r\n" -#include -#include +#include #include diff --git a/ndb/src/common/portlib/Makefile b/ndb/src/common/portlib/Makefile index a928fc1e6d7..48f4929a839 100644 --- a/ndb/src/common/portlib/Makefile +++ b/ndb/src/common/portlib/Makefile @@ -4,38 +4,16 @@ DIRS := ifeq ($(NDB_OS), SOFTOSE) DIRS += ose -endif - +else ifeq ($(NDB_OS), OSE) DIRS += ose -endif - -ifeq ($(NDB_OS), SIMCELLO) -DIRS += ose -endif - -ifeq ($(NDB_OS), LINUX) -DIRS += unix -endif - -ifeq ($(NDB_OS), MACOSX) -DIRS += unix -endif - -ifeq ($(NDB_OS), SOLARIS) -DIRS += unix -endif - -ifeq ($(NDB_OS), SOLARIS6) -DIRS += unix -endif - -ifeq ($(NDB_OS), HPUX) -DIRS += unix -endif - +else ifeq ($(NDB_OS), WIN32) DIRS += win32 +else +DIRS += unix +endif +endif endif diff --git a/ndb/src/common/portlib/memtest/memtest.c b/ndb/src/common/portlib/memtest/memtest.c index fb525c2f19f..059a4ec025e 100644 --- a/ndb/src/common/portlib/memtest/memtest.c +++ b/ndb/src/common/portlib/memtest/memtest.c @@ -17,8 +17,7 @@ #include -#include -#include + long long getMilli(); long long getMicro(); void malloctest(int loopcount, int memsize, int touch); diff --git a/ndb/src/common/portlib/unix/NdbTCP.c b/ndb/src/common/portlib/unix/NdbTCP.c index c2613c211c5..287dc6c2ecd 100644 --- a/ndb/src/common/portlib/unix/NdbTCP.c +++ b/ndb/src/common/portlib/unix/NdbTCP.c @@ -15,10 +15,36 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include "NdbTCP.h" +#ifdef NDB_WIN32 +static NdbMutex & LOCK_gethostbyname = * NdbMutex_Create(); +#else +static NdbMutex LOCK_gethostbyname = NDB_MUTEX_INITIALIZER; +#endif -#ifdef NDB_SOLARIS +int +Ndb_getInAddr(struct in_addr * dst, const char *address) { + struct hostent * hostPtr; + NdbMutex_Lock(&LOCK_gethostbyname); + hostPtr = gethostbyname(address); + if (hostPtr != NULL) { + dst->s_addr = ((struct in_addr *) *hostPtr->h_addr_list)->s_addr; + NdbMutex_Unlock(&LOCK_gethostbyname); + return 0; + } + NdbMutex_Unlock(&LOCK_gethostbyname); + + /* Try it as aaa.bbb.ccc.ddd. */ + dst->s_addr = inet_addr(address); + if (dst->s_addr != -1) { + return 0; + } + return -1; +} + +#if 0 int Ndb_getInAddr(struct in_addr * dst, const char *address) { struct hostent host, * hostPtr; @@ -38,23 +64,3 @@ Ndb_getInAddr(struct in_addr * dst, const char *address) { return -1; } #endif - -#if defined NDB_LINUX || defined NDB_HPUX || defined NDB_MACOSX -int -Ndb_getInAddr(struct in_addr * dst, const char *address) { - struct hostent * hostPtr; - hostPtr = gethostbyname(address); - if (hostPtr != NULL) { - dst->s_addr = ((struct in_addr *) *hostPtr->h_addr_list)->s_addr; - return 0; - } - - /* Try it as aaa.bbb.ccc.ddd. */ - dst->s_addr = inet_addr(address); - if (dst->s_addr != -1) { - return 0; - } - return -1; -} -#endif - diff --git a/ndb/src/common/portlib/unix/NdbThread.c b/ndb/src/common/portlib/unix/NdbThread.c index 7f043bef56e..a5c42f79be8 100644 --- a/ndb/src/common/portlib/unix/NdbThread.c +++ b/ndb/src/common/portlib/unix/NdbThread.c @@ -17,7 +17,7 @@ #include #include -#include +#include #define MAX_THREAD_NAME 16 diff --git a/ndb/src/common/transporter/Makefile b/ndb/src/common/transporter/Makefile index 5fb869e27eb..372bf640566 100644 --- a/ndb/src/common/transporter/Makefile +++ b/ndb/src/common/transporter/Makefile @@ -10,7 +10,6 @@ DIRS := basictest perftest SOURCES = \ Transporter.cpp \ SendBuffer.cpp \ - SHM_Transporter.cpp \ TCP_Transporter.cpp \ TransporterRegistry.cpp \ Packer.cpp @@ -22,6 +21,7 @@ CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/include/kernel) \ ifeq ($(NDB_SHM), Y) +SOURCES += SHM_Transporter.cpp ifeq ($(NDB_OS), WIN32) SOURCES += SHM_Transporter.win32.cpp else diff --git a/ndb/src/common/transporter/SHM_Transporter.cpp b/ndb/src/common/transporter/SHM_Transporter.cpp index 525194db3a6..7c673f93c22 100644 --- a/ndb/src/common/transporter/SHM_Transporter.cpp +++ b/ndb/src/common/transporter/SHM_Transporter.cpp @@ -23,9 +23,7 @@ #include #include -#ifdef NDB_WIN32 -#include -#else +#ifndef NDB_WIN32 #include #include #endif diff --git a/ndb/src/kernel/ndb-main/Main.cpp b/ndb/src/kernel/ndb-main/Main.cpp index f936c630d50..ef33802cab6 100644 --- a/ndb/src/kernel/ndb-main/Main.cpp +++ b/ndb/src/kernel/ndb-main/Main.cpp @@ -78,10 +78,6 @@ NDB_MAIN(ndb_kernel){ char homePath[255]; NdbConfig_HomePath(homePath, 255); -#if defined (NDB_LINUX) || defined (NDB_SOLARIS) - /** - * This has only been tested with linux & solaris - */ if (theConfig->getDaemonMode()) { // Become a daemon char lockfile[255], logfile[255]; @@ -134,7 +130,6 @@ NDB_MAIN(ndb_kernel){ } g_eventLogger.info("Angel pid: %d ndb pid: %d", getppid(), getpid()); -#endif systemInfo(* theConfig, theConfig->clusterConfigurationData().SizeAltData.logLevel); diff --git a/ndb/src/mgmsrv/Makefile b/ndb/src/mgmsrv/Makefile index ebf50ecb76e..b10bdb64d30 100644 --- a/ndb/src/mgmsrv/Makefile +++ b/ndb/src/mgmsrv/Makefile @@ -6,8 +6,6 @@ BIN_TARGET := mgmtsrvr BIN_TARGET_LIBS := BIN_TARGET_ARCHIVES := mgmapi NDB_API mgmsrvcommon -LDFLAGS_LOC = -lpthread - ifneq ($(USE_EDITLINE), N) BIN_TARGET_ARCHIVES += editline DIRS := mkconfig diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index 08bfe20aa95..7c2d94c6b7f 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -15,7 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include -#include +#include #include "MgmtSrvr.hpp" #include "MgmtErrorReporter.hpp" diff --git a/ndb/src/ndbapi/Ndb.cpp b/ndb/src/ndbapi/Ndb.cpp index 68f49b975ee..448a29ca485 100644 --- a/ndb/src/ndbapi/Ndb.cpp +++ b/ndb/src/ndbapi/Ndb.cpp @@ -22,6 +22,7 @@ Name: Ndb.cpp ******************************************************************************/ #include +#include #include "NdbApiSignal.hpp" #include "NdbImpl.hpp" @@ -1244,7 +1245,7 @@ Ndb::printState(const char* fmt, ...) NdbMutex_Lock(&print_state_mutex); bool dups = false; ndbout << buf << " ndb=" << hex << this << dec; -#ifdef NDB_LINUX +#ifndef NDB_WIN32 ndbout << " thread=" << (int)pthread_self(); #endif ndbout << endl; diff --git a/ndb/src/rep/Makefile b/ndb/src/rep/Makefile index 29482b72687..9688a68ec74 100644 --- a/ndb/src/rep/Makefile +++ b/ndb/src/rep/Makefile @@ -12,8 +12,6 @@ BIN_TARGET := ndb_rep BIN_TARGET_LIBS := BIN_TARGET_ARCHIVES += editline repstorage repadapters reprequestor reptransfer mgmapi NDB_API mgmsrvcommon -LDFLAGS_LOC = -lpthread - SOURCES = \ RepMain.cpp \ Requestor.cpp \ From 6f860637c15535fec534f26cbc9025fc76eac0e4 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 May 2004 12:17:24 +0200 Subject: [PATCH 056/162] Fix broken arg fot getrlimit ndb/src/cw/cpcd/Process.cpp: Fix broken arg for getrlimit --- ndb/src/cw/cpcd/Process.cpp | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/ndb/src/cw/cpcd/Process.cpp b/ndb/src/cw/cpcd/Process.cpp index 4c6bf6ce0f6..74426306a88 100644 --- a/ndb/src/cw/cpcd/Process.cpp +++ b/ndb/src/cw/cpcd/Process.cpp @@ -25,7 +25,9 @@ #include "CPCD.hpp" #include +#ifdef HAVE_GETRLIMIT #include +#endif void CPCD::Process::print(FILE * f){ @@ -205,6 +207,7 @@ setup_environment(const char *env) { static int set_ulimit(const BaseString & pair){ +#ifdef HAVE_GETRLIMIT errno = 0; do { Vector list; @@ -212,42 +215,43 @@ set_ulimit(const BaseString & pair){ if(list.size() != 2){ break; } - - int resource = 0; + + int res; rlim_t value = RLIM_INFINITY; if(!(list[1].trim() == "unlimited")){ value = atoi(list[1].c_str()); } + + struct rlimit rlp; +#define _RLIMIT_FIX(x) { res = getrlimit(x,&rlp); if(!res){ rlp.rlim_cur = value; res = setrlimit(x, &rlp); }} + if(list[0].trim() == "c"){ - resource = RLIMIT_CORE; + _RLIMIT_FIX(RLIMIT_CORE); } else if(list[0] == "d"){ - resource = RLIMIT_DATA; + _RLIMIT_FIX(RLIMIT_DATA); } else if(list[0] == "f"){ - resource = RLIMIT_FSIZE; + _RLIMIT_FIX(RLIMIT_FSIZE); } else if(list[0] == "n"){ - resource = RLIMIT_NOFILE; + _RLIMIT_FIX(RLIMIT_NOFILE); } else if(list[0] == "s"){ - resource = RLIMIT_STACK; + _RLIMIT_FIX(RLIMIT_STACK); } else if(list[0] == "t"){ - resource = RLIMIT_CPU; + _RLIMIT_FIX(RLIMIT_CPU); } else { errno = EINVAL; break; } - struct rlimit rlp; - if(getrlimit(resource, &rlp) != 0){ + if(!res) break; - } - - rlp.rlim_cur = value; - if(setrlimit(resource, &rlp) != 0){ - break; - } + return 0; } while(false); logger.error("Unable to process ulimit: %s(%s)", pair.c_str(), strerror(errno)); return -1; +#else + return 0; // Maybe it's ok anyway... +#endif } void From 3f46ae17a2f8d65a816091a8d643917c2b2815f6 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 May 2004 12:52:08 +0200 Subject: [PATCH 057/162] NdbMutex.h: oops forgot this one ndb/include/portlib/NdbMutex.h: oops forgot this one --- ndb/include/portlib/NdbMutex.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndb/include/portlib/NdbMutex.h b/ndb/include/portlib/NdbMutex.h index 52638b19c7e..28adaacb8c4 100644 --- a/ndb/include/portlib/NdbMutex.h +++ b/ndb/include/portlib/NdbMutex.h @@ -35,7 +35,7 @@ typedef SEMAPHORE NdbMutex; #elif defined NDB_WIN32 typedef CRITICAL_SECTION NdbMutex; #else -#include +#include typedef pthread_mutex_t NdbMutex; #define NDB_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER #endif From 79f269cb4d342305bc2e34939d881ba210692340 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 May 2004 14:16:04 +0200 Subject: [PATCH 058/162] Daemon code to run on all unixes --- ndb/src/common/portlib/unix/NdbDaemon.c | 6 +++--- ndb/src/common/portlib/win32/NdbDaemon.c | 7 +++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ndb/src/common/portlib/unix/NdbDaemon.c b/ndb/src/common/portlib/unix/NdbDaemon.c index 6eb319e1fcf..186331a4dab 100644 --- a/ndb/src/common/portlib/unix/NdbDaemon.c +++ b/ndb/src/common/portlib/unix/NdbDaemon.c @@ -18,11 +18,10 @@ #include "NdbDaemon.h" #define NdbDaemon_ErrorSize 500 -#if defined(NDB_LINUX) || defined(NDB_SOLARIS) - /* XXX fix other unixes */ long NdbDaemon_DaemonPid; int NdbDaemon_ErrorCode; char NdbDaemon_ErrorText[NdbDaemon_ErrorSize]; + int NdbDaemon_Make(const char* lockfile, const char* logfile, unsigned flags) { @@ -130,7 +129,8 @@ NdbDaemon_Make(const char* lockfile, const char* logfile, unsigned flags) /* Success */ return 0; } -#else + +#if 0 int NdbDaemon_Make(const char* lockfile, const char* logfile, unsigned flags) { diff --git a/ndb/src/common/portlib/win32/NdbDaemon.c b/ndb/src/common/portlib/win32/NdbDaemon.c index b96d4c20260..972fb1b88d8 100644 --- a/ndb/src/common/portlib/win32/NdbDaemon.c +++ b/ndb/src/common/portlib/win32/NdbDaemon.c @@ -14,6 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include "NdbDaemon.h" #define NdbDaemon_ErrorSize 500 @@ -24,8 +25,10 @@ char NdbDaemon_ErrorText[NdbDaemon_ErrorSize]; int NdbDaemon_Make(const char* lockfile, const char* logfile, unsigned flags) { - // XXX do something - return 0; + /* Fail */ + snprintf(NdbDaemon_ErrorText, NdbDaemon_ErrorSize, + "Daemon mode not implemented"); + return -1; } #ifdef NDB_DAEMON_TEST From fc5445ac0349bcd58dd8d037c6a53e127b7ee69a Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 May 2004 16:44:53 +0300 Subject: [PATCH 059/162] InnoDB: avoid some data races in innobase_mysql_print_thd() (Bug #3596) sql/ha_innodb.cc: innobase_mysql_print_thd(): initial fix to Bug #3596 --- sql/ha_innodb.cc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index ac7ccf5c11a..8651125e331 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -323,9 +323,10 @@ innobase_mysql_print_thd( FILE* f, /* in: output stream */ void* input_thd)/* in: pointer to a MySQL THD object */ { - THD* thd; + const THD* thd; + const char* s; - thd = (THD*) input_thd; + thd = (const THD*) input_thd; fprintf(f, "MySQL thread id %lu, query id %lu", thd->thread_id, thd->query_id); @@ -344,14 +345,14 @@ innobase_mysql_print_thd( fputs(thd->user, f); } - if (thd->proc_info) { + if ((s = thd->proc_info)) { putc(' ', f); - fputs(thd->proc_info, f); + fputs(s, f); } - if (thd->query) { + if ((s = thd->query)) { putc(' ', f); - fputs(thd->query, f); + fputs(s, f); } putc('\n', f); From 05fd891ccc7402407a2a8b41bdd18cbf208f7f1e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 May 2004 16:15:43 +0200 Subject: [PATCH 060/162] regression.sh: fixed typo ndb/bin/regression.sh: fixed typo --- ndb/bin/regression.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndb/bin/regression.sh b/ndb/bin/regression.sh index 5e3491af208..5d0531c7460 100644 --- a/ndb/bin/regression.sh +++ b/ndb/bin/regression.sh @@ -294,7 +294,7 @@ executeTest 'testScan -n ScanUpdate2' T6 executeTest 'drop_tab' T6 executeTest 'testScan -n ScanDelete' -executeTest 'drop_all_tab' +executeTest 'drop_all_tabs' executeTest 'testScan -n ScanDelete2' T10 executeTest 'drop_tab' T10 From ae94c9a1d8df90021395eb39c1dc476e663b9593 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 May 2004 20:58:35 +0200 Subject: [PATCH 061/162] Only compile SHM if configured to --- ndb/src/common/transporter/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndb/src/common/transporter/Makefile b/ndb/src/common/transporter/Makefile index 5fb869e27eb..372bf640566 100644 --- a/ndb/src/common/transporter/Makefile +++ b/ndb/src/common/transporter/Makefile @@ -10,7 +10,6 @@ DIRS := basictest perftest SOURCES = \ Transporter.cpp \ SendBuffer.cpp \ - SHM_Transporter.cpp \ TCP_Transporter.cpp \ TransporterRegistry.cpp \ Packer.cpp @@ -22,6 +21,7 @@ CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/include/kernel) \ ifeq ($(NDB_SHM), Y) +SOURCES += SHM_Transporter.cpp ifeq ($(NDB_OS), WIN32) SOURCES += SHM_Transporter.win32.cpp else From 018b103bfe80167aae6d1adecb49e59a23ab34ee Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 13 May 2004 10:30:42 +0500 Subject: [PATCH 062/162] client_test with embedded library will be built so one can check if he broke something in embedded PS BitKeeper/etc/ignore: Added libmysqld/examples/client_test.c to the ignore list libmysqld/examples/Makefile.am: tests/client_test is now symlinked to libmysqld/examples catalog then it's built with libmysqld.a --- .bzrignore | 1 + libmysqld/examples/Makefile.am | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.bzrignore b/.bzrignore index d116fd29c41..338bc04fabc 100644 --- a/.bzrignore +++ b/.bzrignore @@ -779,3 +779,4 @@ ndb/config/config.mk ndb/src/common/mgmcommon/printConfig/*.d ndb/src/mgmclient/test_cpcd/*.d *.d +libmysqld/examples/client_test.c diff --git a/libmysqld/examples/Makefile.am b/libmysqld/examples/Makefile.am index fe56926039d..b11db65baf6 100644 --- a/libmysqld/examples/Makefile.am +++ b/libmysqld/examples/Makefile.am @@ -1,11 +1,16 @@ -noinst_PROGRAMS = mysqltest mysql +noinst_PROGRAMS = mysqltest mysql client_test client_sources = $(mysqltest_SOURCES) $(mysql_SOURCES) +tests_sources= $(client_test_SOURCES) link_sources: for f in $(client_sources); do \ rm -f $(srcdir)/$$f; \ @LN_CP_F@ $(srcdir)/../../client/$$f $(srcdir)/$$f; \ done; + for f in $(tests_sources); do \ + rm -f $(srcdir)/$$f; \ + @LN_CP_F@ $(srcdir)/../../tests/$$f $(srcdir)/$$f; \ + done; DEFS = -DEMBEDDED_LIBRARY INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include -I$(srcdir) \ @@ -21,8 +26,11 @@ mysql_SOURCES = mysql.cc readline.cc completion_hash.cc \ my_readline.h sql_string.h completion_hash.h mysql_LDADD = @readline_link@ @TERMCAP_LIB@ $(LDADD) +client_test_SOURCES = client_test.c + clean: rm -f $(client_sources) + rm -f $(tests_sources) # Don't update the files from bitkeeper %::SCCS/s.% From b58eb134bb89c2b4102e9d8d662e2af90e1ace73 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 13 May 2004 13:42:36 +0200 Subject: [PATCH 063/162] portability fixes --- ndb/Defs.mk | 1 - ndb/include/ndb_types.h | 10 ++++++++-- ndb/src/common/portlib/unix/NdbMem.c | 12 ++++++------ 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/ndb/Defs.mk b/ndb/Defs.mk index cf891caa5c2..ac4507562fd 100644 --- a/ndb/Defs.mk +++ b/ndb/Defs.mk @@ -40,7 +40,6 @@ SHLIBEXT := sl endif ifeq ($(NDB_OS), MACOSX) -CCFLAGS_TOP += -DNDBOUT_UINTPTR SHLIBEXT := dylib endif diff --git a/ndb/include/ndb_types.h b/ndb/include/ndb_types.h index 166368b99c5..5e7b952cfc5 100644 --- a/ndb/include/ndb_types.h +++ b/ndb/include/ndb_types.h @@ -18,8 +18,8 @@ * @file ndb_types.h */ -#ifndef SYS_TYPES_H -#define SYS_TYPES_H +#ifndef NDB_TYPES_H +#define NDB_TYPES_H typedef char Int8; typedef unsigned char Uint8; @@ -33,7 +33,13 @@ typedef unsigned int UintR; #ifdef __SIZE_TYPE__ typedef __SIZE_TYPE__ UintPtr; #else +#include +#ifdef HAVE_STDINT_H #include +#endif +#ifdef HAVE_INTTYPES_H +#include +#endif typedef uintptr_t UintPtr; #endif diff --git a/ndb/src/common/portlib/unix/NdbMem.c b/ndb/src/common/portlib/unix/NdbMem.c index ce422f45a9d..0b06e5b23f1 100644 --- a/ndb/src/common/portlib/unix/NdbMem.c +++ b/ndb/src/common/portlib/unix/NdbMem.c @@ -54,18 +54,18 @@ void NdbMem_Free(void* ptr) int NdbMem_MemLockAll(){ -#ifndef HAVE_MLOCKALL - return -1; -#else +#if defined(HAVE_MLOCKALL) && defined(MCL_CURRENT) return mlockall(MCL_CURRENT); +#else + return -1; #endif } int NdbMem_MemUnlockAll(){ -#ifndef HAVE_MLOCKALL - return -1; -#else +#if defined(HAVE_MLOCKALL) && defined(MCL_CURRENT) return munlockall(); +#else + return -1; #endif } From 97ae6904dfe5cc7ca486e50362103a72f68c557c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 13 May 2004 13:44:45 +0200 Subject: [PATCH 064/162] portability fix for MACOSX bugreport 3735 ndb/src/ndbapi/Ndberr.cpp: Rename: ndb/src/ndbapi/Ndberror.cpp -> ndb/src/ndbapi/Ndberr.cpp --- ndb/src/ndbapi/Makefile | 2 +- ndb/src/ndbapi/{Ndberror.cpp => Ndberr.cpp} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename ndb/src/ndbapi/{Ndberror.cpp => Ndberr.cpp} (100%) diff --git a/ndb/src/ndbapi/Makefile b/ndb/src/ndbapi/Makefile index 328bb5e3741..f4c82e5d6ba 100644 --- a/ndb/src/ndbapi/Makefile +++ b/ndb/src/ndbapi/Makefile @@ -31,7 +31,7 @@ SOURCES = \ Ndblist.cpp \ Ndbif.cpp \ Ndbinit.cpp \ - Ndberror.cpp \ + Ndberr.cpp \ ndberror.c \ NdbErrorOut.cpp \ NdbConnection.cpp \ diff --git a/ndb/src/ndbapi/Ndberror.cpp b/ndb/src/ndbapi/Ndberr.cpp similarity index 100% rename from ndb/src/ndbapi/Ndberror.cpp rename to ndb/src/ndbapi/Ndberr.cpp From 72595adab2185307c4fc9e9d028ac2e340e27ab8 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 13 May 2004 15:28:56 +0300 Subject: [PATCH 065/162] InnoDB: Remove os_file_lock() from the 4.0 tree (unfix Bug #3608) innobase/os/os0file.c: Remove os_file_lock() --- innobase/os/os0file.c | 41 ----------------------------------------- 1 file changed, 41 deletions(-) diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index 833703e38dd..81566337218 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -358,32 +358,6 @@ os_file_handle_error( return(FALSE); } -#if !defined(__WIN__) && !defined(UNIV_HOTBACKUP) -/******************************************************************** -Obtain an exclusive lock on a file. */ -static -int -os_file_lock( -/*=========*/ - /* out: 0 on success */ - int fd, /* in: file descriptor */ - const char* name) /* in: file name */ -{ - struct flock lk; - lk.l_type = F_WRLCK; - lk.l_whence = SEEK_SET; - lk.l_start = lk.l_len = 0; - if (fcntl(fd, F_SETLK, &lk) == -1) { - fprintf(stderr, - "InnoDB: Unable to lock %s", name); - perror (": fcntl"); - close(fd); - return(-1); - } - return 0; -} -#endif /* !defined(__WIN__) && !defined(UNIV_HOTBACKUP) */ - /******************************************************************** Creates the seek mutexes used in positioned reads and writes. */ @@ -504,11 +478,6 @@ try_again: if (retry) { goto try_again; } -#ifndef UNIV_HOTBACKUP - } else if (os_file_lock(file, name)) { - *success = FALSE; - file = -1; -#endif } else { *success = TRUE; } @@ -603,11 +572,6 @@ os_file_create_simple_no_error_handling( if (file == -1) { *success = FALSE; -#ifndef UNIV_HOTBACKUP - } else if (os_file_lock(file, name)) { - *success = FALSE; - file = -1; -#endif } else { *success = TRUE; } @@ -808,11 +772,6 @@ try_again: if (retry) { goto try_again; } -#ifndef UNIV_HOTBACKUP - } else if (os_file_lock(file, name)) { - *success = FALSE; - file = -1; -#endif } else { *success = TRUE; } From 6a39732037065acfedfbc840f776ba7b754ed6c3 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 13 May 2004 15:51:02 +0300 Subject: [PATCH 066/162] InnoDB: fixed bug in dict0dict.c: dict_index_name_print() innobase/dict/dict0dict.c: dict_index_name_print(): output table name to file, not stderr --- innobase/dict/dict0dict.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c index fa80532a32d..51e92a9900f 100644 --- a/innobase/dict/dict0dict.c +++ b/innobase/dict/dict0dict.c @@ -4195,5 +4195,5 @@ dict_index_name_print( fputs("index ", file); ut_print_name(file, index->name); fputs(" of table ", file); - ut_print_name(stderr, index->table_name); + ut_print_name(file, index->table_name); } From 9e20f63aecd3582957a9f79e8b95cc03ae3f1c7a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 13 May 2004 16:18:39 +0300 Subject: [PATCH 067/162] ha_innodb.cc: innobase_mysql_print_thd(): protect thd with LOCK_thread_count (Bug #3596) sql/ha_innodb.cc: innobase_mysql_print_thd(): protect thd with LOCK_thread_count --- sql/ha_innodb.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 8651125e331..d5bbeb874ad 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -328,6 +328,8 @@ innobase_mysql_print_thd( thd = (const THD*) input_thd; + VOID(pthread_mutex_lock(&LOCK_thread_count)); + fprintf(f, "MySQL thread id %lu, query id %lu", thd->thread_id, thd->query_id); if (thd->host) { @@ -351,11 +353,16 @@ innobase_mysql_print_thd( } if ((s = thd->query)) { - putc(' ', f); - fputs(s, f); + /* determine the length of the query string */ + uint32 i, len = thd->query_length; + for (i = 0; i < len && s[i]; i++); + putc('\n', f); + fwrite(s, 1, i, f); } putc('\n', f); + + VOID(pthread_mutex_unlock(&LOCK_thread_count)); } /************************************************************************* From a6ff8d00e04dd58f86772e86c37775dfe0371fd8 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 13 May 2004 18:50:09 +0200 Subject: [PATCH 068/162] - make sure the binaries are executable before calling them during make_binary_distribution (bug#2857) scripts/make_binary_distribution.sh: - make sure the binaries are executable before calling them (bug#2857) --- scripts/make_binary_distribution.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index c7945e31eda..730086bbb62 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -221,6 +221,7 @@ $CP mysql-test/t/*test mysql-test/t/*.opt mysql-test/t/*.slave-mi mysql-test/t/* $CP mysql-test/r/*result mysql-test/r/*.require $BASE/mysql-test/r if [ $BASE_SYSTEM != "netware" ] ; then + chmod a+x $BASE/bin/* $CP scripts/* $BASE/bin $BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ ./bin \@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db $BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \@MYSQLD_USER\@ root \@localstatedir\@ /usr/local/mysql/data \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/support-files/mysql.server.sh > $BASE/support-files/mysql.server From 6be0dc127370a7c2dc86da7263600c9acb5b38bc Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 13 May 2004 20:02:05 +0300 Subject: [PATCH 069/162] ha_innodb.cc: A flawed fix of the thd->query race in SHOW INNODB STATUS; see the comments in code about how to fix this properly; we cannot use LOCK_thread_count to protect thd->query, because that will cause a deadlock of threads sql/ha_innodb.cc: A flawed fix of the thd->query race in SHOW INNODB STATUS; see the comments in code about how to fix this properly; we cannot use LOCK_thread_count to protect thd->query, because that will cause a deadlock of threads --- sql/ha_innodb.cc | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index d5bbeb874ad..e330a0b532f 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -325,10 +325,18 @@ innobase_mysql_print_thd( { const THD* thd; const char* s; + char buf[301]; thd = (const THD*) input_thd; - VOID(pthread_mutex_lock(&LOCK_thread_count)); +/* We cannot use LOCK_thread_count to protect this operation because we own +the InnoDB kernel_mutex when we enter this function, but in freeing of a +THD object, MySQL first reserves LOCK_thread_count and AFTER THAT InnoDB +reserves kernel_mutex when freeing the trx object => a deadlock can occur. +The solution is for MySQL to use a separate mutex to protect thd->query and +thd->query_len. Someone should do that! This bug has been here for 3 years! + + VOID(pthread_mutex_lock(&LOCK_thread_count)); */ fprintf(f, "MySQL thread id %lu, query id %lu", thd->thread_id, thd->query_id); @@ -354,15 +362,29 @@ innobase_mysql_print_thd( if ((s = thd->query)) { /* determine the length of the query string */ - uint32 i, len = thd->query_length; + uint32 i, len; + + len = thd->query_length; + + if (len > 300) { + len = 300; /* A TEMPORARY SOLUTION: print at most + 300 chars to reduce the probability of + a seg fault in a race */ + } + for (i = 0; i < len && s[i]; i++); + + memcpy(buf, s, i); /* use memcpy to reduce the timeframe + for a race, compared to fwrite() */ + buf[300] = '\0'; + putc('\n', f); - fwrite(s, 1, i, f); + fwrite(buf, 1, i, f); } putc('\n', f); - VOID(pthread_mutex_unlock(&LOCK_thread_count)); +/* VOID(pthread_mutex_unlock(&LOCK_thread_count)); */ } /************************************************************************* From ae17c3c712695388f93faa4e5f9baca1163f653d Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 13 May 2004 22:07:51 +0300 Subject: [PATCH 070/162] ha_innodb.cc, trx0trx.h, lock0lock.c, trx0trx.c: Reserve the MySQL LOCK_thread_count mutex when printing thd->query of an arbitrary transaction; if we are printing thd->query of a transaction that we know is currently executing inside InnoDB, then we know that MySQL cannot meanwhile change thd->query, and no need to reserve the MySQL mutex; note that this patch still leaves open the possibility of races in MySQL's thd->query_len innobase/trx/trx0trx.c: Reserve the MySQL LOCK_thread_count mutex when printing thd->query of an arbitrary transaction; if we are printing thd->query of the a transaction that we know is currently executing inside InnoDB, then we know that MySQL cannot meanwhile change thd->query, and no need to reserve the MySQL mutex; note that thsi patch still leaves aopen the possibility of races in MySQL's thd->query_len innobase/lock/lock0lock.c: Reserve the MySQL LOCK_thread_count mutex when printing thd->query of an arbitrary transaction; if we are printing thd->query of the a transaction that we know is currently executing inside InnoDB, then we know that MySQL cannot meanwhile change thd->query, and no need to reserve the MySQL mutex; note that thsi patch still leaves aopen the possibility of races in MySQL's thd->query_len innobase/include/trx0trx.h: Reserve the MySQL LOCK_thread_count mutex when printing thd->query of an arbitrary transaction; if we are printing thd->query of the a transaction that we know is currently executing inside InnoDB, then we know that MySQL cannot meanwhile change thd->query, and no need to reserve the MySQL mutex; note that thsi patch still leaves aopen the possibility of races in MySQL's thd->query_len sql/ha_innodb.cc: Reserve the MySQL LOCK_thread_count mutex when printing thd->query of an arbitrary transaction; if we are printing thd->query of the a transaction that we know is currently executing inside InnoDB, then we know that MySQL cannot meanwhile change thd->query, and no need to reserve the MySQL mutex; note that thsi patch still leaves aopen the possibility of races in MySQL's thd->query_len --- innobase/include/trx0trx.h | 6 +++-- innobase/lock/lock0lock.c | 34 +++++++++++++++++++++++++++ innobase/trx/trx0trx.c | 4 +++- sql/ha_innodb.cc | 48 +++++++++++++++++++++++++++----------- 4 files changed, 75 insertions(+), 17 deletions(-) diff --git a/innobase/include/trx0trx.h b/innobase/include/trx0trx.h index 71269cb1e4e..07d5e5a8215 100644 --- a/innobase/include/trx0trx.h +++ b/innobase/include/trx0trx.h @@ -275,13 +275,15 @@ trx_commit_step( que_thr_t* thr); /* in: query thread */ /************************************************************************** Prints info about a transaction to the standard output. The caller must -own the kernel mutex. */ +own the kernel mutex and must have called +innobase_mysql_prepare_print_arbitrary_thd(), unless he knows that MySQL or +InnoDB cannot meanwhile change the info printed here. */ void trx_print( /*======*/ FILE* f, /* in: output stream */ - trx_t* trx); /* in: transaction */ + trx_t* trx); /* in: transaction */ /* Signal to a transaction */ diff --git a/innobase/lock/lock0lock.c b/innobase/lock/lock0lock.c index 4343496f6e1..791b81366b2 100644 --- a/innobase/lock/lock0lock.c +++ b/innobase/lock/lock0lock.c @@ -17,6 +17,32 @@ Created 5/7/1996 Heikki Tuuri #include "dict0mem.h" #include "trx0sys.h" + +/* 2 function prototypes copied from ha_innodb.cc: */ + +/***************************************************************** +If you want to print a thd that is not associated with the current thread, +you must call this function before reserving the InnoDB kernel_mutex, to +protect MySQL from setting thd->query NULL. If you print a thd of the current +thread, we know that MySQL cannot modify thd->query, and it is not necessary +to call this. Call innobase_mysql_end_print_arbitrary_thd() after you release +the kernel_mutex. +NOTE that /mysql/innobase/lock/lock0lock.c must contain the prototype for this +function! */ + +void +innobase_mysql_prepare_print_arbitrary_thd(void); +/*============================================*/ + +/***************************************************************** +Relases the mutex reserved by innobase_mysql_prepare_print_arbitrary_thd(). +NOTE that /mysql/innobase/lock/lock0lock.c must contain the prototype for this +function! */ + +void +innobase_mysql_end_print_arbitrary_thd(void); +/*========================================*/ + /* Restricts the length of search we will do in the waits-for graph of transactions */ #define LOCK_MAX_N_STEPS_IN_DEADLOCK_CHECK 1000000 @@ -3974,6 +4000,11 @@ lock_print_info( ulint i; mtr_t mtr; + /* We must protect the MySQL thd->query field with a MySQL mutex, and + because the MySQL mutex must be reserved before the kernel_mutex of + InnoDB, we call innobase_mysql_prepare_print_arbitrary_thd() here. */ + + innobase_mysql_prepare_print_arbitrary_thd(); lock_mutex_enter_kernel(); if (lock_deadlock_found) { @@ -4037,6 +4068,7 @@ loop: if (trx == NULL) { lock_mutex_exit_kernel(); + innobase_mysql_end_print_arbitrary_thd(); ut_ad(lock_validate()); @@ -4101,6 +4133,7 @@ loop: if (load_page_first) { lock_mutex_exit_kernel(); + innobase_mysql_end_print_arbitrary_thd(); mtr_start(&mtr); @@ -4110,6 +4143,7 @@ loop: load_page_first = FALSE; + innobase_mysql_prepare_print_arbitrary_thd(); lock_mutex_enter_kernel(); goto loop; diff --git a/innobase/trx/trx0trx.c b/innobase/trx/trx0trx.c index 69cd6c7b22d..335e1f69228 100644 --- a/innobase/trx/trx0trx.c +++ b/innobase/trx/trx0trx.c @@ -1562,7 +1562,9 @@ trx_mark_sql_stat_end( /************************************************************************** Prints info about a transaction to the standard output. The caller must -own the kernel mutex. */ +own the kernel mutex and must have called +innobase_mysql_prepare_print_arbitrary_thd(), unless he knows that MySQL or +InnoDB cannot meanwhile change the info printed here. */ void trx_print( diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index e330a0b532f..194c8b558f0 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -312,6 +312,35 @@ convert_error_code_to_mysql( } } +/***************************************************************** +If you want to print a thd that is not associated with the current thread, +you must call this function before reserving the InnoDB kernel_mutex, to +protect MySQL from setting thd->query NULL. If you print a thd of the current +thread, we know that MySQL cannot modify thd->query, and it is not necessary +to call this. Call innobase_mysql_end_print_arbitrary_thd() after you release +the kernel_mutex. +NOTE that /mysql/innobase/lock/lock0lock.c must contain the prototype for this +function! */ +extern "C" +void +innobase_mysql_prepare_print_arbitrary_thd(void) +/*============================================*/ +{ + VOID(pthread_mutex_lock(&LOCK_thread_count)); +} + +/***************************************************************** +Relases the mutex reserved by innobase_mysql_prepare_print_arbitrary_thd(). +NOTE that /mysql/innobase/lock/lock0lock.c must contain the prototype for this +function! */ +extern "C" +void +innobase_mysql_end_print_arbitrary_thd(void) +/*========================================*/ +{ + VOID(pthread_mutex_unlock(&LOCK_thread_count)); +} + /***************************************************************** Prints info of a THD object (== user session thread) to the standard output. NOTE that /mysql/innobase/trx/trx0trx.c must contain @@ -329,15 +358,6 @@ innobase_mysql_print_thd( thd = (const THD*) input_thd; -/* We cannot use LOCK_thread_count to protect this operation because we own -the InnoDB kernel_mutex when we enter this function, but in freeing of a -THD object, MySQL first reserves LOCK_thread_count and AFTER THAT InnoDB -reserves kernel_mutex when freeing the trx object => a deadlock can occur. -The solution is for MySQL to use a separate mutex to protect thd->query and -thd->query_len. Someone should do that! This bug has been here for 3 years! - - VOID(pthread_mutex_lock(&LOCK_thread_count)); */ - fprintf(f, "MySQL thread id %lu, query id %lu", thd->thread_id, thd->query_id); if (thd->host) { @@ -367,14 +387,16 @@ thd->query_len. Someone should do that! This bug has been here for 3 years! len = thd->query_length; if (len > 300) { - len = 300; /* A TEMPORARY SOLUTION: print at most + len = 300; /* ADDITIONAL SAFETY: print at most 300 chars to reduce the probability of - a seg fault in a race */ + a seg fault if there is a race in + thd->query_len in MySQL; on May 13, + 2004 we do not know */ } for (i = 0; i < len && s[i]; i++); - memcpy(buf, s, i); /* use memcpy to reduce the timeframe + memcpy(buf, s, i); /* Use memcpy to reduce the timeframe for a race, compared to fwrite() */ buf[300] = '\0'; @@ -383,8 +405,6 @@ thd->query_len. Someone should do that! This bug has been here for 3 years! } putc('\n', f); - -/* VOID(pthread_mutex_unlock(&LOCK_thread_count)); */ } /************************************************************************* From fd51cf47a9fd61dc1102cacfcb1e77cb1f19d702 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 13 May 2004 23:47:20 +0300 Subject: [PATCH 071/162] fixed flags of printed query --- mysql-test/r/auto_increment.result | 2 +- mysql-test/r/bench_count_distinct.result | 2 +- mysql-test/r/case.result | 6 +- mysql-test/r/cast.result | 2 +- mysql-test/r/ctype_collate.result | 2 +- mysql-test/r/date_formats.result | 2 +- mysql-test/r/fulltext.result | 4 +- mysql-test/r/func_compress.result | 4 +- mysql-test/r/func_crypt.result | 2 +- mysql-test/r/func_default.result | 2 +- mysql-test/r/func_gconcat.result | 6 +- mysql-test/r/func_if.result | 4 +- mysql-test/r/func_in.result | 2 +- mysql-test/r/func_math.result | 26 +++---- mysql-test/r/func_op.result | 4 +- mysql-test/r/func_regexp.result | 2 +- mysql-test/r/func_set.result | 2 +- mysql-test/r/func_str.result | 2 +- mysql-test/r/func_system.result | 2 +- mysql-test/r/func_test.result | 12 ++-- mysql-test/r/func_time.result | 2 +- mysql-test/r/gis.result | 22 +++--- mysql-test/r/group_by.result | 2 +- mysql-test/r/having.result | 2 +- mysql-test/r/insert_update.result | 4 +- mysql-test/r/null.result | 6 +- mysql-test/r/olap.result | 2 +- mysql-test/r/query_cache.result | 2 +- mysql-test/r/row.result | 2 +- mysql-test/r/rpl000001.result | 4 +- mysql-test/r/rpl_get_lock.result | 2 +- mysql-test/r/rpl_master_pos_wait.result | 2 +- mysql-test/r/select.result | 2 +- mysql-test/r/subselect.result | 92 ++++++++++++------------ mysql-test/r/type_blob.result | 2 +- mysql-test/r/union.result | 4 +- mysql-test/r/varbinary.result | 2 +- mysql-test/r/variables.result | 6 +- sql/sql_select.cc | 12 ++-- 39 files changed, 131 insertions(+), 131 deletions(-) diff --git a/mysql-test/r/auto_increment.result b/mysql-test/r/auto_increment.result index 9541fa6d355..66b24248cf9 100644 --- a/mysql-test/r/auto_increment.result +++ b/mysql-test/r/auto_increment.result @@ -142,7 +142,7 @@ explain extended select last_insert_id(); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority no_cache last_insert_id() AS `last_insert_id()` +Note 1003 select sql_no_cache last_insert_id() AS `last_insert_id()` insert into t1 set i = 254; ERROR 23000: Duplicate entry '254' for key 1 select last_insert_id(); diff --git a/mysql-test/r/bench_count_distinct.result b/mysql-test/r/bench_count_distinct.result index 2b4701389db..fcc0c0948b3 100644 --- a/mysql-test/r/bench_count_distinct.result +++ b/mysql-test/r/bench_count_distinct.result @@ -7,5 +7,5 @@ explain extended select count(distinct n) from t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL n 4 NULL 200 Using index Warnings: -Note 1003 select high_priority count(distinct test.t1.n) AS `count(distinct n)` from test.t1 +Note 1003 select count(distinct test.t1.n) AS `count(distinct n)` from test.t1 drop table t1; diff --git a/mysql-test/r/case.result b/mysql-test/r/case.result index 14b1788ddd6..1aa838140fd 100644 --- a/mysql-test/r/case.result +++ b/mysql-test/r/case.result @@ -27,7 +27,7 @@ explain extended select CASE 1 when 1 then "one" WHEN 2 then "two" ELSE "more" E id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority (case 1 when 1 then _latin1'one' when 2 then _latin1'two' else _latin1'more' end) AS `CASE 1 when 1 then "one" WHEN 2 then "two" ELSE "more" END` +Note 1003 select (case 1 when 1 then _latin1'one' when 2 then _latin1'two' else _latin1'more' end) AS `CASE 1 when 1 then "one" WHEN 2 then "two" ELSE "more" END` select CASE 2.0 when 1 then "one" WHEN 2.0 then "two" ELSE "more" END; CASE 2.0 when 1 then "one" WHEN 2.0 then "two" ELSE "more" END two @@ -66,7 +66,7 @@ explain extended select case a when 1 then 2 when 2 then 3 else 0 end as fcase, id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using temporary; Using filesort Warnings: -Note 1003 select high_priority (case test.t1.a when 1 then 2 when 2 then 3 else 0 end) AS `fcase`,count(0) AS `count(*)` from test.t1 group by (case test.t1.a when 1 then 2 when 2 then 3 else 0 end) +Note 1003 select (case test.t1.a when 1 then 2 when 2 then 3 else 0 end) AS `fcase`,count(0) AS `count(*)` from test.t1 group by (case test.t1.a when 1 then 2 when 2 then 3 else 0 end) select case a when 1 then "one" when 2 then "two" else "nothing" end as fcase, count(*) from t1 group by fcase; fcase count(*) nothing 2 @@ -141,7 +141,7 @@ COALESCE('a' COLLATE latin1_bin,'b'); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority coalesce(1) AS `COALESCE(1)`,coalesce(1.0) AS `COALESCE(1.0)`,coalesce(_latin1'a') AS `COALESCE('a')`,coalesce(1,1.0) AS `COALESCE(1,1.0)`,coalesce(1,_latin1'1') AS `COALESCE(1,'1')`,coalesce(1.1,_latin1'1') AS `COALESCE(1.1,'1')`,coalesce((_latin1'a' collate _latin1'latin1_bin'),_latin1'b') AS `COALESCE('a' COLLATE latin1_bin,'b')` +Note 1003 select coalesce(1) AS `COALESCE(1)`,coalesce(1.0) AS `COALESCE(1.0)`,coalesce(_latin1'a') AS `COALESCE('a')`,coalesce(1,1.0) AS `COALESCE(1,1.0)`,coalesce(1,_latin1'1') AS `COALESCE(1,'1')`,coalesce(1.1,_latin1'1') AS `COALESCE(1.1,'1')`,coalesce((_latin1'a' collate _latin1'latin1_bin'),_latin1'b') AS `COALESCE('a' COLLATE latin1_bin,'b')` SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result index cdeb5b3dc21..6564a3e392b 100644 --- a/mysql-test/r/cast.result +++ b/mysql-test/r/cast.result @@ -20,7 +20,7 @@ explain extended select ~5, cast(~5 as signed); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority ~(5) AS `~5`,cast(~(5) as signed) AS `cast(~5 as signed)` +Note 1003 select ~(5) AS `~5`,cast(~(5) as signed) AS `cast(~5 as signed)` select cast(5 as unsigned) -6.0; cast(5 as unsigned) -6.0 -1.0 diff --git a/mysql-test/r/ctype_collate.result b/mysql-test/r/ctype_collate.result index 8f4ddedbfcf..d4a8beda185 100644 --- a/mysql-test/r/ctype_collate.result +++ b/mysql-test/r/ctype_collate.result @@ -519,7 +519,7 @@ explain extended SELECT charset('a'),collation('a'),coercibility('a'),'a'='A'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority charset(_latin1'a') AS `charset('a')`,collation(_latin1'a') AS `collation('a')`,coercibility(_latin1'a') AS `coercibility('a')`,(_latin1'a' = _latin1'A') AS `'a'='A'` +Note 1003 select charset(_latin1'a') AS `charset('a')`,collation(_latin1'a') AS `collation('a')`,coercibility(_latin1'a') AS `coercibility('a')`,(_latin1'a' = _latin1'A') AS `'a'='A'` SET CHARACTER SET koi8r; SHOW VARIABLES LIKE 'collation_client'; Variable_name Value diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result index fba1d9f47e3..b73953823ca 100644 --- a/mysql-test/r/date_formats.result +++ b/mysql-test/r/date_formats.result @@ -331,7 +331,7 @@ explain extended select makedate(1997,1), addtime("31.12.97 11.59.59.999999 PM", id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority makedate(1997,1) AS `makedate(1997,1)`,addtime(_latin1'31.12.97 11.59.59.999999 PM',_latin1'31.12.97 11.59.59.999999 PM') AS `addtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002")`,subtime(_latin1'31.12.97 11.59.59.999999 PM',_latin1'31.12.97 11.59.59.999999 PM') AS `subtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002")`,timediff(_latin1'01.01.97 11:59:59.000001 PM',_latin1'31.12.95 11:59:59.000002 PM') AS `timediff("01.01.97 11:59:59.000001 PM","31.12.95 11:59:59.000002 PM")`,cast(str_to_date(_latin1'15-01-2001 12:59:59',_latin1'%d-%m-%Y %H:%i:%S') as time) AS `cast(str_to_date("15-01-2001 12:59:59", "%d-%m-%Y %H:%i:%S") as TIME)`,maketime(23,11,12) AS `maketime(23,11,12)`,microsecond(_latin1'1997-12-31 23:59:59.000001') AS `microsecond("1997-12-31 23:59:59.000001")` +Note 1003 select makedate(1997,1) AS `makedate(1997,1)`,addtime(_latin1'31.12.97 11.59.59.999999 PM',_latin1'31.12.97 11.59.59.999999 PM') AS `addtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002")`,subtime(_latin1'31.12.97 11.59.59.999999 PM',_latin1'31.12.97 11.59.59.999999 PM') AS `subtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002")`,timediff(_latin1'01.01.97 11:59:59.000001 PM',_latin1'31.12.95 11:59:59.000002 PM') AS `timediff("01.01.97 11:59:59.000001 PM","31.12.95 11:59:59.000002 PM")`,cast(str_to_date(_latin1'15-01-2001 12:59:59',_latin1'%d-%m-%Y %H:%i:%S') as time) AS `cast(str_to_date("15-01-2001 12:59:59", "%d-%m-%Y %H:%i:%S") as TIME)`,maketime(23,11,12) AS `maketime(23,11,12)`,microsecond(_latin1'1997-12-31 23:59:59.000001') AS `microsecond("1997-12-31 23:59:59.000001")` create table t1 (d date); insert into t1 values ('2004-07-14'),('2005-07-14'); select date_format(d,"%d") from t1 order by 1; diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index 02850e4d902..f93f7401081 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -17,7 +17,7 @@ explain extended select * from t1 where MATCH(a,b) AGAINST ("collections"); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 fulltext a a 0 1 Using where Warnings: -Note 1003 select high_priority test.t1.a AS `a`,test.t1.b AS `b` from test.t1 where (match test.t1.a,test.t1.b against (_latin1'collections')) +Note 1003 select test.t1.a AS `a`,test.t1.b AS `b` from test.t1 where (match test.t1.a,test.t1.b against (_latin1'collections')) select * from t1 where MATCH(a,b) AGAINST ("indexes"); a b Full-text indexes are called collections @@ -78,7 +78,7 @@ explain extended select * from t1 where MATCH(a,b) AGAINST("support -collections id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 fulltext a a 0 1 Using where Warnings: -Note 1003 select high_priority test.t1.a AS `a`,test.t1.b AS `b` from test.t1 where (match test.t1.a,test.t1.b against (_latin1'support -collections' in boolean mode)) +Note 1003 select test.t1.a AS `a`,test.t1.b AS `b` from test.t1 where (match test.t1.a,test.t1.b against (_latin1'support -collections' in boolean mode)) select * from t1 where MATCH(a,b) AGAINST("support collections" IN BOOLEAN MODE); a b MySQL has now support for full-text search diff --git a/mysql-test/r/func_compress.result b/mysql-test/r/func_compress.result index 61aa1c0a497..ef03ec71c69 100644 --- a/mysql-test/r/func_compress.result +++ b/mysql-test/r/func_compress.result @@ -11,7 +11,7 @@ explain extended select uncompress(compress(@test_compress_string)); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority no_cache uncompress(compress((@test_compress_string))) AS `uncompress(compress(@test_compress_string))` +Note 1003 select sql_no_cache uncompress(compress((@test_compress_string))) AS `uncompress(compress(@test_compress_string))` select uncompressed_length(compress(@test_compress_string))=length(@test_compress_string); uncompressed_length(compress(@test_compress_string))=length(@test_compress_string) 1 @@ -19,7 +19,7 @@ explain extended select uncompressed_length(compress(@test_compress_string))=len id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority no_cache (uncompressed_length(compress((@test_compress_string))) = length((@test_compress_string))) AS `uncompressed_length(compress(@test_compress_string))=length(@test_compress_string)` +Note 1003 select sql_no_cache (uncompressed_length(compress((@test_compress_string))) = length((@test_compress_string))) AS `uncompressed_length(compress(@test_compress_string))=length(@test_compress_string)` select uncompressed_length(compress(@test_compress_string)); uncompressed_length(compress(@test_compress_string)) 117 diff --git a/mysql-test/r/func_crypt.result b/mysql-test/r/func_crypt.result index 70ebcf216fb..2ee3e770a2e 100644 --- a/mysql-test/r/func_crypt.result +++ b/mysql-test/r/func_crypt.result @@ -91,4 +91,4 @@ explain extended select password('idkfa '), old_password('idkfa'); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority password(_latin1'idkfa ') AS `password('idkfa ')`,old_password(_latin1'idkfa') AS `old_password('idkfa')` +Note 1003 select password(_latin1'idkfa ') AS `password('idkfa ')`,old_password(_latin1'idkfa') AS `old_password('idkfa')` diff --git a/mysql-test/r/func_default.result b/mysql-test/r/func_default.result index fe3f5b9473a..2993d79a870 100644 --- a/mysql-test/r/func_default.result +++ b/mysql-test/r/func_default.result @@ -8,7 +8,7 @@ explain extended select default(str), default(strnull), default(intg), default(r id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system NULL NULL NULL NULL 1 Warnings: -Note 1003 select high_priority default(test.t1.str) AS `default(str)`,default(test.t1.strnull) AS `default(strnull)`,default(test.t1.intg) AS `default(intg)`,default(test.t1.rel) AS `default(rel)` from test.t1 +Note 1003 select default(test.t1.str) AS `default(str)`,default(test.t1.strnull) AS `default(strnull)`,default(test.t1.intg) AS `default(intg)`,default(test.t1.rel) AS `default(rel)` from test.t1 select * from t1 where str <> default(str); str strnull intg rel 0 0 diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result index dccd87e3d75..fdde8f766a9 100644 --- a/mysql-test/r/func_gconcat.result +++ b/mysql-test/r/func_gconcat.result @@ -18,7 +18,7 @@ explain extended select grp,group_concat(c) from t1 group by grp; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 9 Using filesort Warnings: -Note 1003 select high_priority test.t1.grp AS `grp`,group_concat(test.t1.c seperator ',') AS `group_concat(c)` from test.t1 group by test.t1.grp +Note 1003 select test.t1.grp AS `grp`,group_concat(test.t1.c seperator ',') AS `group_concat(c)` from test.t1 group by test.t1.grp select grp,group_concat(a,c) from t1 group by grp; grp group_concat(a,c) 1 1a @@ -93,7 +93,7 @@ explain extended select grp,group_concat(distinct c order by c desc) from t1 gro id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 9 Using filesort Warnings: -Note 1003 select high_priority test.t1.grp AS `grp`,group_concat(distinct test.t1.c order by test.t1.c seperator ',') AS `group_concat(distinct c order by c desc)` from test.t1 group by test.t1.grp +Note 1003 select test.t1.grp AS `grp`,group_concat(distinct test.t1.c order by test.t1.c seperator ',') AS `group_concat(distinct c order by c desc)` from test.t1 group by test.t1.grp select grp,group_concat(c order by c separator ",") from t1 group by grp; grp group_concat(c order by c separator ",") 1 a @@ -113,7 +113,7 @@ explain extended select grp,group_concat(distinct c order by c separator ",") fr id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 9 Using filesort Warnings: -Note 1003 select high_priority test.t1.grp AS `grp`,group_concat(distinct test.t1.c order by test.t1.c seperator ',') AS `group_concat(distinct c order by c separator ",")` from test.t1 group by test.t1.grp +Note 1003 select test.t1.grp AS `grp`,group_concat(distinct test.t1.c order by test.t1.c seperator ',') AS `group_concat(distinct c order by c separator ",")` from test.t1 group by test.t1.grp select grp,group_concat(distinct c order by c desc separator ",") from t1 group by grp; grp group_concat(distinct c order by c desc separator ",") 1 a diff --git a/mysql-test/r/func_if.result b/mysql-test/r/func_if.result index 0a04585d77d..ce26a0bf30a 100644 --- a/mysql-test/r/func_if.result +++ b/mysql-test/r/func_if.result @@ -43,7 +43,7 @@ explain extended select if(u=1,st,binary st) s from t1 where st like "%a%" order id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 7 Using where; Using filesort Warnings: -Note 1003 select high_priority if((test.t1.u = 1),test.t1.st,(test.t1.st collate _latin1'BINARY')) AS `s` from test.t1 where (test.t1.st like _latin1'%a%') order by if((test.t1.u = 1),test.t1.st,(test.t1.st collate _latin1'BINARY')) +Note 1003 select if((test.t1.u = 1),test.t1.st,(test.t1.st collate _latin1'BINARY')) AS `s` from test.t1 where (test.t1.st like _latin1'%a%') order by if((test.t1.u = 1),test.t1.st,(test.t1.st collate _latin1'BINARY')) select nullif(u=0, 'test') from t1; nullif(u=0, 'test') NULL @@ -57,7 +57,7 @@ explain extended select nullif(u=0, 'test') from t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 7 Warnings: -Note 1003 select high_priority nullif((test.t1.u = 0),_latin1'test') AS `nullif(u=0, 'test')` from test.t1 +Note 1003 select nullif((test.t1.u = 0),_latin1'test') AS `nullif(u=0, 'test')` from test.t1 drop table t1; select NULLIF(NULL,NULL), NULLIF(NULL,1), NULLIF(NULL,1.0), NULLIF(NULL,"test"); NULLIF(NULL,NULL) NULLIF(NULL,1) NULLIF(NULL,1.0) NULLIF(NULL,"test") diff --git a/mysql-test/r/func_in.result b/mysql-test/r/func_in.result index 04b6fc038b0..f66b3dea94b 100644 --- a/mysql-test/r/func_in.result +++ b/mysql-test/r/func_in.result @@ -146,7 +146,7 @@ explain extended select * from t1 where 'a' in (a,b,c collate latin1_bin); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where Warnings: -Note 1003 select high_priority test.t1.a AS `a`,test.t1.b AS `b`,test.t1.c AS `c` from test.t1 where (_latin1'a' in (test.t1.a,test.t1.b,(test.t1.c collate _latin1'latin1_bin'))) +Note 1003 select test.t1.a AS `a`,test.t1.b AS `b`,test.t1.c AS `c` from test.t1 where (_latin1'a' in (test.t1.a,test.t1.b,(test.t1.c collate _latin1'latin1_bin'))) drop table t1; select '1.0' in (1,2); '1.0' in (1,2) diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result index 9085849e582..12eef4aa881 100644 --- a/mysql-test/r/func_math.result +++ b/mysql-test/r/func_math.result @@ -5,7 +5,7 @@ explain extended select floor(5.5),floor(-5.5); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority floor(5.5) AS `floor(5.5)`,floor(-(5.5)) AS `floor(-5.5)` +Note 1003 select floor(5.5) AS `floor(5.5)`,floor(-(5.5)) AS `floor(-5.5)` select ceiling(5.5),ceiling(-5.5); ceiling(5.5) ceiling(-5.5) 6 -5 @@ -13,7 +13,7 @@ explain extended select ceiling(5.5),ceiling(-5.5); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority ceiling(5.5) AS `ceiling(5.5)`,ceiling(-(5.5)) AS `ceiling(-5.5)` +Note 1003 select ceiling(5.5) AS `ceiling(5.5)`,ceiling(-(5.5)) AS `ceiling(-5.5)` select truncate(52.64,1),truncate(52.64,2),truncate(52.64,-1),truncate(52.64,-2), truncate(-52.64,1),truncate(-52.64,-1); truncate(52.64,1) truncate(52.64,2) truncate(52.64,-1) truncate(52.64,-2) truncate(-52.64,1) truncate(-52.64,-1) 52.6 52.64 50 0 -52.6 -50 @@ -21,7 +21,7 @@ explain extended select truncate(52.64,1),truncate(52.64,2),truncate(52.64,-1),t id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority truncate(52.64,1) AS `truncate(52.64,1)`,truncate(52.64,2) AS `truncate(52.64,2)`,truncate(52.64,-(1)) AS `truncate(52.64,-1)`,truncate(52.64,-(2)) AS `truncate(52.64,-2)`,truncate(-(52.64),1) AS `truncate(-52.64,1)`,truncate(-(52.64),-(1)) AS `truncate(-52.64,-1)` +Note 1003 select truncate(52.64,1) AS `truncate(52.64,1)`,truncate(52.64,2) AS `truncate(52.64,2)`,truncate(52.64,-(1)) AS `truncate(52.64,-1)`,truncate(52.64,-(2)) AS `truncate(52.64,-2)`,truncate(-(52.64),1) AS `truncate(-52.64,1)`,truncate(-(52.64),-(1)) AS `truncate(-52.64,-1)` select round(5.5),round(-5.5); round(5.5) round(-5.5) 6 -6 @@ -29,7 +29,7 @@ explain extended select round(5.5),round(-5.5); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority round(5.5,0) AS `round(5.5)`,round(-(5.5),0) AS `round(-5.5)` +Note 1003 select round(5.5,0) AS `round(5.5)`,round(-(5.5),0) AS `round(-5.5)` select round(5.64,1),round(5.64,2),round(5.64,-1),round(5.64,-2); round(5.64,1) round(5.64,2) round(5.64,-1) round(5.64,-2) 5.6 5.64 10 0 @@ -40,7 +40,7 @@ explain extended select abs(-10), sign(-5), sign(5), sign(0); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority abs(-(10)) AS `abs(-10)`,sign(-(5)) AS `sign(-5)`,sign(5) AS `sign(5)`,sign(0) AS `sign(0)` +Note 1003 select abs(-(10)) AS `abs(-10)`,sign(-(5)) AS `sign(-5)`,sign(5) AS `sign(5)`,sign(0) AS `sign(0)` select log(exp(10)),exp(log(sqrt(10))*2),log(-1),log(NULL),log(1,1),log(3,9),log(-1,2),log(NULL,2); log(exp(10)) exp(log(sqrt(10))*2) log(-1) log(NULL) log(1,1) log(3,9) log(-1,2) log(NULL,2) 10.000000 10.000000 NULL NULL NULL 2.000000 NULL NULL @@ -48,7 +48,7 @@ explain extended select log(exp(10)),exp(log(sqrt(10))*2),log(-1),log(NULL),log( id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority log(exp(10)) AS `log(exp(10))`,exp((log(sqrt(10)) * 2)) AS `exp(log(sqrt(10))*2)`,log(-(1)) AS `log(-1)`,log(NULL) AS `log(NULL)`,log(1,1) AS `log(1,1)`,log(3,9) AS `log(3,9)`,log(-(1),2) AS `log(-1,2)`,log(NULL,2) AS `log(NULL,2)` +Note 1003 select log(exp(10)) AS `log(exp(10))`,exp((log(sqrt(10)) * 2)) AS `exp(log(sqrt(10))*2)`,log(-(1)) AS `log(-1)`,log(NULL) AS `log(NULL)`,log(1,1) AS `log(1,1)`,log(3,9) AS `log(3,9)`,log(-(1),2) AS `log(-1,2)`,log(NULL,2) AS `log(NULL,2)` select ln(exp(10)),exp(ln(sqrt(10))*2),ln(-1),ln(0),ln(NULL); ln(exp(10)) exp(ln(sqrt(10))*2) ln(-1) ln(0) ln(NULL) 10.000000 10.000000 NULL NULL NULL @@ -56,7 +56,7 @@ explain extended select ln(exp(10)),exp(ln(sqrt(10))*2),ln(-1),ln(0),ln(NULL); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority ln(exp(10)) AS `ln(exp(10))`,exp((ln(sqrt(10)) * 2)) AS `exp(ln(sqrt(10))*2)`,ln(-(1)) AS `ln(-1)`,ln(0) AS `ln(0)`,ln(NULL) AS `ln(NULL)` +Note 1003 select ln(exp(10)) AS `ln(exp(10))`,exp((ln(sqrt(10)) * 2)) AS `exp(ln(sqrt(10))*2)`,ln(-(1)) AS `ln(-1)`,ln(0) AS `ln(0)`,ln(NULL) AS `ln(NULL)` select log2(8),log2(15),log2(-2),log2(0),log2(NULL); log2(8) log2(15) log2(-2) log2(0) log2(NULL) 3.000000 3.906891 NULL NULL NULL @@ -64,7 +64,7 @@ explain extended select log2(8),log2(15),log2(-2),log2(0),log2(NULL); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority log2(8) AS `log2(8)`,log2(15) AS `log2(15)`,log2(-(2)) AS `log2(-2)`,log2(0) AS `log2(0)`,log2(NULL) AS `log2(NULL)` +Note 1003 select log2(8) AS `log2(8)`,log2(15) AS `log2(15)`,log2(-(2)) AS `log2(-2)`,log2(0) AS `log2(0)`,log2(NULL) AS `log2(NULL)` select log10(100),log10(18),log10(-4),log10(0),log10(NULL); log10(100) log10(18) log10(-4) log10(0) log10(NULL) 2.000000 1.255273 NULL NULL NULL @@ -72,7 +72,7 @@ explain extended select log10(100),log10(18),log10(-4),log10(0),log10(NULL); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority log10(100) AS `log10(100)`,log10(18) AS `log10(18)`,log10(-(4)) AS `log10(-4)`,log10(0) AS `log10(0)`,log10(NULL) AS `log10(NULL)` +Note 1003 select log10(100) AS `log10(100)`,log10(18) AS `log10(18)`,log10(-(4)) AS `log10(-4)`,log10(0) AS `log10(0)`,log10(NULL) AS `log10(NULL)` select pow(10,log10(10)),power(2,4); pow(10,log10(10)) power(2,4) 10.000000 16.000000 @@ -80,7 +80,7 @@ explain extended select pow(10,log10(10)),power(2,4); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority pow(10,log10(10)) AS `pow(10,log10(10))`,pow(2,4) AS `power(2,4)` +Note 1003 select pow(10,log10(10)) AS `pow(10,log10(10))`,pow(2,4) AS `power(2,4)` set @@rand_seed1=10000000,@@rand_seed2=1000000; select rand(999999),rand(); rand(999999) rand() @@ -89,7 +89,7 @@ explain extended select rand(999999),rand(); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority no_cache rand(999999) AS `rand(999999)`,rand() AS `rand()` +Note 1003 select sql_no_cache rand(999999) AS `rand(999999)`,rand() AS `rand()` select pi(),sin(pi()/2),cos(pi()/2),abs(tan(pi())),cot(1),asin(1),acos(0),atan(1); pi() sin(pi()/2) cos(pi()/2) abs(tan(pi())) cot(1) asin(1) acos(0) atan(1) 3.141593 1.000000 0.000000 0.000000 0.64209262 1.570796 1.570796 0.785398 @@ -97,7 +97,7 @@ explain extended select pi(),sin(pi()/2),cos(pi()/2),abs(tan(pi())),cot(1),asin( id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority pi() AS `pi()`,sin((pi() / 2)) AS `sin(pi()/2)`,cos((pi() / 2)) AS `cos(pi()/2)`,abs(tan(pi())) AS `abs(tan(pi()))`,(1 / tan(1)) AS `cot(1)`,asin(1) AS `asin(1)`,acos(0) AS `acos(0)`,atan(1) AS `atan(1)` +Note 1003 select pi() AS `pi()`,sin((pi() / 2)) AS `sin(pi()/2)`,cos((pi() / 2)) AS `cos(pi()/2)`,abs(tan(pi())) AS `abs(tan(pi()))`,(1 / tan(1)) AS `cot(1)`,asin(1) AS `asin(1)`,acos(0) AS `acos(0)`,atan(1) AS `atan(1)` select degrees(pi()),radians(360); degrees(pi()) radians(360) 180 6.2831853071796 @@ -123,4 +123,4 @@ explain extended select degrees(pi()),radians(360); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority degrees(pi()) AS `degrees(pi())`,radians(360) AS `radians(360)` +Note 1003 select degrees(pi()) AS `degrees(pi())`,radians(360) AS `radians(360)` diff --git a/mysql-test/r/func_op.result b/mysql-test/r/func_op.result index fb1e715ac3b..6cd975b0911 100644 --- a/mysql-test/r/func_op.result +++ b/mysql-test/r/func_op.result @@ -5,7 +5,7 @@ explain extended select 1+1,1-1,1+1*2,8/5,8%5,mod(8,5),mod(8,5)|0,-(1+1)*-2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority (1 + 1) AS `1+1`,(1 - 1) AS `1-1`,(1 + (1 * 2)) AS `1+1*2`,(8 / 5) AS `8/5`,(8 % 5) AS `8%5`,(8 % 5) AS `mod(8,5)`,((8 % 5) | 0) AS `mod(8,5)|0`,(-((1 + 1)) * -(2)) AS `-(1+1)*-2` +Note 1003 select (1 + 1) AS `1+1`,(1 - 1) AS `1-1`,(1 + (1 * 2)) AS `1+1*2`,(8 / 5) AS `8/5`,(8 % 5) AS `8%5`,(8 % 5) AS `mod(8,5)`,((8 % 5) | 0) AS `mod(8,5)|0`,(-((1 + 1)) * -(2)) AS `-(1+1)*-2` select 1 | (1+1),5 & 3,bit_count(7) ; 1 | (1+1) 5 & 3 bit_count(7) 3 1 3 @@ -13,7 +13,7 @@ explain extended select 1 | (1+1),5 & 3,bit_count(7) ; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority (1 | (1 + 1)) AS `1 | (1+1)`,(5 & 3) AS `5 & 3`,bit_count(7) AS `bit_count(7)` +Note 1003 select (1 | (1 + 1)) AS `1 | (1+1)`,(5 & 3) AS `5 & 3`,bit_count(7) AS `bit_count(7)` select 1 << 32,1 << 63, 1 << 64, 4 >> 2, 4 >> 63, 1<< 63 >> 60; 1 << 32 1 << 63 1 << 64 4 >> 2 4 >> 63 1<< 63 >> 60 4294967296 9223372036854775808 0 1 0 8 diff --git a/mysql-test/r/func_regexp.result b/mysql-test/r/func_regexp.result index 323642cab8c..7f977e2782b 100644 --- a/mysql-test/r/func_regexp.result +++ b/mysql-test/r/func_regexp.result @@ -40,7 +40,7 @@ explain extended select * from t1 where xxx regexp('is a test of some long text id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system NULL NULL NULL NULL 1 Warnings: -Note 1003 select high_priority test.t1.xxx AS `xxx` from test.t1 where (test.t1.xxx regexp _latin1'is a test of some long text to') +Note 1003 select test.t1.xxx AS `xxx` from test.t1 where (test.t1.xxx regexp _latin1'is a test of some long text to') select * from t1 where xxx regexp('is a test of some long text to '); xxx this is a test of some long text to see what happens diff --git a/mysql-test/r/func_set.result b/mysql-test/r/func_set.result index b101c18f505..4918617f85f 100644 --- a/mysql-test/r/func_set.result +++ b/mysql-test/r/func_set.result @@ -5,7 +5,7 @@ explain extended select INTERVAL(55,10,20,30,40,50,60,70,80,90,100),interval(3,1 id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority interval((55,10,20,30,40,50,60,70,80,90,100)) AS `INTERVAL(55,10,20,30,40,50,60,70,80,90,100)`,interval((3,1,(1 + 1),(((1 + 1) + 1) + 1))) AS `interval(3,1,1+1,1+1+1+1)`,field(_latin1'IBM',_latin1'NCA',_latin1'ICL',_latin1'SUN',_latin1'IBM',_latin1'DIGITAL') AS `field("IBM","NCA","ICL","SUN","IBM","DIGITAL")`,field(_latin1'A',_latin1'B',_latin1'C') AS `field("A","B","C")`,elt(2,_latin1'ONE',_latin1'TWO',_latin1'THREE') AS `elt(2,"ONE","TWO","THREE")`,interval((0,1,2,3,4)) AS `interval(0,1,2,3,4)`,(elt(1,1,2,3) | 0) AS `elt(1,1,2,3)|0`,(elt(1,1.1,1.2,1.3) + 0) AS `elt(1,1.1,1.2,1.3)+0` +Note 1003 select interval((55,10,20,30,40,50,60,70,80,90,100)) AS `INTERVAL(55,10,20,30,40,50,60,70,80,90,100)`,interval((3,1,(1 + 1),(((1 + 1) + 1) + 1))) AS `interval(3,1,1+1,1+1+1+1)`,field(_latin1'IBM',_latin1'NCA',_latin1'ICL',_latin1'SUN',_latin1'IBM',_latin1'DIGITAL') AS `field("IBM","NCA","ICL","SUN","IBM","DIGITAL")`,field(_latin1'A',_latin1'B',_latin1'C') AS `field("A","B","C")`,elt(2,_latin1'ONE',_latin1'TWO',_latin1'THREE') AS `elt(2,"ONE","TWO","THREE")`,interval((0,1,2,3,4)) AS `interval(0,1,2,3,4)`,(elt(1,1,2,3) | 0) AS `elt(1,1,2,3)|0`,(elt(1,1.1,1.2,1.3) + 0) AS `elt(1,1.1,1.2,1.3)+0` SELECT INTERVAL(13, 7, 14, 21, 28, 35, 42, 49, 56); INTERVAL(13, 7, 14, 21, 28, 35, 42, 49, 56) 1 diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 216e2ed26f2..4e7df9edefa 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -622,7 +622,7 @@ explain extended select md5('hello'), sha('abc'), sha1('abc'), soundex(''), 'moo id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority md5(_latin1'hello') AS `md5('hello')`,sha(_latin1'abc') AS `sha('abc')`,sha(_latin1'abc') AS `sha1('abc')`,soundex(_latin1'') AS `soundex('')`,(soundex(_latin1'mood') = soundex(_latin1'mud')) AS `'mood' sounds like 'mud'`,aes_decrypt(aes_encrypt(_latin1'abc',_latin1'1'),_latin1'1') AS `aes_decrypt(aes_encrypt('abc','1'),'1')`,concat(_latin1'*',repeat(_latin1' ',5),_latin1'*') AS `concat('*',space(5),'*')`,reverse(_latin1'abc') AS `reverse('abc')`,rpad(_latin1'a',4,_latin1'1') AS `rpad('a',4,'1')`,lpad(_latin1'a',4,_latin1'1') AS `lpad('a',4,'1')`,concat_ws(_latin1',',_latin1'',NULL,_latin1'a') AS `concat_ws(',','',NULL,'a')`,make_set(255,_latin2'a',_latin2'b',_latin2'c') AS `make_set(255,_latin2'a',_latin2'b',_latin2'c')`,elt(2,1) AS `elt(2,1)`,locate(_latin1'a',_latin1'b',2) AS `locate("a","b",2)`,format(130,10) AS `format(130,10)`,char(0) AS `char(0)`,conv(130,16,10) AS `conv(130,16,10)`,hex(130) AS `hex(130)`,(_latin1'HE' collate _latin1'BINARY') AS `binary 'HE'`,export_set(255,_latin2'y',_latin2'n',_latin2' ') AS `export_set(255,_latin2'y',_latin2'n',_latin2' ')`,field((_latin1'b' collate _latin1'latin1_bin'),_latin1'A',_latin1'B') AS `FIELD('b' COLLATE latin1_bin,'A','B')`,find_in_set(_latin1'B',_latin1'a,b,c,d') AS `FIND_IN_SET(_latin1'B',_latin1'a,b,c,d')`,collation(conv(130,16,10)) AS `collation(conv(130,16,10))`,coercibility(conv(130,16,10)) AS `coercibility(conv(130,16,10))`,length(_latin1'\n \r\0\\_\\%\\') AS `length('\n\t\r\b\0\_\%\\')`,bit_length(_latin1'\n \r\0\\_\\%\\') AS `bit_length('\n\t\r\b\0\_\%\\')`,bit_length(_latin1'\n \r\0\\_\\%\\') AS `bit_length('\n\t\r\b\0\_\%\\')`,concat(_latin1'monty',_latin1' was here ',_latin1'again') AS `concat('monty',' was here ','again')`,length(_latin1'hello') AS `length('hello')`,char(ascii(_latin1'h')) AS `char(ascii('h'))`,ord(_latin1'h') AS `ord('h')`,quote((1 / 0)) AS `quote(1/0)`,crc32(_latin1'123') AS `crc32("123")`,replace(_latin1'aaaa',_latin1'a',_latin1'b') AS `replace('aaaa','a','b')`,insert(_latin1'txs',2,1,_latin1'hi') AS `insert('txs',2,1,'hi')`,left(_latin2'a',1) AS `left(_latin2'a',1)`,right(_latin2'a',1) AS `right(_latin2'a',1)`,lcase(_latin2'a') AS `lcase(_latin2'a')`,ucase(_latin2'a') AS `ucase(_latin2'a')`,substr(_latin1'abcdefg',3,2) AS `SUBSTR('abcdefg',3,2)`,substr_index(_latin1'1abcd;2abcd;3abcd;4abcd',_latin1';',2) AS `substring_index("1abcd;2abcd;3abcd;4abcd", ';', 2)`,trim(_latin2' a ') AS `trim(_latin2' a ')`,ltrim(_latin2' a ') AS `ltrim(_latin2' a ')`,rtrim(_latin2' a ') AS `rtrim(_latin2' a ')`,decode(encode(repeat(_latin1'a',100000))) AS `decode(encode(repeat("a",100000),"monty"),"monty")` +Note 1003 select md5(_latin1'hello') AS `md5('hello')`,sha(_latin1'abc') AS `sha('abc')`,sha(_latin1'abc') AS `sha1('abc')`,soundex(_latin1'') AS `soundex('')`,(soundex(_latin1'mood') = soundex(_latin1'mud')) AS `'mood' sounds like 'mud'`,aes_decrypt(aes_encrypt(_latin1'abc',_latin1'1'),_latin1'1') AS `aes_decrypt(aes_encrypt('abc','1'),'1')`,concat(_latin1'*',repeat(_latin1' ',5),_latin1'*') AS `concat('*',space(5),'*')`,reverse(_latin1'abc') AS `reverse('abc')`,rpad(_latin1'a',4,_latin1'1') AS `rpad('a',4,'1')`,lpad(_latin1'a',4,_latin1'1') AS `lpad('a',4,'1')`,concat_ws(_latin1',',_latin1'',NULL,_latin1'a') AS `concat_ws(',','',NULL,'a')`,make_set(255,_latin2'a',_latin2'b',_latin2'c') AS `make_set(255,_latin2'a',_latin2'b',_latin2'c')`,elt(2,1) AS `elt(2,1)`,locate(_latin1'a',_latin1'b',2) AS `locate("a","b",2)`,format(130,10) AS `format(130,10)`,char(0) AS `char(0)`,conv(130,16,10) AS `conv(130,16,10)`,hex(130) AS `hex(130)`,(_latin1'HE' collate _latin1'BINARY') AS `binary 'HE'`,export_set(255,_latin2'y',_latin2'n',_latin2' ') AS `export_set(255,_latin2'y',_latin2'n',_latin2' ')`,field((_latin1'b' collate _latin1'latin1_bin'),_latin1'A',_latin1'B') AS `FIELD('b' COLLATE latin1_bin,'A','B')`,find_in_set(_latin1'B',_latin1'a,b,c,d') AS `FIND_IN_SET(_latin1'B',_latin1'a,b,c,d')`,collation(conv(130,16,10)) AS `collation(conv(130,16,10))`,coercibility(conv(130,16,10)) AS `coercibility(conv(130,16,10))`,length(_latin1'\n \r\0\\_\\%\\') AS `length('\n\t\r\b\0\_\%\\')`,bit_length(_latin1'\n \r\0\\_\\%\\') AS `bit_length('\n\t\r\b\0\_\%\\')`,bit_length(_latin1'\n \r\0\\_\\%\\') AS `bit_length('\n\t\r\b\0\_\%\\')`,concat(_latin1'monty',_latin1' was here ',_latin1'again') AS `concat('monty',' was here ','again')`,length(_latin1'hello') AS `length('hello')`,char(ascii(_latin1'h')) AS `char(ascii('h'))`,ord(_latin1'h') AS `ord('h')`,quote((1 / 0)) AS `quote(1/0)`,crc32(_latin1'123') AS `crc32("123")`,replace(_latin1'aaaa',_latin1'a',_latin1'b') AS `replace('aaaa','a','b')`,insert(_latin1'txs',2,1,_latin1'hi') AS `insert('txs',2,1,'hi')`,left(_latin2'a',1) AS `left(_latin2'a',1)`,right(_latin2'a',1) AS `right(_latin2'a',1)`,lcase(_latin2'a') AS `lcase(_latin2'a')`,ucase(_latin2'a') AS `ucase(_latin2'a')`,substr(_latin1'abcdefg',3,2) AS `SUBSTR('abcdefg',3,2)`,substr_index(_latin1'1abcd;2abcd;3abcd;4abcd',_latin1';',2) AS `substring_index("1abcd;2abcd;3abcd;4abcd", ';', 2)`,trim(_latin2' a ') AS `trim(_latin2' a ')`,ltrim(_latin2' a ') AS `ltrim(_latin2' a ')`,rtrim(_latin2' a ') AS `rtrim(_latin2' a ')`,decode(encode(repeat(_latin1'a',100000))) AS `decode(encode(repeat("a",100000),"monty"),"monty")` SELECT lpad(12345, 5, "#"); lpad(12345, 5, "#") 12345 diff --git a/mysql-test/r/func_system.result b/mysql-test/r/func_system.result index 338902e3f3a..671132428c5 100644 --- a/mysql-test/r/func_system.result +++ b/mysql-test/r/func_system.result @@ -41,7 +41,7 @@ explain extended select database(), user(); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority no_cache database() AS `database()`,user() AS `user()` +Note 1003 select sql_no_cache database() AS `database()`,user() AS `user()` create table t1 (version char(40)) select database(), user(), version() as 'version'; show create table t1; Table Create Table diff --git a/mysql-test/r/func_test.result b/mysql-test/r/func_test.result index 3a945c0826f..c3fe1de15db 100644 --- a/mysql-test/r/func_test.result +++ b/mysql-test/r/func_test.result @@ -48,7 +48,7 @@ explain extended select 3 ^ 11, 1 ^ 1, 1 ^ 0, 1 ^ NULL, NULL ^ 1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority (3 ^ 11) AS `3 ^ 11`,(1 ^ 1) AS `1 ^ 1`,(1 ^ 0) AS `1 ^ 0`,(1 ^ NULL) AS `1 ^ NULL`,(NULL ^ 1) AS `NULL ^ 1` +Note 1003 select (3 ^ 11) AS `3 ^ 11`,(1 ^ 1) AS `1 ^ 1`,(1 ^ 0) AS `1 ^ 0`,(1 ^ NULL) AS `1 ^ NULL`,(NULL ^ 1) AS `NULL ^ 1` select 1 XOR 1, 1 XOR 0, 0 XOR 1, 0 XOR 0, NULL XOR 1, 1 XOR NULL, 0 XOR NULL; 1 XOR 1 1 XOR 0 0 XOR 1 0 XOR 0 NULL XOR 1 1 XOR NULL 0 XOR NULL 0 1 1 0 NULL NULL NULL @@ -62,7 +62,7 @@ explain extended select 10 % 7, 10 mod 7, 10 div 3; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority (10 % 7) AS `10 % 7`,(10 % 7) AS `10 mod 7`,(10 DIV 3) AS `10 div 3` +Note 1003 select (10 % 7) AS `10 % 7`,(10 % 7) AS `10 mod 7`,(10 DIV 3) AS `10 div 3` select (1 << 64)-1, ((1 << 64)-1) DIV 1, ((1 << 64)-1) DIV 2; (1 << 64)-1 ((1 << 64)-1) DIV 1 ((1 << 64)-1) DIV 2 18446744073709551615 18446744073709551615 9223372036854775807 @@ -70,7 +70,7 @@ explain extended select (1 << 64)-1, ((1 << 64)-1) DIV 1, ((1 << 64)-1) DIV 2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority ((1 << 64) - 1) AS `(1 << 64)-1`,(((1 << 64) - 1) DIV 1) AS `((1 << 64)-1) DIV 1`,(((1 << 64) - 1) DIV 2) AS `((1 << 64)-1) DIV 2` +Note 1003 select ((1 << 64) - 1) AS `(1 << 64)-1`,(((1 << 64) - 1) DIV 1) AS `((1 << 64)-1) DIV 1`,(((1 << 64) - 1) DIV 2) AS `((1 << 64)-1) DIV 2` create table t1 (a int); insert t1 values (1); select * from t1 where 1 xor 1; @@ -79,7 +79,7 @@ explain extended select * from t1 where 1 xor 1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables Warnings: -Note 1003 select high_priority test.t1.a AS `a` from test.t1 where (1 xor 1) +Note 1003 select test.t1.a AS `a` from test.t1 where (1 xor 1) select - a from t1; - a -1 @@ -87,7 +87,7 @@ explain extended select - a from t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system NULL NULL NULL NULL 1 Warnings: -Note 1003 select high_priority -(test.t1.a) AS `- a` from test.t1 +Note 1003 select -(test.t1.a) AS `- a` from test.t1 drop table t1; select 5 between 0 and 10 between 0 and 1,(5 between 0 and 10) between 0 and 1; 5 between 0 and 10 between 0 and 1 (5 between 0 and 10) between 0 and 1 @@ -108,7 +108,7 @@ explain extended select _koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority (_koi8r'a' = (_koi8r'A' collate _latin1'koi8r_general_ci')) AS `_koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci` +Note 1003 select (_koi8r'a' = (_koi8r'A' collate _latin1'koi8r_general_ci')) AS `_koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci` select _koi8r'a' = _koi8r'A' COLLATE koi8r_bin; _koi8r'a' = _koi8r'A' COLLATE koi8r_bin 0 diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index b37df0aef2c..6f1b4af5d3c 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -584,7 +584,7 @@ explain extended select period_add("9602",-12),period_diff(199505,"9404"),from_d id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority no_cache period_add(_latin1'9602',-(12)) AS `period_add("9602",-12)`,period_diff(199505,_latin1'9404') AS `period_diff(199505,"9404")`,from_days(to_days(_latin1'960101')) AS `from_days(to_days("960101"))`,dayofmonth(_latin1'1997-01-02') AS `dayofmonth("1997-01-02")`,month(_latin1'1997-01-02') AS `month("1997-01-02")`,monthname(_latin1'1972-03-04') AS `monthname("1972-03-04")`,dayofyear(_latin1'0000-00-00') AS `dayofyear("0000-00-00")`,hour(_latin1'1997-03-03 23:03:22') AS `HOUR("1997-03-03 23:03:22")`,minute(_latin1'23:03:22') AS `MINUTE("23:03:22")`,second(230322) AS `SECOND(230322)`,quarter(980303) AS `QUARTER(980303)`,week(_latin1'1998-03-03',0) AS `WEEK("1998-03-03")`,yearweek(_latin1'2000-01-01',1) AS `yearweek("2000-01-01",1)`,week(19950101,1) AS `week(19950101,1)`,year(_latin1'98-02-03') AS `year("98-02-03")`,(weekday(to_days(curdate())) - weekday(to_days(now()))) AS `weekday(curdate())-weekday(now())`,dayname(to_days(_latin1'1962-03-03')) AS `dayname("1962-03-03")`,unix_timestamp() AS `unix_timestamp()`,sec_to_time((time_to_sec(_latin1'0:30:47') / 6.21)) AS `sec_to_time(time_to_sec("0:30:47")/6.21)`,curtime() AS `curtime()`,utc_time() AS `utc_time()`,curdate() AS `curdate()`,utc_date() AS `utc_date()`,utc_timestamp() AS `utc_timestamp()`,date_format(_latin1'1997-01-02 03:04:05',_latin1'%M %W %D %Y %y %m %d %h %i %s %w') AS `date_format("1997-01-02 03:04:05", "%M %W %D %Y %y %m %d %h %i %s %w")`,from_unixtime(unix_timestamp(_latin1'1994-03-02 10:11:12')) AS `from_unixtime(unix_timestamp("1994-03-02 10:11:12"))`,(_latin1'1997-12-31 23:59:59' + interval 1 second) AS `"1997-12-31 23:59:59" + INTERVAL 1 SECOND`,(_latin1'1998-01-01 00:00:00' - interval 1 second) AS `"1998-01-01 00:00:00" - INTERVAL 1 SECOND`,(_latin1'1997-12-31' + interval 1 day) AS `INTERVAL 1 DAY + "1997-12-31"`,extract(year from _latin1'1999-01-02 10:11:12') AS `extract(YEAR FROM "1999-01-02 10:11:12")`,(_latin1'1997-12-31 23:59:59' + interval 1 second) AS `date_add("1997-12-31 23:59:59",INTERVAL 1 SECOND)` +Note 1003 select sql_no_cache period_add(_latin1'9602',-(12)) AS `period_add("9602",-12)`,period_diff(199505,_latin1'9404') AS `period_diff(199505,"9404")`,from_days(to_days(_latin1'960101')) AS `from_days(to_days("960101"))`,dayofmonth(_latin1'1997-01-02') AS `dayofmonth("1997-01-02")`,month(_latin1'1997-01-02') AS `month("1997-01-02")`,monthname(_latin1'1972-03-04') AS `monthname("1972-03-04")`,dayofyear(_latin1'0000-00-00') AS `dayofyear("0000-00-00")`,hour(_latin1'1997-03-03 23:03:22') AS `HOUR("1997-03-03 23:03:22")`,minute(_latin1'23:03:22') AS `MINUTE("23:03:22")`,second(230322) AS `SECOND(230322)`,quarter(980303) AS `QUARTER(980303)`,week(_latin1'1998-03-03',0) AS `WEEK("1998-03-03")`,yearweek(_latin1'2000-01-01',1) AS `yearweek("2000-01-01",1)`,week(19950101,1) AS `week(19950101,1)`,year(_latin1'98-02-03') AS `year("98-02-03")`,(weekday(to_days(curdate())) - weekday(to_days(now()))) AS `weekday(curdate())-weekday(now())`,dayname(to_days(_latin1'1962-03-03')) AS `dayname("1962-03-03")`,unix_timestamp() AS `unix_timestamp()`,sec_to_time((time_to_sec(_latin1'0:30:47') / 6.21)) AS `sec_to_time(time_to_sec("0:30:47")/6.21)`,curtime() AS `curtime()`,utc_time() AS `utc_time()`,curdate() AS `curdate()`,utc_date() AS `utc_date()`,utc_timestamp() AS `utc_timestamp()`,date_format(_latin1'1997-01-02 03:04:05',_latin1'%M %W %D %Y %y %m %d %h %i %s %w') AS `date_format("1997-01-02 03:04:05", "%M %W %D %Y %y %m %d %h %i %s %w")`,from_unixtime(unix_timestamp(_latin1'1994-03-02 10:11:12')) AS `from_unixtime(unix_timestamp("1994-03-02 10:11:12"))`,(_latin1'1997-12-31 23:59:59' + interval 1 second) AS `"1997-12-31 23:59:59" + INTERVAL 1 SECOND`,(_latin1'1998-01-01 00:00:00' - interval 1 second) AS `"1998-01-01 00:00:00" - INTERVAL 1 SECOND`,(_latin1'1997-12-31' + interval 1 day) AS `INTERVAL 1 DAY + "1997-12-31"`,extract(year from _latin1'1999-01-02 10:11:12') AS `extract(YEAR FROM "1999-01-02 10:11:12")`,(_latin1'1997-12-31 23:59:59' + interval 1 second) AS `date_add("1997-12-31 23:59:59",INTERVAL 1 SECOND)` SET @TMP=NOW(); CREATE TABLE t1 (d DATETIME); INSERT INTO t1 VALUES (NOW()); diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index be33c05c578..c2fd7855c85 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -228,7 +228,7 @@ explain extended select Dimension(g), GeometryType(g), IsEmpty(g), AsText(Envelo id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE gis_geometry ALL NULL NULL NULL NULL 21 Warnings: -Note 1003 select high_priority dimension(test.gis_geometry.g) AS `Dimension(g)`,geometrytype(test.gis_geometry.g) AS `GeometryType(g)`,isempty(test.gis_geometry.g) AS `IsEmpty(g)`,astext(envelope(test.gis_geometry.g)) AS `AsText(Envelope(g))` from test.gis_geometry +Note 1003 select dimension(test.gis_geometry.g) AS `Dimension(g)`,geometrytype(test.gis_geometry.g) AS `GeometryType(g)`,isempty(test.gis_geometry.g) AS `IsEmpty(g)`,astext(envelope(test.gis_geometry.g)) AS `AsText(Envelope(g))` from test.gis_geometry SELECT fid, X(g) FROM gis_point; fid X(g) 101 10 @@ -245,7 +245,7 @@ explain extended select X(g),Y(g) FROM gis_point; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE gis_point ALL NULL NULL NULL NULL 4 Warnings: -Note 1003 select high_priority x(test.gis_point.g) AS `X(g)`,y(test.gis_point.g) AS `Y(g)` from test.gis_point +Note 1003 select x(test.gis_point.g) AS `X(g)`,y(test.gis_point.g) AS `Y(g)` from test.gis_point SELECT fid, AsText(StartPoint(g)) FROM gis_line; fid AsText(StartPoint(g)) 105 POINT(0 0) @@ -280,7 +280,7 @@ explain extended select AsText(StartPoint(g)),AsText(EndPoint(g)),GLength(g),Num id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE gis_line ALL NULL NULL NULL NULL 3 Warnings: -Note 1003 select high_priority astext(startpoint(test.gis_line.g)) AS `AsText(StartPoint(g))`,astext(endpoint(test.gis_line.g)) AS `AsText(EndPoint(g))`,glength(test.gis_line.g) AS `GLength(g)`,numpoints(test.gis_line.g) AS `NumPoints(g)`,astext(pointn(test.gis_line.g,2)) AS `AsText(PointN(g, 2))`,isclosed(test.gis_line.g) AS `IsClosed(g)` from test.gis_line +Note 1003 select astext(startpoint(test.gis_line.g)) AS `AsText(StartPoint(g))`,astext(endpoint(test.gis_line.g)) AS `AsText(EndPoint(g))`,glength(test.gis_line.g) AS `GLength(g)`,numpoints(test.gis_line.g) AS `NumPoints(g)`,astext(pointn(test.gis_line.g,2)) AS `AsText(PointN(g, 2))`,isclosed(test.gis_line.g) AS `IsClosed(g)` from test.gis_line SELECT fid, AsText(Centroid(g)) FROM gis_polygon; fid AsText(Centroid(g)) 108 POINT(15 15) @@ -310,7 +310,7 @@ explain extended select AsText(Centroid(g)),Area(g),AsText(ExteriorRing(g)),NumI id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE gis_polygon ALL NULL NULL NULL NULL 3 Warnings: -Note 1003 select high_priority astext(centroid(test.gis_polygon.g)) AS `AsText(Centroid(g))`,area(test.gis_polygon.g) AS `Area(g)`,astext(exteriorring(test.gis_polygon.g)) AS `AsText(ExteriorRing(g))`,numinteriorrings(test.gis_polygon.g) AS `NumInteriorRings(g)`,astext(interiorringn(test.gis_polygon.g,1)) AS `AsText(InteriorRingN(g, 1))` from test.gis_polygon +Note 1003 select astext(centroid(test.gis_polygon.g)) AS `AsText(Centroid(g))`,area(test.gis_polygon.g) AS `Area(g)`,astext(exteriorring(test.gis_polygon.g)) AS `AsText(ExteriorRing(g))`,numinteriorrings(test.gis_polygon.g) AS `NumInteriorRings(g)`,astext(interiorringn(test.gis_polygon.g,1)) AS `AsText(InteriorRingN(g, 1))` from test.gis_polygon SELECT fid, IsClosed(g) FROM gis_multi_line; fid IsClosed(g) 114 0 @@ -349,7 +349,7 @@ explain extended SELECT fid, NumGeometries(g) from gis_multi_point; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE gis_multi_point ALL NULL NULL NULL NULL 3 Warnings: -Note 1003 select high_priority test.gis_multi_point.fid AS `fid`,numgeometries(test.gis_multi_point.g) AS `NumGeometries(g)` from test.gis_multi_point +Note 1003 select test.gis_multi_point.fid AS `fid`,numgeometries(test.gis_multi_point.g) AS `NumGeometries(g)` from test.gis_multi_point SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point; fid AsText(GeometryN(g, 2)) 111 POINT(10 10) @@ -377,7 +377,7 @@ explain extended SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE gis_multi_point ALL NULL NULL NULL NULL 3 Warnings: -Note 1003 select high_priority test.gis_multi_point.fid AS `fid`,astext(geometryn(test.gis_multi_point.g,2)) AS `AsText(GeometryN(g, 2))` from test.gis_multi_point +Note 1003 select test.gis_multi_point.fid AS `fid`,astext(geometryn(test.gis_multi_point.g,2)) AS `AsText(GeometryN(g, 2))` from test.gis_multi_point SELECT g1.fid as first, g2.fid as second, Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o, Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t, @@ -397,7 +397,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE g1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort 1 SIMPLE g2 ALL NULL NULL NULL NULL 2 Warnings: -Note 1003 select high_priority test.g1.fid AS `first`,test.g2.fid AS `second`,within(test.g1.g,test.g2.g) AS `w`,contains(test.g1.g,test.g2.g) AS `c`,overlaps(test.g1.g,test.g2.g) AS `o`,equals(test.g1.g,test.g2.g) AS `e`,disjoint(test.g1.g,test.g2.g) AS `d`,touches(test.g1.g,test.g2.g) AS `t`,intersects(test.g1.g,test.g2.g) AS `i`,crosses(test.g1.g,test.g2.g) AS `r` from test.gis_geometrycollection g1 join test.gis_geometrycollection g2 order by test.g1.fid,test.g2.fid +Note 1003 select test.g1.fid AS `first`,test.g2.fid AS `second`,within(test.g1.g,test.g2.g) AS `w`,contains(test.g1.g,test.g2.g) AS `c`,overlaps(test.g1.g,test.g2.g) AS `o`,equals(test.g1.g,test.g2.g) AS `e`,disjoint(test.g1.g,test.g2.g) AS `d`,touches(test.g1.g,test.g2.g) AS `t`,intersects(test.g1.g,test.g2.g) AS `i`,crosses(test.g1.g,test.g2.g) AS `r` from test.gis_geometrycollection g1 join test.gis_geometrycollection g2 order by test.g1.fid,test.g2.fid DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; CREATE TABLE t1 ( gp point, @@ -439,12 +439,12 @@ explain extended SELECT AsText(GeometryFromWKB(AsWKB(GeometryFromText('POINT(1 4 id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority astext(geometryfromwkb(aswkb(geometryfromtext(_latin1'POINT(1 4)')))) AS `AsText(GeometryFromWKB(AsWKB(GeometryFromText('POINT(1 4)'))))` +Note 1003 select astext(geometryfromwkb(aswkb(geometryfromtext(_latin1'POINT(1 4)')))) AS `AsText(GeometryFromWKB(AsWKB(GeometryFromText('POINT(1 4)'))))` explain extended SELECT AsText(GeometryFromWKB(AsWKB(PointFromText('POINT(1 4)')))); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority astext(geometryfromwkb(aswkb(geometryfromtext(_latin1'POINT(1 4)')))) AS `AsText(GeometryFromWKB(AsWKB(PointFromText('POINT(1 4)'))))` +Note 1003 select astext(geometryfromwkb(aswkb(geometryfromtext(_latin1'POINT(1 4)')))) AS `AsText(GeometryFromWKB(AsWKB(PointFromText('POINT(1 4)'))))` SELECT SRID(GeomFromText('LineString(1 1,2 2)',101)); SRID(GeomFromText('LineString(1 1,2 2)',101)) 101 @@ -452,12 +452,12 @@ explain extended SELECT SRID(GeomFromText('LineString(1 1,2 2)',101)); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority srid(geometryfromtext(_latin1'LineString(1 1,2 2)',101)) AS `SRID(GeomFromText('LineString(1 1,2 2)',101))` +Note 1003 select srid(geometryfromtext(_latin1'LineString(1 1,2 2)',101)) AS `SRID(GeomFromText('LineString(1 1,2 2)',101))` explain extended select issimple(MultiPoint(Point(3, 6), Point(4, 10))), issimple(Point(3, 6)); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority issimple(multipoint(point(3,6),point(4,10))) AS `issimple(MultiPoint(Point(3, 6), Point(4, 10)))`,issimple(point(3,6)) AS `issimple(Point(3, 6))` +Note 1003 select issimple(multipoint(point(3,6),point(4,10))) AS `issimple(MultiPoint(Point(3, 6), Point(4, 10)))`,issimple(point(3,6)) AS `issimple(Point(3, 6))` create table t1 (a geometry not null); insert into t1 values (GeomFromText('Point(1 2)')); insert into t1 values ('Garbage'); diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index bbe3326fd34..9af7304c167 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -288,7 +288,7 @@ explain extended select sql_big_result spid,sum(userid) from t1 group by spid de id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using filesort Warnings: -Note 1003 select high_priority big_result test.t1.spID AS `spid`,sum(test.t1.userID) AS `sum(userid)` from test.t1 group by test.t1.spID desc +Note 1003 select sql_big_result test.t1.spID AS `spid`,sum(test.t1.userID) AS `sum(userid)` from test.t1 group by test.t1.spID desc explain select sql_big_result spid,sum(userid) from t1 group by spid desc order by null; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using filesort diff --git a/mysql-test/r/having.result b/mysql-test/r/having.result index 7c88776579b..010e86273a2 100644 --- a/mysql-test/r/having.result +++ b/mysql-test/r/having.result @@ -12,7 +12,7 @@ explain extended select count(a) as b from t1 where a=0 having b >=0; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables Warnings: -Note 1003 select high_priority count(test.t1.a) AS `b` from test.t1 where (test.t1.a = 0) having (count(test.t1.a) >= 0) +Note 1003 select count(test.t1.a) AS `b` from test.t1 where (test.t1.a = 0) having (count(test.t1.a) >= 0) drop table t1; CREATE TABLE t1 ( raw_id int(10) NOT NULL default '0', diff --git a/mysql-test/r/insert_update.result b/mysql-test/r/insert_update.result index 53867bf4546..303d7186015 100644 --- a/mysql-test/r/insert_update.result +++ b/mysql-test/r/insert_update.result @@ -60,12 +60,12 @@ explain extended SELECT *, VALUES(a) FROM t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Warnings: -Note 1003 select high_priority test.t1.a AS `a`,test.t1.b AS `b`,test.t1.c AS `c`,values(test.t1.a) AS `VALUES(a)` from test.t1 +Note 1003 select test.t1.a AS `a`,test.t1.b AS `b`,test.t1.c AS `c`,values(test.t1.a) AS `VALUES(a)` from test.t1 explain extended select * from t1 where values(a); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE Warnings: -Note 1003 select high_priority test.t1.a AS `a`,test.t1.b AS `b`,test.t1.c AS `c` from test.t1 +Note 1003 select test.t1.a AS `a`,test.t1.b AS `b`,test.t1.c AS `c` from test.t1 DROP TABLE t1; create table t1(a int primary key, b int); insert into t1 values(1,1),(2,2),(3,3),(4,4),(5,5); diff --git a/mysql-test/r/null.result b/mysql-test/r/null.result index cbd949d6e72..7391f4192bf 100644 --- a/mysql-test/r/null.result +++ b/mysql-test/r/null.result @@ -6,7 +6,7 @@ explain extended select null,\N,isnull(null),isnull(1/0),isnull(1/0 = null),ifnu id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority NULL AS `NULL`,NULL AS `NULL`,isnull(NULL) AS `isnull(null)`,isnull((1 / 0)) AS `isnull(1/0)`,isnull(((1 / 0) = NULL)) AS `isnull(1/0 = null)`,ifnull(NULL,1) AS `ifnull(null,1)`,ifnull(NULL,_latin1'TRUE') AS `ifnull(null,"TRUE")`,ifnull(_latin1'TRUE',_latin1'ERROR') AS `ifnull("TRUE","ERROR")`,isnull((1 / 0)) AS `1/0 is null`,(1 is not null) AS `1 is not null` +Note 1003 select NULL AS `NULL`,NULL AS `NULL`,isnull(NULL) AS `isnull(null)`,isnull((1 / 0)) AS `isnull(1/0)`,isnull(((1 / 0) = NULL)) AS `isnull(1/0 = null)`,ifnull(NULL,1) AS `ifnull(null,1)`,ifnull(NULL,_latin1'TRUE') AS `ifnull(null,"TRUE")`,ifnull(_latin1'TRUE',_latin1'ERROR') AS `ifnull("TRUE","ERROR")`,isnull((1 / 0)) AS `1/0 is null`,(1 is not null) AS `1 is not null` select 1 | NULL,1 & NULL,1+NULL,1-NULL; 1 | NULL 1 & NULL 1+NULL 1-NULL NULL NULL NULL NULL @@ -32,7 +32,7 @@ explain extended select 2 between null and 1,2 between 3 AND NULL,NULL between 1 id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority (2 between NULL and 1) AS `2 between null and 1`,(2 between 3 and NULL) AS `2 between 3 AND NULL`,(NULL between 1 and 2) AS `NULL between 1 and 2`,(2 between NULL and 3) AS `2 between NULL and 3`,(2 between 1 and NULL) AS `2 between 1 AND null` +Note 1003 select (2 between NULL and 1) AS `2 between null and 1`,(2 between 3 and NULL) AS `2 between 3 AND NULL`,(NULL between 1 and 2) AS `NULL between 1 and 2`,(2 between NULL and 3) AS `2 between NULL and 3`,(2 between 1 and NULL) AS `2 between 1 AND null` SELECT NULL AND NULL, 1 AND NULL, NULL AND 1, NULL OR NULL, 0 OR NULL, NULL OR 0; NULL AND NULL 1 AND NULL NULL AND 1 NULL OR NULL 0 OR NULL NULL OR 0 NULL NULL NULL NULL NULL NULL @@ -49,7 +49,7 @@ explain extended select inet_ntoa(null),inet_aton(null),inet_aton("122.256"),ine id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority inet_ntoa(NULL) AS `inet_ntoa(null)`,inet_aton(NULL) AS `inet_aton(null)`,inet_aton(_latin1'122.256') AS `inet_aton("122.256")`,inet_aton(_latin1'122.226.') AS `inet_aton("122.226.")`,inet_aton(_latin1'') AS `inet_aton("")` +Note 1003 select inet_ntoa(NULL) AS `inet_ntoa(null)`,inet_aton(NULL) AS `inet_aton(null)`,inet_aton(_latin1'122.256') AS `inet_aton("122.256")`,inet_aton(_latin1'122.226.') AS `inet_aton("122.226.")`,inet_aton(_latin1'') AS `inet_aton("")` create table t1 (x int); insert into t1 values (null); select * from t1 where x != 0; diff --git a/mysql-test/r/olap.result b/mysql-test/r/olap.result index 37e68d8b13e..50048808c39 100644 --- a/mysql-test/r/olap.result +++ b/mysql-test/r/olap.result @@ -85,7 +85,7 @@ explain extended select product, country_id , year, sum(profit) from t1 group by id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 15 Using temporary; Using filesort Warnings: -Note 1003 select high_priority test.t1.product AS `product`,test.t1.country_id AS `country_id`,test.t1.year AS `year`,sum(test.t1.profit) AS `sum(profit)` from test.t1 group by test.t1.product,test.t1.country_id,test.t1.year with rollup +Note 1003 select test.t1.product AS `product`,test.t1.country_id AS `country_id`,test.t1.year AS `year`,sum(test.t1.profit) AS `sum(profit)` from test.t1 group by test.t1.product,test.t1.country_id,test.t1.year with rollup select product, country_id , sum(profit) from t1 group by product desc, country_id with rollup; product country_id sum(profit) TV 1 400 diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index 8d03a7bbcf0..185961c53ff 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -305,7 +305,7 @@ explain extended select benchmark(1,1) from t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system NULL NULL NULL NULL 0 const row not found Warnings: -Note 1003 select high_priority no_cache benchmark(1,1) AS `benchmark(1,1)` from test.t1 +Note 1003 select sql_no_cache benchmark(1,1) AS `benchmark(1,1)` from test.t1 show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 0 diff --git a/mysql-test/r/row.result b/mysql-test/r/row.result index 37d4f1d9b26..76d6fa13766 100644 --- a/mysql-test/r/row.result +++ b/mysql-test/r/row.result @@ -44,7 +44,7 @@ explain extended select row(1,2,row(3,4)) IN (row(3,2,row(3,4)), row(1,2,row(3,N id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority ((1,2,(3,4)) in ((3,2,(3,4)),(1,2,(3,NULL)))) AS `row(1,2,row(3,4)) IN (row(3,2,row(3,4)), row(1,2,row(3,NULL)))` +Note 1003 select ((1,2,(3,4)) in ((3,2,(3,4)),(1,2,(3,NULL)))) AS `row(1,2,row(3,4)) IN (row(3,2,row(3,4)), row(1,2,row(3,NULL)))` SELECT (1,2,3)=(0,NULL,3); (1,2,3)=(0,NULL,3) 0 diff --git a/mysql-test/r/rpl000001.result b/mysql-test/r/rpl000001.result index b8071b16c2e..b60cad18c54 100644 --- a/mysql-test/r/rpl000001.result +++ b/mysql-test/r/rpl000001.result @@ -44,7 +44,7 @@ explain extended select get_lock("hold_slave",10); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority no_cache get_lock(_latin1'hold_slave',10) AS `get_lock("hold_slave",10)` +Note 1003 select sql_no_cache get_lock(_latin1'hold_slave',10) AS `get_lock("hold_slave",10)` start slave; select release_lock("hold_slave"); release_lock("hold_slave") @@ -53,7 +53,7 @@ explain extended select release_lock("hold_slave"); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority no_cache release_lock(_latin1'hold_slave') AS `release_lock("hold_slave")` +Note 1003 select sql_no_cache release_lock(_latin1'hold_slave') AS `release_lock("hold_slave")` unlock tables; create table t2(id int); insert into t2 values(connection_id()); diff --git a/mysql-test/r/rpl_get_lock.result b/mysql-test/r/rpl_get_lock.result index 8e3e335b2d0..2c57069e91a 100644 --- a/mysql-test/r/rpl_get_lock.result +++ b/mysql-test/r/rpl_get_lock.result @@ -25,7 +25,7 @@ explain extended select is_free_lock("lock"), is_used_lock("lock"); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority no_cache is_free_lock(_latin1'lock') AS `is_free_lock("lock")`,is_used_lock(_latin1'lock') AS `is_used_lock("lock")` +Note 1003 select sql_no_cache is_free_lock(_latin1'lock') AS `is_free_lock("lock")`,is_used_lock(_latin1'lock') AS `is_used_lock("lock")` select is_free_lock("lock2"); is_free_lock("lock2") 1 diff --git a/mysql-test/r/rpl_master_pos_wait.result b/mysql-test/r/rpl_master_pos_wait.result index ea917805560..e92d1ffa361 100644 --- a/mysql-test/r/rpl_master_pos_wait.result +++ b/mysql-test/r/rpl_master_pos_wait.result @@ -11,7 +11,7 @@ explain extended select master_pos_wait('master-bin.999999',0,2); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority no_cache master_pos_wait(_latin1'master-bin.999999',0,2) AS `master_pos_wait('master-bin.999999',0,2)` +Note 1003 select sql_no_cache master_pos_wait(_latin1'master-bin.999999',0,2) AS `master_pos_wait('master-bin.999999',0,2)` select master_pos_wait('master-bin.999999',0); stop slave sql_thread; master_pos_wait('master-bin.999999',0) diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 43c41378f30..8c783445127 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -1470,7 +1470,7 @@ explain extended select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where Warnings: -Note 1003 select high_priority count(0) AS `count(*)`,min(test.t2.fld4) AS `min(fld4)`,max(test.t2.fld4) AS `max(fld4)`,sum(test.t2.fld1) AS `sum(fld1)`,avg(test.t2.fld1) AS `avg(fld1)`,std(test.t2.fld1) AS `std(fld1)`,variance(test.t2.fld1) AS `variance(fld1)` from test.t2 where ((test.t2.companynr = 34) and (test.t2.fld4 <> _latin1'')) +Note 1003 select count(0) AS `count(*)`,min(test.t2.fld4) AS `min(fld4)`,max(test.t2.fld4) AS `max(fld4)`,sum(test.t2.fld1) AS `sum(fld1)`,avg(test.t2.fld1) AS `avg(fld1)`,std(test.t2.fld1) AS `std(fld1)`,variance(test.t2.fld1) AS `variance(fld1)` from test.t2 where ((test.t2.companynr = 34) and (test.t2.fld4 <> _latin1'')) select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 group by companynr limit 3; companynr count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) 00 82 Anthony windmills 10355753 126289.6707 115550.9757 13352027981.7087 diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index a2210fde222..d512ecdf34d 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -7,7 +7,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: Note 1249 Select 2 was reduced during optimisation -Note 1003 select high_priority 2 AS `(select 2)` +Note 1003 select 2 AS `(select 2)` SELECT (SELECT 1) UNION SELECT (SELECT 2); (SELECT 1) 1 @@ -19,7 +19,7 @@ id select_type table type possible_keys key key_len ref rows Extra Warnings: Note 1249 Select 2 was reduced during optimisation Note 1249 Select 4 was reduced during optimisation -Note 1003 select high_priority 1 AS `(SELECT 1)` union select 2 AS `(SELECT 2)` +Note 1003 select 1 AS `(SELECT 1)` union select 2 AS `(SELECT 2)` SELECT (SELECT (SELECT 0 UNION SELECT 0)); (SELECT (SELECT 0 UNION SELECT 0)) 0 @@ -30,7 +30,7 @@ id select_type table type possible_keys key key_len ref rows Extra 4 UNION NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: Note 1249 Select 2 was reduced during optimisation -Note 1003 select high_priority (select 0 AS `0` union select 0 AS `0`) AS `(SELECT (SELECT 0 UNION SELECT 0))` +Note 1003 select (select 0 AS `0` union select 0 AS `0`) AS `(SELECT (SELECT 0 UNION SELECT 0))` SELECT (SELECT 1 FROM (SELECT 1) as b HAVING a=1) as a; ERROR 42S22: Reference 'a' not supported (forward reference in item list) SELECT (SELECT 1 FROM (SELECT 1) as b HAVING b=1) as a,(SELECT 1 FROM (SELECT 1) as c HAVING a=1) as b; @@ -48,7 +48,7 @@ id select_type table type possible_keys key key_len ref rows Extra Warnings: Note 1276 Field or reference 'a' of SELECT #3 was resolved in SELECT #1 Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 select high_priority 1 AS `1` from (select 1 AS `a`) b having ((select b.a AS `a`) = 1) +Note 1003 select 1 AS `1` from (select 1 AS `a`) b having ((select b.a AS `a`) = 1) SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1; 1 1 @@ -183,7 +183,7 @@ id select_type table type possible_keys key key_len ref rows Extra 3 UNION t4 ALL NULL NULL NULL NULL 3 Using where; Using filesort 4 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Warnings: -Note 1003 (select high_priority test.t2.a AS `a`,test.t2.b AS `b` from test.t2 where (test.t2.b = (select test.t3.a AS `a` from test.t3 order by test.t3.a desc limit 1))) union (select test.t4.a AS `a`,test.t4.b AS `b` from test.t4 where (test.t4.b = (select (max(test.t2.a) * 4) AS `max(t2.a)*4` from test.t2)) order by test.t4.a) +Note 1003 (select test.t2.a AS `a`,test.t2.b AS `b` from test.t2 where (test.t2.b = (select test.t3.a AS `a` from test.t3 order by test.t3.a desc limit 1))) union (select test.t4.a AS `a`,test.t4.b AS `b` from test.t4 where (test.t4.b = (select (max(test.t2.a) * 4) AS `max(t2.a)*4` from test.t2)) order by test.t4.a) select (select a from t3 where a 1)) tt +Note 1003 select (select test.t3.a AS `a` from test.t3 where (test.t3.a < 8) order by test.t3.a desc limit 1) AS `(select t3.a from t3 where a<8 order by 1 desc limit 1)`,tt.a AS `a` from (select test.t2.a AS `a`,test.t2.b AS `b` from test.t2 where (test.t2.a > 1)) tt select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3) order by 1 desc limit 1); a 2 @@ -220,7 +220,7 @@ id select_type table type possible_keys key key_len ref rows Extra 3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 Using where Warnings: Note 1276 Field or reference 't4.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 select high_priority test.t4.b AS `b`,(select avg((test.t2.a + (select min(test.t3.a) AS `min(t3.a)` from test.t3 where (test.t3.a >= test.t4.a)))) AS `avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a))` from test.t2) AS `(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)` from test.t4 +Note 1003 select test.t4.b AS `b`,(select avg((test.t2.a + (select min(test.t3.a) AS `min(t3.a)` from test.t3 where (test.t3.a >= test.t4.a)))) AS `avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a))` from test.t2) AS `(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)` from test.t4 select * from t3 where exists (select * from t2 where t2.b=t3.a); a 7 @@ -266,7 +266,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where 2 SUBQUERY t2 ALL NULL NULL NULL NULL 3 Warnings: -Note 1003 select high_priority test.t3.a AS `a` from test.t3 where (test.t3.a >= (select min(test.t2.b) from test.t2)) +Note 1003 select test.t3.a AS `a` from test.t3 where (test.t3.a >= (select min(test.t2.b) from test.t2)) select * from t3 where a >= all (select b from t2); a 7 @@ -309,7 +309,7 @@ id select_type table type possible_keys key key_len ref rows Extra Warnings: Note 1276 Field or reference 't2.a' of SELECT #2 was resolved in SELECT #1 Note 1276 Field or reference 't2.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 select high_priority (select test.t1.a AS `a` from test.t1 where (test.t1.a = test.t2.a) union select test.t5.a AS `a` from test.t5 where (test.t5.a = test.t2.a)) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,test.t2.a AS `a` from test.t2 +Note 1003 select (select test.t1.a AS `a` from test.t1 where (test.t1.a = test.t2.a) union select test.t5.a AS `a` from test.t5 where (test.t5.a = test.t2.a)) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,test.t2.a AS `a` from test.t2 select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2; ERROR 21000: Subquery returns more than 1 row create table t6 (patient_uq int, clinic_uq int, index i1 (clinic_uq)); @@ -327,7 +327,7 @@ id select_type table type possible_keys key key_len ref rows Extra 2 DEPENDENT SUBQUERY t7 eq_ref PRIMARY PRIMARY 4 test.t6.clinic_uq 1 Warnings: Note 1276 Field or reference 'clinic_uq' of SELECT #2 was resolved in SELECT #1 -Note 1003 select high_priority test.t6.patient_uq AS `patient_uq`,test.t6.clinic_uq AS `clinic_uq` from test.t6 where exists(select test.t7.uq AS `uq`,test.t7.name AS `name` from test.t7 where (test.t7.uq = test.t6.clinic_uq)) +Note 1003 select test.t6.patient_uq AS `patient_uq`,test.t6.clinic_uq AS `clinic_uq` from test.t6 where exists(select test.t7.uq AS `uq`,test.t7.name AS `name` from test.t7 where (test.t7.uq = test.t6.clinic_uq)) select * from t1 where a= (select a from t2,t4 where t2.b=t4.b); ERROR 23000: Column: 'a' in field list is ambiguous drop table if exists t1,t2,t3; @@ -362,7 +362,7 @@ id select_type table type possible_keys key key_len ref rows Extra 2 SUBQUERY t8 const PRIMARY PRIMARY 35 const 1 3 SUBQUERY t8 const PRIMARY PRIMARY 35 1 Using index Warnings: -Note 1003 select high_priority test.t8.pseudo AS `pseudo`,(select test.t8.email AS `email` from test.t8 where (test.t8.pseudo = (select test.t8.pseudo AS `pseudo` from test.t8 where (test.t8.pseudo = _latin1'joce')))) AS `(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce'))` from test.t8 where (test.t8.pseudo = (select test.t8.pseudo AS `pseudo` from test.t8 where (test.t8.pseudo = _latin1'joce'))) +Note 1003 select test.t8.pseudo AS `pseudo`,(select test.t8.email AS `email` from test.t8 where (test.t8.pseudo = (select test.t8.pseudo AS `pseudo` from test.t8 where (test.t8.pseudo = _latin1'joce')))) AS `(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce'))` from test.t8 where (test.t8.pseudo = (select test.t8.pseudo AS `pseudo` from test.t8 where (test.t8.pseudo = _latin1'joce'))) SELECT pseudo FROM t8 WHERE pseudo=(SELECT pseudo,email FROM t8 WHERE pseudo='joce'); ERROR 21000: Operand should contain 1 column(s) @@ -388,13 +388,13 @@ EXPLAIN EXTENDED SELECT DISTINCT date FROM t1 WHERE date='2002-08-03'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL PRIMARY 41 NULL 2 Using where; Using index Warnings: -Note 1003 select high_priority distinct test.t1.date AS `date` from test.t1 where (test.t1.date = 20020803) +Note 1003 select distinct test.t1.date AS `date` from test.t1 where (test.t1.date = 20020803) EXPLAIN EXTENDED SELECT (SELECT DISTINCT date FROM t1 WHERE date='2002-08-03'); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used 2 SUBQUERY t1 index NULL PRIMARY 41 NULL 2 Using where; Using index Warnings: -Note 1003 select high_priority (select distinct test.t1.date AS `date` from test.t1 where (test.t1.date = 20020803)) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')` +Note 1003 select (select distinct test.t1.date AS `date` from test.t1 where (test.t1.date = 20020803)) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')` SELECT DISTINCT date FROM t1 WHERE date='2002-08-03'; date 2002-08-03 @@ -414,7 +414,7 @@ id select_type table type possible_keys key key_len ref rows Extra 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used 3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority 1 AS `1` from test.t1 +Note 1003 select 1 AS `1` from test.t1 drop table t1; CREATE TABLE `t1` ( `numeropost` mediumint(8) unsigned NOT NULL auto_increment, @@ -534,13 +534,13 @@ EXPLAIN EXTENDED SELECT MAX(numreponse) FROM t1 WHERE numeropost='1'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away Warnings: -Note 1003 select high_priority max(test.t1.numreponse) AS `MAX(numreponse)` from test.t1 where (test.t1.numeropost = _latin1'1') +Note 1003 select max(test.t1.numreponse) AS `MAX(numreponse)` from test.t1 where (test.t1.numeropost = _latin1'1') EXPLAIN EXTENDED SELECT numreponse FROM t1 WHERE numeropost='1' AND numreponse=(SELECT MAX(numreponse) FROM t1 WHERE numeropost='1'); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 const PRIMARY,numreponse PRIMARY 7 const,const 1 Using index 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away Warnings: -Note 1003 select high_priority test.t1.numreponse AS `numreponse` from test.t1 where ((test.t1.numeropost = _latin1'1') and (test.t1.numreponse = 3)) +Note 1003 select test.t1.numreponse AS `numreponse` from test.t1 where ((test.t1.numeropost = _latin1'1') and (test.t1.numreponse = 3)) drop table t1; CREATE TABLE t1 (a int(1)); INSERT INTO t1 VALUES (1); @@ -708,7 +708,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 ref id id 5 const 1 Using where; Using index Warnings: Note 1249 Select 2 was reduced during optimisation -Note 1003 select high_priority test.t2.id AS `id` from test.t2 where (test.t2.id = 1) +Note 1003 select test.t2.id AS `id` from test.t2 where (test.t2.id = 1) SELECT * FROM t2 WHERE id IN (SELECT 1 UNION SELECT 3); id 1 @@ -721,14 +721,14 @@ id select_type table type possible_keys key key_len ref rows Extra Warnings: Note 1249 Select 3 was reduced during optimisation Note 1249 Select 2 was reduced during optimisation -Note 1003 select high_priority test.t2.id AS `id` from test.t2 where (test.t2.id = (1 + 1)) +Note 1003 select test.t2.id AS `id` from test.t2 where (test.t2.id = (1 + 1)) EXPLAIN EXTENDED SELECT * FROM t2 WHERE id IN (SELECT 1 UNION SELECT 3); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 index NULL id 5 NULL 2 Using where; Using index 2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used 3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority test.t2.id AS `id` from test.t2 where (test.t2.id,(select 1 AS `Not_used` having ((test.t2.id) = (1)) union select 1 AS `Not_used` having ((test.t2.id) = (3)))) +Note 1003 select test.t2.id AS `id` from test.t2 where (test.t2.id,(select 1 AS `Not_used` having ((test.t2.id) = (1)) union select 1 AS `Not_used` having ((test.t2.id) = (3)))) SELECT * FROM t2 WHERE id IN (SELECT 5 UNION SELECT 3); id SELECT * FROM t2 WHERE id IN (SELECT 5 UNION SELECT 2); @@ -854,7 +854,7 @@ id select_type table type possible_keys key key_len ref rows Extra Warnings: Note 1276 Field or reference 'a' of SELECT #2 was resolved in SELECT #1 Note 1249 Select 2 was reduced during optimisation -Note 1003 select high_priority (test.t1.a + 1) AS `(select a+1)` from test.t1 +Note 1003 select (test.t1.a + 1) AS `(select a+1)` from test.t1 select (select a+1) from t1; (select a+1) 2.5 @@ -876,7 +876,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 index NULL PRIMARY 4 NULL 4 Using index 2 DEPENDENT SUBQUERY t2 index_subquery a a 5 func 2 Using index Warnings: -Note 1003 select high_priority test.t1.a AS `a`,(test.t1.a,(((test.t1.a) in t2 on a chicking NULL))) AS `t1.a in (select t2.a from t2)` from test.t1 +Note 1003 select test.t1.a AS `a`,(test.t1.a,(((test.t1.a) in t2 on a chicking NULL))) AS `t1.a in (select t2.a from t2)` from test.t1 CREATE TABLE t3 (a int(11) default '0'); INSERT INTO t3 VALUES (1),(2),(3); SELECT t1.a, t1.a in (select t2.a from t2,t3 where t3.a=t2.a) FROM t1; @@ -891,7 +891,7 @@ id select_type table type possible_keys key key_len ref rows Extra 2 DEPENDENT SUBQUERY t2 ref_or_null a a 5 func 2 Using where; Using index 2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 Using where Warnings: -Note 1003 select high_priority test.t1.a AS `a`,(test.t1.a,(select 1 AS `Not_used` from test.t2 join test.t3 where ((test.t3.a = test.t2.a) and (((test.t1.a) = test.t2.a) or isnull(test.t2.a))) having (test.t2.a))) AS `t1.a in (select t2.a from t2,t3 where t3.a=t2.a)` from test.t1 +Note 1003 select test.t1.a AS `a`,(test.t1.a,(select 1 AS `Not_used` from test.t2 join test.t3 where ((test.t3.a = test.t2.a) and (((test.t1.a) = test.t2.a) or isnull(test.t2.a))) having (test.t2.a))) AS `t1.a in (select t2.a from t2,t3 where t3.a=t2.a)` from test.t1 drop table t1,t2,t3; create table t1 (a float); select 10.5 IN (SELECT * from t1 LIMIT 1); @@ -1001,19 +1001,19 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system NULL NULL NULL NULL 0 const row not found 2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 0 const row not found Warnings: -Note 1003 select high_priority no_cache (select no_cache rand() AS `RAND()` from test.t1) AS `(SELECT RAND() FROM t1)` from test.t1 +Note 1003 select sql_no_cache (select sql_no_cache rand() AS `RAND()` from test.t1) AS `(SELECT RAND() FROM t1)` from test.t1 EXPLAIN EXTENDED SELECT (SELECT ENCRYPT('test') FROM t1) FROM t1; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system NULL NULL NULL NULL 0 const row not found 2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 0 const row not found Warnings: -Note 1003 select high_priority no_cache (select no_cache ecrypt(_latin1'test') AS `ENCRYPT('test')` from test.t1) AS `(SELECT ENCRYPT('test') FROM t1)` from test.t1 +Note 1003 select sql_no_cache (select sql_no_cache ecrypt(_latin1'test') AS `ENCRYPT('test')` from test.t1) AS `(SELECT ENCRYPT('test') FROM t1)` from test.t1 EXPLAIN EXTENDED SELECT (SELECT BENCHMARK(1,1) FROM t1) FROM t1; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system NULL NULL NULL NULL 0 const row not found 2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 0 const row not found Warnings: -Note 1003 select high_priority no_cache (select no_cache benchmark(1,1) AS `BENCHMARK(1,1)` from test.t1) AS `(SELECT BENCHMARK(1,1) FROM t1)` from test.t1 +Note 1003 select sql_no_cache (select sql_no_cache benchmark(1,1) AS `BENCHMARK(1,1)` from test.t1) AS `(SELECT BENCHMARK(1,1) FROM t1)` from test.t1 drop table t1; CREATE TABLE `t1` ( `mot` varchar(30) character set latin1 NOT NULL default '', @@ -1108,7 +1108,7 @@ id select_type table type possible_keys key key_len ref rows Extra 2 UNCACHEABLE SUBQUERY t1 ALL NULL NULL NULL NULL 3 3 UNCACHEABLE SUBQUERY t1 ALL NULL NULL NULL NULL 3 Warnings: -Note 1003 select high_priority no_cache test.t1.a AS `a`,(select no_cache (select no_cache rand() AS `rand()` from test.t1 limit 1) AS `(select rand() from t1 limit 1)` from test.t1 limit 1) AS `(select (select rand() from t1 limit 1) from t1 limit 1)` from test.t1 +Note 1003 select sql_no_cache test.t1.a AS `a`,(select sql_no_cache (select sql_no_cache rand() AS `rand()` from test.t1 limit 1) AS `(select rand() from t1 limit 1)` from test.t1 limit 1) AS `(select (select rand() from t1 limit 1) from t1 limit 1)` from test.t1 drop table t1; select t1.Continent, t2.Name, t2.Population from t1 LEFT JOIN t2 ON t1.Code = t2.Country where t2.Population IN (select max(t2.Population) AS Population from t2, t1 where t2.Country = t1.Code group by Continent); ERROR 42S02: Table 'test.t1' doesn't exist @@ -1162,7 +1162,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used 2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE Warnings: -Note 1003 select high_priority (0,(select 1 AS `Not_used` from test.t1 a)) AS `0 IN (SELECT 1 FROM t1 a)` +Note 1003 select (0,(select 1 AS `Not_used` from test.t1 a)) AS `0 IN (SELECT 1 FROM t1 a)` INSERT INTO t1 (pseudo) VALUES ('test1'); SELECT 0 IN (SELECT 1 FROM t1 a); 0 IN (SELECT 1 FROM t1 a) @@ -1172,7 +1172,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used 2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE Warnings: -Note 1003 select high_priority (0,(select 1 AS `Not_used` from test.t1 a)) AS `0 IN (SELECT 1 FROM t1 a)` +Note 1003 select (0,(select 1 AS `Not_used` from test.t1 a)) AS `0 IN (SELECT 1 FROM t1 a)` drop table t1; CREATE TABLE `t1` ( `i` int(11) NOT NULL default '0', @@ -1216,7 +1216,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ref salary salary 5 const 1 Using where 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away Warnings: -Note 1003 select high_priority test.t1.id AS `id` from test.t1 where (test.t1.salary = (select max(test.t1.salary) AS `MAX(salary)` from test.t1)) +Note 1003 select test.t1.id AS `id` from test.t1 where (test.t1.salary = (select max(test.t1.salary) AS `MAX(salary)` from test.t1)) drop table t1; CREATE TABLE t1 ( ID int(10) unsigned NOT NULL auto_increment, @@ -1283,7 +1283,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 index NULL PRIMARY 4 NULL 4 Using where; Using index 2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 Using index Warnings: -Note 1003 select high_priority test.t2.a AS `a` from test.t2 where (test.t2.a,(((test.t2.a) in t1 on PRIMARY))) +Note 1003 select test.t2.a AS `a` from test.t2 where (test.t2.a,(((test.t2.a) in t1 on PRIMARY))) select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a 2 @@ -1293,7 +1293,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 index NULL PRIMARY 4 NULL 4 Using where; Using index 2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 Using index; Using where Warnings: -Note 1003 select high_priority test.t2.a AS `a` from test.t2 where (test.t2.a,(((test.t2.a) in t1 on PRIMARY where (test.t1.b <> 30)))) +Note 1003 select test.t2.a AS `a` from test.t2 where (test.t2.a,(((test.t2.a) in t1 on PRIMARY where (test.t1.b <> 30)))) select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); a 2 @@ -1304,7 +1304,7 @@ id select_type table type possible_keys key key_len ref rows Extra 2 DEPENDENT SUBQUERY t1 eq_ref PRIMARY PRIMARY 4 func 1 Using where 2 DEPENDENT SUBQUERY t3 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 Using where; Using index Warnings: -Note 1003 select high_priority test.t2.a AS `a` from test.t2 where (test.t2.a,(select 1 AS `Not_used` from test.t1 join test.t3 where ((test.t1.b = test.t3.a) and ((test.t2.a) = test.t1.a)))) +Note 1003 select test.t2.a AS `a` from test.t2 where (test.t2.a,(select 1 AS `Not_used` from test.t1 join test.t3 where ((test.t1.b = test.t3.a) and ((test.t2.a) = test.t1.a)))) drop table t1, t2, t3; create table t1 (a int, b int, index a (a,b)); create table t2 (a int, index a (a)); @@ -1322,7 +1322,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 index NULL a 5 NULL 4 Using where; Using index 2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 Using index Warnings: -Note 1003 select high_priority test.t2.a AS `a` from test.t2 where (test.t2.a,(((test.t2.a) in t1 on a))) +Note 1003 select test.t2.a AS `a` from test.t2 where (test.t2.a,(((test.t2.a) in t1 on a))) select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a 2 @@ -1332,7 +1332,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 index NULL a 5 NULL 4 Using where; Using index 2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 Using index; Using where Warnings: -Note 1003 select high_priority test.t2.a AS `a` from test.t2 where (test.t2.a,(((test.t2.a) in t1 on a where (test.t1.b <> 30)))) +Note 1003 select test.t2.a AS `a` from test.t2 where (test.t2.a,(((test.t2.a) in t1 on a where (test.t1.b <> 30)))) select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); a 2 @@ -1343,7 +1343,7 @@ id select_type table type possible_keys key key_len ref rows Extra 2 DEPENDENT SUBQUERY t1 ref a a 5 func 1001 Using where; Using index 2 DEPENDENT SUBQUERY t3 index a a 5 NULL 3 Using where; Using index Warnings: -Note 1003 select high_priority test.t2.a AS `a` from test.t2 where (test.t2.a,(select 1 AS `Not_used` from test.t1 join test.t3 where ((test.t1.b = test.t3.a) and ((test.t2.a) = test.t1.a)))) +Note 1003 select test.t2.a AS `a` from test.t2 where (test.t2.a,(select 1 AS `Not_used` from test.t1 join test.t3 where ((test.t1.b = test.t3.a) and ((test.t2.a) = test.t1.a)))) insert into t1 values (3,31); select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a @@ -1359,7 +1359,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 index NULL a 5 NULL 4 Using where; Using index 2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 Using index; Using where Warnings: -Note 1003 select high_priority test.t2.a AS `a` from test.t2 where (test.t2.a,(((test.t2.a) in t1 on a where (test.t1.b <> 30)))) +Note 1003 select test.t2.a AS `a` from test.t2 where (test.t2.a,(((test.t2.a) in t1 on a where (test.t1.b <> 30)))) drop table t1, t2, t3; create table t1 (a int, b int); create table t2 (a int, b int); @@ -1416,7 +1416,7 @@ explain extended (select * from t1); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system NULL NULL NULL NULL 1 Warnings: -Note 1003 (select high_priority test.t1.s1 AS `s1` from test.t1) +Note 1003 (select test.t1.s1 AS `s1` from test.t1) (select * from t1); s1 tttt @@ -1450,25 +1450,25 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 Using index 2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 2 Using index Warnings: -Note 1003 select high_priority test.t1.s1 AS `s1`,not((test.t1.s1,(((test.t1.s1) in t2 on s1 chicking NULL)))) AS `s1 NOT IN (SELECT s1 FROM t2)` from test.t1 +Note 1003 select test.t1.s1 AS `s1`,not((test.t1.s1,(((test.t1.s1) in t2 on s1 chicking NULL)))) AS `s1 NOT IN (SELECT s1 FROM t2)` from test.t1 explain extended select s1, s1 = ANY (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 Using index 2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 2 Using index Warnings: -Note 1003 select high_priority test.t1.s1 AS `s1`,(test.t1.s1,(((test.t1.s1) in t2 on s1 chicking NULL))) AS `s1 = ANY (SELECT s1 FROM t2)` from test.t1 +Note 1003 select test.t1.s1 AS `s1`,(test.t1.s1,(((test.t1.s1) in t2 on s1 chicking NULL))) AS `s1 = ANY (SELECT s1 FROM t2)` from test.t1 explain extended select s1, s1 <> ALL (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 Using index 2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 2 Using index Warnings: -Note 1003 select high_priority test.t1.s1 AS `s1`,not((test.t1.s1,(((test.t1.s1) in t2 on s1 chicking NULL)))) AS `s1 <> ALL (SELECT s1 FROM t2)` from test.t1 +Note 1003 select test.t1.s1 AS `s1`,not((test.t1.s1,(((test.t1.s1) in t2 on s1 chicking NULL)))) AS `s1 <> ALL (SELECT s1 FROM t2)` from test.t1 explain extended select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 Using index 2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 1 Using index; Using where Warnings: -Note 1003 select high_priority test.t1.s1 AS `s1`,not((test.t1.s1,(((test.t1.s1) in t2 on s1 chicking NULL where (test.t2.s1 < _latin1'a2'))))) AS `s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2')` from test.t1 +Note 1003 select test.t1.s1 AS `s1`,not((test.t1.s1,(((test.t1.s1) in t2 on s1 chicking NULL where (test.t2.s1 < _latin1'a2'))))) AS `s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2')` from test.t1 drop table t1,t2; create table t2 (a int, b int); create table t3 (a int); @@ -1483,7 +1483,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where 2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found Warnings: -Note 1003 select high_priority test.t3.a AS `a` from test.t3 where ((test.t3.a < (select max(test.t2.b) from test.t2))) +Note 1003 select test.t3.a AS `a` from test.t3 where ((test.t3.a < (select max(test.t2.b) from test.t2))) insert into t2 values (2,2), (2,1), (3,3), (3,1); select * from t3 where a > all (select max(b) from t2 group by a); a @@ -1494,7 +1494,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where 2 SUBQUERY t2 ALL NULL NULL NULL NULL 4 Using temporary; Using filesort Warnings: -Note 1003 select high_priority test.t3.a AS `a` from test.t3 where ((test.t3.a <= (select max(test.t2.b) AS `max(b)` from test.t2 group by test.t2.a))) +Note 1003 select test.t3.a AS `a` from test.t3 where ((test.t3.a <= (select max(test.t2.b) AS `max(b)` from test.t2 group by test.t2.a))) drop table t2, t3; CREATE TABLE `t1` ( `id` mediumint(9) NOT NULL auto_increment, `taskid` bigint(20) NOT NULL default '0', `dbid` int(11) NOT NULL default '0', `create_date` datetime NOT NULL default '0000-00-00 00:00:00', `last_update` datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (`id`)) ENGINE=MyISAM CHARSET=latin1 AUTO_INCREMENT=3 ; INSERT INTO `t1` (`id`, `taskid`, `dbid`, `create_date`,`last_update`) VALUES (1, 1, 15, '2003-09-29 10:31:36', '2003-09-29 10:31:36'), (2, 1, 21, now(), now()); @@ -1659,14 +1659,14 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 12 Using where 2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 Using index; Using where Warnings: -Note 1003 select high_priority test.t1.id AS `id`,test.t1.text AS `text` from test.t1 where not((test.t1.id,(((test.t1.id) in t1 on PRIMARY where (test.t1.id < 8))))) +Note 1003 select test.t1.id AS `id`,test.t1.text AS `text` from test.t1 where not((test.t1.id,(((test.t1.id) in t1 on PRIMARY where (test.t1.id < 8))))) explain extended select * from t1 as tt where not exists (select id from t1 where id < 8 and (id = tt.id or id is null) having id is not null); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY tt ALL NULL NULL NULL NULL 12 Using where 2 DEPENDENT SUBQUERY t1 eq_ref PRIMARY PRIMARY 4 test.tt.id 7 Using where; Using index Warnings: Note 1276 Field or reference 'tt.id' of SELECT #2 was resolved in SELECT #1 -Note 1003 select high_priority test.tt.id AS `id`,test.tt.text AS `text` from test.t1 tt where not(exists(select test.t1.id AS `id` from test.t1 where ((test.t1.id < 8) and ((test.t1.id = test.tt.id) or isnull(test.t1.id))) having (test.t1.id is not null))) +Note 1003 select test.tt.id AS `id`,test.tt.text AS `text` from test.t1 tt where not(exists(select test.t1.id AS `id` from test.t1 where ((test.t1.id < 8) and ((test.t1.id = test.tt.id) or isnull(test.t1.id))) having (test.t1.id is not null))) insert into t1 (id, text) values (1000, 'text1000'), (1001, 'text1001'); create table t2 (id int not null, text varchar(20) not null default '', primary key (id)); insert into t2 (id, text) values (1, 'text1'), (2, 'text2'), (3, 'text3'), (4, 'text4'), (5, 'text5'), (6, 'text6'), (7, 'text7'), (8, 'text8'), (9, 'text9'), (10, 'text10'), (11, 'text1'), (12, 'text2'), (13, 'text3'), (14, 'text4'), (15, 'text5'), (16, 'text6'), (17, 'text7'), (18, 'text8'), (19, 'text9'), (20, 'text10'),(21, 'text1'), (22, 'text2'), (23, 'text3'), (24, 'text4'), (25, 'text5'), (26, 'text6'), (27, 'text7'), (28, 'text8'), (29, 'text9'), (30, 'text10'), (31, 'text1'), (32, 'text2'), (33, 'text3'), (34, 'text4'), (35, 'text5'), (36, 'text6'), (37, 'text7'), (38, 'text8'), (39, 'text9'), (40, 'text10'), (41, 'text1'), (42, 'text2'), (43, 'text3'), (44, 'text4'), (45, 'text5'), (46, 'text6'), (47, 'text7'), (48, 'text8'), (49, 'text9'), (50, 'text10'); @@ -1692,7 +1692,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE b eq_ref PRIMARY PRIMARY 4 test.a.id 2 1 SIMPLE c eq_ref PRIMARY PRIMARY 4 func 1 Using where Warnings: -Note 1003 select high_priority test.a.id AS `id`,test.a.text AS `text`,test.b.id AS `id`,test.b.text AS `text`,test.c.id AS `id`,test.c.text AS `text` from test.t1 a left join test.t2 b on(((test.a.id = test.b.id) or isnull(test.b.id))) join test.t1 c where (if(isnull(test.b.id),1000,test.b.id) = test.c.id) +Note 1003 select test.a.id AS `id`,test.a.text AS `text`,test.b.id AS `id`,test.b.text AS `text`,test.c.id AS `id`,test.c.text AS `text` from test.t1 a left join test.t2 b on(((test.a.id = test.b.id) or isnull(test.b.id))) join test.t1 c where (if(isnull(test.b.id),1000,test.b.id) = test.c.id) drop table t1,t2; create table t1 (a int); insert into t1 values (1); diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result index e9861266b78..6792f2f4c2c 100644 --- a/mysql-test/r/type_blob.result +++ b/mysql-test/r/type_blob.result @@ -507,7 +507,7 @@ coercibility(load_file('../../std_data/words.dat')); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority no_cache charset(load_file(_latin1'../../std_data/words.dat')) AS `charset(load_file('../../std_data/words.dat'))`,collation(load_file(_latin1'../../std_data/words.dat')) AS `collation(load_file('../../std_data/words.dat'))`,coercibility(load_file(_latin1'../../std_data/words.dat')) AS `coercibility(load_file('../../std_data/words.dat'))` +Note 1003 select sql_no_cache charset(load_file(_latin1'../../std_data/words.dat')) AS `charset(load_file('../../std_data/words.dat'))`,collation(load_file(_latin1'../../std_data/words.dat')) AS `collation(load_file('../../std_data/words.dat'))`,coercibility(load_file(_latin1'../../std_data/words.dat')) AS `coercibility(load_file('../../std_data/words.dat'))` update t1 set imagem=load_file('../../std_data/words.dat') where id=1; select if(imagem is null, "ERROR", "OK"),length(imagem) from t1 where id = 1; if(imagem is null, "ERROR", "OK") length(imagem) diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index bf8b8df7c65..c85b59be38c 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -87,7 +87,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 4 2 UNION t2 ALL NULL NULL NULL NULL 4 Using filesort Warnings: -Note 1003 (select high_priority test.t1.a AS `a`,test.t1.b AS `b` from test.t1 limit 2) union all (select test.t2.a AS `a`,test.t2.b AS `b` from test.t2 order by test.t2.a limit 1) order by b desc +Note 1003 (select test.t1.a AS `a`,test.t1.b AS `b` from test.t1 limit 2) union all (select test.t2.a AS `a`,test.t2.b AS `b` from test.t2 order by test.t2.a limit 1) order by b desc (select sql_calc_found_rows a,b from t1 limit 2) union all (select a,b from t2 order by a) limit 2; a b 1 a @@ -476,7 +476,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 const PRIMARY PRIMARY 4 const 1 2 UNION t2 const PRIMARY PRIMARY 4 const 1 Warnings: -Note 1003 (select high_priority test.t1.a AS `a`,test.t1.b AS `b` from test.t1 where (test.t1.a = 1)) union (select test.t2.a AS `a`,test.t2.b AS `b` from test.t2 where (test.t2.a = 1)) +Note 1003 (select test.t1.a AS `a`,test.t1.b AS `b` from test.t1 where (test.t1.a = 1)) union (select test.t2.a AS `a`,test.t2.b AS `b` from test.t2 where (test.t2.a = 1)) (select * from t1 where a=5) union (select * from t2 where a=1); a b 1 10 diff --git a/mysql-test/r/varbinary.result b/mysql-test/r/varbinary.result index cf001158ae2..26ce91286da 100644 --- a/mysql-test/r/varbinary.result +++ b/mysql-test/r/varbinary.result @@ -15,7 +15,7 @@ explain extended select * from t1 where UNIQ=0x38afba1d73e6a18a; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 const UNIQ UNIQ 8 const 1 Warnings: -Note 1003 select high_priority test.t1.ID AS `ID`,test.t1.UNIQ AS `UNIQ` from test.t1 where (test.t1.UNIQ = 4084688022709641610) +Note 1003 select test.t1.ID AS `ID`,test.t1.UNIQ AS `UNIQ` from test.t1 where (test.t1.UNIQ = 4084688022709641610) drop table t1; select x'hello'; ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'x'hello'' at line 1 diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index aaf977efe50..290b1fa41cf 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -26,7 +26,7 @@ explain extended select @t1:=(@t2:=1)+@t3:=4,@t1,@t2,@t3; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority no_cache (@t1:=((@t2:=1) + (@t3:=4))) AS `@t1:=(@t2:=1)+@t3:=4`,(@t1) AS `@t1`,(@t2) AS `@t2`,(@t3) AS `@t3` +Note 1003 select sql_no_cache (@t1:=((@t2:=1) + (@t3:=4))) AS `@t1:=(@t2:=1)+@t3:=4`,(@t1) AS `@t1`,(@t2) AS `@t2`,(@t3) AS `@t3` select @t5; @t5 1.23456 @@ -85,7 +85,7 @@ explain extended select last_insert_id(345); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority no_cache last_insert_id(345) AS `last_insert_id(345)` +Note 1003 select sql_no_cache last_insert_id(345) AS `last_insert_id(345)` select @@IDENTITY,last_insert_id(), @@identity; @@IDENTITY last_insert_id() @@identity 345 345 345 @@ -93,7 +93,7 @@ explain extended select @@IDENTITY,last_insert_id(), @@identity; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority no_cache 345 AS `@@IDENTITY`,last_insert_id() AS `last_insert_id()`,345 AS `@@identity` +Note 1003 select sql_no_cache 345 AS `@@IDENTITY`,last_insert_id() AS `last_insert_id()`,345 AS `@@identity` set big_tables=OFF, big_tables=ON, big_tables=0, big_tables=1, big_tables="OFF", big_tables="ON"; set global concurrent_insert=ON; show variables like 'concurrent_insert'; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index c330d1e6b54..f9cd5bcbf86 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -9370,21 +9370,21 @@ void st_select_lex::print(THD *thd, String *str) //options if (options & SELECT_STRAIGHT_JOIN) str->append("straight_join ", 14); - if ((thd->lex->lock_option & TL_READ_HIGH_PRIORITY) && + if ((thd->lex->lock_option == TL_READ_HIGH_PRIORITY) && (this == &thd->lex->select_lex)) str->append("high_priority ", 14); if (options & SELECT_DISTINCT) str->append("distinct ", 9); if (options & SELECT_SMALL_RESULT) - str->append("small_result ", 13); + str->append("sql_small_result ", 17); if (options & SELECT_BIG_RESULT) - str->append("big_result ", 11); + str->append("sql_big_result ", 15); if (options & OPTION_BUFFER_RESULT) - str->append("buffer_result ", 14); + str->append("sql_buffer_result ", 18); if (options & OPTION_FOUND_ROWS) - str->append("calc_found_rows ", 16); + str->append("sql_calc_found_rows ", 20); if (!thd->lex->safe_to_cache_query) - str->append("no_cache ", 9); + str->append("sql_no_cache ", 13); if (options & OPTION_TO_QUERY_CACHE) str->append("cache ", 6); From a3aacd79834acfdd1e2bc7b678f9f618f9902ea0 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 May 2004 01:24:17 +0200 Subject: [PATCH 072/162] compatibility fix for hp-ux 64bit (hpux compiler) and sun 64-bit (sun forte) --- strings/my_strtoll10.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/strings/my_strtoll10.c b/strings/my_strtoll10.c index 349350c6c7a..493d0d63de2 100644 --- a/strings/my_strtoll10.c +++ b/strings/my_strtoll10.c @@ -22,9 +22,9 @@ #define ULONGLONG_MAX (~(ulonglong) 0) #define MAX_NEGATIVE_NUMBER ((ulonglong) LL(0x8000000000000000)) #define INIT_CNT 9 -#define LFACTOR LL(1000000000) -#define LFACTOR1 LL(10000000000) -#define LFACTOR2 LL(100000000000) +#define LFACTOR ULL(1000000000) +#define LFACTOR1 ULL(10000000000) +#define LFACTOR2 ULL(100000000000) static unsigned long lfactor[9]= { @@ -113,8 +113,8 @@ longlong my_strtoll10(const char *nptr, char **endptr, int *error) negative= 1; if (++s == end) goto no_conv; - cutoff= MAX_NEGATIVE_NUMBER / LL(100000000000); - cutoff2= (MAX_NEGATIVE_NUMBER % LL(100000000000)) / 100; + cutoff= MAX_NEGATIVE_NUMBER / LFACTOR2; + cutoff2= (MAX_NEGATIVE_NUMBER % LFACTOR2) / 100; cutoff3= MAX_NEGATIVE_NUMBER % 100; } else @@ -125,8 +125,8 @@ longlong my_strtoll10(const char *nptr, char **endptr, int *error) if (++s == end) goto no_conv; } - cutoff= ULONGLONG_MAX / LL(100000000000); - cutoff2= ULONGLONG_MAX % LL(100000000000) / 100; + cutoff= ULONGLONG_MAX / LFACTOR2; + cutoff2= ULONGLONG_MAX % LFACTOR2 / 100; cutoff3= ULONGLONG_MAX % 100; } From 6f0946d6dd0568c36d33f34e548b5ac8e26842ad Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 May 2004 09:02:06 +0300 Subject: [PATCH 073/162] sql_table.cc: Fix bug #3749: if there were several indexs that made an automatically generated FOREIGN KEY index redundant, then MySQL miscalculated the number of keys, and the AUTO_INCREMENT flag was forgotten by MySQL from a PRIMARY KEY. There were probably a multitude of other errors caused by this. sql/sql_table.cc: Fix bug #3749: if there were several indexs that made an automatically generated FOREIGN KEY index redundant, then MySQL miscalculated the number of keys, and the AUTO_INCREMENT flag was forgotten by MySQL from a PRIMARY KEY. There were probably a multitude of other errors caused by this. --- sql/sql_table.cc | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/sql/sql_table.cc b/sql/sql_table.cc index b90ff942cc6..47574eab666 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -683,6 +683,11 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, { while ((key2 = key_iterator2++) != key) { + /* + foreign_key_prefix(key, key2) returns 0 if key or key2, or both, is + 'generated', and a generated key is a prefix of the other key. Then we + do not need the generated shorter key. + */ if ((key2->type != Key::FOREIGN_KEY && !foreign_key_prefix(key, key2))) { /* TO DO: issue warning message */ @@ -693,10 +698,17 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, key->name= ignore_key; else { - /* Remove the previous, generated key */ - key2->name= ignore_key; - key_parts-= key2->columns.elements; - (*key_count)--; + /* + Remove the previous, generated key if it has not yet been + removed. Note that if we have several identical generated keys, + the last one will remain and others get removed here. + */ + if (key2->name != ignore_key) + { + key2->name= ignore_key; + key_parts-= key2->columns.elements; + (*key_count)--; + } } break; } From 3226b9fae557cc8ef952acbe47ceb744cc4eabdc Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 May 2004 12:16:27 +0500 Subject: [PATCH 074/162] Bug #3403 Wrong encoding in SHOW GRANTS, EPLAIN SELECT output This change fixes SHOW GRANTS problem, while EXPLAIN will be fixed in a separate patch. --- mysql-test/r/grant.result | 24 ++++++++++++++++++++++++ mysql-test/t/grant.test | 23 +++++++++++++++++++++++ sql/sql_acl.cc | 18 +++++++++++------- 3 files changed, 58 insertions(+), 7 deletions(-) diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index 8b3948e093f..c47530cdc46 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -204,3 +204,27 @@ show grants for mysqltest_1@localhost; Grants for mysqltest_1@localhost GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' IDENTIFIED BY PASSWORD '*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19' drop user mysqltest_1@localhost; +SET NAMES koi8r; +CREATE DATABASE ÂÄ; +USE ÂÄ; +CREATE TABLE ÔÁÂ (ËÏÌ int); +GRANT SELECT ON ÂÄ.* TO ÀÚÅÒ@localhost; +SHOW GRANTS FOR ÀÚÅÒ@localhost; +Grants for ÀÚÅÒ@localhost +GRANT USAGE ON *.* TO 'ÀÚÅÒ'@'localhost' +GRANT SELECT ON `ÂÄ`.* TO 'ÀÚÅÒ'@'localhost' +REVOKE SELECT ON ÂÄ.* FROM ÀÚÅÒ@localhost; +GRANT SELECT ON ÂÄ.ÔÁÂ TO ÀÚÅÒ@localhost; +SHOW GRANTS FOR ÀÚÅÒ@localhost; +Grants for ÀÚÅÒ@localhost +GRANT USAGE ON *.* TO 'ÀÚÅÒ'@'localhost' +GRANT SELECT ON `ÂÄ`.`ÔÁÂ` TO 'ÀÚÅÒ'@'localhost' +REVOKE SELECT ON ÂÄ.ÔÁÂ FROM ÀÚÅÒ@localhost; +GRANT SELECT (ËÏÌ) ON ÂÄ.ÔÁÂ TO ÀÚÅÒ@localhost; +SHOW GRANTS FOR ÀÚÅÒ@localhost; +Grants for ÀÚÅÒ@localhost +GRANT USAGE ON *.* TO 'ÀÚÅÒ'@'localhost' +GRANT SELECT (ËÏÌ) ON `ÂÄ`.`ÔÁÂ` TO 'ÀÚÅÒ'@'localhost' +REVOKE SELECT (ËÏÌ) ON ÂÄ.ÔÁÂ FROM ÀÚÅÒ@localhost; +DROP DATABASE ÂÄ; +SET NAMES latin1; diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index 832541b0f86..6bd2fa0c703 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -148,3 +148,26 @@ grant usage on *.* to mysqltest_1@localhost identified by "password"; grant select, update, insert on test.* to mysqltest@localhost; show grants for mysqltest_1@localhost; drop user mysqltest_1@localhost; + +# +# Bug #3403 Wrong encodin in SHOW GRANTS output +# +SET NAMES koi8r; +CREATE DATABASE ÂÄ; +USE ÂÄ; +CREATE TABLE ÔÁÂ (ËÏÌ int); + +GRANT SELECT ON ÂÄ.* TO ÀÚÅÒ@localhost; +SHOW GRANTS FOR ÀÚÅÒ@localhost; +REVOKE SELECT ON ÂÄ.* FROM ÀÚÅÒ@localhost; + +GRANT SELECT ON ÂÄ.ÔÁÂ TO ÀÚÅÒ@localhost; +SHOW GRANTS FOR ÀÚÅÒ@localhost; +REVOKE SELECT ON ÂÄ.ÔÁÂ FROM ÀÚÅÒ@localhost; + +GRANT SELECT (ËÏÌ) ON ÂÄ.ÔÁÂ TO ÀÚÅÒ@localhost; +SHOW GRANTS FOR ÀÚÅÒ@localhost; +REVOKE SELECT (ËÏÌ) ON ÂÄ.ÔÁÂ FROM ÀÚÅÒ@localhost; + +DROP DATABASE ÂÄ; +SET NAMES latin1; diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 9c7fe3e2993..880b6eb74ee 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -3064,7 +3064,7 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user) /* Add first global access grants */ { - String global(buff,sizeof(buff),&my_charset_latin1); + String global(buff,sizeof(buff),system_charset_info); global.length(0); global.append("GRANT ",6); @@ -3089,7 +3089,8 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user) } } global.append (" ON *.* TO '",12); - global.append(lex_user->user.str,lex_user->user.length); + global.append(lex_user->user.str, lex_user->user.length, + system_charset_info); global.append ("'@'",3); global.append(lex_user->host.str,lex_user->host.length); global.append ('\''); @@ -3177,7 +3178,7 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user) want_access=acl_db->access; if (want_access) { - String db(buff,sizeof(buff),&my_charset_latin1); + String db(buff,sizeof(buff),system_charset_info); db.length(0); db.append("GRANT ",6); @@ -3203,7 +3204,8 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user) db.append (" ON ",4); append_identifier(thd, &db, acl_db->db, strlen(acl_db->db)); db.append (".* TO '",7); - db.append(lex_user->user.str,lex_user->user.length); + db.append(lex_user->user.str, lex_user->user.length, + system_charset_info); db.append ("'@'",3); db.append(lex_user->host.str, lex_user->host.length); db.append ('\''); @@ -3237,7 +3239,7 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user) ulong table_access= grant_table->privs; if ((table_access | grant_table->cols) != 0) { - String global(buff,sizeof(buff),&my_charset_latin1); + String global(buff, sizeof(buff), system_charset_info); ulong test_access= (table_access | grant_table->cols) & ~GRANT_ACL; global.length(0); @@ -3291,7 +3293,8 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user) else global.append(", ",2); global.append(grant_column->column, - grant_column->key_length); + grant_column->key_length, + system_charset_info); } } if (found_col) @@ -3307,7 +3310,8 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user) append_identifier(thd, &global, grant_table->tname, strlen(grant_table->tname)); global.append(" TO '",5); - global.append(lex_user->user.str,lex_user->user.length); + global.append(lex_user->user.str, lex_user->user.length, + system_charset_info); global.append("'@'",3); global.append(lex_user->host.str,lex_user->host.length); global.append('\''); From 375825aab0a373e4e4dd39a3770b77c0f96921b4 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 May 2004 13:08:22 +0500 Subject: [PATCH 075/162] Bug #3403 Wrong encoding in EXPLAIN SELECT output --- mysql-test/r/explain.result | 9 +++++++++ mysql-test/t/explain.test | 11 +++++++++++ sql/sql_select.cc | 6 +++--- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/explain.result b/mysql-test/r/explain.result index 02e1ace71e1..d66dec741bd 100644 --- a/mysql-test/r/explain.result +++ b/mysql-test/r/explain.result @@ -44,3 +44,12 @@ explain select count(*) from t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away drop table t1; +set names koi8r; +create table ÔÁÂ (ËÏÌ0 int, ËÏÌ1 int, key ÉÎÄ0 (ËÏÌ0), key ÉÎÄ01 (ËÏÌ0,ËÏÌ1)); +insert into ÔÁÂ (ËÏÌ0) values (1); +insert into ÔÁÂ (ËÏÌ0) values (2); +explain select ËÏÌ0 from ÔÁÂ where ËÏÌ0=1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE ÔÁÂ ref ÉÎÄ0,ÉÎÄ01 ÉÎÄ0 5 const 1 Using where; Using index +drop table ÔÁÂ; +set names latin1; diff --git a/mysql-test/t/explain.test b/mysql-test/t/explain.test index ff1803368b9..050939e5ad2 100644 --- a/mysql-test/t/explain.test +++ b/mysql-test/t/explain.test @@ -30,3 +30,14 @@ explain select count(*) from t1; insert into t1 values(1); explain select count(*) from t1; drop table t1; + +# +# Bug #3403 Wrong encoding in EXPLAIN SELECT output +# +set names koi8r; +create table ÔÁÂ (ËÏÌ0 int, ËÏÌ1 int, key ÉÎÄ0 (ËÏÌ0), key ÉÎÄ01 (ËÏÌ0,ËÏÌ1)); +insert into ÔÁÂ (ËÏÌ0) values (1); +insert into ÔÁÂ (ËÏÌ0) values (2); +explain select ËÏÌ0 from ÔÁÂ where ËÏÌ0=1; +drop table ÔÁÂ; +set names latin1; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index f9cd5bcbf86..47ecc57cf16 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -9123,7 +9123,7 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order, THD *thd=join->thd; select_result *result=join->result; Item *item_null= new Item_null(); - CHARSET_INFO *cs= &my_charset_latin1; + CHARSET_INFO *cs= system_charset_info; DBUG_ENTER("select_describe"); DBUG_PRINT("info", ("Select 0x%lx, type %s, message %s", (ulong)join->select_lex, join->select_lex->type, @@ -9190,7 +9190,7 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order, { if (tmp1.length()) tmp1.append(','); - tmp1.append(table->key_info[j].name); + tmp1.append(table->key_info[j].name, 0, system_charset_info); } } } @@ -9209,7 +9209,7 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order, { if (tmp2.length()) tmp2.append(','); - tmp2.append((*ref)->name()); + tmp2.append((*ref)->name(), 0, system_charset_info); } item_list.push_back(new Item_string(tmp2.ptr(),tmp2.length(),cs)); } From c50d5e94bf63ec3d02574d9012eb9af2ec3e3797 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 May 2004 11:09:57 +0300 Subject: [PATCH 076/162] fixed flags of printed query --- mysql-test/r/func_group.result | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result index 57b109e1ee6..bd5646f4068 100644 --- a/mysql-test/r/func_group.result +++ b/mysql-test/r/func_group.result @@ -265,7 +265,7 @@ explain extended select SQL_BIG_RESULT a,count(b), sum(b), avg(b), std(b), min(b id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using filesort Warnings: -Note 1003 select high_priority big_result test.t1.a AS `a`,count(test.t1.b) AS `count(b)`,sum(test.t1.b) AS `sum(b)`,avg(test.t1.b) AS `avg(b)`,std(test.t1.b) AS `std(b)`,min(test.t1.b) AS `min(b)`,max(test.t1.b) AS `max(b)`,bit_and(test.t1.b) AS `bit_and(b)`,bit_or(test.t1.b) AS `bit_or(b)`,bit_xor(test.t1.b) AS `bit_xor(b)` from test.t1 group by test.t1.a +Note 1003 select sql_big_result test.t1.a AS `a`,count(test.t1.b) AS `count(b)`,sum(test.t1.b) AS `sum(b)`,avg(test.t1.b) AS `avg(b)`,std(test.t1.b) AS `std(b)`,min(test.t1.b) AS `min(b)`,max(test.t1.b) AS `max(b)`,bit_and(test.t1.b) AS `bit_and(b)`,bit_or(test.t1.b) AS `bit_or(b)`,bit_xor(test.t1.b) AS `bit_xor(b)` from test.t1 group by test.t1.a drop table t1; create table t1 (col int); insert into t1 values (-1), (-2), (-3); From 2d743fe227f469c0dbaba803e818b4e23a3e2a76 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 May 2004 12:26:12 +0300 Subject: [PATCH 077/162] InnoDB: Remove unused function ut_str_catenate() innobase/include/ut0mem.h: Remove unused function ut_str_catenate() innobase/ut/ut0mem.c: Remove unused function ut_str_catenate() --- innobase/include/ut0mem.h | 11 ----------- innobase/ut/ut0mem.c | 26 -------------------------- 2 files changed, 37 deletions(-) diff --git a/innobase/include/ut0mem.h b/innobase/include/ut0mem.h index bfda5ded40c..e83b2e6f60c 100644 --- a/innobase/include/ut0mem.h +++ b/innobase/include/ut0mem.h @@ -108,17 +108,6 @@ ut_memcpyq( const char* src, /* in: string to be quoted */ ulint len); /* in: length of src */ -/************************************************************************** -Catenates two strings into newly allocated memory. The memory must be freed -using mem_free. */ - -char* -ut_str_catenate( -/*============*/ - /* out, own: catenated null-terminated string */ - char* str1, /* in: null-terminated string */ - char* str2); /* in: null-terminated string */ - #ifndef UNIV_NONINL #include "ut0mem.ic" #endif diff --git a/innobase/ut/ut0mem.c b/innobase/ut/ut0mem.c index 1fcaf9febbe..13846630818 100644 --- a/innobase/ut/ut0mem.c +++ b/innobase/ut/ut0mem.c @@ -236,29 +236,3 @@ ut_memcpyq( return(dest); } - -/************************************************************************** -Catenates two strings into newly allocated memory. The memory must be freed -using mem_free. */ - -char* -ut_str_catenate( -/*============*/ - /* out, own: catenated null-terminated string */ - char* str1, /* in: null-terminated string */ - char* str2) /* in: null-terminated string */ -{ - ulint len1; - ulint len2; - char* str; - - len1 = ut_strlen(str1); - len2 = ut_strlen(str2); - - str = mem_alloc(len1 + len2 + 1); - - ut_memcpy(str, str1, len1); - ut_memcpy(str + len1, str2, len2 + 1); - - return(str); -} From 213392db2da0a1ba289429524e7d154ecae779af Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 May 2004 13:28:20 +0300 Subject: [PATCH 078/162] UNCACHEABLE_EXPLAIN is enough --- sql/sql_select.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 2b3de669618..f3b342b3fad 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -991,7 +991,7 @@ JOIN::optimize() } } - if (select_lex->master_unit()->uncacheable || thd->lex->describe) + if (select_lex->master_unit()->uncacheable) { if (!(tmp_join= (JOIN*)thd->alloc(sizeof(JOIN)))) DBUG_RETURN(-1); From 321d50fd06c7ddcc9a32ed661c3a91e48178e6f8 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 May 2004 12:49:18 +0200 Subject: [PATCH 079/162] better fix for bug#3749 - do not consider already removed keys in key removal process mysql-test/r/innodb.result: tests for bug#3749 mysql-test/t/innodb.test: tests for bug#3749 --- mysql-test/r/innodb.result | 25 ++++++++++++++++++++++++- mysql-test/t/innodb.test | 12 +++++++++++- sql/sql_table.cc | 19 ++++++------------- 3 files changed, 41 insertions(+), 15 deletions(-) diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 60280715911..259e1fb3059 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1540,4 +1540,27 @@ t2 CREATE TABLE `t2` ( drop table t2; create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb; ERROR HY000: Can't create table './test/t2.frm' (errno: 150) -drop table t1; +create table t2 (a int auto_increment primary key, b int, index(b), foreign key (b) references t1(id), unique(b)) engine=innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) NOT NULL auto_increment, + `b` int(11) default NULL, + PRIMARY KEY (`a`), + UNIQUE KEY `b_2` (`b`), + KEY `b` (`b`), + CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`b`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (a int auto_increment primary key, b int, foreign key (b) references t1(id), foreign key (b) references t1(id), unique(b)) engine=innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) NOT NULL auto_increment, + `b` int(11) default NULL, + PRIMARY KEY (`a`), + UNIQUE KEY `b` (`b`), + CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`b`) REFERENCES `t1` (`id`), + CONSTRAINT `t2_ibfk_2` FOREIGN KEY (`b`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2, t1; diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index a260ab1263d..babfdcb535f 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -1086,4 +1086,14 @@ drop table t2; --error 1005 create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb; -drop table t1; +# bug#3749 + +create table t2 (a int auto_increment primary key, b int, index(b), foreign key (b) references t1(id), unique(b)) engine=innodb; +show create table t2; +drop table t2; +create table t2 (a int auto_increment primary key, b int, foreign key (b) references t1(id), foreign key (b) references t1(id), unique(b)) engine=innodb; +show create table t2; +drop table t2, t1; + + + diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 47574eab666..8d5ec56add9 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -688,9 +688,10 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, 'generated', and a generated key is a prefix of the other key. Then we do not need the generated shorter key. */ - if ((key2->type != Key::FOREIGN_KEY && !foreign_key_prefix(key, key2))) + if (key2->name != ignore_key && key2->type != Key::FOREIGN_KEY && + !foreign_key_prefix(key, key2)) { - /* TO DO: issue warning message */ + /* TODO: issue warning message */ /* mark that the generated key should be ignored */ if (!key2->generated || (key->generated && key->columns.elements < @@ -698,17 +699,9 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, key->name= ignore_key; else { - /* - Remove the previous, generated key if it has not yet been - removed. Note that if we have several identical generated keys, - the last one will remain and others get removed here. - */ - if (key2->name != ignore_key) - { - key2->name= ignore_key; - key_parts-= key2->columns.elements; - (*key_count)--; - } + key2->name= ignore_key; + key_parts-= key2->columns.elements; + (*key_count)--; } break; } From 2536d7183d7723eebb750ff4685a6517054da7b9 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 May 2004 14:11:13 +0300 Subject: [PATCH 080/162] InnoDB: Disable file locking on FreeBSD innobase/os/os0file.c: Disable os_file_lock() on FreeBSD --- innobase/os/os0file.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index aad8a911fd5..79185c30f79 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -369,7 +369,16 @@ os_file_handle_error( return(FALSE); } -#if !defined(__WIN__) && !defined(UNIV_HOTBACKUP) +#undef USE_FILE_LOCK +#define USE_FILE_LOCK +#if defined(UNIV_HOTBACKUP) || defined(__WIN__) || defined(__FreeBSD__) +/* InnoDB Hot Backup does not lock the data files. + * On Windows, mandatory locking is used. + * On FreeBSD with LinuxThreads, advisory locking does not work properly. + */ +# undef USE_FILE_LOCK +#endif +#ifdef USE_FILE_LOCK /******************************************************************** Obtain an exclusive lock on a file. */ static @@ -393,7 +402,7 @@ os_file_lock( } return 0; } -#endif /* !defined(__WIN__) && !defined(UNIV_HOTBACKUP) */ +#endif /* USE_FILE_LOCK */ /******************************************************************** Does error handling when a file operation fails. */ @@ -852,7 +861,7 @@ try_again: if (retry) { goto try_again; } -#ifndef UNIV_HOTBACKUP +#ifdef USE_FILE_LOCK } else if (os_file_lock(file, name)) { *success = FALSE; file = -1; @@ -961,7 +970,7 @@ os_file_create_simple_no_error_handling( if (file == -1) { *success = FALSE; -#ifndef UNIV_HOTBACKUP +#ifdef USE_FILE_LOCK } else if (os_file_lock(file, name)) { *success = FALSE; file = -1; @@ -1172,7 +1181,7 @@ try_again: if (retry) { goto try_again; } -#ifndef UNIV_HOTBACKUP +#ifdef USE_FILE_LOCK } else if (os_file_lock(file, name)) { *success = FALSE; file = -1; From 725d1b44f117156b68dc2cac7b9c89364dba1493 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 May 2004 14:23:46 +0300 Subject: [PATCH 081/162] InnoDB: ut0mem: Remove ut_str_catenate(), add const qualifiers innobase/include/ut0mem.h: Add const qualifiers and remove unused function ut_str_catenate() innobase/include/ut0mem.ic: Add const qualifiers innobase/ut/ut0mem.c: Remove unused function ut_str_catenate() --- innobase/include/ut0mem.h | 21 +++++---------------- innobase/include/ut0mem.ic | 12 ++++++------ innobase/ut/ut0mem.c | 26 -------------------------- 3 files changed, 11 insertions(+), 48 deletions(-) diff --git a/innobase/include/ut0mem.h b/innobase/include/ut0mem.h index bfc937eb212..85b99efff68 100644 --- a/innobase/include/ut0mem.h +++ b/innobase/include/ut0mem.h @@ -18,15 +18,15 @@ extern ulint ut_total_allocated_memory; UNIV_INLINE void* -ut_memcpy(void* dest, void* sour, ulint n); +ut_memcpy(void* dest, const void* sour, ulint n); UNIV_INLINE void* -ut_memmove(void* dest, void* sour, ulint n); +ut_memmove(void* dest, const void* sour, ulint n); UNIV_INLINE int -ut_memcmp(void* str1, void* str2, ulint n); +ut_memcmp(const void* str1, const void* str2, ulint n); /************************************************************************** @@ -75,7 +75,7 @@ ut_free_all_mem(void); UNIV_INLINE char* -ut_strcpy(char* dest, char* sour); +ut_strcpy(char* dest, const char* sour); UNIV_INLINE ulint @@ -83,7 +83,7 @@ ut_strlen(const char* str); UNIV_INLINE int -ut_strcmp(void* str1, void* str2); +ut_strcmp(const void* str1, const void* str2); /************************************************************************** Determine the length of a string when it is quoted with ut_strcpyq(). */ @@ -118,17 +118,6 @@ ut_memcpyq( const char* src, /* in: string to be quoted */ ulint len); /* in: length of src */ -/************************************************************************** -Catenates two strings into newly allocated memory. The memory must be freed -using mem_free. */ - -char* -ut_str_catenate( -/*============*/ - /* out, own: catenated null-terminated string */ - char* str1, /* in: null-terminated string */ - char* str2); /* in: null-terminated string */ - #ifndef UNIV_NONINL #include "ut0mem.ic" #endif diff --git a/innobase/include/ut0mem.ic b/innobase/include/ut0mem.ic index 951d9538424..3bb30a80f22 100644 --- a/innobase/include/ut0mem.ic +++ b/innobase/include/ut0mem.ic @@ -8,28 +8,28 @@ Created 5/30/1994 Heikki Tuuri UNIV_INLINE void* -ut_memcpy(void* dest, void* sour, ulint n) +ut_memcpy(void* dest, const void* sour, ulint n) { return(memcpy(dest, sour, n)); } UNIV_INLINE void* -ut_memmove(void* dest, void* sour, ulint n) +ut_memmove(void* dest, const void* sour, ulint n) { return(memmove(dest, sour, n)); } UNIV_INLINE int -ut_memcmp(void* str1, void* str2, ulint n) +ut_memcmp(const void* str1, const void* str2, ulint n) { return(memcmp(str1, str2, n)); } UNIV_INLINE char* -ut_strcpy(char* dest, char* sour) +ut_strcpy(char* dest, const char* sour) { return(strcpy(dest, sour)); } @@ -43,9 +43,9 @@ ut_strlen(const char* str) UNIV_INLINE int -ut_strcmp(void* str1, void* str2) +ut_strcmp(const void* str1, const void* str2) { - return(strcmp((char*)str1, (char*)str2)); + return(strcmp((const char*)str1, (const char*)str2)); } /************************************************************************** diff --git a/innobase/ut/ut0mem.c b/innobase/ut/ut0mem.c index f21bb752fac..47b612d757e 100644 --- a/innobase/ut/ut0mem.c +++ b/innobase/ut/ut0mem.c @@ -273,29 +273,3 @@ ut_memcpyq( return(dest); } - -/************************************************************************** -Catenates two strings into newly allocated memory. The memory must be freed -using mem_free. */ - -char* -ut_str_catenate( -/*============*/ - /* out, own: catenated null-terminated string */ - char* str1, /* in: null-terminated string */ - char* str2) /* in: null-terminated string */ -{ - ulint len1; - ulint len2; - char* str; - - len1 = ut_strlen(str1); - len2 = ut_strlen(str2); - - str = mem_alloc(len1 + len2 + 1); - - ut_memcpy(str, str1, len1); - ut_memcpy(str + len1, str2, len2 + 1); - - return(str); -} From 8c0e5ebfd372a53cd6b2104c366ac4b6ac4a304b Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 May 2004 15:28:59 +0300 Subject: [PATCH 082/162] after merge fix --- mysql-test/r/func_encrypt.result | 2 +- mysql-test/r/subselect.result | 2 +- sql/sql_union.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/func_encrypt.result b/mysql-test/r/func_encrypt.result index abdfda0423f..d32e67fe7d5 100644 --- a/mysql-test/r/func_encrypt.result +++ b/mysql-test/r/func_encrypt.result @@ -138,4 +138,4 @@ explain extended select des_decrypt(des_encrypt("hello",4),'password2'), des_dec id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority des_decrypt(des_encrypt(_latin1'hello',4),_latin1'password2') AS `des_decrypt(des_encrypt("hello",4),'password2')`,des_decrypt(des_encrypt(_latin1'hello',_latin1'hidden')) AS `des_decrypt(des_encrypt("hello","hidden"))` +Note 1003 select des_decrypt(des_encrypt(_latin1'hello',4),_latin1'password2') AS `des_decrypt(des_encrypt("hello",4),'password2')`,des_decrypt(des_encrypt(_latin1'hello',_latin1'hidden')) AS `des_decrypt(des_encrypt("hello","hidden"))` diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 22438967b57..9fc47d67abb 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -1549,7 +1549,7 @@ id select_type table type possible_keys key key_len ref rows Extra 3 UNION t1 system NULL NULL NULL NULL 1 -2 UNION RESULT ALL NULL NULL NULL NULL NULL Warnings: -Note 1003 select high_priority test.t1.s1 AS `s1` from test.t1 +Note 1003 select test.t1.s1 AS `s1` from test.t1 drop table t1; CREATE TABLE t1 (number char(11) NOT NULL default '') ENGINE=MyISAM CHARSET=latin1; INSERT INTO t1 VALUES ('69294728265'),('18621828126'),('89356874041'),('95895001874'); diff --git a/sql/sql_union.cc b/sql/sql_union.cc index fe009f89e76..42a714aaded 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -120,7 +120,7 @@ bool select_union::flush() ulong st_select_lex_unit::init_prepare_fake_select_lex(THD *thd) { - ulong options_tmp= thd->options; + ulong options_tmp= thd->options | fake_select_lex->options; thd->lex->current_select= fake_select_lex; offset_limit_cnt= global_parameters->offset_limit; select_limit_cnt= global_parameters->select_limit + From a7d22043487583691960816bf05fb4f9166caeb5 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 May 2004 16:06:21 +0300 Subject: [PATCH 083/162] InnoDB cleanup: eliminate IB__FILE__ innobase/btr/btr0cur.c: Replace IB__FILE__ with __FILE__ innobase/btr/btr0sea.c: Replace IB__FILE__ with __FILE__ innobase/buf/buf0buf.c: Replace IB__FILE__ with __FILE__ Add const qualifiers innobase/ibuf/ibuf0ibuf.c: Replace IB__FILE__ with __FILE__ innobase/include/buf0buf.h: Replace IB__FILE__ with __FILE__ Add const qualifiers innobase/include/buf0buf.ic: Replace IB__FILE__ with __FILE__ innobase/include/mem0mem.h: Replace IB__FILE__ with __FILE__ Add const qualifiers innobase/include/mem0mem.ic: Add const qualifiers innobase/include/mtr0mtr.h: Replace IB__FILE__ with __FILE__ Add const qualifiers innobase/include/mtr0mtr.ic: Add const qualifiers innobase/include/pars0pars.h: Add const qualifiers innobase/include/sync0arr.h: Add const qualifiers innobase/include/sync0ipm.ic: Replace IB__FILE__ with __FILE__ innobase/include/sync0rw.h: Replace IB__FILE__ with __FILE__ Add const qualifiers innobase/include/sync0rw.ic: Add const qualifiers innobase/include/sync0sync.h: Replace IB__FILE__ with __FILE__ Add const qualifiers innobase/include/sync0sync.ic: Add const qualifiers innobase/include/univ.i: Remove IB__FILE__ innobase/include/ut0dbg.h: Replace IB__FILE__ with __FILE__ innobase/lock/lock0lock.c: Replace IB__FILE__ with __FILE__ innobase/log/log0recv.c: Replace IB__FILE__ with __FILE__ innobase/mem/mem0mem.c: Add const qualifiers innobase/pars/pars0pars.c: Add const qualifiers innobase/sync/sync0arr.c: Add const qualifiers innobase/sync/sync0rw.c: Replace IB__FILE__ with __FILE__ Add const qualifiers innobase/sync/sync0sync.c: Add const qualifiers innobase/trx/trx0rec.c: Replace IB__FILE__ with __FILE__ --- innobase/btr/btr0cur.c | 6 +-- innobase/btr/btr0sea.c | 4 +- innobase/buf/buf0buf.c | 8 +-- innobase/ibuf/ibuf0ibuf.c | 2 +- innobase/include/buf0buf.h | 14 ++--- innobase/include/buf0buf.ic | 2 +- innobase/include/mem0mem.h | 96 ++++++++++++++++++----------------- innobase/include/mem0mem.ic | 96 +++++++++++++++++------------------ innobase/include/mtr0mtr.h | 8 +-- innobase/include/mtr0mtr.ic | 4 +- innobase/include/pars0pars.h | 2 +- innobase/include/sync0arr.h | 2 +- innobase/include/sync0ipm.ic | 4 +- innobase/include/sync0rw.h | 44 ++++++++-------- innobase/include/sync0rw.ic | 22 ++++---- innobase/include/sync0sync.h | 16 +++--- innobase/include/sync0sync.ic | 8 +-- innobase/include/univ.i | 5 -- innobase/include/ut0dbg.h | 6 +-- innobase/lock/lock0lock.c | 2 +- innobase/log/log0recv.c | 6 +-- innobase/mem/mem0mem.c | 34 ++++++------- innobase/pars/pars0pars.c | 3 +- innobase/sync/sync0arr.c | 4 +- innobase/sync/sync0rw.c | 12 ++--- innobase/sync/sync0sync.c | 13 ++--- innobase/trx/trx0rec.c | 2 +- 27 files changed, 212 insertions(+), 213 deletions(-) diff --git a/innobase/btr/btr0cur.c b/innobase/btr/btr0cur.c index e67d1d76113..5829cc2c406 100644 --- a/innobase/btr/btr0cur.c +++ b/innobase/btr/btr0cur.c @@ -399,7 +399,7 @@ btr_cur_search_to_nth_level( retry_page_get: page = buf_page_get_gen(space, page_no, rw_latch, guess, buf_mode, - IB__FILE__, __LINE__, + __FILE__, __LINE__, mtr); if (page == NULL) { /* This must be a search to perform an insert; @@ -580,7 +580,7 @@ btr_cur_open_at_index_side( for (;;) { page = buf_page_get_gen(space, page_no, RW_NO_LATCH, NULL, BUF_GET, - IB__FILE__, __LINE__, + __FILE__, __LINE__, mtr); ut_ad(0 == ut_dulint_cmp(tree->id, btr_page_get_index_id(page))); @@ -689,7 +689,7 @@ btr_cur_open_at_rnd_pos( for (;;) { page = buf_page_get_gen(space, page_no, RW_NO_LATCH, NULL, BUF_GET, - IB__FILE__, __LINE__, + __FILE__, __LINE__, mtr); ut_ad(0 == ut_dulint_cmp(tree->id, btr_page_get_index_id(page))); diff --git a/innobase/btr/btr0sea.c b/innobase/btr/btr0sea.c index f2b03f9f348..9384168df88 100644 --- a/innobase/btr/btr0sea.c +++ b/innobase/btr/btr0sea.c @@ -764,7 +764,7 @@ btr_search_guess_on_hash( success = buf_page_get_known_nowait(latch_mode, page, BUF_MAKE_YOUNG, - IB__FILE__, __LINE__, + __FILE__, __LINE__, mtr); rw_lock_s_unlock(&btr_search_latch); @@ -1048,7 +1048,7 @@ btr_search_drop_page_hash_when_freed( having to fear a deadlock. */ page = buf_page_get_gen(space, page_no, RW_S_LATCH, NULL, - BUF_GET_IF_IN_POOL, IB__FILE__, __LINE__, + BUF_GET_IF_IN_POOL, __FILE__, __LINE__, &mtr); #ifdef UNIV_SYNC_DEBUG diff --git a/innobase/buf/buf0buf.c b/innobase/buf/buf0buf.c index 7a5ef3c5e14..4d83fb4c9f2 100644 --- a/innobase/buf/buf0buf.c +++ b/innobase/buf/buf0buf.c @@ -1048,7 +1048,7 @@ buf_page_get_gen( buf_frame_t* guess, /* in: guessed frame or NULL */ ulint mode, /* in: BUF_GET, BUF_GET_IF_IN_POOL, BUF_GET_NO_LATCH, BUF_GET_NOWAIT */ - char* file, /* in: file name */ + const char* file, /* in: file name */ ulint line, /* in: line where called */ mtr_t* mtr) /* in: mini-transaction */ { @@ -1257,7 +1257,7 @@ buf_page_optimistic_get_func( frames */ dulint modify_clock,/* in: modify clock value if mode is ..._GUESS_ON_CLOCK */ - char* file, /* in: file name */ + const char* file, /* in: file name */ ulint line, /* in: line where called */ mtr_t* mtr) /* in: mini-transaction */ { @@ -1382,7 +1382,7 @@ buf_page_get_known_nowait( ulint rw_latch,/* in: RW_S_LATCH, RW_X_LATCH */ buf_frame_t* guess, /* in: the known page frame */ ulint mode, /* in: BUF_MAKE_YOUNG or BUF_KEEP_OLD */ - char* file, /* in: file name */ + const char* file, /* in: file name */ ulint line, /* in: line where called */ mtr_t* mtr) /* in: mini-transaction */ { @@ -1742,7 +1742,7 @@ buf_page_create( buf_LRU_add_block(block, FALSE); #ifdef UNIV_SYNC_DEBUG - buf_block_buf_fix_inc_debug(block, IB__FILE__, __LINE__); + buf_block_buf_fix_inc_debug(block, __FILE__, __LINE__); #else buf_block_buf_fix_inc(block); #endif diff --git a/innobase/ibuf/ibuf0ibuf.c b/innobase/ibuf/ibuf0ibuf.c index ecdcf08e4c6..7dc0bd98001 100644 --- a/innobase/ibuf/ibuf0ibuf.c +++ b/innobase/ibuf/ibuf0ibuf.c @@ -3042,7 +3042,7 @@ loop: if (page) { ibool success = buf_page_get_known_nowait(RW_X_LATCH, page, BUF_KEEP_OLD, - IB__FILE__, __LINE__, + __FILE__, __LINE__, &mtr); ut_a(success); #ifdef UNIV_SYNC_DEBUG diff --git a/innobase/include/buf0buf.h b/innobase/include/buf0buf.h index 6b8da886045..9590fea1276 100644 --- a/innobase/include/buf0buf.h +++ b/innobase/include/buf0buf.h @@ -132,7 +132,7 @@ to improve debugging. Only values RW_S_LATCH and RW_X_LATCH are allowed in LA! */ #define buf_page_get(SP, OF, LA, MTR) buf_page_get_gen(\ SP, OF, LA, NULL,\ - BUF_GET, IB__FILE__, __LINE__, MTR) + BUF_GET, __FILE__, __LINE__, MTR) /****************************************************************** Use these macros to bufferfix a page with no latching. Remember not to read the contents of the page unless you know it is safe. Do not modify @@ -141,19 +141,19 @@ error-prone programming not to set a latch, and it should be used with care. */ #define buf_page_get_with_no_latch(SP, OF, MTR) buf_page_get_gen(\ SP, OF, RW_NO_LATCH, NULL,\ - BUF_GET_NO_LATCH, IB__FILE__, __LINE__, MTR) + BUF_GET_NO_LATCH, __FILE__, __LINE__, MTR) /****************************************************************** NOTE! The following macros should be used instead of buf_page_get_gen, to improve debugging. Only values RW_S_LATCH and RW_X_LATCH are allowed as LA! */ #define buf_page_get_nowait(SP, OF, LA, MTR) buf_page_get_gen(\ SP, OF, LA, NULL,\ - BUF_GET_NOWAIT, IB__FILE__, __LINE__, MTR) + BUF_GET_NOWAIT, __FILE__, __LINE__, MTR) /****************************************************************** NOTE! The following macros should be used instead of buf_page_optimistic_get_func, to improve debugging. Only values RW_S_LATCH and RW_X_LATCH are allowed as LA! */ #define buf_page_optimistic_get(LA, BL, G, MC, MTR) buf_page_optimistic_get_func(\ - LA, BL, G, MC, IB__FILE__, __LINE__, MTR) + LA, BL, G, MC, __FILE__, __LINE__, MTR) /************************************************************************ This is the general function used to get optimistic access to a database page. */ @@ -168,7 +168,7 @@ buf_page_optimistic_get_func( frames */ dulint modify_clock,/* in: modify clock value if mode is ..._GUESS_ON_CLOCK */ - char* file, /* in: file name */ + const char* file, /* in: file name */ ulint line, /* in: line where called */ mtr_t* mtr); /* in: mini-transaction */ /************************************************************************ @@ -201,7 +201,7 @@ buf_page_get_known_nowait( ulint rw_latch,/* in: RW_S_LATCH, RW_X_LATCH */ buf_frame_t* guess, /* in: the known page frame */ ulint mode, /* in: BUF_MAKE_YOUNG or BUF_KEEP_OLD */ - char* file, /* in: file name */ + const char* file, /* in: file name */ ulint line, /* in: line where called */ mtr_t* mtr); /* in: mini-transaction */ /************************************************************************ @@ -217,7 +217,7 @@ buf_page_get_gen( buf_frame_t* guess, /* in: guessed frame or NULL */ ulint mode, /* in: BUF_GET, BUF_GET_IF_IN_POOL, BUF_GET_NO_LATCH */ - char* file, /* in: file name */ + const char* file, /* in: file name */ ulint line, /* in: line where called */ mtr_t* mtr); /* in: mini-transaction */ /************************************************************************ diff --git a/innobase/include/buf0buf.ic b/innobase/include/buf0buf.ic index b644afcbdff..4d1173a0d7f 100644 --- a/innobase/include/buf0buf.ic +++ b/innobase/include/buf0buf.ic @@ -585,7 +585,7 @@ buf_page_get_release_on_io( frame = buf_page_get_gen(space, offset, rw_latch, guess, BUF_GET_IF_IN_POOL, - IB__FILE__, __LINE__, + __FILE__, __LINE__, mtr); if (frame != NULL) { diff --git a/innobase/include/mem0mem.h b/innobase/include/mem0mem.h index 89e2a337c99..18bffe5732e 100644 --- a/innobase/include/mem0mem.h +++ b/innobase/include/mem0mem.h @@ -64,14 +64,14 @@ heap creation. */ #define mem_heap_create(N) mem_heap_create_func(\ (N), NULL, MEM_HEAP_DYNAMIC,\ - IB__FILE__, __LINE__) + __FILE__, __LINE__) /****************************************************************** Use this macro instead of the corresponding function! Macro for memory heap creation. */ #define mem_heap_create_in_buffer(N) mem_heap_create_func(\ (N), NULL, MEM_HEAP_BUFFER,\ - IB__FILE__, __LINE__) + __FILE__, __LINE__) /****************************************************************** Use this macro instead of the corresponding function! Macro for memory heap creation. */ @@ -79,7 +79,7 @@ heap creation. */ #define mem_heap_create_in_btr_search(N) mem_heap_create_func(\ (N), NULL, MEM_HEAP_BTR_SEARCH |\ MEM_HEAP_BUFFER,\ - IB__FILE__, __LINE__) + __FILE__, __LINE__) /****************************************************************** Use this macro instead of the corresponding function! Macro for fast memory heap creation. An initial block of memory B is given by the @@ -88,14 +88,14 @@ mem_heap_free. See the parameter comment in mem_heap_create_func below. */ #define mem_heap_fast_create(N, B) mem_heap_create_func(\ (N), (B), MEM_HEAP_DYNAMIC,\ - IB__FILE__, __LINE__) + __FILE__, __LINE__) /****************************************************************** Use this macro instead of the corresponding function! Macro for memory heap freeing. */ #define mem_heap_free(heap) mem_heap_free_func(\ - (heap), IB__FILE__, __LINE__) + (heap), __FILE__, __LINE__) /********************************************************************* NOTE: Use the corresponding macros instead of this function. Creates a memory heap which allocates memory from dynamic space. For debugging @@ -105,26 +105,27 @@ UNIV_INLINE mem_heap_t* mem_heap_create_func( /*=================*/ - /* out, own: memory heap */ - ulint n, /* in: desired start block size, - this means that a single user buffer - of size n will fit in the block, - 0 creates a default size block; - if init_block is not NULL, n tells - its size in bytes */ - void* init_block, /* in: if very fast creation is - wanted, the caller can reserve some - memory from its stack, for example, - and pass it as the the initial block - to the heap: then no OS call of malloc - is needed at the creation. CAUTION: - the caller must make sure the initial - block is not unintentionally erased - (if allocated in the stack), before - the memory heap is explicitly freed. */ - ulint type, /* in: MEM_HEAP_DYNAMIC or MEM_HEAP_BUFFER */ - char* file_name, /* in: file name where created */ - ulint line /* in: line where created */ + /* out, own: memory heap */ + ulint n, /* in: desired start block size, + this means that a single user buffer + of size n will fit in the block, + 0 creates a default size block; + if init_block is not NULL, n tells + its size in bytes */ + void* init_block, /* in: if very fast creation is + wanted, the caller can reserve some + memory from its stack, for example, + and pass it as the the initial block + to the heap: then no OS call of malloc + is needed at the creation. CAUTION: + the caller must make sure the initial + block is not unintentionally erased + (if allocated in the stack), before + the memory heap is explicitly freed. */ + ulint type, /* in: MEM_HEAP_DYNAMIC + or MEM_HEAP_BUFFER */ + const char* file_name, /* in: file name where created */ + ulint line /* in: line where created */ ); /********************************************************************* NOTE: Use the corresponding macro instead of this function. Frees the space @@ -135,7 +136,7 @@ void mem_heap_free_func( /*===============*/ mem_heap_t* heap, /* in, own: heap to be freed */ - char* file_name __attribute__((unused)), + const char* file_name __attribute__((unused)), /* in: file name where freed */ ulint line __attribute__((unused))); /* in: line where freed */ @@ -206,13 +207,13 @@ mem_heap_get_size( Use this macro instead of the corresponding function! Macro for memory buffer allocation */ -#define mem_alloc(N) mem_alloc_func((N), IB__FILE__, __LINE__) +#define mem_alloc(N) mem_alloc_func((N), __FILE__, __LINE__) /****************************************************************** Use this macro instead of the corresponding function! Macro for memory buffer allocation */ #define mem_alloc_noninline(N) mem_alloc_func_noninline(\ - (N), IB__FILE__, __LINE__) + (N), __FILE__, __LINE__) /******************************************************************* NOTE: Use the corresponding macro instead of this function. Allocates a single buffer of memory from the dynamic memory of @@ -222,11 +223,11 @@ UNIV_INLINE void* mem_alloc_func( /*===========*/ - /* out, own: free storage, NULL - if did not succeed */ - ulint n, /* in: desired number of bytes */ - char* file_name, /* in: file name where created */ - ulint line /* in: line where created */ + /* out, own: free storage, NULL + if did not succeed */ + ulint n, /* in: desired number of bytes */ + const char* file_name, /* in: file name where created */ + ulint line /* in: line where created */ ); /******************************************************************* NOTE: Use the corresponding macro instead of this function. @@ -237,17 +238,17 @@ with mem_free. */ void* mem_alloc_func_noninline( /*=====================*/ - /* out, own: free storage, NULL if did not - succeed */ - ulint n, /* in: desired number of bytes */ - char* file_name, /* in: file name where created */ - ulint line /* in: line where created */ + /* out, own: free storage, + NULL if did not succeed */ + ulint n, /* in: desired number of bytes */ + const char* file_name, /* in: file name where created */ + ulint line /* in: line where created */ ); /****************************************************************** Use this macro instead of the corresponding function! Macro for memory buffer freeing */ -#define mem_free(PTR) mem_free_func((PTR), IB__FILE__, __LINE__) +#define mem_free(PTR) mem_free_func((PTR), __FILE__, __LINE__) /******************************************************************* NOTE: Use the corresponding macro instead of this function. Frees a single buffer of storage from @@ -256,9 +257,9 @@ UNIV_INLINE void mem_free_func( /*==========*/ - void* ptr, /* in, own: buffer to be freed */ - char* file_name, /* in: file name where created */ - ulint line /* in: line where created */ + void* ptr, /* in, own: buffer to be freed */ + const char* file_name, /* in: file name where created */ + ulint line /* in: line where created */ ); /******************************************************************* Implements realloc. */ @@ -266,11 +267,12 @@ UNIV_INLINE void* mem_realloc( /*========*/ - /* out, own: free storage, NULL if did not succeed */ - void* buf, /* in: pointer to an old buffer */ - ulint n, /* in: desired number of bytes */ - char* file_name,/* in: file name where called */ - ulint line); /* in: line where called */ + /* out, own: free storage, + NULL if did not succeed */ + void* buf, /* in: pointer to an old buffer */ + ulint n, /* in: desired number of bytes */ + const char* file_name, /* in: file name where called */ + ulint line); /* in: line where called */ /************************************************************************** Duplicates a NUL-terminated string. */ diff --git a/innobase/include/mem0mem.ic b/innobase/include/mem0mem.ic index c250e6948ec..df3dbf9b576 100644 --- a/innobase/include/mem0mem.ic +++ b/innobase/include/mem0mem.ic @@ -16,18 +16,18 @@ Creates a memory heap block where data can be allocated. */ mem_block_t* mem_heap_create_block( /*==================*/ - /* out, own: memory heap block, NULL if did not - succeed */ - mem_heap_t* heap,/* in: memory heap or NULL if first block should - be created */ - ulint n, /* in: number of bytes needed for user data, or - if init_block is not NULL, its size in bytes */ - void* init_block, /* in: init block in fast create, type must be - MEM_HEAP_DYNAMIC */ - ulint type, /* in: type of heap: MEM_HEAP_DYNAMIC or - MEM_HEAP_BUFFER */ - char* file_name,/* in: file name where created */ - ulint line); /* in: line where created */ + /* out, own: memory heap block, + NULL if did not succeed */ + mem_heap_t* heap, /* in: memory heap or NULL if first block + should be created */ + ulint n, /* in: number of bytes needed for user data, or + if init_block is not NULL, its size in bytes */ + void* init_block, /* in: init block in fast create, + type must be MEM_HEAP_DYNAMIC */ + ulint type, /* in: type of heap: MEM_HEAP_DYNAMIC or + MEM_HEAP_BUFFER */ + const char* file_name,/* in: file name where created */ + ulint line); /* in: line where created */ /********************************************************************** Frees a block from a memory heap. */ @@ -377,27 +377,27 @@ UNIV_INLINE mem_heap_t* mem_heap_create_func( /*=================*/ - /* out, own: memory heap */ - ulint n, /* in: desired start block size, - this means that a single user buffer - of size n will fit in the block, - 0 creates a default size block; - if init_block is not NULL, n tells - its size in bytes */ - void* init_block, /* in: if very fast creation is - wanted, the caller can reserve some - memory from its stack, for example, - and pass it as the the initial block - to the heap: then no OS call of malloc - is needed at the creation. CAUTION: - the caller must make sure the initial - block is not unintentionally erased - (if allocated in the stack), before - the memory heap is explicitly freed. */ - ulint type, /* in: MEM_HEAP_DYNAMIC, or MEM_HEAP_BUFFER - possibly ORed to MEM_HEAP_BTR_SEARCH */ - char* file_name, /* in: file name where created */ - ulint line /* in: line where created */ + /* out, own: memory heap */ + ulint n, /* in: desired start block size, + this means that a single user buffer + of size n will fit in the block, + 0 creates a default size block; + if init_block is not NULL, n tells + its size in bytes */ + void* init_block, /* in: if very fast creation is + wanted, the caller can reserve some + memory from its stack, for example, + and pass it as the the initial block + to the heap: then no OS call of malloc + is needed at the creation. CAUTION: + the caller must make sure the initial + block is not unintentionally erased + (if allocated in the stack), before + the memory heap is explicitly freed. */ + ulint type, /* in: MEM_HEAP_DYNAMIC + or MEM_HEAP_BUFFER */ + const char* file_name, /* in: file name where created */ + ulint line /* in: line where created */ ) { mem_block_t* block; @@ -440,10 +440,9 @@ void mem_heap_free_func( /*===============*/ mem_heap_t* heap, /* in, own: heap to be freed */ - char* file_name __attribute__((unused)), + const char* file_name __attribute__((unused)), /* in: file name where freed */ ulint line __attribute__((unused))) - /* in: line where freed */ { mem_block_t* block; mem_block_t* prev_block; @@ -486,11 +485,11 @@ UNIV_INLINE void* mem_alloc_func( /*===========*/ - /* out, own: free storage, NULL if did not - succeed */ - ulint n, /* in: desired number of bytes */ - char* file_name, /* in: file name where created */ - ulint line /* in: line where created */ + /* out, own: free storage, NULL + if did not succeed */ + ulint n, /* in: desired number of bytes */ + const char* file_name, /* in: file name where created */ + ulint line /* in: line where created */ ) { mem_heap_t* heap; @@ -523,9 +522,9 @@ UNIV_INLINE void mem_free_func( /*==========*/ - void* ptr, /* in, own: buffer to be freed */ - char* file_name, /* in: file name where created */ - ulint line /* in: line where created */ + void* ptr, /* in, own: buffer to be freed */ + const char* file_name, /* in: file name where created */ + ulint line /* in: line where created */ ) { mem_heap_t* heap; @@ -569,11 +568,12 @@ UNIV_INLINE void* mem_realloc( /*========*/ - /* out, own: free storage, NULL if did not succeed */ - void* buf, /* in: pointer to an old buffer */ - ulint n, /* in: desired number of bytes */ - char* file_name,/* in: file name where called */ - ulint line) /* in: line where called */ + /* out, own: free storage, + NULL if did not succeed */ + void* buf, /* in: pointer to an old buffer */ + ulint n, /* in: desired number of bytes */ + const char* file_name, /* in: file name where called */ + ulint line) /* in: line where called */ { mem_free(buf); diff --git a/innobase/include/mtr0mtr.h b/innobase/include/mtr0mtr.h index 73338977b9c..f6dfe23bc41 100644 --- a/innobase/include/mtr0mtr.h +++ b/innobase/include/mtr0mtr.h @@ -198,11 +198,11 @@ mtr_read_dulint( mtr_t* mtr); /* in: mini-transaction handle */ /************************************************************************* This macro locks an rw-lock in s-mode. */ -#define mtr_s_lock(B, MTR) mtr_s_lock_func((B), IB__FILE__, __LINE__,\ +#define mtr_s_lock(B, MTR) mtr_s_lock_func((B), __FILE__, __LINE__,\ (MTR)) /************************************************************************* This macro locks an rw-lock in x-mode. */ -#define mtr_x_lock(B, MTR) mtr_x_lock_func((B), IB__FILE__, __LINE__,\ +#define mtr_x_lock(B, MTR) mtr_x_lock_func((B), __FILE__, __LINE__,\ (MTR)) /************************************************************************* NOTE! Use the macro above! @@ -212,7 +212,7 @@ void mtr_s_lock_func( /*============*/ rw_lock_t* lock, /* in: rw-lock */ - char* file, /* in: file name */ + const char* file, /* in: file name */ ulint line, /* in: line number */ mtr_t* mtr); /* in: mtr */ /************************************************************************* @@ -223,7 +223,7 @@ void mtr_x_lock_func( /*============*/ rw_lock_t* lock, /* in: rw-lock */ - char* file, /* in: file name */ + const char* file, /* in: file name */ ulint line, /* in: line number */ mtr_t* mtr); /* in: mtr */ diff --git a/innobase/include/mtr0mtr.ic b/innobase/include/mtr0mtr.ic index 51112fc0d14..4fc6dd2f6a9 100644 --- a/innobase/include/mtr0mtr.ic +++ b/innobase/include/mtr0mtr.ic @@ -217,7 +217,7 @@ void mtr_s_lock_func( /*============*/ rw_lock_t* lock, /* in: rw-lock */ - char* file, /* in: file name */ + const char* file, /* in: file name */ ulint line, /* in: line number */ mtr_t* mtr) /* in: mtr */ { @@ -236,7 +236,7 @@ void mtr_x_lock_func( /*============*/ rw_lock_t* lock, /* in: rw-lock */ - char* file, /* in: file name */ + const char* file, /* in: file name */ ulint line, /* in: line number */ mtr_t* mtr) /* in: mtr */ { diff --git a/innobase/include/pars0pars.h b/innobase/include/pars0pars.h index 2e86a7e5534..c260557c424 100644 --- a/innobase/include/pars0pars.h +++ b/innobase/include/pars0pars.h @@ -92,7 +92,7 @@ Called by yyparse on error. */ void yyerror( /*====*/ - char* s); /* in: error message string */ + const char* s); /* in: error message string */ /************************************************************************* Parses a variable declaration. */ diff --git a/innobase/include/sync0arr.h b/innobase/include/sync0arr.h index 383d0c69fb2..e7d511f8137 100644 --- a/innobase/include/sync0arr.h +++ b/innobase/include/sync0arr.h @@ -51,7 +51,7 @@ sync_array_reserve_cell( sync_array_t* arr, /* in: wait array */ void* object, /* in: pointer to the object to wait for */ ulint type, /* in: lock request type */ - char* file, /* in: file where requested */ + const char* file, /* in: file where requested */ ulint line, /* in: line where requested */ ulint* index); /* out: index of the reserved cell */ /********************************************************************** diff --git a/innobase/include/sync0ipm.ic b/innobase/include/sync0ipm.ic index b8aa87ba6d6..126aceae1eb 100644 --- a/innobase/include/sync0ipm.ic +++ b/innobase/include/sync0ipm.ic @@ -92,7 +92,7 @@ loop: loop_count++; ut_ad(loop_count < 15); - if (mutex_enter_nowait(mutex, IB__FILE__, __LINE__) == 0) { + if (mutex_enter_nowait(mutex, __FILE__, __LINE__) == 0) { /* Succeeded! */ return(0); @@ -105,7 +105,7 @@ loop: /* Order is important here: FIRST reset event, then set waiters */ ip_mutex_set_waiters(ip_mutex, 1); - if (mutex_enter_nowait(mutex, IB__FILE__, __LINE__) == 0) { + if (mutex_enter_nowait(mutex, __FILE__, __LINE__) == 0) { /* Succeeded! */ return(0); diff --git a/innobase/include/sync0rw.h b/innobase/include/sync0rw.h index 82123a529a3..63b01ffac80 100644 --- a/innobase/include/sync0rw.h +++ b/innobase/include/sync0rw.h @@ -62,7 +62,7 @@ location (which must be appropriately aligned). The rw-lock is initialized to the non-locked state. Explicit freeing of the rw-lock with rw_lock_free is necessary only if the memory block containing it is freed. */ -#define rw_lock_create(L) rw_lock_create_func((L), IB__FILE__, __LINE__) +#define rw_lock_create(L) rw_lock_create_func((L), __FILE__, __LINE__) /*=====================*/ /********************************************************************** Creates, or rather, initializes an rw-lock object in a specified memory @@ -74,7 +74,7 @@ void rw_lock_create_func( /*================*/ rw_lock_t* lock, /* in: pointer to memory */ - char* cfile_name, /* in: file name where created */ + const char* cfile_name, /* in: file name where created */ ulint cline); /* in: file line where created */ /********************************************************************** Calling this function is obligatory only if the memory buffer containing @@ -100,19 +100,19 @@ NOTE! The following macros should be used in rw s-locking, not the corresponding function. */ #define rw_lock_s_lock(M) rw_lock_s_lock_func(\ - (M), 0, IB__FILE__, __LINE__) + (M), 0, __FILE__, __LINE__) /****************************************************************** NOTE! The following macros should be used in rw s-locking, not the corresponding function. */ #define rw_lock_s_lock_gen(M, P) rw_lock_s_lock_func(\ - (M), (P), IB__FILE__, __LINE__) + (M), (P), __FILE__, __LINE__) /****************************************************************** NOTE! The following macros should be used in rw s-locking, not the corresponding function. */ #define rw_lock_s_lock_nowait(M) rw_lock_s_lock_func_nowait(\ - (M), IB__FILE__, __LINE__) + (M), __FILE__, __LINE__) /********************************************************************** NOTE! Use the corresponding macro, not directly this function, except if you supply the file name and line number. Lock an rw-lock in shared mode @@ -127,7 +127,7 @@ rw_lock_s_lock_func( rw_lock_t* lock, /* in: pointer to rw-lock */ ulint pass, /* in: pass value; != 0, if the lock will be passed to another thread to unlock */ - char* file_name,/* in: file name where lock requested */ + const char* file_name,/* in: file name where lock requested */ ulint line); /* in: line where requested */ /********************************************************************** NOTE! Use the corresponding macro, not directly this function, except if @@ -139,7 +139,7 @@ rw_lock_s_lock_func_nowait( /*=======================*/ /* out: TRUE if success */ rw_lock_t* lock, /* in: pointer to rw-lock */ - char* file_name,/* in: file name where lock requested */ + const char* file_name,/* in: file name where lock requested */ ulint line); /* in: line where requested */ /********************************************************************** NOTE! Use the corresponding macro, not directly this function! Lock an @@ -151,7 +151,7 @@ rw_lock_x_lock_func_nowait( /*=======================*/ /* out: TRUE if success */ rw_lock_t* lock, /* in: pointer to rw-lock */ - char* file_name,/* in: file name where lock requested */ + const char* file_name,/* in: file name where lock requested */ ulint line); /* in: line where requested */ /********************************************************************** Releases a shared mode lock. */ @@ -186,19 +186,19 @@ NOTE! The following macro should be used in rw x-locking, not the corresponding function. */ #define rw_lock_x_lock(M) rw_lock_x_lock_func(\ - (M), 0, IB__FILE__, __LINE__) + (M), 0, __FILE__, __LINE__) /****************************************************************** NOTE! The following macro should be used in rw x-locking, not the corresponding function. */ #define rw_lock_x_lock_gen(M, P) rw_lock_x_lock_func(\ - (M), (P), IB__FILE__, __LINE__) + (M), (P), __FILE__, __LINE__) /****************************************************************** NOTE! The following macros should be used in rw x-locking, not the corresponding function. */ #define rw_lock_x_lock_nowait(M) rw_lock_x_lock_func_nowait(\ - (M), IB__FILE__, __LINE__) + (M), __FILE__, __LINE__) /********************************************************************** NOTE! Use the corresponding macro, not directly this function! Lock an rw-lock in exclusive mode for the current thread. If the rw-lock is locked @@ -215,7 +215,7 @@ rw_lock_x_lock_func( rw_lock_t* lock, /* in: pointer to rw-lock */ ulint pass, /* in: pass value; != 0, if the lock will be passed to another thread to unlock */ - char* file_name,/* in: file name where lock requested */ + const char* file_name,/* in: file name where lock requested */ ulint line); /* in: line where requested */ /********************************************************************** Releases an exclusive mode lock. */ @@ -253,9 +253,9 @@ UNIV_INLINE void rw_lock_s_lock_direct( /*==================*/ - rw_lock_t* lock /* in: pointer to rw-lock */ - ,char* file_name, /* in: file name where lock requested */ - ulint line /* in: line where requested */ + rw_lock_t* lock, /* in: pointer to rw-lock */ + const char* file_name, /* in: file name where requested */ + ulint line /* in: line where lock requested */ ); /********************************************************************** Low-level function which locks an rw-lock in x-mode when we know that it @@ -265,9 +265,9 @@ UNIV_INLINE void rw_lock_x_lock_direct( /*==================*/ - rw_lock_t* lock /* in: pointer to rw-lock */ - ,char* file_name, /* in: file name where lock requested */ - ulint line /* in: line where requested */ + rw_lock_t* lock, /* in: pointer to rw-lock */ + const char* file_name, /* in: file name where requested */ + ulint line /* in: line where lock requested */ ); /********************************************************************** This function is used in the insert buffer to move the ownership of an @@ -451,10 +451,10 @@ struct rw_lock_struct { #endif /* UNIV_SYNC_DEBUG */ ulint level; /* Level in the global latching order; default SYNC_LEVEL_NONE */ - char* cfile_name; /* File name where lock created */ + const char* cfile_name;/* File name where lock created */ ulint cline; /* Line where created */ - char* last_s_file_name;/* File name where last time s-locked */ - char* last_x_file_name;/* File name where last time x-locked */ + const char* last_s_file_name;/* File name where last s-locked */ + const char* last_x_file_name;/* File name where last x-locked */ ulint last_s_line; /* Line number where last time s-locked */ ulint last_x_line; /* Line number where last time x-locked */ ulint magic_n; @@ -471,7 +471,7 @@ struct rw_lock_debug_struct { ulint pass; /* Pass value given in the lock operation */ ulint lock_type; /* Type of the lock: RW_LOCK_EX, RW_LOCK_SHARED, RW_LOCK_WAIT_EX */ - char* file_name; /* File name where the lock was obtained */ + const char* file_name;/* File name where the lock was obtained */ ulint line; /* Line where the rw-lock was locked */ UT_LIST_NODE_T(rw_lock_debug_t) list; /* Debug structs are linked in a two-way diff --git a/innobase/include/sync0rw.ic b/innobase/include/sync0rw.ic index 8fc93f4a9da..655bd7f6517 100644 --- a/innobase/include/sync0rw.ic +++ b/innobase/include/sync0rw.ic @@ -18,7 +18,7 @@ rw_lock_s_lock_spin( rw_lock_t* lock, /* in: pointer to rw-lock */ ulint pass, /* in: pass value; != 0, if the lock will be passed to another thread to unlock */ - char* file_name,/* in: file name where lock requested */ + const char* file_name,/* in: file name where lock requested */ ulint line); /* in: line where requested */ #ifdef UNIV_SYNC_DEBUG /********************************************************************** @@ -130,7 +130,7 @@ rw_lock_s_lock_low( ulint pass __attribute__((unused)), /* in: pass value; != 0, if the lock will be passed to another thread to unlock */ - char* file_name, /* in: file name where lock requested */ + const char* file_name, /* in: file name where lock requested */ ulint line) /* in: line where requested */ { #ifdef UNIV_SYNC_DEBUG @@ -163,9 +163,9 @@ UNIV_INLINE void rw_lock_s_lock_direct( /*==================*/ - rw_lock_t* lock, /* in: pointer to rw-lock */ - char* file_name,/* in: file name where lock requested */ - ulint line) /* in: line where requested */ + rw_lock_t* lock, /* in: pointer to rw-lock */ + const char* file_name, /* in: file name where requested */ + ulint line) /* in: line where lock requested */ { ut_ad(lock->writer == RW_LOCK_NOT_LOCKED); ut_ad(rw_lock_get_reader_count(lock) == 0); @@ -189,9 +189,9 @@ UNIV_INLINE void rw_lock_x_lock_direct( /*==================*/ - rw_lock_t* lock, /* in: pointer to rw-lock */ - char* file_name, /* in: file name where lock requested */ - ulint line) /* in: line where requested */ + rw_lock_t* lock, /* in: pointer to rw-lock */ + const char* file_name, /* in: file name where requested */ + ulint line) /* in: line where lock requested */ { ut_ad(rw_lock_validate(lock)); ut_ad(rw_lock_get_reader_count(lock) == 0); @@ -223,7 +223,7 @@ rw_lock_s_lock_func( rw_lock_t* lock, /* in: pointer to rw-lock */ ulint pass, /* in: pass value; != 0, if the lock will be passed to another thread to unlock */ - char* file_name, /* in: file name where lock requested */ + const char* file_name,/* in: file name where lock requested */ ulint line) /* in: line where requested */ { /* NOTE: As we do not know the thread ids for threads which have @@ -267,7 +267,7 @@ rw_lock_s_lock_func_nowait( /*=======================*/ /* out: TRUE if success */ rw_lock_t* lock, /* in: pointer to rw-lock */ - char* file_name,/* in: file name where lock requested */ + const char* file_name,/* in: file name where lock requested */ ulint line) /* in: line where requested */ { ibool success = FALSE; @@ -304,7 +304,7 @@ rw_lock_x_lock_func_nowait( /*=======================*/ /* out: TRUE if success */ rw_lock_t* lock, /* in: pointer to rw-lock */ - char* file_name, /* in: file name where lock requested */ + const char* file_name,/* in: file name where lock requested */ ulint line) /* in: line where requested */ { ibool success = FALSE; diff --git a/innobase/include/sync0sync.h b/innobase/include/sync0sync.h index 0cc48d5f299..4307ca5ba0c 100644 --- a/innobase/include/sync0sync.h +++ b/innobase/include/sync0sync.h @@ -36,7 +36,7 @@ in the reset state. Explicit freeing of the mutex with mutex_free is necessary only if the memory block containing it is freed. */ -#define mutex_create(M) mutex_create_func((M), IB__FILE__, __LINE__) +#define mutex_create(M) mutex_create_func((M), __FILE__, __LINE__) /*===================*/ /********************************************************************** Creates, or rather, initializes a mutex object in a specified memory @@ -48,7 +48,7 @@ void mutex_create_func( /*==============*/ mutex_t* mutex, /* in: pointer to memory */ - char* cfile_name, /* in: file name where created */ + const char* cfile_name, /* in: file name where created */ ulint cline); /* in: file line where created */ /********************************************************************** Calling this function is obligatory only if the memory buffer containing @@ -64,7 +64,7 @@ mutex_free( NOTE! The following macro should be used in mutex locking, not the corresponding function. */ -#define mutex_enter(M) mutex_enter_func((M), IB__FILE__, __LINE__) +#define mutex_enter(M) mutex_enter_func((M), __FILE__, __LINE__) /********************************************************************** A noninlined function that reserves a mutex. In ha_innodb.cc we have disabled inlining of InnoDB functions, and no inlined functions should be called from @@ -80,7 +80,7 @@ corresponding function. */ /* NOTE! currently same as mutex_enter! */ -#define mutex_enter_fast(M) mutex_enter_func((M), IB__FILE__, __LINE__) +#define mutex_enter_fast(M) mutex_enter_func((M), __FILE__, __LINE__) #define mutex_enter_fast_func mutex_enter_func; /********************************************************************** NOTE! Use the corresponding macro in the header file, not this function @@ -92,7 +92,7 @@ void mutex_enter_func( /*=============*/ mutex_t* mutex, /* in: pointer to mutex */ - char* file_name, /* in: file name where locked */ + const char* file_name, /* in: file name where locked */ ulint line); /* in: line where locked */ /************************************************************************ Tries to lock the mutex for the current thread. If the lock is not acquired @@ -103,9 +103,9 @@ mutex_enter_nowait( /*===============*/ /* out: 0 if succeed, 1 if not */ mutex_t* mutex, /* in: pointer to mutex */ - char* file_name, /* in: file name where mutex + const char* file_name, /* in: file name where mutex requested */ - ulint line); /* in: line where requested */ + ulint line); /* in: line where requested */ /********************************************************************** Unlocks a mutex owned by the current thread. */ UNIV_INLINE @@ -470,7 +470,7 @@ struct mutex_struct { #endif /* UNIV_SYNC_DEBUG */ ulint level; /* Level in the global latching order; default SYNC_LEVEL_NONE */ - char* cfile_name; /* File name where mutex created */ + const char* cfile_name;/* File name where mutex created */ ulint cline; /* Line where created */ ulint magic_n; }; diff --git a/innobase/include/sync0sync.ic b/innobase/include/sync0sync.ic index 758c8524f66..ecb498918e2 100644 --- a/innobase/include/sync0sync.ic +++ b/innobase/include/sync0sync.ic @@ -23,7 +23,7 @@ void mutex_spin_wait( /*============*/ mutex_t* mutex, /* in: pointer to mutex */ - char* file_name,/* in: file name where mutex requested */ + const char* file_name,/* in: file name where mutex requested */ ulint line); /* in: line where requested */ #ifdef UNIV_SYNC_DEBUG /********************************************************************** @@ -241,9 +241,9 @@ UNIV_INLINE void mutex_enter_func( /*=============*/ - mutex_t* mutex, /* in: pointer to mutex */ - char* file_name,/* in: file name where locked */ - ulint line) /* in: line where locked */ + mutex_t* mutex, /* in: pointer to mutex */ + const char* file_name, /* in: file name where locked */ + ulint line) /* in: line where locked */ { ut_ad(mutex_validate(mutex)); diff --git a/innobase/include/univ.i b/innobase/include/univ.i index cd471a89607..be71d4211b3 100644 --- a/innobase/include/univ.i +++ b/innobase/include/univ.i @@ -242,11 +242,6 @@ contains the sum of the following flag and the locally stored len. */ #define UNIV_EXTERN_STORAGE_FIELD (UNIV_SQL_NULL - UNIV_PAGE_SIZE) -/* The following definition of __FILE__ removes compiler warnings -associated with const char* / char* mismatches with __FILE__ */ - -#define IB__FILE__ ((char*)__FILE__) - #include #include "ut0dbg.h" #include "ut0ut.h" diff --git a/innobase/include/ut0dbg.h b/innobase/include/ut0dbg.h index 085b4811a73..a155f68bd12 100644 --- a/innobase/include/ut0dbg.h +++ b/innobase/include/ut0dbg.h @@ -27,7 +27,7 @@ extern const char* ut_dbg_msg_stop; if (!((ulint)(EXPR) + ut_dbg_zero)) {\ ut_print_timestamp(stderr);\ fprintf(stderr, ut_dbg_msg_assert_fail,\ - os_thread_pf(os_thread_get_curr_id()), IB__FILE__,\ + os_thread_pf(os_thread_get_curr_id()), __FILE__,\ (ulint)__LINE__);\ fputs("InnoDB: Failing assertion: " #EXPR "\n", stderr);\ fputs(ut_dbg_msg_trap, stderr);\ @@ -36,7 +36,7 @@ extern const char* ut_dbg_msg_stop; }\ if (ut_dbg_stop_threads) {\ fprintf(stderr, ut_dbg_msg_stop,\ - os_thread_pf(os_thread_get_curr_id()), IB__FILE__, (ulint)__LINE__);\ + os_thread_pf(os_thread_get_curr_id()), __FILE__, (ulint)__LINE__);\ os_thread_sleep(1000000000);\ }\ } while (0) @@ -44,7 +44,7 @@ extern const char* ut_dbg_msg_stop; #define ut_error do {\ ut_print_timestamp(stderr);\ fprintf(stderr, ut_dbg_msg_assert_fail,\ - os_thread_pf(os_thread_get_curr_id()), IB__FILE__, (ulint)__LINE__);\ + os_thread_pf(os_thread_get_curr_id()), __FILE__, (ulint)__LINE__);\ fprintf(stderr, ut_dbg_msg_trap);\ ut_dbg_stop_threads = TRUE;\ if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = NULL;\ diff --git a/innobase/lock/lock0lock.c b/innobase/lock/lock0lock.c index 8805a22bb57..056d502e858 100644 --- a/innobase/lock/lock0lock.c +++ b/innobase/lock/lock0lock.c @@ -3889,7 +3889,7 @@ lock_rec_print( page = buf_page_get_gen(space, page_no, RW_NO_LATCH, NULL, BUF_GET_IF_IN_POOL, - IB__FILE__, __LINE__, &mtr); + __FILE__, __LINE__, &mtr); if (page) { page = buf_page_get_nowait(space, page_no, RW_S_LATCH, &mtr); diff --git a/innobase/log/log0recv.c b/innobase/log/log0recv.c index 4f4220962f0..65fb3466ad5 100644 --- a/innobase/log/log0recv.c +++ b/innobase/log/log0recv.c @@ -1080,7 +1080,7 @@ recv_recover_page( success = buf_page_get_known_nowait(RW_X_LATCH, page, BUF_KEEP_OLD, - IB__FILE__, __LINE__, + __FILE__, __LINE__, &mtr); ut_a(success); @@ -1664,7 +1664,7 @@ recv_compare_spaces( frame = buf_page_get_gen(space1, page_no, RW_S_LATCH, NULL, BUF_GET_IF_IN_POOL, - IB__FILE__, __LINE__, + __FILE__, __LINE__, &mtr); if (frame) { #ifdef UNIV_SYNC_DEBUG @@ -1679,7 +1679,7 @@ recv_compare_spaces( frame = buf_page_get_gen(space2, page_no, RW_S_LATCH, NULL, BUF_GET_IF_IN_POOL, - IB__FILE__, __LINE__, + __FILE__, __LINE__, &mtr); if (frame) { #ifdef UNIV_SYNC_DEBUG diff --git a/innobase/mem/mem0mem.c b/innobase/mem/mem0mem.c index e1b9a762381..c090b25a632 100644 --- a/innobase/mem/mem0mem.c +++ b/innobase/mem/mem0mem.c @@ -92,11 +92,11 @@ with mem_free. */ void* mem_alloc_func_noninline( /*=====================*/ - /* out, own: free storage, NULL if did not - succeed */ - ulint n, /* in: desired number of bytes */ - char* file_name, /* in: file name where created */ - ulint line /* in: line where created */ + /* out, own: free storage, + NULL if did not succeed */ + ulint n, /* in: desired number of bytes */ + const char* file_name, /* in: file name where created */ + ulint line /* in: line where created */ ) { return(mem_alloc_func(n, file_name, line)); @@ -108,18 +108,18 @@ Creates a memory heap block where data can be allocated. */ mem_block_t* mem_heap_create_block( /*==================*/ - /* out, own: memory heap block, NULL if did not - succeed */ - mem_heap_t* heap,/* in: memory heap or NULL if first block should - be created */ - ulint n, /* in: number of bytes needed for user data, or - if init_block is not NULL, its size in bytes */ - void* init_block, /* in: init block in fast create, type must be - MEM_HEAP_DYNAMIC */ - ulint type, /* in: type of heap: MEM_HEAP_DYNAMIC, or - MEM_HEAP_BUFFER possibly ORed to MEM_HEAP_BTR_SEARCH */ - char* file_name,/* in: file name where created */ - ulint line) /* in: line where created */ + /* out, own: memory heap block, + NULL if did not succeed */ + mem_heap_t* heap, /* in: memory heap or NULL if first block + should be created */ + ulint n, /* in: number of bytes needed for user data, or + if init_block is not NULL, its size in bytes */ + void* init_block, /* in: init block in fast create, + type must be MEM_HEAP_DYNAMIC */ + ulint type, /* in: type of heap: MEM_HEAP_DYNAMIC or + MEM_HEAP_BUFFER */ + const char* file_name,/* in: file name where created */ + ulint line) /* in: line where created */ { mem_block_t* block; ulint len; diff --git a/innobase/pars/pars0pars.c b/innobase/pars/pars0pars.c index a4124672df0..7e835d9ada1 100644 --- a/innobase/pars/pars0pars.c +++ b/innobase/pars/pars0pars.c @@ -1713,7 +1713,8 @@ Called by yyparse on error. */ void yyerror( /*====*/ - char* s __attribute__((unused))) /* in: error message string */ + const char* s __attribute__((unused))) + /* in: error message string */ { ut_ad(s); diff --git a/innobase/sync/sync0arr.c b/innobase/sync/sync0arr.c index 426d7ff9f92..02a9771be35 100644 --- a/innobase/sync/sync0arr.c +++ b/innobase/sync/sync0arr.c @@ -53,7 +53,7 @@ struct sync_cell_struct { rw_lock_t* old_wait_rw_lock;/* the latest wait rw-lock in cell */ ulint request_type; /* lock type requested on the object */ - char* file; /* in debug version file where + const char* file; /* in debug version file where requested */ ulint line; /* in debug version line where requested */ @@ -329,7 +329,7 @@ sync_array_reserve_cell( sync_array_t* arr, /* in: wait array */ void* object, /* in: pointer to the object to wait for */ ulint type, /* in: lock request type */ - char* file, /* in: file where requested */ + const char* file, /* in: file where requested */ ulint line, /* in: line where requested */ ulint* index) /* out: index of the reserved cell */ { diff --git a/innobase/sync/sync0rw.c b/innobase/sync/sync0rw.c index 43f8d646eaa..769eb326ce2 100644 --- a/innobase/sync/sync0rw.c +++ b/innobase/sync/sync0rw.c @@ -89,7 +89,7 @@ void rw_lock_create_func( /*================*/ rw_lock_t* lock, /* in: pointer to memory */ - char* cfile_name, /* in: file name where created */ + const char* cfile_name, /* in: file name where created */ ulint cline) /* in: file line where created */ { /* If this is the very first time a synchronization @@ -213,7 +213,7 @@ rw_lock_s_lock_spin( rw_lock_t* lock, /* in: pointer to rw-lock */ ulint pass, /* in: pass value; != 0, if the lock will be passed to another thread to unlock */ - char* file_name, /* in: file name where lock requested */ + const char* file_name, /* in: file name where lock requested */ ulint line) /* in: line where requested */ { ulint index; /* index of the reserved wait cell */ @@ -324,7 +324,7 @@ rw_lock_x_lock_low( rw_lock_t* lock, /* in: pointer to rw-lock */ ulint pass, /* in: pass value; != 0, if the lock will be passed to another thread to unlock */ - char* file_name,/* in: file name where lock requested */ + const char* file_name,/* in: file name where lock requested */ ulint line) /* in: line where requested */ { #ifdef UNIV_SYNC_DEBUG @@ -429,7 +429,7 @@ rw_lock_x_lock_func( rw_lock_t* lock, /* in: pointer to rw-lock */ ulint pass, /* in: pass value; != 0, if the lock will be passed to another thread to unlock */ - char* file_name,/* in: file name where lock requested */ + const char* file_name,/* in: file name where lock requested */ ulint line) /* in: line where requested */ { ulint index; /* index of the reserved wait cell */ @@ -551,7 +551,7 @@ rw_lock_debug_mutex_enter(void) { loop: if (0 == mutex_enter_nowait(&rw_lock_debug_mutex, - IB__FILE__, __LINE__)) { + __FILE__, __LINE__)) { return; } @@ -560,7 +560,7 @@ loop: rw_lock_debug_waiters = TRUE; if (0 == mutex_enter_nowait(&rw_lock_debug_mutex, - IB__FILE__, __LINE__)) { + __FILE__, __LINE__)) { return; } diff --git a/innobase/sync/sync0sync.c b/innobase/sync/sync0sync.c index c1fb31bc966..31f287b6341 100644 --- a/innobase/sync/sync0sync.c +++ b/innobase/sync/sync0sync.c @@ -201,7 +201,7 @@ void mutex_create_func( /*==============*/ mutex_t* mutex, /* in: pointer to memory */ - char* cfile_name, /* in: file name where created */ + const char* cfile_name, /* in: file name where created */ ulint cline) /* in: file line where created */ { #if defined(_WIN32) && defined(UNIV_CAN_USE_X86_ASSEMBLER) @@ -294,10 +294,10 @@ mutex_enter_nowait( /*===============*/ /* out: 0 if succeed, 1 if not */ mutex_t* mutex, /* in: pointer to mutex */ - char* file_name __attribute__((unused)), + const char* file_name __attribute__((unused)), /* in: file name where mutex requested */ - ulint line __attribute__((unused))) + ulint line __attribute__((unused))) /* in: line where requested */ { ut_ad(mutex_validate(mutex)); @@ -357,9 +357,10 @@ for the mutex before suspending the thread. */ void mutex_spin_wait( /*============*/ - mutex_t* mutex, /* in: pointer to mutex */ - char* file_name, /* in: file name where mutex requested */ - ulint line) /* in: line where requested */ + mutex_t* mutex, /* in: pointer to mutex */ + const char* file_name, /* in: file name where + mutex requested */ + ulint line) /* in: line where requested */ { ulint index; /* index of the reserved wait cell */ ulint i; /* spin round count */ diff --git a/innobase/trx/trx0rec.c b/innobase/trx/trx0rec.c index 7963bec7f33..16f9f3d093d 100644 --- a/innobase/trx/trx0rec.c +++ b/innobase/trx/trx0rec.c @@ -1067,7 +1067,7 @@ trx_undo_report_row_operation( undo_page = buf_page_get_gen(undo->space, page_no, RW_X_LATCH, undo->guess_page, BUF_GET, - IB__FILE__, __LINE__, + __FILE__, __LINE__, &mtr); #ifdef UNIV_SYNC_DEBUG From 7bd91ac065746ba673f24d39c646dcbf7cb74386 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 May 2004 16:48:56 +0300 Subject: [PATCH 084/162] Many files: Fix remaining cases of Bug #3596: fix possible races caused by an obsolete value of thd->query_length in SHOW PROCESSLIST and SHOW INNODB STATUS; this fix depends on the fact that thd->query is always set to NULL before setting it to point to a new query sql/sql_class.h: Fix remaining cases of Bug #3596: fix possible races caused by an obsolete value of thd->query_length in SHOW PROCESSLIST and SHOW INNODB STATUS; this fix depends on the fact that thd->query is always set to NULL before setting it to point to a new query sql/ha_innodb.cc: Fix remaining cases of Bug #3596: fix possible races caused by an obsolete value of thd->query_length in SHOW PROCESSLIST and SHOW INNODB STATUS; this fix depends on the fact that thd->query is always set to NULL before setting it to point to a new query sql/log_event.cc: Fix remaining cases of Bug #3596: fix possible races caused by an obsolete value of thd->query_length in SHOW PROCESSLIST and SHOW INNODB STATUS; this fix depends on the fact that thd->query is always set to NULL before setting it to point to a new query sql/slave.cc: Fix remaining cases of Bug #3596: fix possible races caused by an obsolete value of thd->query_length in SHOW PROCESSLIST and SHOW INNODB STATUS; this fix depends on the fact that thd->query is always set to NULL before setting it to point to a new query sql/sql_db.cc: Fix remaining cases of Bug #3596: fix possible races caused by an obsolete value of thd->query_length in SHOW PROCESSLIST and SHOW INNODB STATUS; this fix depends on the fact that thd->query is always set to NULL before setting it to point to a new query sql/sql_parse.cc: Fix remaining cases of Bug #3596: fix possible races caused by an obsolete value of thd->query_length in SHOW PROCESSLIST and SHOW INNODB STATUS; this fix depends on the fact that thd->query is always set to NULL before setting it to point to a new query sql/sql_show.cc: Fix remaining cases of Bug #3596: fix possible races caused by an obsolete value of thd->query_length in SHOW PROCESSLIST and SHOW INNODB STATUS; this fix depends on the fact that thd->query is always set to NULL before setting it to point to a new query --- sql/ha_innodb.cc | 7 ++++--- sql/log_event.cc | 1 + sql/slave.cc | 2 ++ sql/sql_class.h | 19 ++++++++++++++++++- sql/sql_db.cc | 2 ++ sql/sql_parse.cc | 1 + sql/sql_show.cc | 6 +++++- 7 files changed, 33 insertions(+), 5 deletions(-) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 194c8b558f0..4835f794a1d 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -390,15 +390,16 @@ innobase_mysql_print_thd( len = 300; /* ADDITIONAL SAFETY: print at most 300 chars to reduce the probability of a seg fault if there is a race in - thd->query_len in MySQL; on May 13, - 2004 we do not know */ + thd->query_length in MySQL; after + May 14, 2004 probably no race any more, + but better be safe */ } for (i = 0; i < len && s[i]; i++); memcpy(buf, s, i); /* Use memcpy to reduce the timeframe for a race, compared to fwrite() */ - buf[300] = '\0'; + buf[300] = '\0'; /* not needed, just extra safety */ putc('\n', f); fwrite(buf, 1, i, f); diff --git a/sql/log_event.cc b/sql/log_event.cc index 7817ccff3d7..f84c8d1f579 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -1929,6 +1929,7 @@ end: VOID(pthread_mutex_lock(&LOCK_thread_count)); thd->db= 0; // prevent db from being freed thd->query= 0; // just to be sure + thd->query_length= 0; VOID(pthread_mutex_unlock(&LOCK_thread_count)); // assume no convert for next query unless set explictly thd->variables.convert_set = 0; diff --git a/sql/slave.cc b/sql/slave.cc index d6d0a5b5425..c7a7dac141a 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -2691,6 +2691,7 @@ err: IO_RPL_LOG_NAME, llstr(mi->master_log_pos,llbuff)); VOID(pthread_mutex_lock(&LOCK_thread_count)); thd->query = thd->db = 0; // extra safety + thd->query_length = 0; VOID(pthread_mutex_unlock(&LOCK_thread_count)); if (mysql) { @@ -2839,6 +2840,7 @@ the slave SQL thread with \"SLAVE START\". We stopped at log \ err: VOID(pthread_mutex_lock(&LOCK_thread_count)); thd->query = thd->db = 0; // extra safety + thd->query_length = 0; VOID(pthread_mutex_unlock(&LOCK_thread_count)); thd->proc_info = "Waiting for slave mutex on exit"; pthread_mutex_lock(&rli->run_lock); diff --git a/sql/sql_class.h b/sql/sql_class.h index ad1eed5448f..83dc75e2b84 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -360,7 +360,24 @@ public: struct rand_struct rand; // used for authentication struct system_variables variables; // Changeable local variables pthread_mutex_t LOCK_delete; // Locked before thd is deleted - + /* + Note that (A) if we set query = NULL, we must at the same time set + query_length = 0, and protect the whole operation with the + LOCK_thread_count mutex. And (B) we are ONLY allowed to set query to a + non-NULL value if its previous value is NULL. We do not need to protect + operation (B) with any mutex. To avoid crashes in races, if we do not + know that thd->query cannot change at the moment, one should print + thd->query like this: + (1) reserve the LOCK_thread_count mutex; + (2) check if thd->query is NULL; + (3) if not NULL, then print at most thd->query_length characters from + it. We will see the query_length field as either 0, or the right value + for it. + Assuming that the write and read of an n-bit memory field in an n-bit + computer is atomic, we can avoid races in the above way. + This printing is needed at least in SHOW PROCESSLIST and SHOW INNODB + STATUS. + */ char *query; // Points to the current query, /* A pointer to the stack frame of handle_one_connection(), diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 7dd458a3b5d..865b2e1328f 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -95,6 +95,7 @@ int mysql_create_db(THD *thd, char *db, uint create_options, bool silent) { VOID(pthread_mutex_lock(&LOCK_thread_count)); thd->query= 0; + thd->query_length= 0; VOID(pthread_mutex_unlock(&LOCK_thread_count)); } send_ok(&thd->net, result); @@ -202,6 +203,7 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent) { VOID(pthread_mutex_lock(&LOCK_thread_count)); thd->query= 0; + thd->query_length= 0; VOID(pthread_mutex_unlock(&LOCK_thread_count)); } send_ok(&thd->net,(ulong) deleted); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index be2d81fa372..77032bef698 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1312,6 +1312,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, thd->proc_info=0; thd->command=COM_SLEEP; thd->query=0; + thd->query_length=0; thread_running--; VOID(pthread_mutex_unlock(&LOCK_thread_count)); thd->packet.shrink(thd->variables.net_buffer_length); // Reclaim some memory diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 63f3afab128..7f52e52c849 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1141,7 +1141,11 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose) thd_info->query=0; if (tmp->query) { - /* query_length is always set before tmp->query */ + /* + query_length is always set to 0 when we set query = NULL; see + the comment in sql_class.h why this prevents crashes in possible + races with query_length + */ uint length= min(max_query_length, tmp->query_length); thd_info->query=(char*) thd->memdup(tmp->query,length+1); thd_info->query[length]=0; From fb8eb5a10d06dd041d775974c6f9211bbbcdcd9b Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 May 2004 16:56:47 +0300 Subject: [PATCH 085/162] SELECT options print fixed --- sql/sql_select.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index b847907a1a2..f7a8bce4616 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -9385,7 +9385,7 @@ void st_select_lex::print(THD *thd, String *str) if (!thd->lex->safe_to_cache_query) str->append("sql_no_cache ", 13); if (options & OPTION_TO_QUERY_CACHE) - str->append("cache ", 6); + str->append("sql_cache ", 10); //Item List bool first= 1; From c585b669d665566365bc56d58d5f311af8860ff1 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 May 2004 18:55:24 +0300 Subject: [PATCH 086/162] check of item name presence in find_item_in_list (Bug #3752) mysql-test/r/func_gconcat.result: test of Bug #3752 mysql-test/t/func_gconcat.test: test of Bug #3752 sql/sql_base.cc: check of item name presence in find_item_in_list --- mysql-test/r/func_gconcat.result | 9 +++++++++ mysql-test/t/func_gconcat.test | 10 ++++++++++ sql/sql_base.cc | 9 ++++++++- 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result index fdde8f766a9..11d976b9d15 100644 --- a/mysql-test/r/func_gconcat.result +++ b/mysql-test/r/func_gconcat.result @@ -301,3 +301,12 @@ a c grp 2 4 4 1 2 5 drop table t1,t2; +CREATE TABLE t1 ( a int ); +CREATE TABLE t2 ( a int ); +INSERT INTO t1 VALUES (1), (2); +INSERT INTO t2 VALUES (1), (2); +SELECT GROUP_CONCAT(t1.a*t2.a ORDER BY t1.a) FROM t1, t2 GROUP BY t1.a; +GROUP_CONCAT(t1.a*t2.a ORDER BY t1.a) +2,1 +4,2 +DROP TABLE t1, t2; diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test index 9d99a57afe5..6e1ebe250c1 100644 --- a/mysql-test/t/func_gconcat.test +++ b/mysql-test/t/func_gconcat.test @@ -179,3 +179,13 @@ select group_concat(c order by (select mid(group_concat(c order by a),1,5) from select a,c,(select group_concat(c order by a) from t2 where a=t1.a) as grp from t1 order by grp; drop table t1,t2; + +# +# group_concat of expression with GROUP BY and external GROUP BY +# +CREATE TABLE t1 ( a int ); +CREATE TABLE t2 ( a int ); +INSERT INTO t1 VALUES (1), (2); +INSERT INTO t2 VALUES (1), (2); +SELECT GROUP_CONCAT(t1.a*t2.a ORDER BY t1.a) FROM t1, t2 GROUP BY t1.a; +DROP TABLE t1, t2; diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 3a18b7eaabc..14a54a410a2 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -2096,7 +2096,14 @@ find_item_in_list(Item *find, List &items, uint *counter, if (field_name && item->type() == Item::FIELD_ITEM) { Item_field *item_field= (Item_field*) item; - if (!my_strcasecmp(system_charset_info, item_field->name, field_name)) + /* + In case of group_concat() with ORDER BY condition in the QUERY + item_field can be field of temporary table without item name + (if this field created from expression argument of group_concat()), + => we have to check presence of name before compare + */ + if (item_field->name && + !my_strcasecmp(system_charset_info, item_field->name, field_name)) { if (!table_name) { From dd4be0244d57da44351d6788dc9e29d2bcb60ea3 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 May 2004 21:00:29 +0500 Subject: [PATCH 087/162] CXX linker specified for client_test with libmysqld libmysqld/examples/Makefile.am: CXXLINK specified for client_test with libmysqld --- libmysqld/examples/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/libmysqld/examples/Makefile.am b/libmysqld/examples/Makefile.am index b11db65baf6..b3db54d305a 100644 --- a/libmysqld/examples/Makefile.am +++ b/libmysqld/examples/Makefile.am @@ -26,6 +26,7 @@ mysql_SOURCES = mysql.cc readline.cc completion_hash.cc \ my_readline.h sql_string.h completion_hash.h mysql_LDADD = @readline_link@ @TERMCAP_LIB@ $(LDADD) +client_test_LINK = $(CXXLINK) client_test_SOURCES = client_test.c clean: From f16022dfae6ea7659715c6062decca4d48038bc3 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 May 2004 19:12:09 +0200 Subject: [PATCH 088/162] get rid of remaining strtolls - irix64 compatibility --- sql/sql_yacc.yy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 0f29289ac25..d7ef1fc8d7f 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -4683,8 +4683,8 @@ literal: | TIMESTAMP text_literal { $$ = $2; }; NUM_literal: - NUM { $$ = new Item_int($1.str, (longlong) strtol($1.str, NULL, 10),$1.length); } - | LONG_NUM { $$ = new Item_int($1.str, (longlong) strtoll($1.str,NULL,10), $1.length); } + NUM { int error; $$ = new Item_int($1.str, (longlong) my_strtoll10($1.str, NULL, &error), $1.length); } + | LONG_NUM { int error; $$ = new Item_int($1.str, (longlong) my_strtoll10($1.str, NULL, &error), $1.length); } | ULONGLONG_NUM { $$ = new Item_uint($1.str, $1.length); } | REAL_NUM { $$ = new Item_real($1.str, $1.length); } | FLOAT_NUM { $$ = new Item_float($1.str, $1.length); } From 028a672fd6d82a1a831bbfc16838bbe33c381d48 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 May 2004 23:08:03 +0200 Subject: [PATCH 089/162] Replication testsuite: making the master-slave synchronization less likely to fail, by adding sleep-and-retries (max 4 times) if MASTER_POS_WAIT() returns NULL in sync_with_master and sync_slave_with_master. The problem showed up only today, in MySQL 5.0 in rpl_server_id2.test, but may affect 4.x as well, so fixing it here. Note that I am also fixing 5.0 too, with the same exact patch, because I don't want to leave 5.0 broken until the next 4.0->4.1->5.0 merge. client/mysqltest.c: in sync_with_master (and sync_slave_with_master), if MASTER_POS_WAIT() returns NULL, it may be that the slave SQL thread did not have time to start yes, so we sleep 1 sec and retry, 4 times at most. mysql-test/r/rpl_server_id2.result: result update mysql-test/t/rpl_server_id2.test: master_slave.inc already drops the table --- client/mysqltest.c | 21 ++++++++++++++++++--- mysql-test/r/rpl_server_id2.result | 1 - mysql-test/t/rpl_server_id2.test | 1 - 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 32fb44d178e..7dae99efde3 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -1081,7 +1081,7 @@ int do_sync_with_master2(const char* p) MYSQL_ROW row; MYSQL* mysql = &cur_con->mysql; char query_buf[FN_REFLEN+128]; - int offset = 0; + int offset= 0, tries= 0; int rpl_parse; if (!master_pos.file[0]) @@ -1096,6 +1096,9 @@ int do_sync_with_master2(const char* p) sprintf(query_buf, "select master_pos_wait('%s', %ld)", master_pos.file, master_pos.pos + offset); + +wait_for_position: + if (mysql_query(mysql, query_buf)) die("line %u: failed in %s: %d: %s", start_lineno, query_buf, mysql_errno(mysql), mysql_error(mysql)); @@ -1106,8 +1109,20 @@ int do_sync_with_master2(const char* p) if (!(row = mysql_fetch_row(res))) die("line %u: empty result in %s", start_lineno, query_buf); if (!row[0]) - die("line %u: could not sync with master ('%s' returned NULL)", - start_lineno, query_buf); + { + /* + It may be that the slave SQL thread has not started yet, though START + SLAVE has been issued ? + */ + if (tries++ == 3) + { + die("line %u: could not sync with master ('%s' returned NULL)", + start_lineno, query_buf); + } + sleep(1); /* So at most we will wait 3 seconds and make 4 tries */ + mysql_free_result(res); + goto wait_for_position; + } mysql_free_result(res); last_result=0; if (rpl_parse) diff --git a/mysql-test/r/rpl_server_id2.result b/mysql-test/r/rpl_server_id2.result index d665bb25dbb..1b5d946998c 100644 --- a/mysql-test/r/rpl_server_id2.result +++ b/mysql-test/r/rpl_server_id2.result @@ -4,7 +4,6 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; slave start; -drop table if exists t1; create table t1 (n int); reset master; stop slave; diff --git a/mysql-test/t/rpl_server_id2.test b/mysql-test/t/rpl_server_id2.test index dc8f733b7ed..7bbac358ada 100644 --- a/mysql-test/t/rpl_server_id2.test +++ b/mysql-test/t/rpl_server_id2.test @@ -3,7 +3,6 @@ source include/master-slave.inc; connection slave; -drop table if exists t1; create table t1 (n int); reset master; # replicate ourselves From fa163d0ba5f5fc22dbadbd66255879ceeb895c27 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 15 May 2004 09:08:03 +0300 Subject: [PATCH 090/162] Extra safety fixes (probably not needed, but can't hurt) sql/ha_innodb.cc: simple optimization sql/sql_show.cc: Simple optimization --- sql/ha_innodb.cc | 9 +++------ sql/sql_parse.cc | 3 ++- sql/sql_show.cc | 3 +-- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 4835f794a1d..4a50e2d8ccf 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -395,12 +395,9 @@ innobase_mysql_print_thd( but better be safe */ } - for (i = 0; i < len && s[i]; i++); - - memcpy(buf, s, i); /* Use memcpy to reduce the timeframe - for a race, compared to fwrite() */ - buf[300] = '\0'; /* not needed, just extra safety */ - + /* Use strmake to reduce the timeframe + for a race, compared to fwrite() */ + i= (uint) (strmake(buf, s, len) - buf); putc('\n', f); fwrite(buf, 1, i, f); } diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 77032bef698..7e68db0dcd2 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1067,6 +1067,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, packet_length--; } /* We must allocate some extra memory for query cache */ + thd->query_length= 0; // Extra safety: Avoid races if (!(thd->query= (char*) thd->memdup_w_gap((gptr) (packet), packet_length, thd->db_length+2+ @@ -2982,8 +2983,8 @@ void mysql_parse(THD *thd, char *inBuf, uint length) { DBUG_ENTER("mysql_parse"); - mysql_init_query(thd); thd->query_length = length; + mysql_init_query(thd); if (query_cache_send_result_to_client(thd, inBuf, length) <= 0) { LEX *lex=lex_start(thd, (uchar*) inBuf, length); diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 7f52e52c849..a4ef735c715 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1147,8 +1147,7 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose) races with query_length */ uint length= min(max_query_length, tmp->query_length); - thd_info->query=(char*) thd->memdup(tmp->query,length+1); - thd_info->query[length]=0; + thd_info->query=(char*) thd->strmake(tmp->query,length); } thread_infos.append(thd_info); } From a936a280946b72859df75c77c2d169faba84de13 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 15 May 2004 11:20:43 +0300 Subject: [PATCH 091/162] results fix mysql-test/r/func_encrypt.result: right SELECT print mysql-test/r/func_gconcat.result: make results stable mysql-test/t/func_gconcat.test: make results stable --- mysql-test/r/func_encrypt.result | 2 +- mysql-test/r/func_gconcat.result | 8 ++++---- mysql-test/t/func_gconcat.test | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/func_encrypt.result b/mysql-test/r/func_encrypt.result index abdfda0423f..d32e67fe7d5 100644 --- a/mysql-test/r/func_encrypt.result +++ b/mysql-test/r/func_encrypt.result @@ -138,4 +138,4 @@ explain extended select des_decrypt(des_encrypt("hello",4),'password2'), des_dec id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority des_decrypt(des_encrypt(_latin1'hello',4),_latin1'password2') AS `des_decrypt(des_encrypt("hello",4),'password2')`,des_decrypt(des_encrypt(_latin1'hello',_latin1'hidden')) AS `des_decrypt(des_encrypt("hello","hidden"))` +Note 1003 select des_decrypt(des_encrypt(_latin1'hello',4),_latin1'password2') AS `des_decrypt(des_encrypt("hello",4),'password2')`,des_decrypt(des_encrypt(_latin1'hello',_latin1'hidden')) AS `des_decrypt(des_encrypt("hello","hidden"))` diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result index 11d976b9d15..60a28e5018f 100644 --- a/mysql-test/r/func_gconcat.result +++ b/mysql-test/r/func_gconcat.result @@ -305,8 +305,8 @@ CREATE TABLE t1 ( a int ); CREATE TABLE t2 ( a int ); INSERT INTO t1 VALUES (1), (2); INSERT INTO t2 VALUES (1), (2); -SELECT GROUP_CONCAT(t1.a*t2.a ORDER BY t1.a) FROM t1, t2 GROUP BY t1.a; -GROUP_CONCAT(t1.a*t2.a ORDER BY t1.a) -2,1 -4,2 +SELECT GROUP_CONCAT(t1.a*t2.a ORDER BY t2.a) FROM t1, t2 GROUP BY t1.a; +GROUP_CONCAT(t1.a*t2.a ORDER BY t2.a) +1,2 +2,4 DROP TABLE t1, t2; diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test index 6e1ebe250c1..aede2220466 100644 --- a/mysql-test/t/func_gconcat.test +++ b/mysql-test/t/func_gconcat.test @@ -187,5 +187,5 @@ CREATE TABLE t1 ( a int ); CREATE TABLE t2 ( a int ); INSERT INTO t1 VALUES (1), (2); INSERT INTO t2 VALUES (1), (2); -SELECT GROUP_CONCAT(t1.a*t2.a ORDER BY t1.a) FROM t1, t2 GROUP BY t1.a; +SELECT GROUP_CONCAT(t1.a*t2.a ORDER BY t2.a) FROM t1, t2 GROUP BY t1.a; DROP TABLE t1, t2; From c9667f114695bbf9dda1548b2c48a44b89c580b0 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 15 May 2004 11:57:40 +0300 Subject: [PATCH 092/162] Better fix for bug #3749 (bug in deleting automatic generated foreign keys) mysql-test/r/func_encrypt.result: Update tests (left after sanjas last push) mysql-test/r/innodb.result: Added test for bug #3749 (bug in deleting automatic generated foreign keys) mysql-test/t/innodb.test: Added test for bug #3749 (bug in deleting automatic generated foreign keys) sql/sql_class.cc: Updated comment tests/client_test.c: Added missing mysql_stmt_close() --- mysql-test/r/func_encrypt.result | 2 +- mysql-test/r/innodb.result | 31 +++++++++++++++++++++++++++++++ mysql-test/t/innodb.test | 10 ++++++++++ sql/sql_class.cc | 2 +- sql/sql_table.cc | 24 +++++++++--------------- tests/client_test.c | 5 ++--- 6 files changed, 54 insertions(+), 20 deletions(-) diff --git a/mysql-test/r/func_encrypt.result b/mysql-test/r/func_encrypt.result index abdfda0423f..d32e67fe7d5 100644 --- a/mysql-test/r/func_encrypt.result +++ b/mysql-test/r/func_encrypt.result @@ -138,4 +138,4 @@ explain extended select des_decrypt(des_encrypt("hello",4),'password2'), des_dec id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select high_priority des_decrypt(des_encrypt(_latin1'hello',4),_latin1'password2') AS `des_decrypt(des_encrypt("hello",4),'password2')`,des_decrypt(des_encrypt(_latin1'hello',_latin1'hidden')) AS `des_decrypt(des_encrypt("hello","hidden"))` +Note 1003 select des_decrypt(des_encrypt(_latin1'hello',4),_latin1'password2') AS `des_decrypt(des_encrypt("hello",4),'password2')`,des_decrypt(des_encrypt(_latin1'hello',_latin1'hidden')) AS `des_decrypt(des_encrypt("hello","hidden"))` diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 60280715911..cb99f9fe06d 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1538,6 +1538,37 @@ t2 CREATE TABLE `t2` ( CONSTRAINT `t1_id_fk` FOREIGN KEY (`id2`, `id`) REFERENCES `t1` (`id`, `id2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t2; +create table t2 (id int(11) not null auto_increment, id2 int(11) not null, constraint t1_id_fk foreign key (id) references t1 (id), primary key (id), index (id,id2)) engine = innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL auto_increment, + `id2` int(11) NOT NULL default '0', + PRIMARY KEY (`id`), + KEY `id` (`id`,`id2`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (id int(11) not null auto_increment, id2 int(11) not null, constraint t1_id_fk foreign key (id) references t1 (id)) engine= innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL auto_increment, + `id2` int(11) NOT NULL default '0', + KEY `t1_id_fk` (`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +alter table t2 add index id_test (id), add index id_test2 (id,id2); +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL auto_increment, + `id2` int(11) NOT NULL default '0', + KEY `id_test` (`id`), + KEY `id_test2` (`id`,`id2`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb; ERROR HY000: Can't create table './test/t2.frm' (errno: 150) drop table t1; diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index a260ab1263d..36b2914ef46 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -1082,6 +1082,16 @@ create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2),cons show create table t2; drop table t2; +create table t2 (id int(11) not null auto_increment, id2 int(11) not null, constraint t1_id_fk foreign key (id) references t1 (id), primary key (id), index (id,id2)) engine = innodb; +show create table t2; +drop table t2; + +create table t2 (id int(11) not null auto_increment, id2 int(11) not null, constraint t1_id_fk foreign key (id) references t1 (id)) engine= innodb; +show create table t2; +alter table t2 add index id_test (id), add index id_test2 (id,id2); +show create table t2; +drop table t2; + # Test error handling --error 1005 create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb; diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 03d67c4f300..f7992c3db9e 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -86,7 +86,7 @@ bool key_part_spec::operator==(const key_part_spec& other) const /* - Test if a foreign key is a prefix of the given key + Test if a foreign key (= generated key) is a prefix of the given key (ignoring key name, key type and order of columns) NOTES: diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 47574eab666..284b228567a 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -684,11 +684,13 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, while ((key2 = key_iterator2++) != key) { /* - foreign_key_prefix(key, key2) returns 0 if key or key2, or both, is - 'generated', and a generated key is a prefix of the other key. Then we - do not need the generated shorter key. + foreign_key_prefix(key, key2) returns 0 if key or key2, or both, is + 'generated', and a generated key is a prefix of the other key. + Then we do not need the generated shorter key. */ - if ((key2->type != Key::FOREIGN_KEY && !foreign_key_prefix(key, key2))) + if ((key2->type != Key::FOREIGN_KEY && + key2->name != ignore_key && + !foreign_key_prefix(key, key2))) { /* TO DO: issue warning message */ /* mark that the generated key should be ignored */ @@ -698,17 +700,9 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, key->name= ignore_key; else { - /* - Remove the previous, generated key if it has not yet been - removed. Note that if we have several identical generated keys, - the last one will remain and others get removed here. - */ - if (key2->name != ignore_key) - { - key2->name= ignore_key; - key_parts-= key2->columns.elements; - (*key_count)--; - } + key2->name= ignore_key; + key_parts-= key2->columns.elements; + (*key_count)--; } break; } diff --git a/tests/client_test.c b/tests/client_test.c index ba70bcd7fa7..c244274a2e7 100644 --- a/tests/client_test.c +++ b/tests/client_test.c @@ -9614,7 +9614,6 @@ union distinct \ select sum(a) + 200, 1 from t1 \ group by b "); check_stmt(stmt); - mysql_stmt_close(stmt); stmt= mysql_simple_prepare(mysql, @@ -9624,14 +9623,14 @@ union distinct \ select sum(a) + 200, 1 from t1 \ group by b "); check_stmt(stmt); + mysql_stmt_close(stmt); - stmt= mysql_simple_prepare(mysql, + stmt= mysql_simple_prepare(mysql, "select sum(a) + 200, ? from t1 \ union distinct \ select sum(a) + 200, 1 from t1 \ group by b "); check_stmt(stmt); - mysql_stmt_close(stmt); rc= mysql_query(mysql, "DROP TABLE t1"); From b40430e08cf40d931c511d4d31ea517b7294417b Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 15 May 2004 11:20:42 +0200 Subject: [PATCH 093/162] bad old merge fixed mysql-test/r/order_by.result: buggy results bug#3681 mysql-test/t/order_by.test: test for bug#3681 --- mysql-test/r/order_by.result | 9 +++++++++ mysql-test/t/order_by.test | 10 ++++++++++ sql/sql_select.cc | 1 - 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result index 1a10c9c6ce9..5edffdacc98 100644 --- a/mysql-test/r/order_by.result +++ b/mysql-test/r/order_by.result @@ -85,6 +85,15 @@ i 1 3 drop table t1; +create table t1 ( pk int primary key, name varchar(255) not null, number varchar(255) not null); +insert into t1 values (1, 'Gamma', '123'), (2, 'Gamma Ext', '123a'), (3, 'Alpha', '001'), (4, 'Beta', '200c'); +select distinct t1.name as 'Building Name',t1.number as 'Building Number' from t1 order by t1.name asc; +Building Name Building Number +Gamma 123 +Gamma Ext 123a +Alpha 001 +Beta 200c +drop table t1; create table t1 (id int not null,col1 int not null,col2 int not null,index(col1)); insert into t1 values(1,2,2),(2,2,1),(3,1,2),(4,1,1),(5,1,4),(6,2,3),(7,3,1),(8,2,4); select * from t1 order by col1,col2; diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test index 9ae9c1b5e12..465920deaed 100644 --- a/mysql-test/t/order_by.test +++ b/mysql-test/t/order_by.test @@ -79,6 +79,16 @@ select distinct i from t1 order by 1-i; select distinct i from t1 order by mod(i,2),i; drop table t1; +# +# bug#3681 +# + +create table t1 ( pk int primary key, name varchar(255) not null, number varchar(255) not null); +insert into t1 values (1, 'Gamma', '123'), (2, 'Gamma Ext', '123a'), (3, 'Alpha', '001'), (4, 'Beta', '200c'); +select distinct t1.name as 'Building Name',t1.number as 'Building Number' from t1 order by t1.name asc; +drop table t1; + + # # Order by on first index part # diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 47ecc57cf16..92bc13cb01e 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -665,7 +665,6 @@ JOIN::optimize() if (!order && org_order) skip_sort_order= 1; } - order= remove_const(this, order, conds, &simple_order); if (group_list || tmp_table_param.sum_func_count) { if (! hidden_group_fields) From 05cd698f542f295b4fcd28d4704bce0f37e534ca Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 15 May 2004 17:07:44 +0500 Subject: [PATCH 094/162] Fixes for #3371, #3372, #3374, #3375, #3376 libmysql/libmysql.c: code to fix #3772 counting of field->max_length moved to mysql_store_stmt_result so it will work in libmysqld also libmysqld/lib_sql.cc: to fix #3771 and #3775 stmt->affected_rows specifying added code getting default values changed so it will add terminating /0 to values sql/sql_parse.cc: to fix #3773 silly mistake here :\ sql/sql_prepare.cc: to fix #3774 and #3776 special function for datetime values in embedded server added unsigned flag now specified for values in embedded server tests/client_test.c: this test fails if privilege-checking pars are disabled (it's the default for libmysqld) --- libmysql/libmysql.c | 54 +++++++++++++++++++++++------------------ libmysqld/lib_sql.cc | 7 ++++-- sql/sql_parse.cc | 2 +- sql/sql_prepare.cc | 58 ++++++++++++++++++++++++++++++++++++++++++++ tests/client_test.c | 3 +++ 5 files changed, 97 insertions(+), 27 deletions(-) diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index a467b7fc9fd..2214ca68c81 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -3729,28 +3729,6 @@ int cli_read_binary_rows(MYSQL_STMT *stmt) mysql= mysql->last_used_con; - if (stmt->update_max_length && !stmt->bind_result_done) - { - /* - We must initalize the bind structure to be able to calculate - max_length - */ - MYSQL_BIND *bind, *end; - MYSQL_FIELD *field; - bzero((char*) stmt->bind, sizeof(*stmt->bind)* stmt->field_count); - - for (bind= stmt->bind, end= bind + stmt->field_count, field= stmt->fields; - bind < end ; - bind++, field++) - { - bind->buffer_type= field->type; - bind->buffer_length=1; - } - - mysql_stmt_bind_result(stmt, stmt->bind); - stmt->bind_result_done= 0; /* No normal bind done */ - } - while ((pkt_len= net_safe_read(mysql)) != packet_error) { cp= net->read_pos; @@ -3768,8 +3746,6 @@ int cli_read_binary_rows(MYSQL_STMT *stmt) memcpy((char *) cur->data, (char *) cp+1, pkt_len-1); cur->length= pkt_len; /* To allow us to do sanity checks */ result->rows++; - if (stmt->update_max_length) - stmt_update_metadata(stmt, cur); } else { @@ -3814,6 +3790,29 @@ int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt) result->rows= 0; stmt->data_cursor= NULL; } + + if (stmt->update_max_length && !stmt->bind_result_done) + { + /* + We must initalize the bind structure to be able to calculate + max_length + */ + MYSQL_BIND *bind, *end; + MYSQL_FIELD *field; + bzero((char*) stmt->bind, sizeof(*stmt->bind)* stmt->field_count); + + for (bind= stmt->bind, end= bind + stmt->field_count, field= stmt->fields; + bind < end ; + bind++, field++) + { + bind->buffer_type= field->type; + bind->buffer_length=1; + } + + mysql_stmt_bind_result(stmt, stmt->bind); + stmt->bind_result_done= 0; /* No normal bind done */ + } + if ((*mysql->methods->read_binary_rows)(stmt)) { free_root(&result->alloc, MYF(MY_KEEP_PREALLOC)); @@ -3822,6 +3821,13 @@ int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt) DBUG_RETURN(1); } + if (stmt->update_max_length) + { + MYSQL_ROWS *cur= result->data; + for(; cur; cur=cur->next) + stmt_update_metadata(stmt, cur); + } + stmt->data_cursor= result->data; mysql->affected_rows= stmt->affected_rows= result->rows; stmt->read_row_func= stmt_read_row_buffered; diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index cfb50d3907a..09b03e38f2e 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -197,6 +197,8 @@ static int emb_stmt_execute(MYSQL_STMT *stmt) set_stmt_errmsg(stmt, net->last_error, net->last_errno, net->sqlstate); DBUG_RETURN(1); } + stmt->affected_rows= stmt->mysql->affected_rows; + stmt->insert_id= stmt->mysql->insert_id; DBUG_RETURN(0); } @@ -605,13 +607,14 @@ bool Protocol::send_fields(List *list, uint flag) if (!(res=item->val_str(&tmp))) { - client_field->def= strdup_root(field_alloc, ""); client_field->def_length= 0; + client_field->def= strmake_root(field_alloc, "",0); } else { - client_field->def= strdup_root(field_alloc, res->ptr()); client_field->def_length= res->length(); + client_field->def= strmake_root(field_alloc, res->ptr(), + client_field->def_length); } } else diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index e949d40625d..9a750b2df99 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1493,7 +1493,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, thd->query_rest.length(length); } else - thd->query_rest.copy(length); + thd->query_rest.copy(packet, length, thd->query_rest.charset()); break; #endif /*EMBEDDED_LIBRARY*/ } diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 61e5b778b64..68da21018a0 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -309,6 +309,7 @@ void set_param_double(Item_param *param, uchar **pos, ulong len) *pos+= 8; } +#ifndef EMBEDDED_LIBRARY void set_param_time(Item_param *param, uchar **pos, ulong len) { ulong length; @@ -386,6 +387,62 @@ void set_param_date(Item_param *param, uchar **pos, ulong len) *pos+= length; } +#else/*!EMBEDDED_LIBRARY*/ +void set_param_time(Item_param *param, uchar **pos, ulong len) +{ + TIME tm; + MYSQL_TIME *to= (MYSQL_TIME*)*pos; + + tm.second_part= to->second_part; + + tm.day= to->day; + tm.hour= to->hour; + tm.minute= to->minute; + tm.second= to->second; + + tm.year= tm.month= 0; + tm.neg= to->neg; + + param->set_time(&tm, TIMESTAMP_TIME); +} + +void set_param_datetime(Item_param *param, uchar **pos, ulong len) +{ + TIME tm; + MYSQL_TIME *to= (MYSQL_TIME*)*pos; + + tm.second_part= to->second_part; + + tm.day= to->day; + tm.hour= to->hour; + tm.minute= to->minute; + tm.second= to->second; + tm.year= to->year; + tm.month= to->month; + tm.neg= 0; + + param->set_time(&tm, TIMESTAMP_DATETIME); +} + +void set_param_date(Item_param *param, uchar **pos, ulong len) +{ + TIME tm; + MYSQL_TIME *to= (MYSQL_TIME*)*pos; + + tm.second_part= to->second_part; + + tm.day= to->day; + tm.year= to->year; + tm.month= to->month; + tm.neg= 0; + tm.hour= tm.minute= tm.second= 0; + tm.second_part= 0; + tm.neg= 0; + + param->set_time(&tm, TIMESTAMP_DATE); +} +#endif /*!EMBEDDED_LIBRARY*/ + void set_param_str(Item_param *param, uchar **pos, ulong len) { ulong length= get_param_length(pos, len); @@ -568,6 +625,7 @@ static bool emb_insert_params(Prepared_statement *stmt) { Item_param *param= *it; setup_one_conversion_function(param, client_param->buffer_type); + param->unsigned_flag= client_param->is_unsigned; if (!param->long_data_supplied) { if (*client_param->is_null) diff --git a/tests/client_test.c b/tests/client_test.c index ba70bcd7fa7..f859bffb405 100644 --- a/tests/client_test.c +++ b/tests/client_test.c @@ -9872,7 +9872,10 @@ int main(int argc, char **argv) test_stiny_bug(); /* test a simple conv bug from php */ test_field_misc(); /* check the field info for misc case, bug: #74 */ test_set_option(); /* test the SET OPTION feature, bug #85 */ + /*TODO HF: here should be NO_EMBEDDED_ACCESS_CHECKS*/ +#ifndef EMBEDDED_LIBRARY test_prepare_grant(); /* to test the GRANT command, bug #89 */ +#endif test_frm_bug(); /* test the crash when .frm is invalid, bug #93 */ test_explain_bug(); /* test for the EXPLAIN, bug #115 */ test_decimal_bug(); /* test for the decimal bug */ From 90e87293cbc9489ffc51a8883087398564579067 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 15 May 2004 16:13:08 +0300 Subject: [PATCH 095/162] Optimising UNION ALL (WL 1687) --- sql/sql_union.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sql/sql_union.cc b/sql/sql_union.cc index 63638b618d9..e6568f5f598 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -339,8 +339,8 @@ int st_select_lex_unit::exec() item->reset(); table->file->delete_all_rows(); } - if (union_distinct) // for subselects - table->file->extra(HA_EXTRA_CHANGE_KEY_TO_UNIQUE); + if (union_distinct && table->file->enable_indexes(HA_KEY_SWITCH_ALL)) + DBUG_RETURN(1); // For sub-selects for (SELECT_LEX *sl= select_cursor; sl; sl= sl->next_select()) { ha_rows records_at_start= 0; @@ -392,7 +392,11 @@ int st_select_lex_unit::exec() records_at_start= table->file->records; sl->join->exec(); if (sl == union_distinct) - table->file->extra(HA_EXTRA_CHANGE_KEY_TO_DUP); + { + if (table->file->disable_indexes(HA_KEY_SWITCH_ALL)) + DBUG_RETURN(1); + table->no_keyread=1; + } res= sl->join->error; offset_limit_cnt= sl->offset_limit; if (!res && union_result->flush()) From 70f79563d9fa8ef3cdfef01b8eee95ea6e927147 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 16 May 2004 14:48:32 +0300 Subject: [PATCH 096/162] key_cmp -> key_cmp_if_same New records_in_range() interface (similar to read_range()) Macros for faster bitmap handling Simplify read_range() code (#WL1786) New general key_cmp() function to compare keys heap/hp_hash.c: New records_in_range() interface include/heap.h: New records_in_range() interface include/my_base.h: Moved 'key_range' here so that all table handlers can use it include/my_bitmap.h: Make some bitmap functions inline for faster usage in one thread include/myisam.h: New records_in_range() interface include/myisammrg.h: New records_in_range() interface myisam/mi_range.c: New records_in_range() interface myisam/mi_test2.c: New records_in_range() interface myisam/rt_test.c: New records_in_range() interface Indentation fixes myisam/sp_test.c: New records_in_range() interface Indentation fixes myisammrg/myrg_range.c: New records_in_range() interface mysys/my_bitmap.c: Make some bitmap functions inline for faster usage in one thread sql/examples/ha_example.cc: New records_in_range() interface sql/field.cc: Fixed indentation sql/ha_berkeley.cc: New records_in_range() interface sql/ha_berkeley.h: New records_in_range() interface sql/ha_heap.cc: New records_in_range() interface sql/ha_heap.h: New records_in_range() interface sql/ha_innodb.cc: New records_in_range() interface sql/ha_innodb.h: New records_in_range() interface sql/ha_isam.cc: New records_in_range() interface sql/ha_isam.h: New records_in_range() interface sql/ha_myisam.cc: New records_in_range() interface sql/ha_myisam.h: New records_in_range() interface sql/ha_myisammrg.cc: New records_in_range() interface sql/ha_myisammrg.h: New records_in_range() interface sql/ha_ndbcluster.cc: New records_in_range() interface sql/ha_ndbcluster.h: New records_in_range() interface sql/handler.cc: Simplify read_range() interface: - Add 'eq_range' to read_range_first - Remove 'eq_range' parameer from read_range_next() - Trust values from index_next_same() - Simplfy compare_key() by moving key_comparision to key.cc (as this code can be reused from other places) sql/handler.h: Move key_range to my_base.h to be used by external table handlers Simplify read_range() interface New records_in_range() interface sql/key.cc: Rename key_cmp() to key_cmp_if_same() to make it more descriptive Add new key_cmp() function usable from range and handler code. sql/mysql_priv.h: Prototypes for new functions sql/opt_range.cc: New records_in_range() interface Simplify cmp_prev() (We can in 5.0 simplify cmp_next() the same way) sql/opt_range.h: Added key_part_info to QUICK_SELECT to be able to use key_cmp() in get_next() sql/opt_sum.cc: key_cmp -> key_cmp_if_same sql/sql_acl.cc: key_cmp -> key_cmp_if_same sql/sql_select.cc: key_cmp -> key_cmp_if_same --- heap/hp_hash.c | 37 ++++++++--------- include/heap.h | 7 +--- include/my_base.h | 10 +++++ include/my_bitmap.h | 6 +++ include/myisam.h | 5 +-- include/myisammrg.h | 5 +-- myisam/mi_range.c | 70 +++++++++++++++++++------------ myisam/mi_test2.c | 22 ++++++++-- myisam/rt_test.c | 79 +++++++++++++---------------------- myisam/sp_test.c | 84 ++++++++++++++------------------------ myisammrg/myrg_range.c | 11 ++--- mysys/my_bitmap.c | 6 +-- sql/examples/ha_example.cc | 11 ++--- sql/field.cc | 9 ++-- sql/ha_berkeley.cc | 29 +++++++------ sql/ha_berkeley.h | 7 +--- sql/ha_heap.cc | 34 ++++++--------- sql/ha_heap.h | 5 +-- sql/ha_innodb.cc | 39 +++++++----------- sql/ha_innodb.h | 6 +-- sql/ha_isam.cc | 23 ++++++----- sql/ha_isam.h | 6 +-- sql/ha_myisam.cc | 26 ++++-------- sql/ha_myisam.h | 6 +-- sql/ha_myisammrg.cc | 16 +++----- sql/ha_myisammrg.h | 6 +-- sql/ha_ndbcluster.cc | 23 +++++------ sql/ha_ndbcluster.h | 7 +--- sql/handler.cc | 66 ++++++++++-------------------- sql/handler.h | 25 ++++-------- sql/key.cc | 76 +++++++++++++++++++++++++++++++++- sql/mysql_priv.h | 5 ++- sql/opt_range.cc | 81 ++++++++++++++---------------------- sql/opt_range.h | 7 +++- sql/opt_sum.cc | 2 +- sql/sql_acl.cc | 4 +- sql/sql_select.cc | 4 +- 37 files changed, 405 insertions(+), 460 deletions(-) diff --git a/heap/hp_hash.c b/heap/hp_hash.c index d040f37aea0..38ed581fe58 100644 --- a/heap/hp_hash.c +++ b/heap/hp_hash.c @@ -29,19 +29,15 @@ hp_rb_records_in_range() info HEAP handler inx Index to use - start_key Start of range. Null pointer if from first key - start_key_len Length of start key - start_search_flag Flag if start key should be included or not - end_key End of range. Null pointer if to last key - end_key_len Length of end key - end_search_flag Flag if start key should be included or not + min_key Min key. Is = 0 if no min range + max_key Max key. Is = 0 if no max range NOTES - start_search_flag can have one of the following values: + min_key.flag can have one of the following values: HA_READ_KEY_EXACT Include the key in the range HA_READ_AFTER_KEY Don't include key in range - end_search_flag can have one of the following values: + max_key.flag can have one of the following values: HA_READ_BEFORE_KEY Don't include key in range HA_READ_AFTER_KEY Include all 'end_key' values in the range @@ -52,11 +48,8 @@ the range. */ -ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, const byte *start_key, - uint start_key_len, - enum ha_rkey_function start_search_flag, - const byte *end_key, uint end_key_len, - enum ha_rkey_function end_search_flag) +ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, key_range *min_key, + key_range *max_key) { ha_rows start_pos, end_pos; HP_KEYDEF *keyinfo= info->s->keydef + inx; @@ -67,12 +60,12 @@ ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, const byte *start_key, info->lastinx= inx; custom_arg.keyseg= keyinfo->seg; custom_arg.search_flag= SEARCH_FIND | SEARCH_SAME; - if (start_key) + if (min_key) { custom_arg.key_length= hp_rb_pack_key(keyinfo, (uchar*) info->recbuf, - (uchar*) start_key, - start_key_len); - start_pos= tree_record_pos(rb_tree, info->recbuf, start_search_flag, + (uchar*) min_key->key, + min_key->length); + start_pos= tree_record_pos(rb_tree, info->recbuf, min_key->flag, &custom_arg); } else @@ -80,11 +73,12 @@ ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, const byte *start_key, start_pos= 0; } - if (end_key) + if (max_key) { custom_arg.key_length= hp_rb_pack_key(keyinfo, (uchar*) info->recbuf, - (uchar*) end_key, end_key_len); - end_pos= tree_record_pos(rb_tree, info->recbuf, end_search_flag, + (uchar*) max_key->key, + max_key->length); + end_pos= tree_record_pos(rb_tree, info->recbuf, max_key->flag, &custom_arg); } else @@ -100,12 +94,13 @@ ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, const byte *start_key, (end_pos == start_pos ? (ha_rows) 1 : end_pos - start_pos)); } + /* Search after a record based on a key */ /* Sets info->current_ptr to found record */ /* next_flag: Search=0, next=1, prev =2, same =3 */ byte *hp_search(HP_INFO *info, HP_KEYDEF *keyinfo, const byte *key, - uint nextflag) + uint nextflag) { reg1 HASH_INFO *pos,*prev_ptr; int flag; diff --git a/include/heap.h b/include/heap.h index b536937c8c0..63f2abbabc7 100644 --- a/include/heap.h +++ b/include/heap.h @@ -182,11 +182,8 @@ extern int heap_disable_indexes(HP_INFO *info); extern int heap_enable_indexes(HP_INFO *info); extern int heap_indexes_are_disabled(HP_INFO *info); extern void heap_update_auto_increment(HP_INFO *info, const byte *record); -ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, const byte *start_key, - uint start_key_len, - enum ha_rkey_function start_search_flag, - const byte *end_key, uint end_key_len, - enum ha_rkey_function end_search_flag); +ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, key_range *min_key, + key_range *max_key); int heap_rkey(HP_INFO *info, byte *record, int inx, const byte *key, uint key_len, enum ha_rkey_function find_flag); extern gptr heap_find(HP_INFO *info,int inx,const byte *key); diff --git a/include/my_base.h b/include/my_base.h index 4a2f3f85083..f912cb4278c 100644 --- a/include/my_base.h +++ b/include/my_base.h @@ -349,6 +349,16 @@ enum data_file_type { STATIC_RECORD,DYNAMIC_RECORD,COMPRESSED_RECORD }; +/* For key ranges */ + +typedef struct st_key_range +{ + const byte *key; + uint length; + enum ha_rkey_function flag; +} key_range; + + /* For number of records */ #ifdef BIG_TABLES #define rows2double(A) ulonglong2double(A) diff --git a/include/my_bitmap.h b/include/my_bitmap.h index 5b3da011f54..a4511bf3414 100644 --- a/include/my_bitmap.h +++ b/include/my_bitmap.h @@ -55,6 +55,12 @@ extern void bitmap_set_bit(MY_BITMAP *map, uint bitmap_bit); extern void bitmap_set_prefix(MY_BITMAP *map, uint prefix_size); extern void bitmap_subtract(MY_BITMAP *map, const MY_BITMAP *map2); extern void bitmap_union(MY_BITMAP *map, const MY_BITMAP *map2); + +/* Fast, not thread safe, bitmap functions */ +#define bitmap_fast_set_bit(MAP, BIT) (MAP)->bitmap[(BIT) / 8] |= (1 << ((BIT) & 7)) +#define bitmap_fast_clear_bit(MAP, BIT) (MAP)->bitmap[(BIT) / 8] &= ~ (1 << ((BIT) & 7)) +#define bitmap_fast_is_set(MAP, BIT) (MAP)->bitmap[(BIT) / 8] & (1 << ((BIT) & 7)) + #ifdef __cplusplus } #endif diff --git a/include/myisam.h b/include/myisam.h index 93e2dc15574..c99e9a30b08 100644 --- a/include/myisam.h +++ b/include/myisam.h @@ -231,10 +231,7 @@ extern int mi_extra(struct st_myisam_info *file, enum ha_extra_function function, void *extra_arg); extern ha_rows mi_records_in_range(struct st_myisam_info *info,int inx, - const byte *start_key,uint start_key_len, - enum ha_rkey_function start_search_flag, - const byte *end_key,uint end_key_len, - enum ha_rkey_function end_search_flag); + key_range *min_key, key_range *max_key); extern int mi_log(int activate_log); extern int mi_is_changed(struct st_myisam_info *info); extern int mi_delete_all_rows(struct st_myisam_info *info); diff --git a/include/myisammrg.h b/include/myisammrg.h index 8b09e1a9231..de8a36c2d0a 100644 --- a/include/myisammrg.h +++ b/include/myisammrg.h @@ -101,10 +101,7 @@ extern int myrg_extra(MYRG_INFO *file,enum ha_extra_function function, void *extra_arg); extern void myrg_extrafunc(MYRG_INFO *info,invalidator_by_filename inv); extern ha_rows myrg_records_in_range(MYRG_INFO *info,int inx, - const byte *start_key,uint start_key_len, - enum ha_rkey_function start_search_flag, - const byte *end_key,uint end_key_len, - enum ha_rkey_function end_search_flag); + key_range *min_key, key_range *max_key); extern ulonglong myrg_position(MYRG_INFO *info); #ifdef __cplusplus diff --git a/myisam/mi_range.c b/myisam/mi_range.c index caa57ce6187..db01ada16dd 100644 --- a/myisam/mi_range.c +++ b/myisam/mi_range.c @@ -30,15 +30,27 @@ static uint _mi_keynr(MI_INFO *info,MI_KEYDEF *keyinfo,uchar *page, uchar *keypos,uint *ret_max_key); - /* If start_key = 0 assume read from start */ - /* If end_key = 0 assume read to end */ - /* Returns HA_POS_ERROR on error */ +/* + Estimate how many records there is in a given range -ha_rows mi_records_in_range(MI_INFO *info, int inx, const byte *start_key, - uint start_key_len, - enum ha_rkey_function start_search_flag, - const byte *end_key, uint end_key_len, - enum ha_rkey_function end_search_flag) + SYNOPSIS + mi_records_in_range() + info MyISAM handler + inx Index to use + min_key Min key. Is = 0 if no min range + max_key Max key. Is = 0 if no max range + + NOTES + We should ONLY return 0 if there is no rows in range + + RETURN + HA_POS_ERROR error (or we can't estimate number of rows) + number Estimated number of rows +*/ + + +ha_rows mi_records_in_range(MI_INFO *info, int inx, key_range *min_key, + key_range *max_key) { ha_rows start_pos,end_pos,res; DBUG_ENTER("mi_records_in_range"); @@ -54,27 +66,31 @@ ha_rows mi_records_in_range(MI_INFO *info, int inx, const byte *start_key, switch(info->s->keyinfo[inx].key_alg){ case HA_KEY_ALG_RTREE: - { - uchar * key_buff; - if (start_key_len == 0) - start_key_len=USE_WHOLE_KEY; - key_buff=info->lastkey+info->s->base.max_key_length; - start_key_len= _mi_pack_key(info,inx,key_buff,(uchar*) start_key, - start_key_len, (HA_KEYSEG**) 0); - res=rtree_estimate(info, inx, key_buff, start_key_len, myisam_read_vec[start_search_flag]); - res=res?res:1; - break; - } + { + uchar * key_buff; + uint start_key_len; + + key_buff= info->lastkey+info->s->base.max_key_length; + start_key_len= _mi_pack_key(info,inx, key_buff, + (uchar*) min_key->key, min_key->length, + (HA_KEYSEG**) 0); + res= rtree_estimate(info, inx, key_buff, start_key_len, + myisam_read_vec[min_key->flag]); + res= res ? res : 1; /* Don't return 0 */ + break; + } case HA_KEY_ALG_BTREE: default: - start_pos= (start_key ? - _mi_record_pos(info,start_key,start_key_len,start_search_flag) : - (ha_rows) 0); - end_pos= (end_key ? - _mi_record_pos(info,end_key,end_key_len,end_search_flag) : - info->state->records+ (ha_rows) 1); - res=end_pos < start_pos ? (ha_rows) 0 : - (end_pos == start_pos ? (ha_rows) 1 : end_pos-start_pos); + start_pos= (min_key ? + _mi_record_pos(info, min_key->key, min_key->length, + min_key->flag) : + (ha_rows) 0); + end_pos= (max_key ? + _mi_record_pos(info, max_key->key, max_key->length, + max_key->flag) : + info->state->records+ (ha_rows) 1); + res= (end_pos < start_pos ? (ha_rows) 0 : + (end_pos == start_pos ? (ha_rows) 1 : end_pos-start_pos)); if (start_pos == HA_POS_ERROR || end_pos == HA_POS_ERROR) res=HA_POS_ERROR; } diff --git a/myisam/mi_test2.c b/myisam/mi_test2.c index d3c3cc2c492..56d8357536a 100644 --- a/myisam/mi_test2.c +++ b/myisam/mi_test2.c @@ -606,13 +606,20 @@ int main(int argc, char *argv[]) mi_status(file,&info,HA_STATUS_VARIABLE); for (i=0 ; i < info.keys ; i++) { + key_range min_key, max_key; if (mi_rfirst(file,read_record,(int) i) || mi_rlast(file,read_record2,(int) i)) goto err; copy_key(file,(uint) i,(uchar*) read_record,(uchar*) key); copy_key(file,(uint) i,(uchar*) read_record2,(uchar*) key2); - range_records=mi_records_in_range(file,(int) i,key,0,HA_READ_KEY_EXACT, - key2,0,HA_READ_AFTER_KEY); + min_key.key= key; + min_key.length= USE_WHOLE_KEY; + min_key.flag= HA_READ_KEY_EXACT; + max_key.key= key2; + max_key.length= USE_WHOLE_KEY; + max_key.flag= HA_READ_AFTER_KEY; + + range_records= mi_records_in_range(file,(int) i, &min_key, &max_key); if (range_records < info.records*8/10 || range_records > info.records*12/10) { @@ -634,12 +641,19 @@ int main(int argc, char *argv[]) for (k=rnd(1000)+1 ; k>0 && key1[k] == 0 ; k--) ; if (j != 0 && k != 0) { + key_range min_key, max_key; if (j > k) swap(int,j,k); sprintf(key,"%6d",j); sprintf(key2,"%6d",k); - range_records=mi_records_in_range(file,0,key,0,HA_READ_AFTER_KEY, - key2,0,HA_READ_BEFORE_KEY); + + min_key.key= key; + min_key.length= USE_WHOLE_KEY; + min_key.flag= HA_READ_AFTER_KEY; + max_key.key= key2; + max_key.length= USE_WHOLE_KEY; + max_key.flag= HA_READ_BEFORE_KEY; + range_records= mi_records_in_range(file, 0, &min_key, &max_key); records=0; for (j++ ; j < k ; j++) records+=key1[j]; diff --git a/myisam/rt_test.c b/myisam/rt_test.c index bbeb8fce2d1..c1126c1939a 100644 --- a/myisam/rt_test.c +++ b/myisam/rt_test.c @@ -39,7 +39,6 @@ int main(int argc __attribute__((unused)),char *argv[] __attribute__((unused))) } - int run_test(const char *filename) { MI_INFO *file; @@ -48,6 +47,7 @@ int run_test(const char *filename) MI_COLUMNDEF recinfo[20]; MI_KEYDEF keyinfo[20]; HA_KEYSEG keyseg[20]; + key_range range; int silent=0; int opt_unique=0; @@ -66,15 +66,12 @@ int run_test(const char *filename) int upd= 10; ha_rows hrows; - - /* Define a column for NULLs and DEL markers*/ recinfo[0].type=FIELD_NORMAL; recinfo[0].length=1; /* For NULL bits */ rec_length=1; - /* Define 2*ndims columns for coordinates*/ for (i=1; i<=2*ndims ;i++){ @@ -83,7 +80,6 @@ int run_test(const char *filename) rec_length+=key_length; } - /* Define a key with 2*ndims segments */ keyinfo[0].seg=keyseg; @@ -101,8 +97,7 @@ int run_test(const char *filename) keyinfo[0].seg[i].language=default_charset_info->number; } - - if(!silent) + if (!silent) printf("- Creating isam-file\n"); bzero((char*) &create_info,sizeof(create_info)); @@ -115,15 +110,11 @@ int run_test(const char *filename) recinfo,uniques,&uniquedef,&create_info,create_flag)) goto err; - - - - if(!silent) + if (!silent) printf("- Open isam-file\n"); if (!(file=mi_open(filename,2,HA_OPEN_ABORT_IF_LOCKED))) goto err; - if (!silent) printf("- Writing key:s\n"); @@ -144,11 +135,9 @@ int run_test(const char *filename) } } - - if((error=read_with_pos(file,silent))) + if ((error=read_with_pos(file,silent))) goto err; - if (!silent) printf("- Reading rows with key\n"); @@ -160,12 +149,12 @@ int run_test(const char *filename) bzero((char*) read_record,MAX_REC_LENGTH); error=mi_rkey(file,read_record,0,record+1,0,HA_READ_MBR_EQUAL); - if(error && error!=HA_ERR_KEY_NOT_FOUND) + if (error && error!=HA_ERR_KEY_NOT_FOUND) { printf(" mi_rkey: %3d errno: %3d\n",error,my_errno); goto err; } - if(error == HA_ERR_KEY_NOT_FOUND) + if (error == HA_ERR_KEY_NOT_FOUND) { print_record(record,mi_position(file)," NOT FOUND\n"); continue; @@ -173,10 +162,6 @@ int run_test(const char *filename) print_record(read_record,mi_position(file),"\n"); } - - - - if (!silent) printf("- Deleting rows\n"); for (i=0; i < nrecords/4; i++) @@ -184,7 +169,7 @@ int run_test(const char *filename) my_errno=0; bzero((char*) read_record,MAX_REC_LENGTH); error=mi_rrnd(file,read_record,i == 0 ? 0L : HA_OFFSET_ERROR); - if(error) + if (error) { printf("pos: %2d mi_rrnd: %3d errno: %3d\n",i,error,my_errno); goto err; @@ -192,14 +177,13 @@ int run_test(const char *filename) print_record(read_record,mi_position(file),"\n"); error=mi_delete(file,read_record); - if(error) + if (error) { printf("pos: %2d mi_delete: %3d errno: %3d\n",i,error,my_errno); goto err; } } - if (!silent) printf("- Updating rows with position\n"); for (i=0; i < (nrecords - nrecords/4) ; i++) @@ -207,9 +191,9 @@ int run_test(const char *filename) my_errno=0; bzero((char*) read_record,MAX_REC_LENGTH); error=mi_rrnd(file,read_record,i == 0 ? 0L : HA_OFFSET_ERROR); - if(error) + if (error) { - if(error==HA_ERR_RECORD_DELETED) + if (error==HA_ERR_RECORD_DELETED) continue; printf("pos: %2d mi_rrnd: %3d errno: %3d\n",i,error,my_errno); goto err; @@ -219,19 +203,16 @@ int run_test(const char *filename) printf("\t-> "); print_record(record,mi_position(file),"\n"); error=mi_update(file,read_record,record); - if(error) + if (error) { printf("pos: %2d mi_update: %3d errno: %3d\n",i,error,my_errno); goto err; } } - - if((error=read_with_pos(file,silent))) + if ((error=read_with_pos(file,silent))) goto err; - - if (!silent) printf("- Test mi_rkey then a sequence of mi_rnext_same\n"); @@ -246,25 +227,20 @@ int run_test(const char *filename) print_record(read_record,mi_position(file)," mi_rkey\n"); row_count=1; - - do { - if((error=mi_rnext_same(file,read_record))) + for (;;) + { + if ((error=mi_rnext_same(file,read_record))) { - if(error==HA_ERR_END_OF_FILE) + if (error==HA_ERR_END_OF_FILE) break; printf("mi_next: %3d errno: %3d\n",error,my_errno); goto err; } print_record(read_record,mi_position(file)," mi_rnext_same\n"); row_count++; - }while(1); + } printf(" %d rows\n",row_count); - - - - - if (!silent) printf("- Test mi_rfirst then a sequence of mi_rnext\n"); @@ -277,10 +253,11 @@ int run_test(const char *filename) row_count=1; print_record(read_record,mi_position(file)," mi_frirst\n"); - for(i=0;i "); print_record(record,mi_position(file),"\n"); error=mi_update(file,read_record,record); - if(error) + if (error) { printf("pos: %2d mi_update: %3d errno: %3d\n",i,error,my_errno); goto err; } } - - - if((error=read_with_pos(file,silent))) + if ((error=read_with_pos(file,silent))) goto err; - - if (!silent) printf("- Test mi_rkey then a sequence of mi_rnext_same\n"); @@ -219,25 +204,20 @@ int run_test(const char *filename) print_record(read_record,mi_position(file)," mi_rkey\n"); row_count=1; - - do { - if((error=mi_rnext_same(file,read_record))) + for (;;) + { + if ((error=mi_rnext_same(file,read_record))) { - if(error==HA_ERR_END_OF_FILE) + if (error==HA_ERR_END_OF_FILE) break; printf("mi_next: %3d errno: %3d\n",error,my_errno); goto err; } print_record(read_record,mi_position(file)," mi_rnext_same\n"); row_count++; - }while(1); + } printf(" %d rows\n",row_count); - - - - - if (!silent) printf("- Test mi_rfirst then a sequence of mi_rnext\n"); @@ -251,9 +231,9 @@ int run_test(const char *filename) print_record(read_record,mi_position(file)," mi_frirst\n"); for(i=0;i "); @@ -360,7 +339,6 @@ static void print_record(char * record, my_off_t offs,const char * tail) } - #ifdef NOT_USED static void create_point(char *record,uint rownr) { @@ -447,7 +425,6 @@ static void print_key(const char *key,const char * tail) } - #ifdef NOT_USED static int rtree_CreatePointWKB(double *ords, uint n_dims, uchar *wkb) @@ -489,6 +466,7 @@ static int rtree_CreateLineStringWKB(double *ords, uint n_dims, uint n_points, return 9 + n_points * n_dims * 8; } + static void rtree_PrintWKB(uchar *wkb, uint n_dims) { uint wkb_type; diff --git a/myisammrg/myrg_range.c b/myisammrg/myrg_range.c index 7644ae40c7b..aafdf70525c 100644 --- a/myisammrg/myrg_range.c +++ b/myisammrg/myrg_range.c @@ -16,20 +16,15 @@ #include "myrg_def.h" -ha_rows myrg_records_in_range(MYRG_INFO *info, int inx, const byte *start_key, - uint start_key_len, - enum ha_rkey_function start_search_flag, - const byte *end_key, uint end_key_len, - enum ha_rkey_function end_search_flag) +ha_rows myrg_records_in_range(MYRG_INFO *info, int inx, + key_range *min_key, key_range *max_key) { ha_rows records=0, res; MYRG_TABLE *table; for (table=info->open_tables ; table != info->end_table ; table++) { - res=mi_records_in_range(table->table, inx, - start_key, start_key_len, start_search_flag, - end_key, end_key_len, end_search_flag); + res= mi_records_in_range(table->table, inx, min_key, max_key); if (res == HA_POS_ERROR) return HA_POS_ERROR; if (records > HA_POS_ERROR - res) diff --git a/mysys/my_bitmap.c b/mysys/my_bitmap.c index da16457c299..0f8984e6b3d 100644 --- a/mysys/my_bitmap.c +++ b/mysys/my_bitmap.c @@ -104,7 +104,7 @@ void bitmap_set_bit(MY_BITMAP *map, uint bitmap_bit) { DBUG_ASSERT(map->bitmap && bitmap_bit < map->bitmap_size*8); bitmap_lock(map); - map->bitmap[bitmap_bit / 8] |= (1 << (bitmap_bit & 7)); + bitmap_fast_set_bit(map, bitmap_bit); bitmap_unlock(map); } @@ -144,7 +144,7 @@ void bitmap_clear_bit(MY_BITMAP *map, uint bitmap_bit) { DBUG_ASSERT(map->bitmap && bitmap_bit < map->bitmap_size*8); bitmap_lock(map); - map->bitmap[bitmap_bit / 8] &= ~ (1 << (bitmap_bit & 7)); + bitmap_fast_clear_bit(map, bitmap_bit); bitmap_unlock(map); } @@ -220,7 +220,7 @@ my_bool bitmap_is_set_all(const MY_BITMAP *map) my_bool bitmap_is_set(const MY_BITMAP *map, uint bitmap_bit) { DBUG_ASSERT(map->bitmap && bitmap_bit < map->bitmap_size*8); - return map->bitmap[bitmap_bit / 8] & (1 << (bitmap_bit & 7)); + return bitmap_fast_is_set(map, bitmap_bit); } diff --git a/sql/examples/ha_example.cc b/sql/examples/ha_example.cc index b8ae5967475..2d17caf1a83 100644 --- a/sql/examples/ha_example.cc +++ b/sql/examples/ha_example.cc @@ -625,14 +625,11 @@ int ha_example::rename_table(const char * from, const char * to) Called from opt_range.cc by check_quick_keys(). */ -ha_rows ha_example::records_in_range(int inx, - const byte *start_key,uint start_key_len, - enum ha_rkey_function start_search_flag, - const byte *end_key,uint end_key_len, - enum ha_rkey_function end_search_flag) +ha_rows ha_example::records_in_range(uint inx, key_range *min_key, + key_range *max_key) { - DBUG_ENTER("ha_example::records_in_range "); - DBUG_RETURN(records); + DBUG_ENTER("ha_example::records_in_range"); + DBUG_RETURN(10); // low number to force index usage } diff --git a/sql/field.cc b/sql/field.cc index edaa29dbaa0..1ad7e039363 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -4252,12 +4252,13 @@ int Field_string::cmp(const char *a_ptr, const char *b_ptr) like in latin_de 'ae' and 0xe4 */ return field_charset->coll->strnncollsp(field_charset, - (const uchar*) a_ptr, field_length, - (const uchar*) b_ptr, field_length); + (const uchar*) a_ptr, field_length, + (const uchar*) b_ptr, + field_length); } return field_charset->coll->strnncoll(field_charset, - (const uchar*) a_ptr, field_length, - (const uchar*) b_ptr, field_length); + (const uchar*) a_ptr, field_length, + (const uchar*) b_ptr, field_length); } void Field_string::sort_string(char *to,uint length) diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc index 593b9575fb6..4dde893116f 100644 --- a/sql/ha_berkeley.cc +++ b/sql/ha_berkeley.cc @@ -1542,7 +1542,7 @@ int ha_berkeley::index_next_same(byte * buf, const byte *key, uint keylen) { error=read_row(cursor->c_get(cursor, &last_key, &row, DB_NEXT), (char*) buf, active_index, &row, &last_key, 1); - if (!error && ::key_cmp(table, key, active_index, keylen)) + if (!error && ::key_cmp_if_same(table, key, active_index, keylen)) error=HA_ERR_END_OF_FILE; } DBUG_RETURN(error); @@ -1987,11 +1987,8 @@ double ha_berkeley::scan_time() return rows2double(records/3); } -ha_rows ha_berkeley::records_in_range(int keynr, - const byte *start_key,uint start_key_len, - enum ha_rkey_function start_search_flag, - const byte *end_key,uint end_key_len, - enum ha_rkey_function end_search_flag) +ha_rows ha_berkeley::records_in_range(uint keynr, key_range *start_key, + key_range *end_key) { DBT key; DB_KEY_RANGE start_range, end_range; @@ -2000,25 +1997,27 @@ ha_rows ha_berkeley::records_in_range(int keynr, DBUG_ENTER("records_in_range"); if ((start_key && kfile->key_range(kfile,transaction, - pack_key(&key, keynr, key_buff, start_key, - start_key_len), - &start_range,0)) || + pack_key(&key, keynr, key_buff, + start_key->key, + start_key->length), + &start_range,0)) || (end_key && kfile->key_range(kfile,transaction, - pack_key(&key, keynr, key_buff, end_key, - end_key_len), + pack_key(&key, keynr, key_buff, + end_key->key, + end_key->length), &end_range,0))) DBUG_RETURN(HA_BERKELEY_RANGE_COUNT); // Better than returning an error /* purecov: inspected */ if (!start_key) - start_pos=0.0; - else if (start_search_flag == HA_READ_KEY_EXACT) + start_pos= 0.0; + else if (start_key->flag == HA_READ_KEY_EXACT) start_pos=start_range.less; else start_pos=start_range.less+start_range.equal; if (!end_key) - end_pos=1.0; - else if (end_search_flag == HA_READ_BEFORE_KEY) + end_pos= 1.0; + else if (end_key->flag == HA_READ_BEFORE_KEY) end_pos=end_range.less; else end_pos=end_range.less+end_range.equal; diff --git a/sql/ha_berkeley.h b/sql/ha_berkeley.h index 88af2326eac..4bc8e3a5777 100644 --- a/sql/ha_berkeley.h +++ b/sql/ha_berkeley.h @@ -143,12 +143,7 @@ class ha_berkeley: public handler int optimize(THD* thd, HA_CHECK_OPT* check_opt); int check(THD* thd, HA_CHECK_OPT* check_opt); - ha_rows records_in_range(int inx, - const byte *start_key,uint start_key_len, - enum ha_rkey_function start_search_flag, - const byte *end_key,uint end_key_len, - enum ha_rkey_function end_search_flag); - + ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key); int create(const char *name, register TABLE *form, HA_CREATE_INFO *create_info); int delete_table(const char *name); diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc index 12b922e6fc0..9915dc90dc1 100644 --- a/sql/ha_heap.cc +++ b/sql/ha_heap.cc @@ -363,28 +363,20 @@ int ha_heap::rename_table(const char * from, const char * to) return heap_rename(from,to); } -ha_rows ha_heap::records_in_range(int inx, - const byte *start_key,uint start_key_len, - enum ha_rkey_function start_search_flag, - const byte *end_key,uint end_key_len, - enum ha_rkey_function end_search_flag) + +ha_rows ha_heap::records_in_range(uint inx, key_range *min_key, + key_range *max_key) { - KEY *pos=table->key_info+inx; - if (pos->algorithm == HA_KEY_ALG_BTREE) - { - return hp_rb_records_in_range(file, inx, start_key, start_key_len, - start_search_flag, end_key, end_key_len, - end_search_flag); - } - else - { - if (start_key_len != end_key_len || - start_key_len != pos->key_length || - start_search_flag != HA_READ_KEY_EXACT || - end_search_flag != HA_READ_AFTER_KEY) - return HA_POS_ERROR; // Can't only use exact keys - return 10; // Good guess - } + KEY *key=table->key_info+inx; + if (key->algorithm == HA_KEY_ALG_BTREE) + return hp_rb_records_in_range(file, inx, min_key, max_key); + + if (min_key->length != max_key->length || + min_key->length != key->key_length || + min_key->flag != HA_READ_KEY_EXACT || + max_key->flag != HA_READ_AFTER_KEY) + return HA_POS_ERROR; // Can't only use exact keys + return 10; // Good guess } diff --git a/sql/ha_heap.h b/sql/ha_heap.h index 2f849d2574b..f55eda91149 100644 --- a/sql/ha_heap.h +++ b/sql/ha_heap.h @@ -86,10 +86,7 @@ class ha_heap: public handler int disable_indexes(uint mode); int enable_indexes(uint mode); int indexes_are_disabled(void); - ha_rows records_in_range(int inx, const byte *start_key,uint start_key_len, - enum ha_rkey_function start_search_flag, - const byte *end_key,uint end_key_len, - enum ha_rkey_function end_search_flag); + ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key); int delete_table(const char *from); int rename_table(const char * from, const char * to); int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info); diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 201ec8f183f..ff491a95043 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -3925,18 +3925,11 @@ ha_innobase::records_in_range( /*==========================*/ /* out: estimated number of rows */ - int keynr, /* in: index number */ - const mysql_byte* start_key, /* in: start key value of the - range, may also be empty */ - uint start_key_len, /* in: start key val len, may - also be 0 */ - enum ha_rkey_function start_search_flag,/* in: start search condition - e.g., 'greater than' */ - const mysql_byte* end_key, /* in: range end key val, may - also be empty */ - uint end_key_len, /* in: range end key val len, - may also be 0 */ - enum ha_rkey_function end_search_flag)/* in: range end search cond */ + uint keynr, /* in: index number */ + key_range *min_key, /* in: start key value of the + range, may also be 0 */ + key_range *max_key) /* in: range end key val, may + also be 0 */ { row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; KEY* key; @@ -3957,12 +3950,6 @@ ha_innobase::records_in_range( DBUG_ENTER("records_in_range"); - /* We do not know if MySQL can call this function before calling - external_lock(). To be safe, update the thd of the current table - handle. */ - - update_thd(current_thd); - prebuilt->trx->op_info = (char*)"estimating records in index range"; /* In case MySQL calls this in the middle of a SELECT query, release @@ -3986,17 +3973,21 @@ ha_innobase::records_in_range( range_start, (byte*) key_val_buff, (ulint)upd_and_key_val_buff_len, index, - (byte*) start_key, - (ulint) start_key_len); + (byte*) (min_key ? min_key->key : + (const mysql_byte*) 0), + (ulint) (min_key ? min_key->length : 0)); row_sel_convert_mysql_key_to_innobase( range_end, (byte*) key_val_buff2, buff2_len, index, - (byte*) end_key, - (ulint) end_key_len); + (byte*) (max_key ? max_key->key : + (const mysql_byte*) 0), + (ulint) (max_key ? max_key->length : 0)); - mode1 = convert_search_mode_to_innobase(start_search_flag); - mode2 = convert_search_mode_to_innobase(end_search_flag); + mode1 = convert_search_mode_to_innobase(min_key ? min_key->flag : + HA_READ_KEY_EXACT); + mode2 = convert_search_mode_to_innobase(max_key ? max_key->flag : + HA_READ_KEY_EXACT); n_rows = btr_estimate_n_rows_in_range(index, range_start, mode1, range_end, mode2); diff --git a/sql/ha_innodb.h b/sql/ha_innodb.h index 83a3edc4126..c585fd9c463 100644 --- a/sql/ha_innodb.h +++ b/sql/ha_innodb.h @@ -166,11 +166,7 @@ class ha_innobase: public handler int start_stmt(THD *thd); void position(byte *record); - ha_rows records_in_range(int inx, - const byte *start_key,uint start_key_len, - enum ha_rkey_function start_search_flag, - const byte *end_key,uint end_key_len, - enum ha_rkey_function end_search_flag); + ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key); ha_rows estimate_number_of_rows(); int create(const char *name, register TABLE *form, diff --git a/sql/ha_isam.cc b/sql/ha_isam.cc index 09c2aeceafc..85ab25a31d9 100644 --- a/sql/ha_isam.cc +++ b/sql/ha_isam.cc @@ -382,18 +382,21 @@ int ha_isam::create(const char *name, register TABLE *form, } +static key_range no_range= { (byte*) 0, 0, HA_READ_KEY_EXACT }; -ha_rows ha_isam::records_in_range(int inx, - const byte *start_key,uint start_key_len, - enum ha_rkey_function start_search_flag, - const byte *end_key,uint end_key_len, - enum ha_rkey_function end_search_flag) +ha_rows ha_isam::records_in_range(uint inx, key_range *min_key, + key_range *max_key) { + /* ISAM checks if 'key' pointer <> 0 to know if there is no range */ + if (!min_key) + min_key= &no_range; + if (!max_key) + max_key= &no_range; return (ha_rows) nisam_records_in_range(file, - inx, - start_key,start_key_len, - start_search_flag, - end_key,end_key_len, - end_search_flag); + (int) inx, + min_key->key, min_key->length, + min_key->flag, + max_key->key, max_key->length, + max_key->flag); } #endif /* HAVE_ISAM */ diff --git a/sql/ha_isam.h b/sql/ha_isam.h index 2c8ec274145..8a887ababde 100644 --- a/sql/ha_isam.h +++ b/sql/ha_isam.h @@ -70,11 +70,7 @@ class ha_isam: public handler void info(uint); int extra(enum ha_extra_function operation); int external_lock(THD *thd, int lock_type); - ha_rows records_in_range(int inx, - const byte *start_key,uint start_key_len, - enum ha_rkey_function start_search_flag, - const byte *end_key,uint end_key_len, - enum ha_rkey_function end_search_flag); + ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key); int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info); THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index 1b24633953d..feac5c51dce 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -1515,19 +1515,15 @@ longlong ha_myisam::get_auto_increment() SYNOPSIS records_in_range() inx Index to use - start_key Start of range. Null pointer if from first key - start_key_len Length of start key - start_search_flag Flag if start key should be included or not - end_key End of range. Null pointer if to last key - end_key_len Length of end key - end_search_flag Flag if start key should be included or not + min_key Start of range. Null pointer if from first key + max_key End of range. Null pointer if to last key NOTES - start_search_flag can have one of the following values: + min_key.flag can have one of the following values: HA_READ_KEY_EXACT Include the key in the range HA_READ_AFTER_KEY Don't include key in range - end_search_flag can have one of the following values: + max_key.flag can have one of the following values: HA_READ_BEFORE_KEY Don't include key in range HA_READ_AFTER_KEY Include all 'end_key' values in the range @@ -1538,18 +1534,10 @@ longlong ha_myisam::get_auto_increment() the range. */ -ha_rows ha_myisam::records_in_range(int inx, - const byte *start_key,uint start_key_len, - enum ha_rkey_function start_search_flag, - const byte *end_key,uint end_key_len, - enum ha_rkey_function end_search_flag) +ha_rows ha_myisam::records_in_range(uint inx, key_range *min_key, + key_range *max_key) { - return (ha_rows) mi_records_in_range(file, - inx, - start_key,start_key_len, - start_search_flag, - end_key,end_key_len, - end_search_flag); + return (ha_rows) mi_records_in_range(file, (int) inx, min_key, max_key); } diff --git a/sql/ha_myisam.h b/sql/ha_myisam.h index 206a1c62a2f..77887220903 100644 --- a/sql/ha_myisam.h +++ b/sql/ha_myisam.h @@ -110,11 +110,7 @@ class ha_myisam: public handler int indexes_are_disabled(void); void start_bulk_insert(ha_rows rows); int end_bulk_insert(); - ha_rows records_in_range(int inx, - const byte *start_key,uint start_key_len, - enum ha_rkey_function start_search_flag, - const byte *end_key,uint end_key_len, - enum ha_rkey_function end_search_flag); + ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key); void update_create_info(HA_CREATE_INFO *create_info); int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info); THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, diff --git a/sql/ha_myisammrg.cc b/sql/ha_myisammrg.cc index 041d9eaead3..9aa6d039efb 100644 --- a/sql/ha_myisammrg.cc +++ b/sql/ha_myisammrg.cc @@ -199,20 +199,14 @@ void ha_myisammrg::position(const byte *record) ha_store_ptr(ref, ref_length, (my_off_t) position); } -ha_rows ha_myisammrg::records_in_range(int inx, - const byte *start_key,uint start_key_len, - enum ha_rkey_function start_search_flag, - const byte *end_key,uint end_key_len, - enum ha_rkey_function end_search_flag) + +ha_rows ha_myisammrg::records_in_range(uint inx, key_range *min_key, + key_range *max_key) { - return (ha_rows) myrg_records_in_range(file, - inx, - start_key,start_key_len, - start_search_flag, - end_key,end_key_len, - end_search_flag); + return (ha_rows) myrg_records_in_range(file, (int) inx, min_key, max_key); } + void ha_myisammrg::info(uint flag) { MYMERGE_INFO info; diff --git a/sql/ha_myisammrg.h b/sql/ha_myisammrg.h index c0f81a77a1e..fd36c78202d 100644 --- a/sql/ha_myisammrg.h +++ b/sql/ha_myisammrg.h @@ -70,11 +70,7 @@ class ha_myisammrg: public handler int rnd_next(byte *buf); int rnd_pos(byte * buf, byte *pos); void position(const byte *record); - ha_rows records_in_range(int inx, - const byte *start_key,uint start_key_len, - enum ha_rkey_function start_search_flag, - const byte *end_key,uint end_key_len, - enum ha_rkey_function end_search_flag); + ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key); my_off_t row_position() { return myrg_position(file); } void info(uint); int extra(enum ha_extra_function operation); diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 3bc322878d1..21056ef4a8f 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -2748,22 +2748,19 @@ void ha_ndbcluster::set_dbname(const char *path_name) ha_rows -ha_ndbcluster::records_in_range(int inx, - const byte *start_key,uint start_key_len, - enum ha_rkey_function start_search_flag, - const byte *end_key,uint end_key_len, - enum ha_rkey_function end_search_flag) +ha_ndbcluster::records_in_range(uint inx, key_range *min_key, + key_range *max_key) { - ha_rows records= 10; - KEY* key_info= table->key_info + inx; + ha_rows records= 10; /* Good guess when you don't know anything */ + KEY *key_info= table->key_info + inx; uint key_length= key_info->key_length; DBUG_ENTER("records_in_range"); - DBUG_PRINT("enter", ("inx: %d", inx)); - DBUG_PRINT("enter", ("start_key: %x, start_key_len: %d", start_key, start_key_len)); - DBUG_PRINT("enter", ("start_search_flag: %d", start_search_flag)); - DBUG_PRINT("enter", ("end_key: %x, end_key_len: %d", end_key, end_key_len)); - DBUG_PRINT("enter", ("end_search_flag: %d", end_search_flag)); + DBUG_PRINT("enter", ("inx: %u", inx)); + DBUG_DUMP("start_key", min_key->key, min_key->length); + DBUG_DUMP("end_key", max_key->key, max_key->length); + DBUG_PRINT("enter", ("start_search_flag: %u end_search_flag: %u", + min_key->flag, max_key->flag)); /* Check that start_key_len is equal to @@ -2772,7 +2769,7 @@ ha_ndbcluster::records_in_range(int inx, */ NDB_INDEX_TYPE idx_type= get_index_type(inx); if ((idx_type == UNIQUE_INDEX || idx_type == PRIMARY_KEY_INDEX) && - start_key_len < key_length) + min_key->length < key_length) { DBUG_PRINT("warning", ("Tried to use index which required" "full key length: %d, HA_POS_ERROR", diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h index bd601f39fc4..029ebc11e46 100644 --- a/sql/ha_ndbcluster.h +++ b/sql/ha_ndbcluster.h @@ -121,12 +121,7 @@ class ha_ndbcluster: public handler } double scan_time(); - ha_rows records_in_range(int inx, - const byte *start_key,uint start_key_len, - enum ha_rkey_function start_search_flag, - const byte *end_key,uint end_key_len, - enum ha_rkey_function end_search_flag); - + ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key); static Ndb* seize_ndb(); static void release_ndb(Ndb* ndb); diff --git a/sql/handler.cc b/sql/handler.cc index 7374242ebf8..f8eca1b93ef 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -1184,7 +1184,7 @@ int handler::index_next_same(byte *buf, const byte *key, uint keylen) int error; if (!(error=index_next(buf))) { - if (key_cmp(table, key, active_index, keylen)) + if (key_cmp_if_same(table, key, active_index, keylen)) { table->status=STATUS_NOT_FOUND; error=HA_ERR_END_OF_FILE; @@ -1388,6 +1388,7 @@ int ha_discover(const char* dbname, const char* name, read_range_first() start_key Start key. Is 0 if no min range end_key End key. Is 0 if no max range + eq_range_arg Set to 1 if start_key == end_key sorted Set to 1 if result should be sorted per key NOTES @@ -1401,11 +1402,12 @@ int ha_discover(const char* dbname, const char* name, int handler::read_range_first(const key_range *start_key, const key_range *end_key, - bool sorted) + bool eq_range_arg, bool sorted) { int result; DBUG_ENTER("handler::read_range_first"); + eq_range= eq_range_arg; end_range= 0; if (end_key) { @@ -1416,7 +1418,6 @@ int handler::read_range_first(const key_range *start_key, } range_key_part= table->key_info[active_index].key_part; - if (!start_key) // Read first record result= index_first(table->record[0]); else @@ -1438,7 +1439,6 @@ int handler::read_range_first(const key_range *start_key, SYNOPSIS read_range_next() - eq_range Set to 1 if start_key == end_key NOTES Record is read into table->record[0] @@ -1449,17 +1449,19 @@ int handler::read_range_first(const key_range *start_key, # Error code */ -int handler::read_range_next(bool eq_range) +int handler::read_range_next() { int result; DBUG_ENTER("handler::read_range_next"); if (eq_range) - result= index_next_same(table->record[0], - end_range->key, - end_range->length); - else - result= index_next(table->record[0]); + { + /* We trust that index_next_same always gives a row in range */ + DBUG_RETURN(index_next_same(table->record[0], + end_range->key, + end_range->length)); + } + result= index_next(table->record[0]); if (result) DBUG_RETURN(result); DBUG_RETURN(compare_key(end_range) <= 0 ? 0 : HA_ERR_END_OF_FILE); @@ -1467,16 +1469,18 @@ int handler::read_range_next(bool eq_range) /* - Compare if found key is over max-value + Compare if found key (in row) is over max-value SYNOPSIS compare_key - range key to compare to row + range range to compare to row. May be 0 for no range NOTES - For this to work, the row must be stored in table->record[0] + See key.cc::key_cmp() for details RETURN + The return value is SIGN(key_in_row - range_key): + 0 Key is equal to range or 'range' == 0 (no range) -1 Key is less than range 1 Key is larger than range @@ -1484,37 +1488,11 @@ int handler::read_range_next(bool eq_range) int handler::compare_key(key_range *range) { - KEY_PART_INFO *key_part= range_key_part; - uint store_length; - + int cmp; if (!range) return 0; // No max range - - for (const char *key= (const char*) range->key, *end=key+range->length; - key < end; - key+= store_length, key_part++) - { - int cmp; - store_length= key_part->store_length; - if (key_part->null_bit) - { - if (*key) - { - if (!key_part->field->is_null()) - return 1; - continue; - } - else if (key_part->field->is_null()) - return 0; - key++; // Skip null byte - store_length--; - } - if ((cmp=key_part->field->key_cmp((byte*) key, key_part->length)) < 0) - return -1; - if (cmp > 0) - return 1; - } - return key_compare_result_on_equal; + cmp= key_cmp(range_key_part, range->key, range->length); + if (!cmp) + cmp= key_compare_result_on_equal; + return cmp; } - - diff --git a/sql/handler.h b/sql/handler.h index 4f721a01412..bbeefa7c916 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -234,14 +234,6 @@ typedef struct st_ha_check_opt } HA_CHECK_OPT; -typedef struct st_key_range -{ - const byte *key; - uint length; - enum ha_rkey_function flag; -} key_range; - - class handler :public Sql_alloc { protected: @@ -268,6 +260,7 @@ public: key_range save_end_range, *end_range; KEY_PART_INFO *range_key_part; int key_compare_result_on_equal; + bool eq_range; uint errkey; /* Last dup key */ uint sortkey, key_used_on_scan; @@ -330,13 +323,14 @@ public: return (my_errno=HA_ERR_WRONG_COMMAND); } virtual int read_range_first(const key_range *start_key, - const key_range *end_key, - bool sorted); - virtual int read_range_next(bool eq_range); + const key_range *end_key, + bool eq_range, bool sorted); + virtual int read_range_next(); int compare_key(key_range *range); virtual int ft_init() { return -1; } - virtual FT_INFO *ft_init_ext(uint flags,uint inx,const byte *key, uint keylen) + virtual FT_INFO *ft_init_ext(uint flags,uint inx,const byte *key, + uint keylen) { return NULL; } virtual int ft_read(byte *buf) { return -1; } virtual int rnd_init(bool scan=1)=0; @@ -345,11 +339,8 @@ public: virtual int rnd_pos(byte * buf, byte *pos)=0; virtual int read_first_row(byte *buf, uint primary_key); virtual int restart_rnd_next(byte *buf, byte *pos); - virtual ha_rows records_in_range(int inx, - const byte *start_key,uint start_key_len, - enum ha_rkey_function start_search_flag, - const byte *end_key,uint end_key_len, - enum ha_rkey_function end_search_flag) + virtual ha_rows records_in_range(uint inx, key_range *min_key, + key_range *max_key) { return (ha_rows) 10; } virtual void position(const byte *record)=0; virtual my_off_t row_position() { return HA_OFFSET_ERROR; } diff --git a/sql/key.cc b/sql/key.cc index a2c3b2c8989..9425a368669 100644 --- a/sql/key.cc +++ b/sql/key.cc @@ -156,9 +156,28 @@ void key_restore(TABLE *table,byte *key,uint idx,uint key_length) } /* key_restore */ - /* Compare if a key has changed */ +/* + Compare if a key has changed -int key_cmp(TABLE *table,const byte *key,uint idx,uint key_length) + SYNOPSIS + key_cmp_if_same() + table TABLE + key key to compare to row + idx Index used + key_length Length of key + + NOTES + In theory we could just call field->cmp() for all field types, + but as we are only interested if a key has changed (not if the key is + larger or smaller than the previous value) we can do things a bit + faster by using memcmp() instead. + + RETURN + 0 If key is equal + 1 Key has changed +*/ + +bool key_cmp_if_same(TABLE *table,const byte *key,uint idx,uint key_length) { uint length; KEY_PART_INFO *key_part; @@ -281,3 +300,56 @@ bool check_if_key_used(TABLE *table, uint idx, List &fields) return check_if_key_used(table, table->primary_key, fields); return 0; } + + +/* + Compare key in row to a given key + + SYNOPSIS + key_cmp() + key_part Key part handler + key Key to compare to value in table->record[0] + key_length length of 'key' + + RETURN + The return value is SIGN(key_in_row - range_key): + + 0 Key is equal to range or 'range' == 0 (no range) + -1 Key is less than range + 1 Key is larger than range +*/ + +int key_cmp(KEY_PART_INFO *key_part, const byte *key, uint key_length) +{ + uint store_length; + + for (const byte *end=key + key_length; + key < end; + key+= store_length, key_part++) + { + int cmp; + store_length= key_part->store_length; + if (key_part->null_bit) + { + /* This key part allows null values; NULL is lower than everything */ + register bool field_is_null= key_part->field->is_null(); + if (*key) // If range key is null + { + /* the range is expecting a null value */ + if (!field_is_null) + return 1; // Found key is > range + /* null -- exact match, go to next key part */ + continue; + } + else if (field_is_null) + return -1; // NULL is less than any value + key++; // Skip null byte + store_length--; + } + if ((cmp=key_part->field->key_cmp((byte*) key, key_part->length)) < 0) + return -1; + if (cmp > 0) + return 1; + } + return 0; // Keys are equal +} diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 8cae95e5070..14bd16332ef 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -754,11 +754,12 @@ void mysql_print_status(THD *thd); int find_ref_key(TABLE *form,Field *field, uint *offset); void key_copy(byte *key,TABLE *form,uint index,uint key_length); void key_restore(TABLE *form,byte *key,uint index,uint key_length); -int key_cmp(TABLE *form,const byte *key,uint index,uint key_length); +bool key_cmp_if_same(TABLE *form,const byte *key,uint index,uint key_length); void key_unpack(String *to,TABLE *form,uint index); bool check_if_key_used(TABLE *table, uint idx, List &fields); -bool init_errmessage(void); +int key_cmp(KEY_PART_INFO *key_part, const byte *key, uint key_length); +bool init_errmessage(void); void sql_perror(const char *message); void sql_print_error(const char *format,...) __attribute__ ((format (printf, 1, 2))); diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 1e7bf90738c..3cc64c35223 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -1800,8 +1800,8 @@ SEL_ARG * SEL_ARG::insert(SEL_ARG *key) { SEL_ARG *element,**par,*last_element; - LINT_INIT(par); LINT_INIT(last_element); + for (element= this; element != &null_element ; ) { last_element=element; @@ -2296,26 +2296,32 @@ check_quick_keys(PARAM *param,uint idx,SEL_ARG *key_tree, { if (tmp_min_flag & GEOM_FLAG) { - tmp= param->table->file-> - records_in_range((int) keynr, (byte*)(param->min_key), - min_key_length, - (ha_rkey_function)(tmp_min_flag ^ GEOM_FLAG), - (byte *)NullS, 0, HA_READ_KEY_EXACT); + key_range min_range; + min_range.key= (byte*) param->min_key; + min_range.length= min_key_length; + /* In this case tmp_min_flag contains the handler-read-function */ + min_range.flag= (ha_rkey_function) (tmp_min_flag ^ GEOM_FLAG); + + tmp= param->table->file->records_in_range(keynr, &min_range, + (key_range*) 0); } else { - tmp=param->table->file-> - records_in_range((int) keynr, - (byte*) (!min_key_length ? NullS : - param->min_key), - min_key_length, - tmp_min_flag & NEAR_MIN ? - HA_READ_AFTER_KEY : HA_READ_KEY_EXACT, - (byte*) (!max_key_length ? NullS : - param->max_key), - max_key_length, - (tmp_max_flag & NEAR_MAX ? - HA_READ_BEFORE_KEY : HA_READ_AFTER_KEY)); + key_range min_range, max_range; + + min_range.key= (byte*) param->min_key; + min_range.length= min_key_length; + min_range.flag= (tmp_min_flag & NEAR_MIN ? HA_READ_AFTER_KEY : + HA_READ_KEY_EXACT); + max_range.key= param->max_key; + max_range.length= max_key_length; + max_range.flag= (tmp_max_flag & NEAR_MAX ? + HA_READ_BEFORE_KEY : HA_READ_AFTER_KEY); + tmp=param->table->file->records_in_range(keynr, + (min_key_length ? &min_range : + (key_range*) 0), + (max_key_length ? &max_range : + (key_range*) 0)); } } end: @@ -2604,7 +2610,7 @@ int QUICK_SELECT::get_next() if (range) { // Already read through key - result= file->read_range_next(test(range->flag & EQ_RANGE)); + result= file->read_range_next(); if (result != HA_ERR_END_OF_FILE) DBUG_RETURN(result); } @@ -2628,6 +2634,7 @@ int QUICK_SELECT::get_next() result= file->read_range_first(range->min_length ? &start_key : 0, range->max_length ? &end_key : 0, + test(range->flag & EQ_RANGE), sorted); if (range->flag == (UNIQUE_RANGE | EQ_RANGE)) range=0; // Stop searching @@ -2815,40 +2822,14 @@ int QUICK_SELECT_DESC::get_next() int QUICK_SELECT_DESC::cmp_prev(QUICK_RANGE *range_arg) { + int cmp; if (range_arg->flag & NO_MIN_RANGE) return 0; /* key can't be to small */ - KEY_PART *key_part = key_parts; - uint store_length; - - for (char *key = range_arg->min_key, *end = key + range_arg->min_length; - key < end; - key += store_length, key_part++) - { - int cmp; - store_length= key_part->store_length; - if (key_part->null_bit) - { - // this key part allows null values; NULL is lower than everything else - if (*key) - { - // the range is expecting a null value - if (!key_part->field->is_null()) - return 0; // not null -- still inside the range - continue; // null -- exact match, go to next key part - } - else if (key_part->field->is_null()) - return 1; // null -- outside the range - key++; - store_length--; - } - if ((cmp = key_part->field->key_cmp((byte*) key, - key_part->length)) > 0) - return 0; - if (cmp < 0) - return 1; - } - return (range_arg->flag & NEAR_MIN) ? 1 : 0; // Exact match + cmp= key_cmp(key_part_info, range_arg->min_key, range_arg->min_length); + if (cmp > 0 || cmp == 0 && !(range_arg->flag & NEAR_MIN)) + return 0; + return 1; // outside of range } diff --git a/sql/opt_range.h b/sql/opt_range.h index 2df9d93e1ef..2072ded15d1 100644 --- a/sql/opt_range.h +++ b/sql/opt_range.h @@ -80,13 +80,18 @@ public: MEM_ROOT alloc; KEY_PART *key_parts; + KEY_PART_INFO *key_part_info; ha_rows records; double read_time; QUICK_SELECT(THD *thd, TABLE *table,uint index_arg,bool no_alloc=0); virtual ~QUICK_SELECT(); void reset(void) { next=0; it.rewind(); } - int init() { return error=file->index_init(index); } + int init() + { + key_part_info= head->key_info[index].key_part; + return error=file->index_init(index); + } virtual int get_next(); virtual bool reverse_sorted() { return 0; } bool unique_key_range(); diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc index 4fdcd093132..8c1cd9ce1cb 100644 --- a/sql/opt_sum.cc +++ b/sql/opt_sum.cc @@ -716,7 +716,7 @@ static bool find_key_for_maxmin(bool max_fl, TABLE_REF *ref, static int reckey_in_range(bool max_fl, TABLE_REF *ref, Field* field, COND *cond, uint range_fl, uint prefix_len) { - if (key_cmp(field->table, ref->key_buff, ref->key, prefix_len)) + if (key_cmp_if_same(field->table, ref->key_buff, ref->key, prefix_len)) return 1; if (!cond || (range_fl & (max_fl ? NO_MIN_RANGE : NO_MAX_RANGE))) return 0; diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 9c7fe3e2993..447a5d9ae80 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1820,7 +1820,7 @@ GRANT_TABLE::GRANT_TABLE(TABLE *form, TABLE *col_privs) } my_hash_insert(&hash_columns, (byte *) mem_check); } while (!col_privs->file->index_next(col_privs->record[0]) && - !key_cmp(col_privs,key,0,key_len)); + !key_cmp_if_same(col_privs,key,0,key_len)); } } @@ -2043,7 +2043,7 @@ static int replace_column_table(GRANT_TABLE *g_t, } } } while (!table->file->index_next(table->record[0]) && - !key_cmp(table,key,0,key_length)); + !key_cmp_if_same(table,key,0,key_length)); } end: diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 5db4a0042ea..5e2525f046a 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -6162,8 +6162,8 @@ join_read_prev_same(READ_RECORD *info) if ((error=table->file->index_prev(table->record[0]))) return report_error(table, error); - if (key_cmp(table, tab->ref.key_buff, tab->ref.key, - tab->ref.key_length)) + if (key_cmp_if_same(table, tab->ref.key_buff, tab->ref.key, + tab->ref.key_length)) { table->status=STATUS_NOT_FOUND; error= -1; From afe09e48e0471e989f01b4fe4125d2fd91db2ab8 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 May 2004 12:05:57 +0500 Subject: [PATCH 097/162] Proposed fix for #3744 (embedded server, wrong error message if database is missing) libmysqld/embedded_priv.h: embedded_get_error interface added libmysqld/lib_sql.cc: embedded_get_error implementation/using added libmysqld/libmysqld.c: embedded_get_error call added --- libmysqld/embedded_priv.h | 1 + libmysqld/lib_sql.cc | 31 +++++++++++++++++++------------ libmysqld/libmysqld.c | 1 + 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/libmysqld/embedded_priv.h b/libmysqld/embedded_priv.h index 1608f4ed4ad..d4316dff63f 100644 --- a/libmysqld/embedded_priv.h +++ b/libmysqld/embedded_priv.h @@ -28,5 +28,6 @@ void init_embedded_mysql(MYSQL *mysql, int client_flag, char *db); void *create_embedded_thd(int client_flag, char *db); int check_embedded_connection(MYSQL *mysql); void free_old_query(MYSQL *mysql); +void embedded_get_error(MYSQL *mysql); extern MYSQL_METHODS embedded_methods; C_MODE_END diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index cfb50d3907a..137af80313a 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -42,6 +42,22 @@ C_MODE_START #include "errmsg.h" #include +void embedded_get_error(MYSQL *mysql) +{ + THD *thd=(THD *) mysql->thd; + NET *net= &mysql->net; + if ((net->last_errno= thd->net.last_errno)) + { + memcpy(net->last_error, thd->net.last_error, sizeof(net->last_error)); + memcpy(net->sqlstate, thd->net.sqlstate, sizeof(net->sqlstate)); + } + else + { + net->last_error[0]= 0; + strmov(net->sqlstate, not_error_sqlstate); + } +} + static my_bool emb_advanced_command(MYSQL *mysql, enum enum_server_command command, const char *header, ulong header_length, @@ -86,16 +102,7 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command, if (!skip_check) result= thd->net.last_errno ? -1 : 0; - if ((net->last_errno= thd->net.last_errno)) - { - memcpy(net->last_error, thd->net.last_error, sizeof(net->last_error)); - memcpy(net->sqlstate, thd->net.sqlstate, sizeof(net->sqlstate)); - } - else - { - net->last_error[0]= 0; - strmov(net->sqlstate, not_error_sqlstate); - } + embedded_get_error(mysql); mysql->server_status= thd->server_status; mysql->warning_count= ((THD*)mysql->thd)->total_warn_count; return result; @@ -237,6 +244,7 @@ static void emb_free_embedded_thd(MYSQL *mysql) free_rows(thd->data); thread_count--; delete thd; + mysql->thd=0; } static const char * emb_read_statistics(MYSQL *mysql) @@ -496,8 +504,7 @@ int check_embedded_connection(MYSQL *mysql) thd->host= (char*)my_localhost; thd->host_or_ip= thd->host; thd->user= my_strdup(mysql->user, MYF(0)); - check_user(thd, COM_CONNECT, NULL, 0, thd->db, true); - return 0; + return check_user(thd, COM_CONNECT, NULL, 0, thd->db, true); } #else diff --git a/libmysqld/libmysqld.c b/libmysqld/libmysqld.c index 95f745aef5f..db9e828369d 100644 --- a/libmysqld/libmysqld.c +++ b/libmysqld/libmysqld.c @@ -232,6 +232,7 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user, DBUG_RETURN(mysql); error: + embedded_get_error(mysql); DBUG_PRINT("error",("message: %u (%s)", mysql->net.last_errno, mysql->net.last_error)); { From 6bc1a1bf2b8853c98b4068ebee7f0a24b22ee341 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 May 2004 12:07:58 +0500 Subject: [PATCH 098/162] Proposed fix for #3791 (embedded: mysql segfaults if cannot find errmsg.sys) client/mysql.cc: Checking of mysql_server_init output added --- client/mysql.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/mysql.cc b/client/mysql.cc index ddc6441f08a..b3b1e35bb85 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -374,7 +374,11 @@ int main(int argc,char *argv[]) exit(1); } glob_buffer.realloc(512); - mysql_server_init(0, NULL, (char**) server_default_groups); + if (mysql_server_init(0, NULL, (char**) server_default_groups)) + { + free_defaults(defaults_argv); + exit(1); + } completion_hash_init(&ht, 128); init_alloc_root(&hash_mem_root, 16384, 0); bzero((char*) &mysql, sizeof(mysql)); From ff23273b7afe24ebc5927178895c18c97c01d3cf Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 May 2004 12:47:16 +0500 Subject: [PATCH 099/162] A fix (bug #3756: ISNULL(QUOTE()) returns 1 for every row after 1st NULL) --- mysql-test/r/func_str.result | 9 +++++++++ mysql-test/t/func_str.test | 9 +++++++++ sql/item_strfunc.cc | 1 + 3 files changed, 19 insertions(+) diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index dd20ffa2dbb..12c1cf78f7c 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -273,3 +273,12 @@ i ELT(j, '345', '34') 1 345 2 34 DROP TABLE t1; +create table t1(a char(4)); +insert into t1 values ('one'),(NULL),('two'),('four'); +select a, quote(a), isnull(quote(a)), quote(a) is null, ifnull(quote(a), 'n') from t1; +a quote(a) isnull(quote(a)) quote(a) is null ifnull(quote(a), 'n') +one 'one' 0 0 'one' +NULL NULL 1 1 n +two 'two' 0 0 'two' +four 'four' 0 0 'four' +drop table t1; diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index d6255e4d93c..1d33e459372 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -163,3 +163,12 @@ CREATE TABLE t1 (i int, j int); INSERT INTO t1 VALUES (1,1),(2,2); SELECT DISTINCT i, ELT(j, '345', '34') FROM t1; DROP TABLE t1; + +# +# bug #3756: quote and NULL +# + +create table t1(a char(4)); +insert into t1 values ('one'),(NULL),('two'),('four'); +select a, quote(a), isnull(quote(a)), quote(a) is null, ifnull(quote(a), 'n') from t1; +drop table t1; \ No newline at end of file diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index ac70ef2cbd3..5d017b3a27a 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -2215,6 +2215,7 @@ String *Item_func_quote::val_str(String *str) } *to= '\''; str->length(new_length); + null_value= 0; return str; null: From c004463171bf107b3903977ef02e1e098993ea70 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 May 2004 10:49:01 +0300 Subject: [PATCH 100/162] InnoDB: Remove unused module os0shm BitKeeper/deleted/.del-os0shm.h~72e5e03d7b74061f: Delete: innobase/include/os0shm.h BitKeeper/deleted/.del-os0shm.c~489ce7f33d07ffa: Delete: innobase/os/os0shm.c BitKeeper/deleted/.del-os0shm.ic~1cac6731d2a64d53: Delete: innobase/include/os0shm.ic innobase/include/Makefile.am: Remove unused files os0shm.h and os0shm.ic innobase/os/Makefile.am: Remove unused file os0shm.c innobase/os/makefilewin: Remove unused file os0shm.c --- innobase/include/Makefile.am | 2 +- innobase/include/os0shm.h | 66 --------------- innobase/include/os0shm.ic | 10 --- innobase/os/Makefile.am | 2 +- innobase/os/makefilewin | 7 +- innobase/os/os0shm.c | 152 ----------------------------------- 6 files changed, 4 insertions(+), 235 deletions(-) delete mode 100644 innobase/include/os0shm.h delete mode 100644 innobase/include/os0shm.ic delete mode 100644 innobase/os/os0shm.c diff --git a/innobase/include/Makefile.am b/innobase/include/Makefile.am index 2584357e24a..0a9aa928998 100644 --- a/innobase/include/Makefile.am +++ b/innobase/include/Makefile.am @@ -32,7 +32,7 @@ noinst_HEADERS = btr0btr.h btr0btr.ic btr0cur.h btr0cur.ic \ mem0dbg.h mem0dbg.ic mem0mem.h mem0mem.ic mem0pool.h \ mem0pool.ic mtr0log.h mtr0log.ic mtr0mtr.h mtr0mtr.ic \ mtr0types.h os0file.h os0proc.h os0proc.ic \ - os0shm.h os0shm.ic os0sync.h os0sync.ic os0thread.h \ + os0sync.h os0sync.ic os0thread.h \ os0thread.ic page0cur.h page0cur.ic page0page.h \ page0page.ic page0types.h pars0grm.h pars0opt.h \ pars0opt.ic pars0pars.h pars0pars.ic pars0sym.h \ diff --git a/innobase/include/os0shm.h b/innobase/include/os0shm.h deleted file mode 100644 index 250794a976f..00000000000 --- a/innobase/include/os0shm.h +++ /dev/null @@ -1,66 +0,0 @@ -/****************************************************** -The interface to the operating system -shared memory primitives - -(c) 1995 Innobase Oy - -Created 9/23/1995 Heikki Tuuri -*******************************************************/ - -#ifndef os0shm_h -#define os0shm_h - -#include "univ.i" - -typedef void* os_shm_t; - - -/******************************************************************** -Creates an area of shared memory. It can be named so that -different processes may access it in the same computer. -If an area with the same name already exists, returns -a handle to that area (where the size of the area is -not changed even if this call requests a different size). -To use the area, it first has to be mapped to the process -address space by os_shm_map. */ - -os_shm_t -os_shm_create( -/*==========*/ - /* out, own: handle to the shared - memory area, NULL if error */ - ulint size, /* in: area size < 4 GB */ - char* name); /* in: name of the area as a null-terminated - string */ -/*************************************************************************** -Frees a shared memory area. The area can be freed only after it -has been unmapped in all the processes where it was mapped. */ - -ibool -os_shm_free( -/*========*/ - /* out: TRUE if success */ - os_shm_t shm); /* in, own: handle to a shared memory area */ -/*************************************************************************** -Maps a shared memory area in the address space of a process. */ - -void* -os_shm_map( -/*=======*/ - /* out: address of the area, NULL if error */ - os_shm_t shm); /* in: handle to a shared memory area */ -/*************************************************************************** -Unmaps a shared memory area from the address space of a process. */ - -ibool -os_shm_unmap( -/*=========*/ - /* out: TRUE if succeed */ - void* addr); /* in: address of the area */ - - -#ifndef UNIV_NONINL -#include "os0shm.ic" -#endif - -#endif diff --git a/innobase/include/os0shm.ic b/innobase/include/os0shm.ic deleted file mode 100644 index cc267544bc9..00000000000 --- a/innobase/include/os0shm.ic +++ /dev/null @@ -1,10 +0,0 @@ -/****************************************************** -The interface to the operating system -shared memory primitives - -(c) 1995 Innobase Oy - -Created 9/23/1995 Heikki Tuuri -*******************************************************/ - - diff --git a/innobase/os/Makefile.am b/innobase/os/Makefile.am index 132ce07c83b..3b09a10efb5 100644 --- a/innobase/os/Makefile.am +++ b/innobase/os/Makefile.am @@ -19,7 +19,7 @@ include ../include/Makefile.i noinst_LIBRARIES = libos.a -libos_a_SOURCES = os0proc.c os0shm.c os0sync.c os0thread.c os0file.c +libos_a_SOURCES = os0proc.c os0sync.c os0thread.c os0file.c EXTRA_PROGRAMS = diff --git a/innobase/os/makefilewin b/innobase/os/makefilewin index 08dba0e5e47..8bc8d08611b 100644 --- a/innobase/os/makefilewin +++ b/innobase/os/makefilewin @@ -1,7 +1,7 @@ include ..\include\makefile.i -os.lib: os0sync.obj os0thread.obj os0shm.obj os0proc.obj os0file.obj - lib -out:..\libs\os.lib os0sync.obj os0thread.obj os0shm.obj os0proc.obj os0file.obj +os.lib: os0sync.obj os0thread.obj os0proc.obj os0file.obj + lib -out:..\libs\os.lib os0sync.obj os0thread.obj os0proc.obj os0file.obj os0sync.obj: os0sync.c $(CCOM) $(CFLW) -c os0sync.c @@ -9,9 +9,6 @@ os0sync.obj: os0sync.c os0thread.obj: os0thread.c $(CCOM) $(CFLW) -c os0thread.c -os0shm.obj: os0shm.c - $(CCOM) $(CFLW) -c os0shm.c - os0proc.obj: os0proc.c $(CCOM) $(CFLW) -c os0proc.c diff --git a/innobase/os/os0shm.c b/innobase/os/os0shm.c deleted file mode 100644 index f49aa2922b0..00000000000 --- a/innobase/os/os0shm.c +++ /dev/null @@ -1,152 +0,0 @@ -/****************************************************** -The interface to the operating system -shared memory primitives - -(c) 1995 Innobase Oy - -Created 9/23/1995 Heikki Tuuri -*******************************************************/ - -#include "os0shm.h" -#ifdef UNIV_NONINL -#include "os0shm.ic" -#endif - -#ifdef __WIN__ -#include "windows.h" - -typedef HANDLE os_shm_t; -#endif - -/******************************************************************** -Creates an area of shared memory. It can be named so that -different processes may access it in the same computer. -If an area with the same name already exists, returns -a handle to that area (where the size of the area is -not changed even if this call requests a different size). -To use the area, it first has to be mapped to the process -address space by os_shm_map. */ - -os_shm_t -os_shm_create( -/*==========*/ - /* out, own: handle to the shared - memory area, NULL if error */ - ulint size, /* in: area size < 4 GB */ - char* name) /* in: name of the area as a null-terminated - string */ -{ -#ifdef __WIN__ - os_shm_t shm; - - ut_a(name); - ut_a(size > 0); - ut_a(size < 0xFFFFFFFF); - - /* In Windows NT shared memory is created as a memory mapped - file */ - shm = CreateFileMapping((HANDLE)0xFFFFFFFF, /* use operating system - swap file as the backing - file */ - NULL, /* default security - descriptor */ - PAGE_READWRITE, /* allow reading and - writing */ - 0, /* size must be less - than 4 GB */ - (DWORD)size, - name); - return(shm); -#else - UT_NOT_USED(size); - UT_NOT_USED(name); - - return(NULL); -#endif -} - -/*************************************************************************** -Frees a shared memory area. The area can be freed only after it -has been unmapped in all the processes where it was mapped. */ - -ibool -os_shm_free( -/*========*/ - /* out: TRUE if success */ - os_shm_t shm) /* in, own: handle to a shared memory area */ -{ -#ifdef __WIN__ - - BOOL ret; - - ut_a(shm); - - ret = CloseHandle(shm); - - if (ret) { - return(TRUE); - } else { - return(FALSE); - } -#else - UT_NOT_USED(shm); - - return(FALSE); -#endif -} - -/*************************************************************************** -Maps a shared memory area in the address space of a process. */ - -void* -os_shm_map( -/*=======*/ - /* out: address of the area, NULL if error */ - os_shm_t shm) /* in: handle to a shared memory area */ -{ -#ifdef __WIN__ - void* mem; - - ut_a(shm); - - mem = MapViewOfFile(shm, - FILE_MAP_ALL_ACCESS, /* read and write access - allowed */ - 0, /* map from start of */ - 0, /* area */ - 0); /* map the whole area */ - return(mem); -#else - UT_NOT_USED(shm); - - return(NULL); -#endif -} - -/*************************************************************************** -Unmaps a shared memory area from the address space of a process. */ - -ibool -os_shm_unmap( -/*=========*/ - /* out: TRUE if succeed */ - void* addr) /* in: address of the area */ -{ -#ifdef __WIN__ - BOOL ret; - - ut_a(addr); - - ret = UnmapViewOfFile(addr); - - if (ret) { - return(TRUE); - } else { - return(FALSE); - } -#else - UT_NOT_USED(addr); - - return(FALSE); -#endif -} From 29f480c504042ebe19dd88be2c885874667ad654 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 May 2004 11:11:26 +0300 Subject: [PATCH 101/162] InnoDB: Remove unused module sync0ipm BitKeeper/deleted/.del-sync0ipm.c~48eb5196b6819734: Delete: innobase/sync/sync0ipm.c BitKeeper/deleted/.del-sync0ipm.h~92a27f3bd9b15164: Delete: innobase/include/sync0ipm.h BitKeeper/deleted/.del-sync0ipm.ic~2024167f6418de39: Delete: innobase/include/sync0ipm.ic innobase/sync/makefilewin: Remove unused file sync0ipm.c innobase/include/Makefile.am: Remove unused files sync0ipm.h and sync0ipm.ic innobase/sync/Makefile.am: Remove unused file sync0ipm.c --- innobase/include/Makefile.am | 2 +- innobase/include/sync0ipm.h | 113 ---------------------- innobase/include/sync0ipm.ic | 182 ----------------------------------- innobase/sync/Makefile.am | 2 +- innobase/sync/makefilewin | 7 +- innobase/sync/sync0ipm.c | 170 -------------------------------- 6 files changed, 4 insertions(+), 472 deletions(-) delete mode 100644 innobase/include/sync0ipm.h delete mode 100644 innobase/include/sync0ipm.ic delete mode 100644 innobase/sync/sync0ipm.c diff --git a/innobase/include/Makefile.am b/innobase/include/Makefile.am index 0a9aa928998..102d25566da 100644 --- a/innobase/include/Makefile.am +++ b/innobase/include/Makefile.am @@ -44,7 +44,7 @@ noinst_HEADERS = btr0btr.h btr0btr.ic btr0cur.h btr0cur.ic \ row0types.h row0uins.h row0uins.ic row0umod.h row0umod.ic \ row0undo.h row0undo.ic row0upd.h row0upd.ic row0vers.h \ row0vers.ic srv0que.h srv0srv.h srv0srv.ic srv0start.h \ - sync0arr.h sync0arr.ic sync0ipm.h sync0ipm.ic sync0rw.h \ + sync0arr.h sync0arr.ic sync0rw.h \ sync0rw.ic sync0sync.h sync0sync.ic sync0types.h \ thr0loc.h thr0loc.ic trx0purge.h trx0purge.ic trx0rec.h \ trx0rec.ic trx0roll.h trx0roll.ic trx0rseg.h trx0rseg.ic \ diff --git a/innobase/include/sync0ipm.h b/innobase/include/sync0ipm.h deleted file mode 100644 index 3244a6d26de..00000000000 --- a/innobase/include/sync0ipm.h +++ /dev/null @@ -1,113 +0,0 @@ -/****************************************************** -A fast mutex for interprocess synchronization. -mutex_t can be used only within single process, -but ip mutex also between processes. - -(c) 1995 Innobase Oy - -Created 9/30/1995 Heikki Tuuri -*******************************************************/ - -#ifndef sync0ipm_h -#define sync0ipm_h - -#include "univ.i" -#include "os0sync.h" -#include "sync0sync.h" - -typedef struct ip_mutex_hdl_struct ip_mutex_hdl_t; -typedef struct ip_mutex_struct ip_mutex_t; - -/* NOTE! The structure appears here only for the compiler to -know its size. Do not use its fields directly! -The structure used in a fast implementation of -an interprocess mutex. */ - -struct ip_mutex_struct { - mutex_t mutex; /* Ordinary mutex struct */ - ulint waiters; /* This field is set to 1 if - there may be waiters */ -}; - -/* The performance of the ip mutex in NT depends on how often -a thread has to suspend itself waiting for the ip mutex -to become free. The following variable counts system calls -involved. */ - -extern ulint ip_mutex_system_call_count; - -/********************************************************************** -Creates, or rather, initializes -an ip mutex object in a specified shared memory location (which must be -appropriately aligned). The ip mutex is initialized in the reset state. -NOTE! Explicit destroying of the ip mutex with ip_mutex_free -is not recommended -as the mutex resides in shared memory and we cannot make sure that -no process is currently accessing it. Therefore just use -ip_mutex_close to free the operating system event and mutex. */ - -ulint -ip_mutex_create( -/*============*/ - /* out: 0 if succeed */ - ip_mutex_t* ip_mutex, /* in: pointer to shared memory */ - char* name, /* in: name of the ip mutex */ - ip_mutex_hdl_t** handle); /* out, own: handle to the - created mutex; handle exists - in the private address space of - the calling process */ -/********************************************************************** -NOTE! Using this function is not recommended. See the note -on ip_mutex_create. Destroys an ip mutex */ - -void -ip_mutex_free( -/*==========*/ - ip_mutex_hdl_t* handle); /* in, own: ip mutex handle */ -/********************************************************************** -Opens an ip mutex object in a specified shared memory location. -Explicit closing of the ip mutex with ip_mutex_close is necessary to -free the operating system event and mutex created, and the handle. */ - -ulint -ip_mutex_open( -/*==========*/ - /* out: 0 if succeed */ - ip_mutex_t* ip_mutex, /* in: pointer to shared memory */ - char* name, /* in: name of the ip mutex */ - ip_mutex_hdl_t** handle); /* out, own: handle to the - opened mutex */ -/********************************************************************** -Closes an ip mutex. */ - -void -ip_mutex_close( -/*===========*/ - ip_mutex_hdl_t* handle); /* in, own: ip mutex handle */ -/****************************************************************** -Reserves an ip mutex. */ -UNIV_INLINE -ulint -ip_mutex_enter( -/*===========*/ - /* out: 0 if success, - SYNC_TIME_EXCEEDED if timeout */ - ip_mutex_hdl_t* ip_mutex_hdl, /* in: pointer to ip mutex handle */ - ulint time); /* in: maximum time to wait, in - microseconds, or - SYNC_INFINITE_TIME */ -/****************************************************************** -Releases an ip mutex. */ -UNIV_INLINE -void -ip_mutex_exit( -/*==========*/ - ip_mutex_hdl_t* ip_mutex_hdl); /* in: pointer to ip mutex handle */ - - - -#ifndef UNIV_NONINL -#include "sync0ipm.ic" -#endif - -#endif diff --git a/innobase/include/sync0ipm.ic b/innobase/include/sync0ipm.ic deleted file mode 100644 index b8aa87ba6d6..00000000000 --- a/innobase/include/sync0ipm.ic +++ /dev/null @@ -1,182 +0,0 @@ -/****************************************************** -A fast mutex for interprocess synchronization. -mutex_t can be used only within single process, -but ip_mutex_t also between processes. - -(c) 1995 Innobase Oy - -Created 9/30/1995 Heikki Tuuri -*******************************************************/ - -/* An extra structure created in the private address space of each process -which creates or opens the ip mutex. */ - -struct ip_mutex_hdl_struct { - ip_mutex_t* ip_mutex; /* pointer to ip mutex */ - os_event_t released; /* event which signals that the mutex - is released; this is obtained from - create or open of an ip mutex */ - os_mutex_t exclude; /* os mutex obtained when ip mutex is - created or opened */ -}; - - -UNIV_INLINE -ulint -ip_mutex_get_waiters( -volatile ip_mutex_t* ipm); -UNIV_INLINE -void -ip_mutex_set_waiters( -volatile ip_mutex_t* ipm, - ulint flag); -UNIV_INLINE -mutex_t* -ip_mutex_get_mutex( - ip_mutex_t* ipm); - - -/****************************************************************** -Accessor functions for ip mutex. */ -UNIV_INLINE -ulint -ip_mutex_get_waiters( -volatile ip_mutex_t* ipm) -{ - return(ipm->waiters); -} -UNIV_INLINE -void -ip_mutex_set_waiters( -volatile ip_mutex_t* ipm, - ulint flag) -{ - ipm->waiters = flag; -} -UNIV_INLINE -mutex_t* -ip_mutex_get_mutex( - ip_mutex_t* ipm) -{ - return(&(ipm->mutex)); -} - -/****************************************************************** -Reserves an ip mutex. */ -UNIV_INLINE -ulint -ip_mutex_enter( -/*===========*/ - /* out: 0 if success, - SYNC_TIME_EXCEEDED if timeout */ - ip_mutex_hdl_t* ip_mutex_hdl, /* in: pointer to ip mutex handle */ - ulint time) /* in: maximum time to wait, in - microseconds, or - SYNC_INFINITE_TIME */ -{ - mutex_t* mutex; - os_event_t released; - os_mutex_t exclude; - ip_mutex_t* ip_mutex; - ulint loop_count; - ulint ret; - - ip_mutex = ip_mutex_hdl->ip_mutex; - released = ip_mutex_hdl->released; - exclude = ip_mutex_hdl->exclude; - - mutex = ip_mutex_get_mutex(ip_mutex); - - loop_count = 0; -loop: - loop_count++; - ut_ad(loop_count < 15); - - if (mutex_enter_nowait(mutex, IB__FILE__, __LINE__) == 0) { - /* Succeeded! */ - - return(0); - } - - ip_mutex_system_call_count++; - - os_event_reset(released); - - /* Order is important here: FIRST reset event, then set waiters */ - ip_mutex_set_waiters(ip_mutex, 1); - - if (mutex_enter_nowait(mutex, IB__FILE__, __LINE__) == 0) { - /* Succeeded! */ - - return(0); - } - - if (time == SYNC_INFINITE_TIME) { - time = OS_SYNC_INFINITE_TIME; - } - - /* Suspend to wait for release */ - - ip_mutex_system_call_count++; - - ret = os_event_wait_time(released, time); - - ip_mutex_system_call_count++; - - os_mutex_enter(exclude); - ip_mutex_system_call_count++; - os_mutex_exit(exclude); - - if (ret != 0) { - ut_a(ret == OS_SYNC_TIME_EXCEEDED); - - return(SYNC_TIME_EXCEEDED); - } - - goto loop; -} - -/****************************************************************** -Releases an ip mutex. */ -UNIV_INLINE -void -ip_mutex_exit( -/*==========*/ - ip_mutex_hdl_t* ip_mutex_hdl) /* in: pointer to ip mutex handle */ -{ - mutex_t* mutex; - os_event_t released; - os_mutex_t exclude; - ip_mutex_t* ip_mutex; - - ip_mutex = ip_mutex_hdl->ip_mutex; - released = ip_mutex_hdl->released; - exclude = ip_mutex_hdl->exclude; - - mutex = ip_mutex_get_mutex(ip_mutex); - - mutex_exit(mutex); - - if (ip_mutex_get_waiters(ip_mutex) != 0) { - - ip_mutex_set_waiters(ip_mutex, 0); - - /* Order is important here: FIRST reset waiters, - then set event */ - - ip_mutex_system_call_count++; - os_mutex_enter(exclude); - - /* The use of the exclude mutex seems to prevent some - kind of a convoy problem in the test tsproc.c. We do - not know why. */ - - ip_mutex_system_call_count++; - - os_event_set(released); - - ip_mutex_system_call_count++; - - os_mutex_exit(exclude); - } -} diff --git a/innobase/sync/Makefile.am b/innobase/sync/Makefile.am index 4acd4516e35..c95955a733b 100644 --- a/innobase/sync/Makefile.am +++ b/innobase/sync/Makefile.am @@ -19,6 +19,6 @@ include ../include/Makefile.i noinst_LIBRARIES = libsync.a -libsync_a_SOURCES = sync0arr.c sync0ipm.c sync0rw.c sync0sync.c +libsync_a_SOURCES = sync0arr.c sync0rw.c sync0sync.c EXTRA_PROGRAMS = diff --git a/innobase/sync/makefilewin b/innobase/sync/makefilewin index 5809d8e7375..73cff40405a 100644 --- a/innobase/sync/makefilewin +++ b/innobase/sync/makefilewin @@ -1,7 +1,7 @@ include ..\include\makefile.i -sync.lib: sync0sync.obj sync0rw.obj sync0ipm.obj sync0arr.obj - lib -out:..\libs\sync.lib sync0sync.obj sync0rw.obj sync0ipm.obj sync0arr.obj +sync.lib: sync0sync.obj sync0rw.obj sync0arr.obj + lib -out:..\libs\sync.lib sync0sync.obj sync0rw.obj sync0arr.obj sync0sync.obj: sync0sync.c $(CCOM) $(CFLN) -c sync0sync.c @@ -9,9 +9,6 @@ sync0sync.obj: sync0sync.c sync0rw.obj: sync0rw.c $(CCOM) $(CFL) -c sync0rw.c -sync0ipm.obj: sync0ipm.c - $(CCOM) $(CFL) -c sync0ipm.c - sync0arr.obj: sync0arr.c $(CCOM) $(CFL) -c sync0arr.c diff --git a/innobase/sync/sync0ipm.c b/innobase/sync/sync0ipm.c deleted file mode 100644 index e10e1c85da5..00000000000 --- a/innobase/sync/sync0ipm.c +++ /dev/null @@ -1,170 +0,0 @@ -/****************************************************** -A fast mutex for interprocess synchronization. -mutex_t can be used only within single process, -but ip_mutex_t also between processes. - -(c) 1995 Innobase Oy - -Created 9/30/1995 Heikki Tuuri -*******************************************************/ -#include "sync0ipm.h" -#ifdef UNIV_NONINL -#include "sync0ipm.ic" -#endif - -#include "mem0mem.h" - -/* The performance of the ip mutex in NT depends on how often -a thread has to suspend itself waiting for the ip mutex -to become free. The following variable counts system calls -involved. */ - -ulint ip_mutex_system_call_count = 0; - -/********************************************************************** -Creates, or rather, initializes -an ip mutex object in a specified shared memory location (which must be -appropriately aligned). The ip mutex is initialized in the reset state. -NOTE! Explicit destroying of the ip mutex with ip_mutex_free -is not recommended -as the mutex resides in shared memory and we cannot make sure that -no process is currently accessing it. Therefore just use -ip_mutex_close to free the operating system event and mutex. */ - -ulint -ip_mutex_create( -/*============*/ - /* out: 0 if succeed */ - ip_mutex_t* ip_mutex, /* in: pointer to shared memory */ - char* name, /* in: name of the ip mutex */ - ip_mutex_hdl_t** handle) /* out, own: handle to the - created mutex; handle exists - in the private address space of - the calling process */ -{ - mutex_t* mutex; - char* buf; - os_event_t released; - os_mutex_t exclude; - - ip_mutex_set_waiters(ip_mutex, 0); - - buf = mem_alloc(strlen(name) + 20); - - strcpy(buf, name); - strcpy(buf + strlen(name), "_IB_RELS"); - - released = os_event_create(buf); - - if (released == NULL) { - mem_free(buf); - return(1); - } - - strcpy(buf + strlen(name), "_IB_EXCL"); - - exclude = os_mutex_create(buf); - - if (exclude == NULL) { - os_event_free(released); - mem_free(buf); - return(1); - } - - mutex = ip_mutex_get_mutex(ip_mutex); - - mutex_create(mutex); - mutex_set_level(mutex, SYNC_NO_ORDER_CHECK); - - *handle = mem_alloc(sizeof(ip_mutex_hdl_t)); - - (*handle)->ip_mutex = ip_mutex; - (*handle)->released = released; - (*handle)->exclude = exclude; - - mem_free(buf); - - return(0); -} - -/********************************************************************** -NOTE! Using this function is not recommended. See the note -on ip_mutex_create. Destroys an ip mutex */ - -void -ip_mutex_free( -/*==========*/ - ip_mutex_hdl_t* handle) /* in, own: ip mutex handle */ -{ - mutex_free(ip_mutex_get_mutex(handle->ip_mutex)); - - os_event_free(handle->released); - os_mutex_free(handle->exclude); - - mem_free(handle); -} - -/********************************************************************** -Opens an ip mutex object in a specified shared memory location. -Explicit closing of the ip mutex with ip_mutex_close is necessary to -free the operating system event and mutex created, and the handle. */ - -ulint -ip_mutex_open( -/*==========*/ - /* out: 0 if succeed */ - ip_mutex_t* ip_mutex, /* in: pointer to shared memory */ - char* name, /* in: name of the ip mutex */ - ip_mutex_hdl_t** handle) /* out, own: handle to the - opened mutex */ -{ - char* buf; - os_event_t released; - os_mutex_t exclude; - - buf = mem_alloc(strlen(name) + 20); - - strcpy(buf, name); - strcpy(buf + strlen(name), "_IB_RELS"); - - released = os_event_create(buf); - - if (released == NULL) { - mem_free(buf); - return(1); - } - - strcpy(buf + strlen(name), "_IB_EXCL"); - - exclude = os_mutex_create(buf); - - if (exclude == NULL) { - os_event_free(released); - mem_free(buf); - return(1); - } - - *handle = mem_alloc(sizeof(ip_mutex_hdl_t)); - - (*handle)->ip_mutex = ip_mutex; - (*handle)->released = released; - (*handle)->exclude = exclude; - - mem_free(buf); - - return(0); -} - -/********************************************************************** -Closes an ip mutex. */ - -void -ip_mutex_close( -/*===========*/ - ip_mutex_hdl_t* handle) /* in, own: ip mutex handle */ -{ - os_event_free(handle->released); - os_mutex_free(handle->exclude); - - mem_free(handle); -} From 3fba03f345e0d121280e38e64cf74016ab9af474 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 May 2004 11:22:30 +0300 Subject: [PATCH 102/162] After merge fixes mysql-test/r/type_float.result: Fix result after merge sql/log_event.cc: Fixed typo --- mysql-test/r/type_float.result | 2 +- sql/log_event.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result index 3dee0c2fcf9..f044ced2342 100644 --- a/mysql-test/r/type_float.result +++ b/mysql-test/r/type_float.result @@ -83,7 +83,7 @@ show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `col` double default NULL -) TYPE=MyISAM +) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1,t2; create table t1 (a float); insert into t1 values (1); diff --git a/sql/log_event.cc b/sql/log_event.cc index 9cbcead743f..abbccb32034 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -1675,7 +1675,7 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli, thd->db= (char*) rewrite_db(db); DBUG_ASSERT(thd->query == 0); thd->query= 0; // Should not be needed - thd->querty_length= 0; // Should not be needed + thd->query_length= 0; // Should not be needed thd->query_error= 0; clear_all_errors(thd, rli); if (!use_rli_only_for_errors) From f948d7bb2434ae2431f6401a030414d07c4ab82c Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 May 2004 13:40:02 +0500 Subject: [PATCH 103/162] added newline at the end of the file. --- mysql-test/t/func_str.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 1d33e459372..9b0c076f23e 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -171,4 +171,4 @@ DROP TABLE t1; create table t1(a char(4)); insert into t1 values ('one'),(NULL),('two'),('four'); select a, quote(a), isnull(quote(a)), quote(a) is null, ifnull(quote(a), 'n') from t1; -drop table t1; \ No newline at end of file +drop table t1; From 484f6cb3b49d902a76f7c3f0b3e332dc1ef36a9e Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 May 2004 11:04:12 +0200 Subject: [PATCH 104/162] bug#3681 - order by, distinct, refer to aliased field by name check for field_name (not only for name) in find_item_in_list, to be compatible with item->eq() that is done later mysql-test/r/order_by.result: bug#3681 - order by, distinct, refer to aliased field by name --- mysql-test/r/order_by.result | 4 ++-- sql/sql_base.cc | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result index 5edffdacc98..694dc26bcde 100644 --- a/mysql-test/r/order_by.result +++ b/mysql-test/r/order_by.result @@ -89,10 +89,10 @@ create table t1 ( pk int primary key, name varchar(255) not null, number v insert into t1 values (1, 'Gamma', '123'), (2, 'Gamma Ext', '123a'), (3, 'Alpha', '001'), (4, 'Beta', '200c'); select distinct t1.name as 'Building Name',t1.number as 'Building Number' from t1 order by t1.name asc; Building Name Building Number -Gamma 123 -Gamma Ext 123a Alpha 001 Beta 200c +Gamma 123 +Gamma Ext 123a drop table t1; create table t1 (id int not null,col1 int not null,col2 int not null,index(col1)); insert into t1 values(1,2,2),(2,2,1),(3,1,2),(4,1,1),(5,1,4),(6,2,3),(7,3,1),(8,2,4); diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 14a54a410a2..e3fbfb2d0e3 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -2103,7 +2103,9 @@ find_item_in_list(Item *find, List &items, uint *counter, => we have to check presence of name before compare */ if (item_field->name && - !my_strcasecmp(system_charset_info, item_field->name, field_name)) + (!my_strcasecmp(system_charset_info, item_field->name, field_name) || + !my_strcasecmp(system_charset_info, + item_field->field_name, field_name))) { if (!table_name) { From 1915bfebcb9005102c72028221bb89aa5f0204e4 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 May 2004 11:10:22 +0200 Subject: [PATCH 105/162] typo fixed --- sql/ha_heap.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc index 9915dc90dc1..c375614ac95 100644 --- a/sql/ha_heap.cc +++ b/sql/ha_heap.cc @@ -375,7 +375,7 @@ ha_rows ha_heap::records_in_range(uint inx, key_range *min_key, min_key->length != key->key_length || min_key->flag != HA_READ_KEY_EXACT || max_key->flag != HA_READ_AFTER_KEY) - return HA_POS_ERROR; // Can't only use exact keys + return HA_POS_ERROR; // Can only use exact keys return 10; // Good guess } From 6b237533f1baae131e192ccbafcfcfaef13f4fc0 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 May 2004 14:40:31 +0300 Subject: [PATCH 106/162] InnoDB cleanup: Add const qualifiers to many char* arguments innobase/dict/dict0dict.c: Replace char* arguments with const char* innobase/dict/dict0load.c: Replace char* arguments with const char* innobase/dict/dict0mem.c: Replace char* arguments with const char* innobase/fil/fil0fil.c: Replace char* arguments with const char* innobase/include/data0data.h: dfield_set_data(): add const qualifier innobase/include/data0data.ic: dfield_set_data(): add const qualifier (temporarily shut up compiler warnings) innobase/include/dict0dict.h: Replace char* arguments with const char* innobase/include/dict0dict.ic: Replace char* arguments with const char* innobase/include/dict0load.h: Replace char* arguments with const char* innobase/include/dict0mem.h: Replace char* arguments with const char* innobase/include/fil0fil.h: Replace char* arguments with const char* innobase/include/os0file.h: Replace char* arguments with const char* innobase/include/os0sync.h: Replace char* arguments with const char* innobase/include/pars0pars.h: Replace char* arguments with const char* innobase/include/pars0sym.h: Replace char* arguments with const char* innobase/include/row0mysql.h: Replace char* arguments with const char* innobase/include/row0sel.h: Replace char* arguments with const char* innobase/include/trx0roll.h: Replace char* arguments with const char* innobase/include/trx0sys.h: Replace char* arguments with const char* innobase/include/trx0trx.h: Replace char* arguments with const char* innobase/include/ut0rnd.h: Replace char* arguments with const char* innobase/include/ut0rnd.ic: Replace char* arguments with const char* innobase/include/ut0ut.h: Remove unused function ut_printf() innobase/os/os0file.c: Replace char* arguments with const char* innobase/os/os0sync.c: Replace char* arguments with const char* innobase/pars/pars0pars.c: Replace char* arguments with const char* innobase/pars/pars0sym.c: Use mem_heap_strdupl() instead of mem_heap_alloc() and memcpy() innobase/row/row0mysql.c: Replace char* arguments with const char* innobase/row/row0sel.c: Replace char* arguments with const char* innobase/trx/trx0roll.c: Replace char* arguments with const char* innobase/trx/trx0sys.c: Replace char* arguments with const char* --- innobase/dict/dict0dict.c | 64 +++++++------ innobase/dict/dict0load.c | 28 +++--- innobase/dict/dict0mem.c | 42 +++++---- innobase/fil/fil0fil.c | 127 +++++++++++++------------- innobase/include/data0data.h | 2 +- innobase/include/data0data.ic | 2 +- innobase/include/dict0dict.h | 53 ++++++----- innobase/include/dict0dict.ic | 10 +-- innobase/include/dict0load.h | 23 ++--- innobase/include/dict0mem.h | 70 ++++++++------- innobase/include/fil0fil.h | 104 ++++++++++++---------- innobase/include/os0file.h | 156 +++++++++++++++++--------------- innobase/include/os0sync.h | 18 ++-- innobase/include/pars0pars.h | 4 +- innobase/include/pars0sym.h | 4 +- innobase/include/row0mysql.h | 51 +++++------ innobase/include/row0sel.h | 10 +-- innobase/include/trx0roll.h | 4 +- innobase/include/trx0sys.h | 2 +- innobase/include/trx0trx.h | 6 +- innobase/include/ut0rnd.h | 10 +-- innobase/include/ut0rnd.ic | 10 +-- innobase/include/ut0ut.h | 15 ---- innobase/os/os0file.c | 163 ++++++++++++++++++---------------- innobase/os/os0sync.c | 18 ++-- innobase/pars/pars0pars.c | 4 +- innobase/pars/pars0sym.c | 5 +- innobase/row/row0mysql.c | 51 +++++------ innobase/row/row0sel.c | 10 +-- innobase/trx/trx0roll.c | 4 +- innobase/trx/trx0sys.c | 2 +- 31 files changed, 553 insertions(+), 519 deletions(-) diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c index c9e3ac5ec66..6a6ac2492f8 100644 --- a/innobase/dict/dict0dict.c +++ b/innobase/dict/dict0dict.c @@ -70,7 +70,7 @@ dict_col_reposition_in_cache( /*=========================*/ dict_table_t* table, /* in: table */ dict_col_t* col, /* in: column */ - char* new_name); /* in: new table name */ + const char* new_name); /* in: new table name */ /************************************************************************** Removes a column from the data dictionary hash table. */ static @@ -309,7 +309,7 @@ dict_table_get_index_noninline( /*===========================*/ /* out: index, NULL if does not exist */ dict_table_t* table, /* in: table */ - char* name) /* in: index name */ + const char* name) /* in: index name */ { return(dict_table_get_index(table, name)); } @@ -693,9 +693,10 @@ directory dict_table_get_low is usually the appropriate function. */ dict_table_t* dict_table_get( /*===========*/ - /* out: table, NULL if does not exist */ - char* table_name, /* in: table name */ - trx_t* trx) /* in: transaction handle or NULL */ + /* out: table, NULL if + does not exist */ + const char* table_name, /* in: table name */ + trx_t* trx) /* in: transaction handle or NULL */ { dict_table_t* table; @@ -722,9 +723,10 @@ Returns a table object and increments MySQL open handle count on the table. */ dict_table_t* dict_table_get_and_increment_handle_count( /*======================================*/ - /* out: table, NULL if does not exist */ - char* table_name, /* in: table name */ - trx_t* trx) /* in: transaction handle or NULL */ + /* out: table, NULL if + does not exist */ + const char* table_name, /* in: table name */ + trx_t* trx) /* in: transaction handle or NULL */ { dict_table_t* table; @@ -886,7 +888,7 @@ dict_table_rename_in_cache( /*=======================*/ /* out: TRUE if success */ dict_table_t* table, /* in: table */ - char* new_name, /* in: new name */ + const char* new_name, /* in: new name */ ibool rename_also_foreigns)/* in: in ALTER TABLE we want to preserve the original table name in constraints which reference it */ @@ -1294,7 +1296,7 @@ dict_col_reposition_in_cache( /*=========================*/ dict_table_t* table, /* in: table */ dict_col_t* col, /* in: column */ - char* new_name) /* in: new table name */ + const char* new_name) /* in: new table name */ { ulint fold; @@ -2019,7 +2021,7 @@ dict_foreign_find_index( column types must match */ { dict_index_t* index; - char* col_name; + const char* col_name; ulint i; index = dict_table_get_first_index(table); @@ -2564,14 +2566,14 @@ static char* dict_strip_comments( /*================*/ - /* out, own: SQL string stripped from - comments; the caller must free this - with mem_free()! */ - char* sql_string) /* in: SQL string */ + /* out, own: SQL string stripped from + comments; the caller must free this + with mem_free()! */ + const char* sql_string) /* in: SQL string */ { - char* str; - char* sptr; - char* ptr; + char* str; + const char* sptr; + char* ptr; str = mem_alloc(strlen(sql_string) + 1); @@ -2970,7 +2972,8 @@ col_loop1: } foreign->foreign_table = table; - foreign->foreign_table_name = table->name; + foreign->foreign_table_name = mem_heap_strdup(foreign->heap, + table->name); foreign->foreign_index = index; foreign->n_fields = i; foreign->foreign_col_names = mem_heap_alloc(foreign->heap, @@ -3244,16 +3247,19 @@ allowed to contain more fields than mentioned in the constraint. */ ulint dict_create_foreign_constraints( /*============================*/ - /* out: error code or DB_SUCCESS */ - trx_t* trx, /* in: transaction */ - char* sql_string, /* in: table create or ALTER TABLE - statement where foreign keys are declared like: - FOREIGN KEY (a, b) REFERENCES table2(c, d), - table2 can be written also with the database - name before it: test.table2; the default - database is the database of parameter name */ - char* name) /* in: table full name in the normalized form - database_name/table_name */ + /* out: error code or DB_SUCCESS */ + trx_t* trx, /* in: transaction */ + const char* sql_string, /* in: table create statement where + foreign keys are declared like: + FOREIGN KEY (a, b) REFERENCES + table2(c, d), table2 can be written + also with the database + name before it: test.table2; the + default database id the database of + parameter name */ + const char* name) /* in: table full name in the + normalized form + database_name/table_name */ { char* str; ulint err; diff --git a/innobase/dict/dict0load.c b/innobase/dict/dict0load.c index bf8b4582f63..071a3b4c684 100644 --- a/innobase/dict/dict0load.c +++ b/innobase/dict/dict0load.c @@ -27,9 +27,10 @@ Finds the first table name in the given database. */ char* dict_get_first_table_name_in_db( /*============================*/ - /* out, own: table name, NULL if does not exist; - the caller must free the memory in the string! */ - char* name) /* in: database name which ends to '/' */ + /* out, own: table name, NULL if + does not exist; the caller must + free the memory in the string! */ + const char* name) /* in: database name which ends to '/' */ { dict_table_t* sys_tables; btr_pcur_t pcur; @@ -389,8 +390,8 @@ Report that an index field or index for a table has been delete marked. */ static void dict_load_report_deleted_index( - char* name, /* in: table name */ - ulint field) /* in: index field, or ULINT_UNDEFINED */ + const char* name, /* in: table name */ + ulint field) /* in: index field, or ULINT_UNDEFINED */ { fputs("InnoDB: Error: data dictionary entry" " for table ", stderr); @@ -688,12 +689,13 @@ dictionary cache. */ dict_table_t* dict_load_table( /*============*/ - /* out: table, NULL if does not exist; if the table is - stored in an .ibd file, but the file does not exist, - then we set the ibd_file_missing flag TRUE in the table - object we return */ - char* name) /* in: table name in the databasename/tablename - format */ + /* out: table, NULL if does not exist; + if the table is stored in an .ibd file, + but the file does not exist, + then we set the ibd_file_missing flag TRUE + in the table object we return */ + const char* name) /* in: table name in the + databasename/tablename format */ { ibool ibd_file_missing = FALSE; dict_table_t* table; @@ -1185,8 +1187,8 @@ already in the dictionary cache. */ ulint dict_load_foreigns( /*===============*/ - /* out: DB_SUCCESS or error code */ - char* table_name) /* in: table name */ + /* out: DB_SUCCESS or error code */ + const char* table_name) /* in: table name */ { btr_pcur_t pcur; mem_heap_t* heap; diff --git a/innobase/dict/dict0mem.c b/innobase/dict/dict0mem.c index a4f83ddd657..936b06b1905 100644 --- a/innobase/dict/dict0mem.c +++ b/innobase/dict/dict0mem.c @@ -30,15 +30,14 @@ dict_table_t* dict_mem_table_create( /*==================*/ /* out, own: table object */ - char* name, /* in: table name */ - ulint space, /* in: space where the clustered index of + const char* name, /* in: table name */ + ulint space, /* in: space where the clustered index of the table is placed; this parameter is ignored if the table is made a member of a cluster */ - ulint n_cols) /* in: number of columns */ + ulint n_cols) /* in: number of columns */ { dict_table_t* table; - char* str; mem_heap_t* heap; ut_ad(name); @@ -48,11 +47,9 @@ dict_mem_table_create( table = mem_heap_alloc(heap, sizeof(dict_table_t)); table->heap = heap; - - str = mem_heap_strdup(heap, name); table->type = DICT_TABLE_ORDINARY; - table->name = str; + table->name = mem_heap_strdup(heap, name); table->space = space; table->ibd_file_missing = FALSE; table->tablespace_discarded = FALSE; @@ -103,11 +100,11 @@ dict_table_t* dict_mem_cluster_create( /*====================*/ /* out, own: cluster object */ - char* name, /* in: cluster name */ - ulint space, /* in: space where the clustered indexes + const char* name, /* in: cluster name */ + ulint space, /* in: space where the clustered indexes of the member tables are placed */ - ulint n_cols, /* in: number of columns */ - ulint mix_len) /* in: length of the common key prefix in the + ulint n_cols, /* in: number of columns */ + ulint mix_len)/* in: length of the common key prefix in the cluster */ { dict_table_t* cluster; @@ -127,7 +124,7 @@ void dict_mem_table_make_cluster_member( /*===============================*/ dict_table_t* table, /* in: non-published table */ - char* cluster_name) /* in: cluster name */ + const char* cluster_name) /* in: cluster name */ { table->type = DICT_TABLE_CLUSTER_MEMBER; table->cluster_name = cluster_name; @@ -140,7 +137,7 @@ void dict_mem_table_add_col( /*===================*/ dict_table_t* table, /* in: table */ - char* name, /* in: column name */ + const char* name, /* in: column name */ ulint mtype, /* in: main datatype */ ulint prtype, /* in: precise type */ ulint len, /* in: length */ @@ -174,14 +171,15 @@ Creates an index memory object. */ dict_index_t* dict_mem_index_create( /*==================*/ - /* out, own: index object */ - char* table_name, /* in: table name */ - char* index_name, /* in: index name */ - ulint space, /* in: space where the index tree is placed, - ignored if the index is of the clustered - type */ - ulint type, /* in: DICT_UNIQUE, DICT_CLUSTERED, ... ORed */ - ulint n_fields) /* in: number of fields */ + /* out, own: index object */ + const char* table_name, /* in: table name */ + const char* index_name, /* in: index name */ + ulint space, /* in: space where the index tree is + placed, ignored if the index is of + the clustered type */ + ulint type, /* in: DICT_UNIQUE, + DICT_CLUSTERED, ... ORed */ + ulint n_fields) /* in: number of fields */ { dict_index_t* index; mem_heap_t* heap; @@ -259,7 +257,7 @@ void dict_mem_index_add_field( /*=====================*/ dict_index_t* index, /* in: index */ - char* name, /* in: column name */ + const char* name, /* in: column name */ ulint order, /* in: order criterion; 0 means an ascending order */ ulint prefix_len) /* in: 0 or the column prefix length diff --git a/innobase/fil/fil0fil.c b/innobase/fil/fil0fil.c index b9aff246802..28eea0ba188 100644 --- a/innobase/fil/fil0fil.c +++ b/innobase/fil/fil0fil.c @@ -390,11 +390,12 @@ Appends a new file to the chain of files of a space. File must be closed. */ void fil_node_create( /*============*/ - char* name, /* in: file name (file must be closed) */ - ulint size, /* in: file size in database blocks, rounded downwards - to an integer */ - ulint id, /* in: space id where to append */ - ibool is_raw) /* in: TRUE if a raw device or a raw disk partition */ + const char* name, /* in: file name (file must be closed) */ + ulint size, /* in: file size in database blocks, rounded + downwards to an integer */ + ulint id, /* in: space id where to append */ + ibool is_raw) /* in: TRUE if a raw device or + a raw disk partition */ { fil_system_t* system = fil_system; fil_node_t* node; @@ -804,10 +805,10 @@ there is an error, prints an error message to the .err log. */ ibool fil_space_create( /*=============*/ - /* out: TRUE if success */ - char* name, /* in: space name */ - ulint id, /* in: space id */ - ulint purpose)/* in: FIL_TABLESPACE, or FIL_LOG if log */ + /* out: TRUE if success */ + const char* name, /* in: space name */ + ulint id, /* in: space id */ + ulint purpose)/* in: FIL_TABLESPACE, or FIL_LOG if log */ { fil_system_t* system = fil_system; fil_space_t* space; @@ -1542,16 +1543,18 @@ static void fil_op_write_log( /*=============*/ - ulint type, /* in: MLOG_FILE_CREATE, MLOG_FILE_DELETE, or - MLOG_FILE_RENAME */ - ulint space_id, /* in: space id */ - char* name, /* in: table name in the familiar - 'databasename/tablename' format, or the file - path in the case of MLOG_FILE_DELETE */ - char* new_name, /* in: if type is MLOG_FILE_RENAME, the new - table name in the 'databasename/tablename' - format */ - mtr_t* mtr) /* in: mini-transaction handle */ + ulint type, /* in: MLOG_FILE_CREATE, + MLOG_FILE_DELETE, or + MLOG_FILE_RENAME */ + ulint space_id, /* in: space id */ + const char* name, /* in: table name in the familiar + 'databasename/tablename' format, or + the file path in the case of + MLOG_FILE_DELETE */ + const char* new_name, /* in: if type is MLOG_FILE_RENAME, + the new table name in the + 'databasename/tablename' format */ + mtr_t* mtr) /* in: mini-transaction handle */ { byte* log_ptr; @@ -1960,14 +1963,15 @@ tablespace memory cache. */ ibool fil_rename_tablespace( /*==================*/ - /* out: TRUE if success */ - char* old_name, /* in: old table name in the standard - databasename/tablename format of InnoDB, or - NULL if we do the rename based on the space - id only */ - ulint id, /* in: space id */ - char* new_name) /* in: new table name in the standard - databasename/tablename format of InnoDB */ + /* out: TRUE if success */ + const char* old_name, /* in: old table name in the standard + databasename/tablename format of + InnoDB, or NULL if we do the rename + based on the space id only */ + ulint id, /* in: space id */ + const char* new_name) /* in: new table name in the standard + databasename/tablename format + of InnoDB */ { fil_system_t* system = fil_system; ibool success; @@ -2124,15 +2128,16 @@ path '.'. */ ulint fil_create_new_single_table_tablespace( /*===================================*/ - /* out: DB_SUCCESS or error code */ - ulint* space_id, /* in/out: space id; if this is != 0, then - this is an input parameter, otherwise - output */ - char* tablename, /* in: the table name in the usual - databasename/tablename format of InnoDB */ - ulint size) /* in: the initial size of the tablespace file - in pages, must be >= FIL_IBD_FILE_INITIAL_SIZE - */ + /* out: DB_SUCCESS or error code */ + ulint* space_id, /* in/out: space id; if this is != 0, + then this is an input parameter, + otherwise output */ + const char* tablename, /* in: the table name in the usual + databasename/tablename format + of InnoDB */ + ulint size) /* in: the initial size of the + tablespace file in pages, + must be >= FIL_IBD_FILE_INITIAL_SIZE */ { os_file_t file; ibool ret; @@ -2293,12 +2298,12 @@ lsn's just by looking at that flush lsn. */ ibool fil_reset_too_high_lsns( /*====================*/ - /* out: TRUE if success */ - char* name, /* in: table name in the databasename/tablename - format */ - dulint current_lsn) /* in: reset lsn's if the lsn stamped to - FIL_PAGE_FILE_FLUSH_LSN in the first page is - too high */ + /* out: TRUE if success */ + const char* name, /* in: table name in the + databasename/tablename format */ + dulint current_lsn) /* in: reset lsn's if the lsn stamped + to FIL_PAGE_FILE_FLUSH_LSN in the + first page is too high */ { os_file_t file; char* filepath; @@ -2433,10 +2438,10 @@ closes it after we have looked at the space id in it. */ ibool fil_open_single_table_tablespace( /*=============================*/ - /* out: TRUE if success */ - ulint id, /* in: space id */ - char* name) /* in: table name in the databasename/tablename - format */ + /* out: TRUE if success */ + ulint id, /* in: space id */ + const char* name) /* in: table name in the + databasename/tablename format */ { os_file_t file; char* filepath; @@ -2937,20 +2942,22 @@ there may be many tablespaces which are not yet in the memory cache. */ ibool fil_space_for_table_exists_in_mem( /*==============================*/ - /* out: TRUE if a matching tablespace exists - in the memory cache */ - ulint id, /* in: space id */ - char* name, /* in: table name in the standard - 'databasename/tablename' format */ - ibool mark_space, /* in: in crash recovery, at database startup - we mark all spaces which have an associated - table in the InnoDB data dictionary, so that - we can print a warning about orphaned - tablespaces */ - ibool print_error_if_does_not_exist) - /* in: print detailed error information to - the .err log if a matching tablespace is - not found from memory */ + /* out: TRUE if a matching tablespace + exists in the memory cache */ + ulint id, /* in: space id */ + const char* name, /* in: table name in the standard + 'databasename/tablename' format */ + ibool mark_space, /* in: in crash recovery, at database + startup we mark all spaces which have + an associated table in the InnoDB + data dictionary, so that + we can print a warning about orphaned + tablespaces */ + ibool print_error_if_does_not_exist) + /* in: print detailed error + information to the .err log if a + matching tablespace is not found from + memory */ { fil_system_t* system = fil_system; fil_space_t* namespace; diff --git a/innobase/include/data0data.h b/innobase/include/data0data.h index 99d3c297039..e2de13d0520 100644 --- a/innobase/include/data0data.h +++ b/innobase/include/data0data.h @@ -86,7 +86,7 @@ void dfield_set_data( /*============*/ dfield_t* field, /* in: field */ - void* data, /* in: data */ + const void* data, /* in: data */ ulint len); /* in: length or UNIV_SQL_NULL */ /************************************************************************** Writes an SQL null field full of zeros. */ diff --git a/innobase/include/data0data.ic b/innobase/include/data0data.ic index 697a272ccd6..569bf898801 100644 --- a/innobase/include/data0data.ic +++ b/innobase/include/data0data.ic @@ -93,7 +93,7 @@ void dfield_set_data( /*============*/ dfield_t* field, /* in: field */ - void* data, /* in: data */ + const void* data, /* in: data */ ulint len) /* in: length or UNIV_SQL_NULL */ { ut_ad(field); diff --git a/innobase/include/dict0dict.h b/innobase/include/dict0dict.h index 98636f6e1cb..fe04359d6f1 100644 --- a/innobase/include/dict0dict.h +++ b/innobase/include/dict0dict.h @@ -166,7 +166,7 @@ dict_table_rename_in_cache( /*=======================*/ /* out: TRUE if success */ dict_table_t* table, /* in: table */ - char* new_name, /* in: new name */ + const char* new_name, /* in: new name */ ibool rename_also_foreigns);/* in: in ALTER TABLE we want to preserve the original table name in constraints which reference it */ @@ -210,16 +210,19 @@ fields than mentioned in the constraint. */ ulint dict_create_foreign_constraints( /*============================*/ - /* out: error code or DB_SUCCESS */ - trx_t* trx, /* in: transaction */ - char* sql_string, /* in: table create statement where - foreign keys are declared like: - FOREIGN KEY (a, b) REFERENCES table2(c, d), - table2 can be written also with the database - name before it: test.table2; the default - database id the database of parameter name */ - char* name); /* in: table full name in the normalized form - database_name/table_name */ + /* out: error code or DB_SUCCESS */ + trx_t* trx, /* in: transaction */ + const char* sql_string, /* in: table create statement where + foreign keys are declared like: + FOREIGN KEY (a, b) REFERENCES + table2(c, d), table2 can be written + also with the database + name before it: test.table2; the + default database id the database of + parameter name */ + const char* name); /* in: table full name in the + normalized form + database_name/table_name */ /************************************************************************** Parses the CONSTRAINT id's to be dropped in an ALTER TABLE statement. */ @@ -246,9 +249,10 @@ directory dict_table_get_low is usually the appropriate function. */ dict_table_t* dict_table_get( /*===========*/ - /* out: table, NULL if does not exist */ - char* table_name, /* in: table name */ - trx_t* trx); /* in: transaction handle */ + /* out: table, NULL if + does not exist */ + const char* table_name, /* in: table name */ + trx_t* trx); /* in: transaction handle */ /************************************************************************** Returns a table object and increments MySQL open handle count on the table. */ @@ -256,9 +260,10 @@ Returns a table object and increments MySQL open handle count on the table. dict_table_t* dict_table_get_and_increment_handle_count( /*======================================*/ - /* out: table, NULL if does not exist */ - char* table_name, /* in: table name */ - trx_t* trx); /* in: transaction handle or NULL */ + /* out: table, NULL if + does not exist */ + const char* table_name, /* in: table name */ + trx_t* trx); /* in: transaction handle or NULL */ /************************************************************************** Returns a table object, based on table id, and memoryfixes it. */ @@ -290,8 +295,8 @@ UNIV_INLINE dict_table_t* dict_table_check_if_in_cache_low( /*==============================*/ - /* out: table, NULL if not found */ - char* table_name); /* in: table name */ + /* out: table, NULL if not found */ + const char* table_name); /* in: table name */ /************************************************************************** Gets a table; loads it to the dictionary cache if necessary. A low-level function. */ @@ -299,8 +304,8 @@ UNIV_INLINE dict_table_t* dict_table_get_low( /*===============*/ - /* out: table, NULL if not found */ - char* table_name); /* in: table name */ + /* out: table, NULL if not found */ + const char* table_name); /* in: table name */ /************************************************************************** Returns an index object. */ UNIV_INLINE @@ -309,7 +314,7 @@ dict_table_get_index( /*=================*/ /* out: index, NULL if does not exist */ dict_table_t* table, /* in: table */ - char* name); /* in: index name */ + const char* name); /* in: index name */ /************************************************************************** Returns an index object. */ @@ -318,7 +323,7 @@ dict_table_get_index_noninline( /*===========================*/ /* out: index, NULL if does not exist */ dict_table_t* table, /* in: table */ - char* name); /* in: index name */ + const char* name); /* in: index name */ /************************************************************************** Prints a table data. */ @@ -340,7 +345,7 @@ Prints a table data when we know the table name. */ void dict_table_print_by_name( /*=====================*/ - char* name); + const char* name); #endif /* UNIV_DEBUG */ /************************************************************************** Outputs info on foreign keys of a table. */ diff --git a/innobase/include/dict0dict.ic b/innobase/include/dict0dict.ic index 57ef4b896f5..0f7cc8973db 100644 --- a/innobase/include/dict0dict.ic +++ b/innobase/include/dict0dict.ic @@ -536,8 +536,8 @@ UNIV_INLINE dict_table_t* dict_table_check_if_in_cache_low( /*==============================*/ - /* out: table, NULL if not found */ - char* table_name) /* in: table name */ + /* out: table, NULL if not found */ + const char* table_name) /* in: table name */ { dict_table_t* table; ulint table_fold; @@ -562,8 +562,8 @@ UNIV_INLINE dict_table_t* dict_table_get_low( /*===============*/ - /* out: table, NULL if not found */ - char* table_name) /* in: table name */ + /* out: table, NULL if not found */ + const char* table_name) /* in: table name */ { dict_table_t* table; @@ -642,7 +642,7 @@ dict_table_get_index( /*=================*/ /* out: index, NULL if does not exist */ dict_table_t* table, /* in: table */ - char* name) /* in: index name */ + const char* name) /* in: index name */ { dict_index_t* index = NULL; diff --git a/innobase/include/dict0load.h b/innobase/include/dict0load.h index f7168a0f45f..d4dccb33373 100644 --- a/innobase/include/dict0load.h +++ b/innobase/include/dict0load.h @@ -31,9 +31,10 @@ Finds the first table name in the given database. */ char* dict_get_first_table_name_in_db( /*============================*/ - /* out, own: table name, NULL if does not exist; - the caller must free the memory in the string! */ - char* name); /* in: database name which ends to '/' */ + /* out, own: table name, NULL if + does not exist; the caller must free + the memory in the string! */ + const char* name); /* in: database name which ends to '/' */ /************************************************************************ Loads a table definition and also all its index definitions, and also the cluster definition if the table is a member in a cluster. Also loads @@ -43,11 +44,13 @@ a foreign key references columns in this table. */ dict_table_t* dict_load_table( /*============*/ - /* out: table, NULL if does not exist; if the table is - stored in an .ibd file, but the file does not exist, - then we set the ibd_file_missing flag TRUE in the table - object we return */ - char* name); /* in: table name */ + /* out: table, NULL if does not exist; + if the table is stored in an .ibd file, + but the file does not exist, + then we set the ibd_file_missing flag TRUE + in the table object we return */ + const char* name); /* in: table name in the + databasename/tablename format */ /*************************************************************************** Loads a table object based on the table id. */ @@ -75,8 +78,8 @@ already in the dictionary cache. */ ulint dict_load_foreigns( /*===============*/ - /* out: DB_SUCCESS or error code */ - char* table_name); /* in: table name */ + /* out: DB_SUCCESS or error code */ + const char* table_name); /* in: table name */ /************************************************************************ Prints to the standard output information on all tables found in the data dictionary system table. */ diff --git a/innobase/include/dict0mem.h b/innobase/include/dict0mem.h index 674868c9fce..f141ea9da09 100644 --- a/innobase/include/dict0mem.h +++ b/innobase/include/dict0mem.h @@ -48,27 +48,28 @@ Creates a table memory object. */ dict_table_t* dict_mem_table_create( /*==================*/ - /* out, own: table object */ - char* name, /* in: table name */ - ulint space, /* in: space where the clustered index of - the table is placed; this parameter is - ignored if the table is made a member of - a cluster */ - ulint n_cols); /* in: number of columns */ + /* out, own: table object */ + const char* name, /* in: table name */ + ulint space, /* in: space where the clustered index + of the table is placed; this parameter + is ignored if the table is made + a member of a cluster */ + ulint n_cols); /* in: number of columns */ /************************************************************************** Creates a cluster memory object. */ dict_cluster_t* dict_mem_cluster_create( /*====================*/ - /* out, own: cluster object (where the type - dict_cluster_t == dict_table_t) */ - char* name, /* in: cluster name */ - ulint space, /* in: space where the clustered indexes - of the member tables are placed */ - ulint n_cols, /* in: number of columns */ - ulint mix_len); /* in: length of the common key prefix in the - cluster */ + /* out, own: cluster object (where the + type dict_cluster_t == dict_table_t) */ + const char* name, /* in: cluster name */ + ulint space, /* in: space where the clustered + indexes of the member tables are + placed */ + ulint n_cols, /* in: number of columns */ + ulint mix_len); /* in: length of the common key prefix + in the cluster */ /************************************************************************** Declares a non-published table as a member in a cluster. */ @@ -76,7 +77,7 @@ void dict_mem_table_make_cluster_member( /*===============================*/ dict_table_t* table, /* in: non-published table */ - char* cluster_name); /* in: cluster name */ + const char* cluster_name); /* in: cluster name */ /************************************************************************** Adds a column definition to a table. */ @@ -84,7 +85,7 @@ void dict_mem_table_add_col( /*===================*/ dict_table_t* table, /* in: table */ - char* name, /* in: column name */ + const char* name, /* in: column name */ ulint mtype, /* in: main datatype */ ulint prtype, /* in: precise type */ ulint len, /* in: length */ @@ -95,14 +96,15 @@ Creates an index memory object. */ dict_index_t* dict_mem_index_create( /*==================*/ - /* out, own: index object */ - char* table_name, /* in: table name */ - char* index_name, /* in: index name */ - ulint space, /* in: space where the index tree is placed, - ignored if the index is of the clustered - type */ - ulint type, /* in: DICT_UNIQUE, DICT_CLUSTERED, ... ORed */ - ulint n_fields); /* in: number of fields */ + /* out, own: index object */ + const char* table_name, /* in: table name */ + const char* index_name, /* in: index name */ + ulint space, /* in: space where the index tree is + placed, ignored if the index is of + the clustered type */ + ulint type, /* in: DICT_UNIQUE, + DICT_CLUSTERED, ... ORed */ + ulint n_fields); /* in: number of fields */ /************************************************************************** Adds a field definition to an index. NOTE: does not take a copy of the column name if the field is a column. The memory occupied @@ -112,7 +114,7 @@ void dict_mem_index_add_field( /*=====================*/ dict_index_t* index, /* in: index */ - char* name, /* in: column name */ + const char* name, /* in: column name */ ulint order, /* in: order criterion; 0 means an ascending order */ ulint prefix_len); /* in: 0 or the column prefix length @@ -142,7 +144,7 @@ struct dict_col_struct{ clustered index */ ulint ord_part;/* count of how many times this column appears in ordering fields of an index */ - char* name; /* name */ + const char* name; /* name */ dtype_t type; /* data type */ dict_table_t* table; /* back pointer to table of this column */ ulint aux; /* this is used as an auxiliary variable @@ -154,7 +156,7 @@ struct dict_col_struct{ /* Data structure for a field in an index */ struct dict_field_struct{ dict_col_t* col; /* pointer to the table column */ - char* name; /* name of the column */ + const char* name; /* name of the column */ ulint order; /* flags for ordering this field: DICT_DESCEND, ... */ ulint prefix_len; /* 0 or the length of the column @@ -197,8 +199,8 @@ struct dict_index_struct{ dulint id; /* id of the index */ mem_heap_t* heap; /* memory heap */ ulint type; /* index type */ - char* name; /* index name */ - char* table_name; /* table name */ + const char* name; /* index name */ + const char* table_name; /* table name */ dict_table_t* table; /* back pointer to table */ ulint space; /* space where the index tree is placed */ ulint page_no;/* page number of the index tree root */ @@ -254,12 +256,12 @@ struct dict_foreign_struct{ or DICT_FOREIGN_ON_DELETE_SET_NULL */ char* foreign_table_name;/* foreign table name */ dict_table_t* foreign_table; /* table where the foreign key is */ - char** foreign_col_names;/* names of the columns in the + const char** foreign_col_names;/* names of the columns in the foreign key */ char* referenced_table_name;/* referenced table name */ dict_table_t* referenced_table;/* table where the referenced key is */ - char** referenced_col_names;/* names of the referenced + const char** referenced_col_names;/* names of the referenced columns in the referenced table */ ulint n_fields; /* number of indexes' first fields for which the the foreign key @@ -295,7 +297,7 @@ struct dict_table_struct{ dulint id; /* id of the table or cluster */ ulint type; /* DICT_TABLE_ORDINARY, ... */ mem_heap_t* heap; /* memory heap */ - char* name; /* table name */ + const char* name; /* table name */ ulint space; /* space where the clustered index of the table is placed */ ibool ibd_file_missing;/* TRUE if this is in a single-table @@ -363,7 +365,7 @@ struct dict_table_struct{ byte mix_id_buf[12]; /* mix id of a mixed table written in a compressed form */ - char* cluster_name; /* if the table is a member in a + const char* cluster_name; /* if the table is a member in a cluster, this is the name of the cluster */ /*----------------------*/ ibool does_not_fit_in_memory; diff --git a/innobase/include/fil0fil.h b/innobase/include/fil0fil.h index f7cdeb7f195..b750e9b38f2 100644 --- a/innobase/include/fil0fil.h +++ b/innobase/include/fil0fil.h @@ -132,11 +132,12 @@ Appends a new file to the chain of files of a space. File must be closed. */ void fil_node_create( /*============*/ - char* name, /* in: file name (file must be closed) */ - ulint size, /* in: file size in database blocks, rounded downwards - to an integer */ - ulint id, /* in: space id where to append */ - ibool is_raw);/* in: TRUE if a raw device or a raw disk partition */ + const char* name, /* in: file name (file must be closed) */ + ulint size, /* in: file size in database blocks, rounded + downwards to an integer */ + ulint id, /* in: space id where to append */ + ibool is_raw);/* in: TRUE if a raw device or + a raw disk partition */ /******************************************************************** Drops files from the start of a file space, so that its size is cut by the amount given. */ @@ -155,10 +156,10 @@ there is an error, prints an error message to the .err log. */ ibool fil_space_create( /*=============*/ - /* out: TRUE if success */ - char* name, /* in: space name */ - ulint id, /* in: space id */ - ulint purpose);/* in: FIL_TABLESPACE, or FIL_LOG if log */ + /* out: TRUE if success */ + const char* name, /* in: space name */ + ulint id, /* in: space id */ + ulint purpose);/* in: FIL_TABLESPACE, or FIL_LOG if log */ /*********************************************************************** Frees a space object from a the tablespace memory cache. Closes the files in the chain but does not delete them. */ @@ -327,14 +328,15 @@ tablespace memory cache. */ ibool fil_rename_tablespace( /*==================*/ - /* out: TRUE if success */ - char* old_name, /* in: old table name in the standard - databasename/tablename format of InnoDB, or - NULL if we do the rename based on the space - id only */ - ulint id, /* in: space id */ - char* new_name); /* in: new table name in the standard - databasename/tablename format of InnoDB */ + /* out: TRUE if success */ + const char* old_name, /* in: old table name in the standard + databasename/tablename format of + InnoDB, or NULL if we do the rename + based on the space id only */ + ulint id, /* in: space id */ + const char* new_name); /* in: new table name in the standard + databasename/tablename format + of InnoDB */ /*********************************************************************** Creates a new single-table tablespace to a database directory of MySQL. Database directories are under the 'datadir' of MySQL. The datadir is the @@ -344,14 +346,16 @@ path '.'. */ ulint fil_create_new_single_table_tablespace( /*===================================*/ - /* out: DB_SUCCESS or error code */ - ulint* space_id, /* in/out: space id; if this is != 0, then - this is an input parameter, otherwise - output */ - char* tablename, /* in: the table name in the usual - databasename/tablename format of InnoDB */ - ulint size); /* in: the initial size of the tablespace file - in pages, must be > 0 */ + /* out: DB_SUCCESS or error code */ + ulint* space_id, /* in/out: space id; if this is != 0, + then this is an input parameter, + otherwise output */ + const char* tablename, /* in: the table name in the usual + databasename/tablename format + of InnoDB */ + ulint size); /* in: the initial size of the + tablespace file in pages, + must be >= FIL_IBD_FILE_INITIAL_SIZE */ /************************************************************************ Tries to open a single-table tablespace and checks the space id is right in it. If does not succeed, prints an error message to the .err log. This @@ -362,10 +366,10 @@ protection of the dictionary mutex, so that two users cannot race here. */ ibool fil_open_single_table_tablespace( /*=============================*/ - /* out: TRUE if success */ - ulint id, /* in: space id */ - char* name); /* in: table name in the databasename/tablename - format */ + /* out: TRUE if success */ + ulint id, /* in: space id */ + const char* name); /* in: table name in the + databasename/tablename format */ /************************************************************************ It is possible, though very improbable, that the lsn's in the tablespace to be imported have risen above the current system lsn, if a lengthy purge, ibuf @@ -379,12 +383,12 @@ lsn's just by looking at that flush lsn. */ ibool fil_reset_too_high_lsns( /*====================*/ - /* out: TRUE if success */ - char* name, /* in: table name in the databasename/tablename - format */ - dulint current_lsn); /* in: reset lsn's if the lsn stamped to - FIL_PAGE_FILE_FLUSH_LSN in the first page is - too high */ + /* out: TRUE if success */ + const char* name, /* in: table name in the + databasename/tablename format */ + dulint current_lsn); /* in: reset lsn's if the lsn stamped + to FIL_PAGE_FILE_FLUSH_LSN in the + first page is too high */ /************************************************************************ At the server startup, if we need crash recovery, scans the database directories under the MySQL datadir, looking for .ibd files. Those files are @@ -436,20 +440,22 @@ there may be many tablespaces which are not yet in the memory cache. */ ibool fil_space_for_table_exists_in_mem( /*==============================*/ - /* out: TRUE if a matching tablespace - exists in the memory cache */ - ulint id, /* in: space id */ - char* name, /* in: table name in the standard - 'databasename/tablename' format */ - ibool mark_space, /* in: in crash recovery, at database startup - we mark all spaces which have an associated - table in the InnoDB data dictionary, so that - we can print a warning about orphaned - tablespaces */ - ibool print_error_if_does_not_exist); - /* in: print detailed error information to - the .err log if a matching tablespace is - not found from memory */ + /* out: TRUE if a matching tablespace + exists in the memory cache */ + ulint id, /* in: space id */ + const char* name, /* in: table name in the standard + 'databasename/tablename' format */ + ibool mark_space, /* in: in crash recovery, at database + startup we mark all spaces which have + an associated table in the InnoDB + data dictionary, so that + we can print a warning about orphaned + tablespaces */ + ibool print_error_if_does_not_exist); + /* in: print detailed error + information to the .err log if a + matching tablespace is not found from + memory */ /************************************************************************** Tries to extend a data file so that it would accommodate the number of pages given. The tablespace must be cached in the memory cache. If the space is big diff --git a/innobase/include/os0file.h b/innobase/include/os0file.h index 3eccfcd3be5..930390241d3 100644 --- a/innobase/include/os0file.h +++ b/innobase/include/os0file.h @@ -177,13 +177,15 @@ and '..' items at the start of the directory listing. */ os_file_dir_t os_file_opendir( /*============*/ - /* out: directory stream, NULL if error */ - char* dirname, /* in: directory name; it must not contain - a trailing '\' or '/' */ - ibool error_is_fatal);/* in: TRUE if we should treat an error as a - fatal error; if we try to open symlinks then - we do not wish a fatal error if it happens - not to be a directory */ + /* out: directory stream, NULL if + error */ + const char* dirname, /* in: directory name; it must not + contain a trailing '\' or '/' */ + ibool error_is_fatal);/* in: TRUE if we should treat an + error as a fatal error; if we try to + open symlinks then we do not wish a + fatal error if it happens not to be + a directory */ /*************************************************************************** Closes a directory stream. */ @@ -201,7 +203,7 @@ os_file_readdir_next_file( /*======================*/ /* out: 0 if ok, -1 if error, 1 if at the end of the directory */ - char* dirname,/* in: directory name or path */ + const char* dirname,/* in: directory name or path */ os_file_dir_t dir, /* in: directory stream */ os_file_stat_t* info); /* in/out: buffer where the info is returned */ /********************************************************************* @@ -213,81 +215,89 @@ fail_if_exists arguments is true. */ ibool os_file_create_directory( /*=====================*/ - /* out: TRUE if call succeeds, FALSE on - error */ - char* pathname, /* in: directory name as null-terminated - string */ - ibool fail_if_exists);/* in: if TRUE, pre-existing directory is - treated as an error. */ + /* out: TRUE if call succeeds, + FALSE on error */ + const char* pathname, /* in: directory name as + null-terminated string */ + ibool fail_if_exists);/* in: if TRUE, pre-existing directory + is treated as an error. */ /******************************************************************** A simple function to open or create a file. */ os_file_t os_file_create_simple( /*==================*/ - /* out, own: handle to the file, not defined if error, - error number can be retrieved with - os_file_get_last_error */ - char* name, /* in: name of the file or path as a null-terminated - string */ - ulint create_mode,/* in: OS_FILE_OPEN if an existing file is opened - (if does not exist, error), or OS_FILE_CREATE if a new - file is created (if exists, error), or - OS_FILE_CREATE_PATH if new file (if exists, error) and - subdirectories along its path are created (if needed)*/ - ulint access_type,/* in: OS_FILE_READ_ONLY or OS_FILE_READ_WRITE */ - ibool* success);/* out: TRUE if succeed, FALSE if error */ + /* out, own: handle to the file, not defined + if error, error number can be retrieved with + os_file_get_last_error */ + const char* name, /* in: name of the file or path as a + null-terminated string */ + ulint create_mode,/* in: OS_FILE_OPEN if an existing file is + opened (if does not exist, error), or + OS_FILE_CREATE if a new file is created + (if exists, error), or + OS_FILE_CREATE_PATH if new file + (if exists, error) and subdirectories along + its path are created (if needed)*/ + ulint access_type,/* in: OS_FILE_READ_ONLY or + OS_FILE_READ_WRITE */ + ibool* success);/* out: TRUE if succeed, FALSE if error */ /******************************************************************** A simple function to open or create a file. */ os_file_t os_file_create_simple_no_error_handling( /*====================================*/ - /* out, own: handle to the file, not defined if error, - error number can be retrieved with - os_file_get_last_error */ - char* name, /* in: name of the file or path as a null-terminated - string */ - ulint create_mode,/* in: OS_FILE_OPEN if an existing file is opened - (if does not exist, error), or OS_FILE_CREATE if a new - file is created (if exists, error) */ - ulint access_type,/* in: OS_FILE_READ_ONLY, OS_FILE_READ_WRITE, or - OS_FILE_READ_ALLOW_DELETE; the last option is used by - a backup program reading the file */ - ibool* success);/* out: TRUE if succeed, FALSE if error */ + /* out, own: handle to the file, not defined + if error, error number can be retrieved with + os_file_get_last_error */ + const char* name, /* in: name of the file or path as a + null-terminated string */ + ulint create_mode,/* in: OS_FILE_OPEN if an existing file + is opened (if does not exist, error), or + OS_FILE_CREATE if a new file is created + (if exists, error) */ + ulint access_type,/* in: OS_FILE_READ_ONLY, + OS_FILE_READ_WRITE, or + OS_FILE_READ_ALLOW_DELETE; the last option is + used by a backup program reading the file */ + ibool* success);/* out: TRUE if succeed, FALSE if error */ /******************************************************************** Opens an existing file or creates a new. */ os_file_t os_file_create( /*===========*/ - /* out, own: handle to the file, not defined if error, - error number can be retrieved with - os_file_get_last_error */ - char* name, /* in: name of the file or path as a null-terminated - string */ - ulint create_mode,/* in: OS_FILE_OPEN if an existing file is opened - (if does not exist, error), or OS_FILE_CREATE if a new - file is created (if exists, error), OS_FILE_OVERWRITE - if a new file is created or an old overwritten; - OS_FILE_OPEN_RAW, if a raw device or disk partition - should be opened */ - ulint purpose,/* in: OS_FILE_AIO, if asynchronous, non-buffered i/o - is desired, OS_FILE_NORMAL, if any normal file; - NOTE that it also depends on type, os_aio_.. and srv_.. - variables whether we really use async i/o or - unbuffered i/o: look in the function source code for - the exact rules */ - ulint type, /* in: OS_DATA_FILE or OS_LOG_FILE */ - ibool* success);/* out: TRUE if succeed, FALSE if error */ + /* out, own: handle to the file, not defined + if error, error number can be retrieved with + os_file_get_last_error */ + const char* name, /* in: name of the file or path as a + null-terminated string */ + ulint create_mode,/* in: OS_FILE_OPEN if an existing file + is opened (if does not exist, error), or + OS_FILE_CREATE if a new file is created + (if exists, error), + OS_FILE_OVERWRITE if a new file is created + or an old overwritten; + OS_FILE_OPEN_RAW, if a raw device or disk + partition should be opened */ + ulint purpose,/* in: OS_FILE_AIO, if asynchronous, + non-buffered i/o is desired, + OS_FILE_NORMAL, if any normal file; + NOTE that it also depends on type, os_aio_.. + and srv_.. variables whether we really use + async i/o or unbuffered i/o: look in the + function source code for the exact rules */ + ulint type, /* in: OS_DATA_FILE or OS_LOG_FILE */ + ibool* success);/* out: TRUE if succeed, FALSE if error */ /*************************************************************************** Deletes a file. The file has to be closed before calling this. */ ibool os_file_delete( /*===========*/ - /* out: TRUE if success */ - char* name); /* in: file path as a null-terminated string */ + /* out: TRUE if success */ + const char* name); /* in: file path as a null-terminated string */ /*************************************************************************** Deletes a file if it exists. The file has to be closed before calling this. */ @@ -295,8 +305,8 @@ Deletes a file if it exists. The file has to be closed before calling this. */ ibool os_file_delete_if_exists( /*=====================*/ - /* out: TRUE if success */ - char* name); /* in: file path as a null-terminated string */ + /* out: TRUE if success */ + const char* name); /* in: file path as a null-terminated string */ /*************************************************************************** Renames a file (can also move it to another directory). It is safest that the file is closed before calling this function. */ @@ -304,10 +314,10 @@ file is closed before calling this function. */ ibool os_file_rename( /*===========*/ - /* out: TRUE if success */ - char* oldpath, /* in: old file path as a null-terminated - string */ - char* newpath); /* in: new file path */ + /* out: TRUE if success */ + const char* oldpath, /* in: old file path as a + null-terminated string */ + const char* newpath); /* in: new file path */ /*************************************************************************** Closes a file handle. In case of error, error number can be retrieved with os_file_get_last_error. */ @@ -351,7 +361,7 @@ ibool os_file_set_size( /*=============*/ /* out: TRUE if success */ - char* name, /* in: name of the file or path as a + const char* name, /* in: name of the file or path as a null-terminated string */ os_file_t file, /* in: handle to a file */ ulint size, /* in: least significant 32 bits of file @@ -426,10 +436,10 @@ os_file_write( /*==========*/ /* out: TRUE if request was successful, FALSE if fail */ - char* name, /* in: name of the file or path as a + const char* name, /* in: name of the file or path as a null-terminated string */ os_file_t file, /* in: handle to a file */ - void* buf, /* in: buffer from which to write */ + const void* buf, /* in: buffer from which to write */ ulint offset, /* in: least significant 32 bits of file offset where to write */ ulint offset_high,/* in: most significant 32 bits of @@ -442,8 +452,8 @@ ibool os_file_status( /*===========*/ /* out: TRUE if call succeeded */ - char * path, /* in: pathname of the file */ - ibool * exists, /* out: TRUE if file exists */ + const char* path, /* in: pathname of the file */ + ibool* exists, /* out: TRUE if file exists */ os_file_type_t* type); /* out: type of the file (if it exists) */ /******************************************************************** The function os_file_dirname returns a directory component of a @@ -478,7 +488,7 @@ os_file_dirname( /*============*/ /* out, own: directory component of the pathname */ - char* path); /* in: pathname */ + const char* path); /* in: pathname */ /******************************************************************** Creates all missing subdirectories along the given path. */ @@ -487,7 +497,7 @@ os_file_create_subdirs_if_needed( /*=============================*/ /* out: TRUE if call succeeded FALSE otherwise */ - char* path); /* in: path name */ + const char* path); /* in: path name */ /**************************************************************************** Initializes the asynchronous io system. Creates separate aio array for non-ibuf read and write, a third aio array for the ibuf i/o, with just one @@ -527,7 +537,7 @@ os_aio( because i/os are not actually handled until all have been posted: use with great caution! */ - char* name, /* in: name of the file or path as a + const char* name, /* in: name of the file or path as a null-terminated string */ os_file_t file, /* in: handle to a file */ void* buf, /* in: buffer where to read or from which diff --git a/innobase/include/os0sync.h b/innobase/include/os0sync.h index e1cf263216e..d27b1676f1b 100644 --- a/innobase/include/os0sync.h +++ b/innobase/include/os0sync.h @@ -87,9 +87,9 @@ explicitly by calling sync_os_reset_event. */ os_event_t os_event_create( /*============*/ - /* out: the event handle */ - char* name); /* in: the name of the event, if NULL - the event is created without a name */ + /* out: the event handle */ + const char* name); /* in: the name of the event, if NULL + the event is created without a name */ #ifdef __WIN__ /************************************************************* Creates an auto-reset event semaphore, i.e., an event which is automatically @@ -98,9 +98,9 @@ reset when a single thread is released. Works only in Windows. */ os_event_t os_event_create_auto( /*=================*/ - /* out: the event handle */ - char* name); /* in: the name of the event, if NULL - the event is created without a name */ + /* out: the event handle */ + const char* name); /* in: the name of the event, if NULL + the event is created without a name */ #endif /************************************************************** Sets an event semaphore to the signaled state: lets waiting threads @@ -171,9 +171,9 @@ mutex semaphore of InnoDB itself (mutex_t) should be used where possible. */ os_mutex_t os_mutex_create( /*============*/ - /* out: the mutex handle */ - char* name); /* in: the name of the mutex, if NULL - the mutex is created without a name */ + /* out: the mutex handle */ + const char* name); /* in: the name of the mutex, if NULL + the mutex is created without a name */ /************************************************************** Acquires ownership of a mutex semaphore. */ diff --git a/innobase/include/pars0pars.h b/innobase/include/pars0pars.h index c260557c424..28985e2f9d0 100644 --- a/innobase/include/pars0pars.h +++ b/innobase/include/pars0pars.h @@ -74,8 +74,8 @@ Parses an SQL string returning the query graph. */ que_t* pars_sql( /*=====*/ - /* out, own: the query graph */ - char* str); /* in: SQL string */ + /* out, own: the query graph */ + const char* str); /* in: SQL string */ /***************************************************************** Retrieves characters to the lexical analyzer. */ diff --git a/innobase/include/pars0sym.h b/innobase/include/pars0sym.h index 3060fd06c8f..a40523861dd 100644 --- a/innobase/include/pars0sym.h +++ b/innobase/include/pars0sym.h @@ -122,7 +122,7 @@ struct sym_node_struct{ SYM_IMPLICIT_VAR, SYM_LIT, SYM_TABLE, SYM_CURSOR, ... */ - char* name; /* name of an id */ + const char* name; /* name of an id */ ulint name_len; /* id name length */ dict_table_t* table; /* table definition if a table id or a @@ -150,7 +150,7 @@ struct sym_tab_struct{ que_t* query_graph; /* query graph generated by the parser */ - char* sql_string; + const char* sql_string; /* SQL string to parse */ int string_len; /* SQL string length */ diff --git a/innobase/include/row0mysql.h b/innobase/include/row0mysql.h index 0b9f34dda1e..af6d8969cfc 100644 --- a/innobase/include/row0mysql.h +++ b/innobase/include/row0mysql.h @@ -316,15 +316,16 @@ fields than mentioned in the constraint. */ int row_table_add_foreign_constraints( /*==============================*/ - /* out: error code or DB_SUCCESS */ - trx_t* trx, /* in: transaction */ - char* sql_string, /* in: table create statement where - foreign keys are declared like: + /* out: error code or DB_SUCCESS */ + trx_t* trx, /* in: transaction */ + const char* sql_string, /* in: table create statement where + foreign keys are declared like: FOREIGN KEY (a, b) REFERENCES table2(c, d), - table2 can be written also with the database - name before it: test.table2 */ - char* name); /* in: table full name in the normalized form - database_name/table_name */ + table2 can be written also with the + database name before it: test.table2 */ + const char* name); /* in: table full name in the + normalized form + database_name/table_name */ /************************************************************************* The master thread in srv0srv.c calls this regularly to drop tables which we must drop in background after queries to them have ended. Such lazy @@ -351,10 +352,10 @@ output by the master thread. */ int row_drop_table_for_mysql( /*=====================*/ - /* out: error code or DB_SUCCESS */ - char* name, /* in: table name */ - trx_t* trx, /* in: transaction handle */ - ibool drop_db);/* in: TRUE=dropping whole database */ + /* out: error code or DB_SUCCESS */ + const char* name, /* in: table name */ + trx_t* trx, /* in: transaction handle */ + ibool drop_db);/* in: TRUE=dropping whole database */ /************************************************************************* Discards the tablespace of a table which stored in an .ibd file. Discarding @@ -382,9 +383,9 @@ discard ongoing operations. */ int row_discard_tablespace_for_mysql( /*=============================*/ - /* out: error code or DB_SUCCESS */ - char* name, /* in: table name */ - trx_t* trx); /* in: transaction handle */ + /* out: error code or DB_SUCCESS */ + const char* name, /* in: table name */ + trx_t* trx); /* in: transaction handle */ /********************************************************************* Imports a tablespace. The space id in the .ibd file must match the space id of the table in the data dictionary. */ @@ -392,28 +393,28 @@ of the table in the data dictionary. */ int row_import_tablespace_for_mysql( /*============================*/ - /* out: error code or DB_SUCCESS */ - char* name, /* in: table name */ - trx_t* trx); /* in: transaction handle */ + /* out: error code or DB_SUCCESS */ + const char* name, /* in: table name */ + trx_t* trx); /* in: transaction handle */ /************************************************************************* Drops a database for MySQL. */ int row_drop_database_for_mysql( /*========================*/ - /* out: error code or DB_SUCCESS */ - char* name, /* in: database name which ends to '/' */ - trx_t* trx); /* in: transaction handle */ + /* out: error code or DB_SUCCESS */ + const char* name, /* in: database name which ends to '/' */ + trx_t* trx); /* in: transaction handle */ /************************************************************************* Renames a table for MySQL. */ int row_rename_table_for_mysql( /*=======================*/ - /* out: error code or DB_SUCCESS */ - char* old_name, /* in: old table name */ - char* new_name, /* in: new table name */ - trx_t* trx); /* in: transaction handle */ + /* out: error code or DB_SUCCESS */ + const char* old_name, /* in: old table name */ + const char* new_name, /* in: new table name */ + trx_t* trx); /* in: transaction handle */ /************************************************************************* Checks a table for corruption. */ diff --git a/innobase/include/row0sel.h b/innobase/include/row0sel.h index a35d588ad08..0be224eb255 100644 --- a/innobase/include/row0sel.h +++ b/innobase/include/row0sel.h @@ -144,11 +144,11 @@ consistent read result, or store it to the query cache. */ ibool row_search_check_if_query_cache_permitted( /*======================================*/ - /* out: TRUE if storing or retrieving from - the query cache is permitted */ - trx_t* trx, /* in: transaction object */ - char* norm_name); /* in: concatenation of database name, '/' - char, table name */ + /* out: TRUE if storing or retrieving + from the query cache is permitted */ + trx_t* trx, /* in: transaction object */ + const char* norm_name); /* in: concatenation of database name, + '/' char, table name */ /* A structure for caching column values for prefetched rows */ diff --git a/innobase/include/trx0roll.h b/innobase/include/trx0roll.h index 0d7126c9c57..6004551f456 100644 --- a/innobase/include/trx0roll.h +++ b/innobase/include/trx0roll.h @@ -193,7 +193,7 @@ trx_rollback_to_savepoint_for_mysql( DB_NO_SAVEPOINT, otherwise DB_SUCCESS */ trx_t* trx, /* in: transaction handle */ - char* savepoint_name, /* in: savepoint name */ + const char* savepoint_name, /* in: savepoint name */ ib_longlong* mysql_binlog_cache_pos);/* out: the MySQL binlog cache position corresponding to this savepoint; MySQL needs this @@ -211,7 +211,7 @@ trx_savepoint_for_mysql( /*====================*/ /* out: always DB_SUCCESS */ trx_t* trx, /* in: transaction handle */ - char* savepoint_name, /* in: savepoint name */ + const char* savepoint_name, /* in: savepoint name */ ib_longlong binlog_cache_pos); /* in: MySQL binlog cache position corresponding to this connection at the time of the diff --git a/innobase/include/trx0sys.h b/innobase/include/trx0sys.h index 9987955ec76..7d20455ffdf 100644 --- a/innobase/include/trx0sys.h +++ b/innobase/include/trx0sys.h @@ -258,7 +258,7 @@ replication has proceeded. */ void trx_sys_update_mysql_binlog_offset( /*===============================*/ - char* file_name,/* in: MySQL log file name */ + const char* file_name,/* in: MySQL log file name */ ib_longlong offset, /* in: position in that log file */ ulint field, /* in: offset of the MySQL log info field in the trx sys header */ diff --git a/innobase/include/trx0trx.h b/innobase/include/trx0trx.h index 07d5e5a8215..a8c1df534da 100644 --- a/innobase/include/trx0trx.h +++ b/innobase/include/trx0trx.h @@ -315,7 +315,7 @@ struct trx_struct{ ulint magic_n; /* All the next fields are protected by the kernel mutex, except the undo logs which are protected by undo_mutex */ - char* op_info; /* English text describing the + const char* op_info; /* English text describing the current operation, or an empty string */ ulint type; /* TRX_USER, TRX_PURGE */ @@ -358,7 +358,7 @@ struct trx_struct{ char** mysql_query_str;/* pointer to the field in mysqld_thd which contains the pointer to the current SQL query string */ - char* mysql_log_file_name; + const char* mysql_log_file_name; /* if MySQL binlog is used, this field contains a pointer to the latest file name; this is NULL if binlog is not @@ -366,7 +366,7 @@ struct trx_struct{ ib_longlong mysql_log_offset;/* if MySQL binlog is used, this field contains the end offset of the binlog entry */ - char* mysql_master_log_file_name; + const char* mysql_master_log_file_name; /* if the database server is a MySQL replication slave, we have here the master binlog name up to which diff --git a/innobase/include/ut0rnd.h b/innobase/include/ut0rnd.h index c8ef0dd4001..aeec5d2f6eb 100644 --- a/innobase/include/ut0rnd.h +++ b/innobase/include/ut0rnd.h @@ -92,17 +92,17 @@ UNIV_INLINE ulint ut_fold_string( /*===========*/ - /* out: folded value */ - char* str); /* in: null-terminated string */ + /* out: folded value */ + const char* str); /* in: null-terminated string */ /***************************************************************** Folds a binary string. */ UNIV_INLINE ulint ut_fold_binary( /*===========*/ - /* out: folded value */ - byte* str, /* in: string of bytes */ - ulint len); /* in: length */ + /* out: folded value */ + const byte* str, /* in: string of bytes */ + ulint len); /* in: length */ /*************************************************************** Looks for a prime number slightly greater than the given argument. The prime is chosen so that it is not near any power of 2. */ diff --git a/innobase/include/ut0rnd.ic b/innobase/include/ut0rnd.ic index 5493c37404a..06d7012f60b 100644 --- a/innobase/include/ut0rnd.ic +++ b/innobase/include/ut0rnd.ic @@ -173,8 +173,8 @@ UNIV_INLINE ulint ut_fold_string( /*===========*/ - /* out: folded value */ - char* str) /* in: null-terminated string */ + /* out: folded value */ + const char* str) /* in: null-terminated string */ { #ifdef UNIV_DEBUG ulint i = 0; @@ -203,9 +203,9 @@ UNIV_INLINE ulint ut_fold_binary( /*===========*/ - /* out: folded value */ - byte* str, /* in: string of bytes */ - ulint len) /* in: length */ + /* out: folded value */ + const byte* str, /* in: string of bytes */ + ulint len) /* in: length */ { ulint i; ulint fold = 0; diff --git a/innobase/include/ut0ut.h b/innobase/include/ut0ut.h index 6c173f5cba9..04516535965 100644 --- a/innobase/include/ut0ut.h +++ b/innobase/include/ut0ut.h @@ -17,21 +17,6 @@ Created 1/20/1994 Heikki Tuuri typedef time_t ib_time_t; - -/************************************************************ -On the 64-bit Windows we substitute the format string -%l -> %I64 -because we define ulint as unsigned __int64 and lint as __int64 on Windows, -and both the Microsoft and Intel C compilers require the format string -%I64 in that case instead of %l. */ - -int -ut_printf( -/*======*/ - /* out: the number of characters written, or - negative in case of an error */ - const char* format, /* in: format of prints */ - ...); /* in: arguments to be printed */ /************************************************************ On the 64-bit Windows we substitute the format string %l -> %I64 diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index 1a158372563..5f5060c7464 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -70,7 +70,7 @@ struct os_aio_slot_struct{ bytes */ ulint offset_high; /* 32 high bits of file offset */ os_file_t file; /* file where to read or write */ - char* name; /* file name or path */ + const char* name; /* file name or path */ ibool io_already_done;/* used only in simulated aio: TRUE if the physical i/o already made and only the slot message @@ -415,7 +415,7 @@ os_file_handle_error_no_exit( /* out: TRUE if we should retry the operation */ os_file_t file, /* in: file pointer */ - char* name, /* in: name of a file or NULL */ + const char* name, /* in: name of a file or NULL */ const char* operation)/* in: operation */ { ulint err; @@ -493,13 +493,15 @@ and '..' items at the start of the directory listing. */ os_file_dir_t os_file_opendir( /*============*/ - /* out: directory stream, NULL if error */ - char* dirname, /* in: directory name; it must not contain - a trailing '\' or '/' */ - ibool error_is_fatal) /* in: TRUE if we should treat an error as a - fatal error; if we try to open symlinks then - we do not wish a fatal error if it happens - not to be a directory */ + /* out: directory stream, NULL if + error */ + const char* dirname, /* in: directory name; it must not + contain a trailing '\' or '/' */ + ibool error_is_fatal) /* in: TRUE if we should treat an + error as a fatal error; if we try to + open symlinks then we do not wish a + fatal error if it happens not to be + a directory */ { os_file_dir_t dir; #ifdef __WIN__ @@ -585,7 +587,7 @@ os_file_readdir_next_file( /*======================*/ /* out: 0 if ok, -1 if error, 1 if at the end of the directory */ - char* dirname,/* in: directory name or path */ + const char* dirname,/* in: directory name or path */ os_file_dir_t dir, /* in: directory stream */ os_file_stat_t* info) /* in/out: buffer where the info is returned */ { @@ -704,12 +706,12 @@ fail_if_exists arguments is true. */ ibool os_file_create_directory( /*=====================*/ - /* out: TRUE if call succeeds, FALSE on - error */ - char* pathname, /* in: directory name as null-terminated - string */ - ibool fail_if_exists) /* in: if TRUE, pre-existing directory is - treated as an error. */ + /* out: TRUE if call succeeds, + FALSE on error */ + const char* pathname, /* in: directory name as + null-terminated string */ + ibool fail_if_exists) /* in: if TRUE, pre-existing directory + is treated as an error. */ { #ifdef __WIN__ BOOL rcode; @@ -746,18 +748,21 @@ A simple function to open or create a file. */ os_file_t os_file_create_simple( /*==================*/ - /* out, own: handle to the file, not defined if error, - error number can be retrieved with - os_file_get_last_error */ - char* name, /* in: name of the file or path as a null-terminated - string */ - ulint create_mode,/* in: OS_FILE_OPEN if an existing file is opened - (if does not exist, error), or OS_FILE_CREATE if a new - file is created (if exists, error), or - OS_FILE_CREATE_PATH if new file (if exists, error) and - subdirectories along its path are created (if needed)*/ - ulint access_type,/* in: OS_FILE_READ_ONLY or OS_FILE_READ_WRITE */ - ibool* success)/* out: TRUE if succeed, FALSE if error */ + /* out, own: handle to the file, not defined + if error, error number can be retrieved with + os_file_get_last_error */ + const char* name, /* in: name of the file or path as a + null-terminated string */ + ulint create_mode,/* in: OS_FILE_OPEN if an existing file is + opened (if does not exist, error), or + OS_FILE_CREATE if a new file is created + (if exists, error), or + OS_FILE_CREATE_PATH if new file + (if exists, error) and subdirectories along + its path are created (if needed)*/ + ulint access_type,/* in: OS_FILE_READ_ONLY or + OS_FILE_READ_WRITE */ + ibool* success)/* out: TRUE if succeed, FALSE if error */ { #ifdef __WIN__ os_file_t file; @@ -882,18 +887,20 @@ A simple function to open or create a file. */ os_file_t os_file_create_simple_no_error_handling( /*====================================*/ - /* out, own: handle to the file, not defined if error, - error number can be retrieved with - os_file_get_last_error */ - char* name, /* in: name of the file or path as a null-terminated - string */ - ulint create_mode,/* in: OS_FILE_OPEN if an existing file is opened - (if does not exist, error), or OS_FILE_CREATE if a new - file is created (if exists, error) */ - ulint access_type,/* in: OS_FILE_READ_ONLY, OS_FILE_READ_WRITE, or - OS_FILE_READ_ALLOW_DELETE; the last option is used by - a backup program reading the file */ - ibool* success)/* out: TRUE if succeed, FALSE if error */ + /* out, own: handle to the file, not defined + if error, error number can be retrieved with + os_file_get_last_error */ + const char* name, /* in: name of the file or path as a + null-terminated string */ + ulint create_mode,/* in: OS_FILE_OPEN if an existing file + is opened (if does not exist, error), or + OS_FILE_CREATE if a new file is created + (if exists, error) */ + ulint access_type,/* in: OS_FILE_READ_ONLY, + OS_FILE_READ_WRITE, or + OS_FILE_READ_ALLOW_DELETE; the last option is + used by a backup program reading the file */ + ibool* success)/* out: TRUE if succeed, FALSE if error */ { #ifdef __WIN__ os_file_t file; @@ -991,25 +998,28 @@ Opens an existing file or creates a new. */ os_file_t os_file_create( /*===========*/ - /* out, own: handle to the file, not defined if error, - error number can be retrieved with - os_file_get_last_error */ - char* name, /* in: name of the file or path as a null-terminated - string */ - ulint create_mode, /* in: OS_FILE_OPEN if an existing file is opened - (if does not exist, error), or OS_FILE_CREATE if a new - file is created (if exists, error), OS_FILE_OVERWRITE - if a new is created or an old overwritten, - OS_FILE_OPEN_RAW, if a raw device or disk partition - should be opened */ - ulint purpose,/* in: OS_FILE_AIO, if asynchronous, non-buffered i/o - is desired, OS_FILE_NORMAL, if any normal file; - NOTE that it also depends on type, os_aio_.. and srv_.. - variables whether we really use async i/o or - unbuffered i/o: look in the function source code for - the exact rules */ - ulint type, /* in: OS_DATA_FILE or OS_LOG_FILE */ - ibool* success)/* out: TRUE if succeed, FALSE if error */ + /* out, own: handle to the file, not defined + if error, error number can be retrieved with + os_file_get_last_error */ + const char* name, /* in: name of the file or path as a + null-terminated string */ + ulint create_mode,/* in: OS_FILE_OPEN if an existing file + is opened (if does not exist, error), or + OS_FILE_CREATE if a new file is created + (if exists, error), + OS_FILE_OVERWRITE if a new file is created + or an old overwritten; + OS_FILE_OPEN_RAW, if a raw device or disk + partition should be opened */ + ulint purpose,/* in: OS_FILE_AIO, if asynchronous, + non-buffered i/o is desired, + OS_FILE_NORMAL, if any normal file; + NOTE that it also depends on type, os_aio_.. + and srv_.. variables whether we really use + async i/o or unbuffered i/o: look in the + function source code for the exact rules */ + ulint type, /* in: OS_DATA_FILE or OS_LOG_FILE */ + ibool* success)/* out: TRUE if succeed, FALSE if error */ { #ifdef __WIN__ os_file_t file; @@ -1202,8 +1212,8 @@ Deletes a file if it exists. The file has to be closed before calling this. */ ibool os_file_delete_if_exists( /*=====================*/ - /* out: TRUE if success */ - char* name) /* in: file path as a null-terminated string */ + /* out: TRUE if success */ + const char* name) /* in: file path as a null-terminated string */ { #ifdef __WIN__ BOOL ret; @@ -1263,8 +1273,8 @@ Deletes a file. The file has to be closed before calling this. */ ibool os_file_delete( /*===========*/ - /* out: TRUE if success */ - char* name) /* in: file path as a null-terminated string */ + /* out: TRUE if success */ + const char* name) /* in: file path as a null-terminated string */ { #ifdef __WIN__ BOOL ret; @@ -1327,9 +1337,9 @@ ibool os_file_rename( /*===========*/ /* out: TRUE if success */ - char* oldpath, /* in: old file path as a null-terminated + const char* oldpath,/* in: old file path as a null-terminated string */ - char* newpath) /* in: new file path */ + const char* newpath)/* in: new file path */ { #ifdef __WIN__ BOOL ret; @@ -1340,7 +1350,7 @@ os_file_rename( return(TRUE); } - os_file_handle_error(NULL, oldpath, "delete"); + os_file_handle_error(NULL, oldpath, "rename"); return(FALSE); #else @@ -1516,7 +1526,7 @@ ibool os_file_set_size( /*=============*/ /* out: TRUE if success */ - char* name, /* in: name of the file or path as a + const char* name, /* in: name of the file or path as a null-terminated string */ os_file_t file, /* in: handle to a file */ ulint size, /* in: least significant 32 bits of file @@ -1777,7 +1787,7 @@ os_file_pwrite( /*===========*/ /* out: number of bytes written, -1 if error */ os_file_t file, /* in: handle to a file */ - void* buf, /* in: buffer from where to write */ + const void* buf, /* in: buffer from where to write */ ulint n, /* in: number of bytes to write */ ulint offset, /* in: least significant 32 bits of file offset where to write */ @@ -2057,10 +2067,10 @@ os_file_write( /*==========*/ /* out: TRUE if request was successful, FALSE if fail */ - char* name, /* in: name of the file or path as a + const char* name, /* in: name of the file or path as a null-terminated string */ os_file_t file, /* in: handle to a file */ - void* buf, /* in: buffer from which to write */ + const void* buf, /* in: buffer from which to write */ ulint offset, /* in: least significant 32 bits of file offset where to write */ ulint offset_high, /* in: most significant 32 bits of @@ -2214,7 +2224,7 @@ ibool os_file_status( /*===========*/ /* out: TRUE if call succeeded */ - char* path, /* in: pathname of the file */ + const char* path, /* in: pathname of the file */ ibool* exists, /* out: TRUE if file exists */ os_file_type_t* type) /* out: type of the file (if it exists) */ { @@ -2319,7 +2329,7 @@ os_file_dirname( /*============*/ /* out, own: directory component of the pathname */ - char* path) /* in: pathname */ + const char* path) /* in: pathname */ { char* dir; int i, length, last_slash; @@ -2356,7 +2366,7 @@ os_file_create_subdirs_if_needed( /*=============================*/ /* out: TRUE if call succeeded FALSE otherwise */ - char* path) /* in: path name */ + const char* path) /* in: path name */ { char* subdir; static char rootdir[2] = { OS_FILE_PATH_SEPARATOR, 0 }; @@ -2753,7 +2763,7 @@ os_aio_array_reserve_slot( void* message2,/* in: message to be passed along with the aio operation */ os_file_t file, /* in: file handle */ - char* name, /* in: name of the file or path as a + const char* name, /* in: name of the file or path as a null-terminated string */ void* buf, /* in: buffer where to read or from which to write */ @@ -3000,7 +3010,7 @@ os_aio( because i/os are not actually handled until all have been posted: use with great caution! */ - char* name, /* in: name of the file or path as a + const char* name, /* in: name of the file or path as a null-terminated string */ os_file_t file, /* in: handle to a file */ void* buf, /* in: buffer where to read or from which @@ -3543,6 +3553,7 @@ consecutive_loop: if (n_consecutive == 1) { /* We can use the buffer of the i/o request */ combined_buf = slot->buf; + combined_buf2 = NULL; } else { combined_buf2 = ut_malloc(total_len + UNIV_PAGE_SIZE); @@ -3638,7 +3649,7 @@ consecutive_loop: } } - if (n_consecutive > 1) { + if (combined_buf2) { ut_free(combined_buf2); } diff --git a/innobase/os/os0sync.c b/innobase/os/os0sync.c index 7cbaf1f5123..c48c44a4c70 100644 --- a/innobase/os/os0sync.c +++ b/innobase/os/os0sync.c @@ -109,9 +109,9 @@ must be reset explicitly by calling sync_os_reset_event. */ os_event_t os_event_create( /*============*/ - /* out: the event handle */ - char* name) /* in: the name of the event, if NULL - the event is created without a name */ + /* out: the event handle */ + const char* name) /* in: the name of the event, if NULL + the event is created without a name */ { #ifdef __WIN__ os_event_t event; @@ -166,9 +166,9 @@ reset when a single thread is released. Works only in Windows. */ os_event_t os_event_create_auto( /*=================*/ - /* out: the event handle */ - char* name) /* in: the name of the event, if NULL - the event is created without a name */ + /* out: the event handle */ + const char* name) /* in: the name of the event, if NULL + the event is created without a name */ { os_event_t event; @@ -430,9 +430,9 @@ mutex semaphore of InnoDB itself (mutex_t) should be used where possible. */ os_mutex_t os_mutex_create( /*============*/ - /* out: the mutex handle */ - char* name) /* in: the name of the mutex, if NULL - the mutex is created without a name */ + /* out: the mutex handle */ + const char* name) /* in: the name of the mutex, if NULL + the mutex is created without a name */ { #ifdef __WIN__ HANDLE mutex; diff --git a/innobase/pars/pars0pars.c b/innobase/pars/pars0pars.c index 7e835d9ada1..12451b4d94d 100644 --- a/innobase/pars/pars0pars.c +++ b/innobase/pars/pars0pars.c @@ -1729,8 +1729,8 @@ Parses an SQL string returning the query graph. */ que_t* pars_sql( /*=====*/ - /* out, own: the query graph */ - char* str) /* in: SQL string */ + /* out, own: the query graph */ + const char* str) /* in: SQL string */ { sym_node_t* sym_node; mem_heap_t* heap; diff --git a/innobase/pars/pars0sym.c b/innobase/pars/pars0sym.c index 1a0608ed142..194e6677183 100644 --- a/innobase/pars/pars0sym.c +++ b/innobase/pars/pars0sym.c @@ -217,13 +217,10 @@ sym_tab_add_id( node->common.type = QUE_NODE_SYMBOL; - node->name = mem_heap_alloc(sym_tab->heap, len + 1); node->resolved = FALSE; node->indirection = NULL; - ut_memcpy(node->name, name, len); - node->name[len] = '\0'; - + node->name = mem_heap_strdupl(sym_tab->heap, name, len + 1); node->name_len = len; UT_LIST_ADD_LAST(sym_list, sym_tab->sym_list, node); diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c index 154da11da58..61be3a7248e 100644 --- a/innobase/row/row0mysql.c +++ b/innobase/row/row0mysql.c @@ -1686,15 +1686,16 @@ constraints which reference this table are ok. */ int row_table_add_foreign_constraints( /*==============================*/ - /* out: error code or DB_SUCCESS */ - trx_t* trx, /* in: transaction */ - char* sql_string, /* in: table create statement where - foreign keys are declared like: + /* out: error code or DB_SUCCESS */ + trx_t* trx, /* in: transaction */ + const char* sql_string, /* in: table create statement where + foreign keys are declared like: FOREIGN KEY (a, b) REFERENCES table2(c, d), - table2 can be written also with the database - name before it: test.table2 */ - char* name) /* in: table full name in the normalized form - database_name/table_name */ + table2 can be written also with the + database name before it: test.table2 */ + const char* name) /* in: table full name in the + normalized form + database_name/table_name */ { ulint err; @@ -1940,9 +1941,9 @@ discard ongoing operations. */ int row_discard_tablespace_for_mysql( /*=============================*/ - /* out: error code or DB_SUCCESS */ - char* name, /* in: table name */ - trx_t* trx) /* in: transaction handle */ + /* out: error code or DB_SUCCESS */ + const char* name, /* in: table name */ + trx_t* trx) /* in: transaction handle */ { dulint new_id; dict_table_t* table; @@ -2071,9 +2072,9 @@ of the table in the data dictionary. */ int row_import_tablespace_for_mysql( /*============================*/ - /* out: error code or DB_SUCCESS */ - char* name, /* in: table name */ - trx_t* trx) /* in: transaction handle */ + /* out: error code or DB_SUCCESS */ + const char* name, /* in: table name */ + trx_t* trx) /* in: transaction handle */ { dict_table_t* table; ibool success; @@ -2177,10 +2178,10 @@ the corresponding monitor output by the master thread. */ int row_drop_table_for_mysql( /*=====================*/ - /* out: error code or DB_SUCCESS */ - char* name, /* in: table name */ - trx_t* trx, /* in: transaction handle */ - ibool drop_db)/* in: TRUE=dropping whole database */ + /* out: error code or DB_SUCCESS */ + const char* name, /* in: table name */ + trx_t* trx, /* in: transaction handle */ + ibool drop_db)/* in: TRUE=dropping whole database */ { dict_foreign_t* foreign; dict_table_t* table; @@ -2519,9 +2520,9 @@ Drops a database for MySQL. */ int row_drop_database_for_mysql( /*========================*/ - /* out: error code or DB_SUCCESS */ - char* name, /* in: database name which ends to '/' */ - trx_t* trx) /* in: transaction handle */ + /* out: error code or DB_SUCCESS */ + const char* name, /* in: database name which ends to '/' */ + trx_t* trx) /* in: transaction handle */ { dict_table_t* table; char* table_name; @@ -2611,10 +2612,10 @@ Renames a table for MySQL. */ int row_rename_table_for_mysql( /*=======================*/ - /* out: error code or DB_SUCCESS */ - char* old_name, /* in: old table name */ - char* new_name, /* in: new table name */ - trx_t* trx) /* in: transaction handle */ + /* out: error code or DB_SUCCESS */ + const char* old_name, /* in: old table name */ + const char* new_name, /* in: new table name */ + trx_t* trx) /* in: transaction handle */ { dict_table_t* table; que_thr_t* thr; diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c index 47d61459d47..ff9b697c02f 100644 --- a/innobase/row/row0sel.c +++ b/innobase/row/row0sel.c @@ -3585,11 +3585,11 @@ consistent read result, or store it to the query cache. */ ibool row_search_check_if_query_cache_permitted( /*======================================*/ - /* out: TRUE if storing or retrieving from - the query cache is permitted */ - trx_t* trx, /* in: transaction object */ - char* norm_name) /* in: concatenation of database name, '/' - char, table name */ + /* out: TRUE if storing or retrieving + from the query cache is permitted */ + trx_t* trx, /* in: transaction object */ + const char* norm_name) /* in: concatenation of database name, + '/' char, table name */ { dict_table_t* table; ibool ret = FALSE; diff --git a/innobase/trx/trx0roll.c b/innobase/trx/trx0roll.c index 5c01a5371aa..e2e4f24b82e 100644 --- a/innobase/trx/trx0roll.c +++ b/innobase/trx/trx0roll.c @@ -200,7 +200,7 @@ trx_rollback_to_savepoint_for_mysql( DB_NO_SAVEPOINT, otherwise DB_SUCCESS */ trx_t* trx, /* in: transaction handle */ - char* savepoint_name, /* in: savepoint name */ + const char* savepoint_name, /* in: savepoint name */ ib_longlong* mysql_binlog_cache_pos) /* out: the MySQL binlog cache position corresponding to this savepoint; MySQL needs this @@ -265,7 +265,7 @@ trx_savepoint_for_mysql( /*====================*/ /* out: always DB_SUCCESS */ trx_t* trx, /* in: transaction handle */ - char* savepoint_name, /* in: savepoint name */ + const char* savepoint_name, /* in: savepoint name */ ib_longlong binlog_cache_pos) /* in: MySQL binlog cache position corresponding to this connection at the time of the diff --git a/innobase/trx/trx0sys.c b/innobase/trx/trx0sys.c index ef068d8d523..87abcbefa52 100644 --- a/innobase/trx/trx0sys.c +++ b/innobase/trx/trx0sys.c @@ -569,7 +569,7 @@ replication has proceeded. */ void trx_sys_update_mysql_binlog_offset( /*===============================*/ - char* file_name,/* in: MySQL log file name */ + const char* file_name,/* in: MySQL log file name */ ib_longlong offset, /* in: position in that log file */ ulint field, /* in: offset of the MySQL log info field in the trx sys header */ From 93168d599dfd311f27e508338443a10ece38e16a Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 May 2004 14:51:46 +0300 Subject: [PATCH 107/162] InnoDB cleanup: Remove unused function ut_printf() innobase/ut/ut0ut.c: Remove unused function ut_printf() --- innobase/ut/ut0ut.c | 73 --------------------------------------------- 1 file changed, 73 deletions(-) diff --git a/innobase/ut/ut0ut.c b/innobase/ut/ut0ut.c index 21677e98318..cce98cf5644 100644 --- a/innobase/ut/ut0ut.c +++ b/innobase/ut/ut0ut.c @@ -36,79 +36,6 @@ because we define ulint as unsigned __int64 and lint as __int64 on Windows, and both the Microsoft and Intel C compilers require the format string %I64 in that case instead of %l. */ -int -ut_printf( -/*======*/ - /* out: the number of characters written, or - negative in case of an error */ - const char* format, /* in: format of prints */ - ...) /* in: arguments to be printed */ -{ - va_list args; - ulint len; - char* format_end; - char* newformat; - char* ptr; - char* newptr; - int ret; - char format_buf_in_stack[500]; - - len = strlen(format); - - if (len > 250) { - newformat = malloc(2 * len); - } else { - newformat = format_buf_in_stack; - } - - format_end = (char*)format + len; - - ptr = (char*)format; - newptr = newformat; - -#if defined(__WIN__) && (defined(WIN64) || defined(_WIN64)) - /* Replace %l with %I64 if it is not preceded with '\' */ - - while (ptr < format_end) { - if (*ptr == '%' && *(ptr + 1) == 'l' - && (ptr == format || *(ptr - 1) != '\\')) { - - memcpy(newptr, "%I64", 4); - ptr += 2; - newptr += 4; - } else { - *newptr = *ptr; - ptr++; - newptr++; - } - } - - *newptr = '\0'; - - ut_a(newptr < newformat + 2 * len); -#else - strcpy(newformat, format); -#endif - va_start(args, format); - - ret = vprintf((const char*)newformat, args); - - va_end(args); - - if (newformat != format_buf_in_stack) { - free(newformat); - } - - return(ret); -} - -/************************************************************ -On the 64-bit Windows we substitute the format string -%l -> %I64 -because we define ulint as unsigned __int64 and lint as __int64 on Windows, -and both the Microsoft and Intel C compilers require the format string -%I64 in that case instead of %l. */ - int ut_sprintf( /*=======*/ From 31280b062439846f9d64c26817372deea7bb8c54 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 May 2004 16:19:55 +0300 Subject: [PATCH 108/162] InnoDB: srv0srv.c: Remove reference to sync0ipm.h (fix ChangeSet@1.1833) innobase/srv/srv0srv.c: Remove reference to sync0ipm.h --- innobase/srv/srv0srv.c | 1 - 1 file changed, 1 deletion(-) diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c index ba1f72d0a58..a78bd0d864c 100644 --- a/innobase/srv/srv0srv.c +++ b/innobase/srv/srv0srv.c @@ -32,7 +32,6 @@ Created 10/8/1995 Heikki Tuuri #include "mem0mem.h" #include "mem0pool.h" #include "sync0sync.h" -#include "sync0ipm.h" #include "thr0loc.h" #include "que0que.h" #include "srv0que.h" From d4f6c7a4c7e836fb81bd4b21a1ea8b1e69d0c917 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 May 2004 17:27:25 +0300 Subject: [PATCH 109/162] dict0dict.c: Allocate the table name buffer from the mem heap of a foreign key object rather than pointing to the name buffer in the table object; even though this apparently caused no bugs in RENAME, DROP, ALTER TABLE, or elsewhere, this convention was very prone to memory allocation bugs innobase/dict/dict0dict.c: Allocate the table name buffer from the mem heap of a foreign key object rather than pointing to the name buffer in the table object; even though this apparently caused no bugs in RENAME, DROP, ALTER TABLE, or elsewhere, this convention was very prone to memory allocation bugs --- innobase/dict/dict0dict.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c index 51e92a9900f..0fc4ac2b687 100644 --- a/innobase/dict/dict0dict.c +++ b/innobase/dict/dict0dict.c @@ -2892,7 +2892,8 @@ col_loop1: } foreign->foreign_table = table; - foreign->foreign_table_name = table->name; + foreign->foreign_table_name = mem_heap_strdup(foreign->heap, + table->name); foreign->foreign_index = index; foreign->n_fields = i; foreign->foreign_col_names = mem_heap_alloc(foreign->heap, From 742606bafd847fac184f9d335604bfc79cbdff88 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 May 2004 18:45:59 +0200 Subject: [PATCH 110/162] current_thd is 0 if ha_resolve_by_name() is called when parsing command-line options --- sql/handler.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sql/handler.cc b/sql/handler.cc index f8eca1b93ef..9acd55db0b1 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -103,15 +103,16 @@ TYPELIB tx_isolation_typelib= {array_elements(tx_isolation_names)-1,"", enum db_type ha_resolve_by_name(const char *name, uint namelen) { - if (!my_strcasecmp(&my_charset_latin1, name, "DEFAULT")) { - return(enum db_type) current_thd->variables.table_type; + THD *thd=current_thd; + if (thd && !my_strcasecmp(&my_charset_latin1, name, "DEFAULT")) { + return (enum db_type) thd->variables.table_type; } show_table_type_st *types; for (types= sys_table_types; types->type; types++) { if (!my_strcasecmp(&my_charset_latin1, name, types->type)) - return(enum db_type)types->db_type; + return (enum db_type) types->db_type; } return DB_TYPE_UNKNOWN; } From 08d1de2c167ff900965aa9f0951a02077a4f663f Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 18 May 2004 01:53:06 +0300 Subject: [PATCH 111/162] mem0pool.c: Fix a memory corruption bug: in 32-bit computers, every 4 billionth malloc outside innodb_additional_mem_pool_size was mistreated when freeing the memory; this could corrupt the InnoDB additional mem pool and could have caused crashes anywhere, also inside MySQL, or even database corruption! the bug exists also in 3.23 and 4.1; workaround: configure innodb_additional_mem_pool_size big enough innobase/mem/mem0pool.c: Fix a memory corruption bug: in 32-bit computers, every 4 billionth malloc outside innodb_additional_mem_pool_size was mistreated when freeing the memory; this could corrupt the InnoDB additional mem pool and could have caused crashes anywhere, also inside MySQL, or even database corruption! the bug exists also in 3.23 and 4.1; workaround: configure innodb_additional_mem_pool_size big enough --- innobase/mem/mem0pool.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/innobase/mem/mem0pool.c b/innobase/mem/mem0pool.c index 3c409e3fceb..d77432a1e20 100644 --- a/innobase/mem/mem0pool.c +++ b/innobase/mem/mem0pool.c @@ -97,8 +97,6 @@ struct mem_pool_struct{ /* The common memory pool */ mem_pool_t* mem_comm_pool = NULL; -ulint mem_out_of_mem_err_msg_count = 0; - /* We use this counter to check that the mem pool mutex does not leak; this is to track a strange assertion failure reported at mysql@lists.mysql.com */ @@ -266,8 +264,6 @@ mem_pool_fill_free_list( if (i >= 63) { /* We come here when we have run out of space in the memory pool: */ - - mem_out_of_mem_err_msg_count++; return(FALSE); } @@ -460,17 +456,13 @@ mem_area_free( ulint size; ulint n; - if (mem_out_of_mem_err_msg_count > 0) { - /* It may be that the area was really allocated from the - OS with regular malloc: check if ptr points within - our memory pool */ + /* It may be that the area was really allocated from the OS with + regular malloc: check if ptr points within our memory pool */ - if ((byte*)ptr < pool->buf - || (byte*)ptr >= pool->buf + pool->size) { - ut_free(ptr); + if ((byte*)ptr < pool->buf || (byte*)ptr >= pool->buf + pool->size) { + ut_free(ptr); - return; - } + return; } area = (mem_area_t*) (((byte*)ptr) - MEM_AREA_EXTRA_SIZE); From 4471aadb7cc34dedbd29f15c372e72f5c468f5b6 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 18 May 2004 12:16:00 +0500 Subject: [PATCH 112/162] A fix (Bug #3728: Missing warning in 4.1). --- mysql-test/r/type_datetime.result | 6 ++++++ sql/field.cc | 5 +++++ sql/time.cc | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index cc29c676283..66eb744e7ce 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -35,6 +35,12 @@ Table Op Msg_type Msg_text test.t1 check status OK delete from t1; insert into t1 values("000101"),("691231"),("700101"),("991231"),("00000101"),("00010101"),("99991231"),("00101000000"),("691231000000"),("700101000000"),("991231235959"),("10000101000000"),("99991231235959"),("20030102030460"),("20030102036301"),("20030102240401"),("20030132030401"),("20031302030460"); +Warnings: +Warning 1264 Data truncated, out of range for column 't' at row 14 +Warning 1264 Data truncated, out of range for column 't' at row 15 +Warning 1264 Data truncated, out of range for column 't' at row 16 +Warning 1264 Data truncated, out of range for column 't' at row 17 +Warning 1264 Data truncated, out of range for column 't' at row 18 select * from t1; t 2000-01-01 00:00:00 diff --git a/sql/field.cc b/sql/field.cc index 1ad7e039363..944f18080f6 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -3930,6 +3930,11 @@ void Field_newdate::sql_type(String &res) const int Field_datetime::store(const char *from,uint len,CHARSET_INFO *cs) { longlong tmp=str_to_datetime(from,len,1); + if (tmp < 0) + { + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + tmp= 0; + } #ifdef WORDS_BIGENDIAN if (table->db_low_byte_first) { diff --git a/sql/time.cc b/sql/time.cc index 7fb466f6b97..a5e081dfb30 100644 --- a/sql/time.cc +++ b/sql/time.cc @@ -667,7 +667,7 @@ longlong str_to_datetime(const char *str,uint length, uint fuzzy_date) { TIME l_time; if (str_to_TIME(str,length,&l_time,fuzzy_date) <= TIMESTAMP_DATETIME_ERROR) - return(0); + return -1; return (longlong) (l_time.year*LL(10000000000) + l_time.month*LL(100000000)+ l_time.day*LL(1000000)+ From 30afc0b52b34a0dfff9f485a94592ee17b4552ba Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 18 May 2004 09:56:45 +0200 Subject: [PATCH 113/162] after merge fix --- client/mysql.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/mysql.cc b/client/mysql.cc index cf80a5594e4..14fb1e1f917 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -2406,7 +2406,7 @@ com_shell(String *buffer, char *line __attribute__((unused))) char *shell_cmd; /* Skip space from line begin */ - while (isspace(*line)) + while (my_isspace(charset_info, *line)) line++; if (!(shell_cmd = strchr(line, ' '))) { From d8229afab9d91009b15ac31dd555e87760b7cca9 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 18 May 2004 10:29:20 +0200 Subject: [PATCH 114/162] don't try to purge closed logs --- sql/sql_parse.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index f2458068633..58b125b3ddc 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -4613,7 +4613,7 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables, mysql_bin_log.new_file(1); mysql_slow_log.new_file(1); #ifdef HAVE_REPLICATION - if (expire_logs_days) + if (mysql_bin_log.is_open() && expire_logs_days) { long purge_time= time(0) - expire_logs_days*24*60*60; if (purge_time >= 0) From 056ee93c5c27dc0c1db6939e98c68ad34cd54671 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 18 May 2004 19:13:21 +0500 Subject: [PATCH 115/162] embedded library: fix for sending of parameters to stored procedure. using of methods like sint2korr() doesn't work on Bigendian machines sql/sql_prepare.cc: special 'embedded' patches added to almost all set_parameter_XXX functions --- sql/sql_prepare.cc | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 68da21018a0..a8e2cabe44b 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -256,8 +256,11 @@ void set_param_short(Item_param *param, uchar **pos, ulong len) #ifndef EMBEDDED_LIBRARY if (len < 2) return; -#endif int16 value= sint2korr(*pos); +#else + int16 value; + shortget(value, *pos); +#endif param->set_int(param->unsigned_flag ? (longlong) ((uint16) value) : (longlong) value); *pos+= 2; @@ -268,8 +271,11 @@ void set_param_int32(Item_param *param, uchar **pos, ulong len) #ifndef EMBEDDED_LIBRARY if (len < 4) return; -#endif int32 value= sint4korr(*pos); +#else + int32 value; + longget(value, *pos); +#endif param->set_int(param->unsigned_flag ? (longlong) ((uint32) value) : (longlong) value); *pos+= 4; @@ -280,9 +286,13 @@ void set_param_int64(Item_param *param, uchar **pos, ulong len) #ifndef EMBEDDED_LIBRARY if (len < 8) return; -#endif param->set_int((longlong)sint8korr(*pos)); *pos+= 8; +#else + longlong value; + longlongget(value, *pos); + param->set_int(value); +#endif } void set_param_float(Item_param *param, uchar **pos, ulong len) From 934982f51af5d711fa148be294742bda938ae7c8 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 18 May 2004 17:26:49 +0300 Subject: [PATCH 116/162] Fixed a bug in mysql-copy-right-2 script. As it was, it destroyed some ndb source files, such as ha_ndbcluster.cc --- Build-tools/mysql-copyright-2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build-tools/mysql-copyright-2 b/Build-tools/mysql-copyright-2 index 447a2d7c164..e946ed217d1 100755 --- a/Build-tools/mysql-copyright-2 +++ b/Build-tools/mysql-copyright-2 @@ -93,7 +93,7 @@ sub add_copyright { $start_copyright="/* "; $line_copyright= " "; - $end_copyright= " */"; + $end_copyright= "*/"; } elsif ($ARGV =~ /-x86\.s$/) { From e015ee3918e5d61cd5635c399383120b91e7098d Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 18 May 2004 09:54:36 -0700 Subject: [PATCH 117/162] Updating range_in_rows for the include file for ha_example (the main .cc file has already been updated). sql/examples/ha_example.h: Updating ha_example.h for new records_in_range. ha_example.cc has already been updated. --- sql/examples/ha_example.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sql/examples/ha_example.h b/sql/examples/ha_example.h index ffc4f5b941c..2228f04284a 100644 --- a/sql/examples/ha_example.h +++ b/sql/examples/ha_example.h @@ -114,10 +114,8 @@ public: int reset(void); int external_lock(THD *thd, int lock_type); int delete_all_rows(void); - ha_rows records_in_range(int inx, const byte *start_key,uint start_key_len, - enum ha_rkey_function start_search_flag, - const byte *end_key,uint end_key_len, - enum ha_rkey_function end_search_flag); + ha_rows records_in_range(uint inx, key_range *min_key, + key_range *max_key); int delete_table(const char *from); int rename_table(const char * from, const char * to); int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info); From cdf7471c2c504840bd6feb1e7c634a2d1ad8ed89 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 18 May 2004 22:59:43 +0400 Subject: [PATCH 118/162] Fix and test case for BUG#3649. mysql-test/r/handler.result: Test case for BUG#3649 mysql-test/t/handler.test: Test case for BUG#3649 sql/sql_handler.cc: Fix for BUG#3649: when doing an index scan for an equality condition, use index_next_same to retrieve subsequent rows. --- mysql-test/r/handler.result | 12 +++++++ mysql-test/t/handler.test | 12 +++++++ sql/sql_handler.cc | 68 +++++++++++++++++++++---------------- 3 files changed, 63 insertions(+), 29 deletions(-) diff --git a/mysql-test/r/handler.result b/mysql-test/r/handler.result index 1cfc3a9de8b..50d51cf14f4 100644 --- a/mysql-test/r/handler.result +++ b/mysql-test/r/handler.result @@ -191,3 +191,15 @@ Ok handler t close; use test; drop table t1; +create table t1 ( a int, b int, INDEX a (a) ); +insert into t1 values (1,2), (2,1); +handler t1 open; +handler t1 read a=(1) where b=2; +a b +1 2 +handler t1 read a=(1) where b=3; +a b +handler t1 read a=(1) where b=1; +a b +handler t1 close; +drop table t1; diff --git a/mysql-test/t/handler.test b/mysql-test/t/handler.test index 936902fd9bf..1f7f32c930a 100644 --- a/mysql-test/t/handler.test +++ b/mysql-test/t/handler.test @@ -123,3 +123,15 @@ handler t close; use test; drop table t1; +# +# BUG#3649 +# +create table t1 ( a int, b int, INDEX a (a) ); +insert into t1 values (1,2), (2,1); +handler t1 open; +handler t1 read a=(1) where b=2; +handler t1 read a=(1) where b=3; +handler t1 read a=(1) where b=1; +handler t1 close; +drop table t1; + diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc index a80b4040882..6f7bb319258 100644 --- a/sql/sql_handler.cc +++ b/sql/sql_handler.cc @@ -103,7 +103,7 @@ int mysql_ha_closeall(THD *thd, TABLE_LIST *tables) } static enum enum_ha_read_modes rkey_to_rnext[]= - { RNEXT, RNEXT, RPREV, RNEXT, RPREV, RNEXT, RPREV }; + { RKEY, RNEXT, RPREV, RNEXT, RPREV, RNEXT, RPREV }; int mysql_ha_read(THD *thd, TABLE_LIST *tables, @@ -151,6 +151,10 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables, HANDLER_TABLES_HACK(thd); MYSQL_LOCK *lock=mysql_lock_tables(thd,&tables->table,1); HANDLER_TABLES_HACK(thd); + + byte *key= NULL; + uint key_len; + LINT_INIT(key_len); /* protected by key key variable */ if (!lock) goto err0; // mysql_lock_tables() printed error message already @@ -185,40 +189,46 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables, break; case RKEY: { - DBUG_ASSERT(keyname != 0); - KEY *keyinfo=table->key_info+keyno; - KEY_PART_INFO *key_part=keyinfo->key_part; - uint key_len; - byte *key; - if (key_expr->elements > keyinfo->key_parts) + if (key) { - my_printf_error(ER_TOO_MANY_KEY_PARTS,ER(ER_TOO_MANY_KEY_PARTS), - MYF(0),keyinfo->key_parts); - goto err; + /* Continue scan on "(keypart1,keypart2,...)=(c1, c2, ...) */ + err= table->file->index_next_same(table->record[0], key, key_len); } - List_iterator_fast it_ke(*key_expr); - Item *item; - for (key_len=0 ; (item=it_ke++) ; key_part++) + else { - if (item->fix_fields(thd, tables)) - goto err; - if (item->used_tables() & ~RAND_TABLE_BIT) + DBUG_ASSERT(keyname != 0); + KEY *keyinfo=table->key_info+keyno; + KEY_PART_INFO *key_part=keyinfo->key_part; + if (key_expr->elements > keyinfo->key_parts) { - my_error(ER_WRONG_ARGUMENTS,MYF(0),"HANDLER ... READ"); - goto err; + my_printf_error(ER_TOO_MANY_KEY_PARTS,ER(ER_TOO_MANY_KEY_PARTS), + MYF(0),keyinfo->key_parts); + goto err; } - item->save_in_field(key_part->field, 1); - key_len+=key_part->store_length; + List_iterator_fast it_ke(*key_expr); + Item *item; + for (key_len=0 ; (item=it_ke++) ; key_part++) + { + if (item->fix_fields(thd, tables)) + goto err; + if (item->used_tables() & ~RAND_TABLE_BIT) + { + my_error(ER_WRONG_ARGUMENTS,MYF(0),"HANDLER ... READ"); + goto err; + } + item->save_in_field(key_part->field, 1); + key_len+=key_part->store_length; + } + if (!(key= (byte*) thd->calloc(ALIGN_SIZE(key_len)))) + { + send_error(&thd->net,ER_OUTOFMEMORY); + goto err; + } + key_copy(key, table, keyno, key_len); + err=table->file->index_read(table->record[0], + key,key_len,ha_rkey_mode); + mode=rkey_to_rnext[(int)ha_rkey_mode]; } - if (!(key= (byte*) thd->calloc(ALIGN_SIZE(key_len)))) - { - send_error(&thd->net,ER_OUTOFMEMORY); - goto err; - } - key_copy(key, table, keyno, key_len); - err=table->file->index_read(table->record[0], - key,key_len,ha_rkey_mode); - mode=rkey_to_rnext[(int)ha_rkey_mode]; break; } default: From ea44ccb00f770387bad01eff938866a38d013a75 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 19 May 2004 02:18:54 +0400 Subject: [PATCH 119/162] Fix for BUG33649: Post-review fixes sql/sql_class.h: Fix for BUG33649: Post-review fixes: added RNEXT_SAME sql/sql_handler.cc: Fix for BUG33649: Post-review fixes: added RNEXT_SAME --- sql/sql_class.h | 2 +- sql/sql_handler.cc | 70 ++++++++++++++++++++++------------------------ 2 files changed, 35 insertions(+), 37 deletions(-) diff --git a/sql/sql_class.h b/sql/sql_class.h index 83dc75e2b84..9663957963f 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -28,7 +28,7 @@ class Load_log_event; class Slave_log_event; enum enum_enable_or_disable { LEAVE_AS_IS, ENABLE, DISABLE }; -enum enum_ha_read_modes { RFIRST, RNEXT, RPREV, RLAST, RKEY }; +enum enum_ha_read_modes { RFIRST, RNEXT, RPREV, RLAST, RKEY, RNEXT_SAME }; enum enum_duplicates { DUP_ERROR, DUP_REPLACE, DUP_IGNORE }; enum enum_log_type { LOG_CLOSED, LOG_TO_BE_OPENED, LOG_NORMAL, LOG_NEW, LOG_BIN}; enum enum_delay_key_write { DELAY_KEY_WRITE_NONE, DELAY_KEY_WRITE_ON, diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc index 6f7bb319258..022ca76a0af 100644 --- a/sql/sql_handler.cc +++ b/sql/sql_handler.cc @@ -103,7 +103,7 @@ int mysql_ha_closeall(THD *thd, TABLE_LIST *tables) } static enum enum_ha_read_modes rkey_to_rnext[]= - { RKEY, RNEXT, RPREV, RNEXT, RPREV, RNEXT, RPREV }; + { RNEXT_SAME, RNEXT, RPREV, RNEXT, RPREV, RNEXT, RPREV }; int mysql_ha_read(THD *thd, TABLE_LIST *tables, @@ -152,9 +152,10 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables, MYSQL_LOCK *lock=mysql_lock_tables(thd,&tables->table,1); HANDLER_TABLES_HACK(thd); - byte *key= NULL; + byte *key; uint key_len; - LINT_INIT(key_len); /* protected by key key variable */ + LINT_INIT(key); + LINT_INIT(key_len); if (!lock) goto err0; // mysql_lock_tables() printed error message already @@ -187,48 +188,45 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables, DBUG_ASSERT(keyname != 0); err=table->file->index_prev(table->record[0]); break; + case RNEXT_SAME: + /* Continue scan on "(keypart1,keypart2,...)=(c1, c2, ...) */ + DBUG_ASSERT(keyname != 0); + err= table->file->index_next_same(table->record[0], key, key_len); + break; case RKEY: { - if (key) + DBUG_ASSERT(keyname != 0); + KEY *keyinfo=table->key_info+keyno; + KEY_PART_INFO *key_part=keyinfo->key_part; + if (key_expr->elements > keyinfo->key_parts) { - /* Continue scan on "(keypart1,keypart2,...)=(c1, c2, ...) */ - err= table->file->index_next_same(table->record[0], key, key_len); + my_printf_error(ER_TOO_MANY_KEY_PARTS,ER(ER_TOO_MANY_KEY_PARTS), + MYF(0),keyinfo->key_parts); + goto err; } - else + List_iterator_fast it_ke(*key_expr); + Item *item; + for (key_len=0 ; (item=it_ke++) ; key_part++) { - DBUG_ASSERT(keyname != 0); - KEY *keyinfo=table->key_info+keyno; - KEY_PART_INFO *key_part=keyinfo->key_part; - if (key_expr->elements > keyinfo->key_parts) + if (item->fix_fields(thd, tables)) + goto err; + if (item->used_tables() & ~RAND_TABLE_BIT) { - my_printf_error(ER_TOO_MANY_KEY_PARTS,ER(ER_TOO_MANY_KEY_PARTS), - MYF(0),keyinfo->key_parts); + my_error(ER_WRONG_ARGUMENTS,MYF(0),"HANDLER ... READ"); goto err; } - List_iterator_fast it_ke(*key_expr); - Item *item; - for (key_len=0 ; (item=it_ke++) ; key_part++) - { - if (item->fix_fields(thd, tables)) - goto err; - if (item->used_tables() & ~RAND_TABLE_BIT) - { - my_error(ER_WRONG_ARGUMENTS,MYF(0),"HANDLER ... READ"); - goto err; - } - item->save_in_field(key_part->field, 1); - key_len+=key_part->store_length; - } - if (!(key= (byte*) thd->calloc(ALIGN_SIZE(key_len)))) - { - send_error(&thd->net,ER_OUTOFMEMORY); - goto err; - } - key_copy(key, table, keyno, key_len); - err=table->file->index_read(table->record[0], - key,key_len,ha_rkey_mode); - mode=rkey_to_rnext[(int)ha_rkey_mode]; + item->save_in_field(key_part->field, 1); + key_len+=key_part->store_length; } + if (!(key= (byte*) thd->calloc(ALIGN_SIZE(key_len)))) + { + send_error(&thd->net,ER_OUTOFMEMORY); + goto err; + } + key_copy(key, table, keyno, key_len); + err=table->file->index_read(table->record[0], + key,key_len,ha_rkey_mode); + mode=rkey_to_rnext[(int)ha_rkey_mode]; break; } default: From a41883facfdda411441cc868d2af278360c3dbe5 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 19 May 2004 05:09:10 +0300 Subject: [PATCH 120/162] Portability fixes Fixed wrong number of warnings/duplicates for machines with high-byte-first client/mysql.cc: Remove not used variables client/mysqltest.c: Remove double ; myisam/ft_nlq_search.c: Fix valgrind error (not fatal) myisam/rt_test.c: Portability fix mysql-test/r/rpl_trunc_binlog.result: Portability fix mysql-test/t/rpl_trunc_binlog.test: Portability fix (Column 23 was different on openbsd) sql/sql_insert.cc: Fixed wrong number of warnings/duplicates for machines with high-byte-first strings/ctype-big5.c: Portability fix strings/ctype-gbk.c: Portability fix strings/ctype-mb.c: Portability fix strings/ctype-uca.c: Portability fix tests/client_test.c: Portability fixes --- client/mysql.cc | 4 +--- client/mysqltest.c | 2 +- myisam/ft_nlq_search.c | 5 +++-- myisam/rt_test.c | 2 +- mysql-test/r/rpl_trunc_binlog.result | 2 +- mysql-test/t/rpl_trunc_binlog.test | 2 +- sql/sql_insert.cc | 4 ++-- strings/ctype-big5.c | 10 +++++----- strings/ctype-gbk.c | 8 ++++---- strings/ctype-mb.c | 2 +- strings/ctype-uca.c | 6 +++--- tests/client_test.c | 20 +++++++++++--------- 12 files changed, 34 insertions(+), 33 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index cf80a5594e4..e58790e5232 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -1239,7 +1239,6 @@ static void fix_history(String *final_command) static int not_in_history(const char *line) { HIST_ENTRY *oldhist = history_get(history_length); - int num; if (oldhist == 0) return 1; @@ -1589,7 +1588,6 @@ static int com_server_help(String *buffer __attribute__((unused)), const char *server_cmd= buffer->ptr(); char cmd_buf[100]; MYSQL_RES *result; - MYSQL_FIELD *fields; int error; if (help_arg[0] != '\'') @@ -1615,7 +1613,7 @@ static int com_server_help(String *buffer __attribute__((unused)), { unsigned int num_fields= mysql_num_fields(result); my_ulonglong num_rows= mysql_num_rows(result); - fields= mysql_fetch_fields(result); + mysql_fetch_fields(result); if (num_fields==3 && num_rows==1) { if (!(cur= mysql_fetch_row(result))) diff --git a/client/mysqltest.c b/client/mysqltest.c index 2cd395a02b8..303473ef558 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -109,7 +109,7 @@ MYSQL_MANAGER* manager=0; static char **default_argv; static const char *load_default_groups[]= { "mysqltest","client",0 }; -static char line_buffer[MAX_DELIMITER], *line_buffer_pos= line_buffer;; +static char line_buffer[MAX_DELIMITER], *line_buffer_pos= line_buffer; static FILE* file_stack[MAX_INCLUDE_DEPTH]; static FILE** cur_file; diff --git a/myisam/ft_nlq_search.c b/myisam/ft_nlq_search.c index 9b42d51ab55..c9caf4f39af 100644 --- a/myisam/ft_nlq_search.c +++ b/myisam/ft_nlq_search.c @@ -90,8 +90,9 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio) /* Skip rows inserted by current inserted */ for (r=_mi_search(info, keyinfo, keybuff, keylen, SEARCH_FIND, key_root) ; - (subkeys=ft_sintXkorr(info->lastkey+info->lastkey_length-extra)) > 0 && - !r && info->lastpos >= info->state->data_file_length ; + !r && + (subkeys=ft_sintXkorr(info->lastkey+info->lastkey_length-extra)) > 0 && + info->lastpos >= info->state->data_file_length ; r= _mi_search_next(info, keyinfo, info->lastkey, info->lastkey_length, SEARCH_BIGGER, key_root)) ; diff --git a/myisam/rt_test.c b/myisam/rt_test.c index c1126c1939a..41cc56d4d78 100644 --- a/myisam/rt_test.c +++ b/myisam/rt_test.c @@ -39,7 +39,7 @@ int main(int argc __attribute__((unused)),char *argv[] __attribute__((unused))) } -int run_test(const char *filename) +static int run_test(const char *filename) { MI_INFO *file; MI_UNIQUEDEF uniquedef; diff --git a/mysql-test/r/rpl_trunc_binlog.result b/mysql-test/r/rpl_trunc_binlog.result index ad0fb9e5022..085a2937584 100644 --- a/mysql-test/r/rpl_trunc_binlog.result +++ b/mysql-test/r/rpl_trunc_binlog.result @@ -10,4 +10,4 @@ reset slave; start slave; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 4 slave-relay-bin.000002 123 master-bin.000001 Yes No 0 Rolling back unfinished transaction (no COMMIT or ROLLBACK) from relay log. A probable cause is that the master died while writing the transaction to its binary log. 0 79 326 None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 4 slave-relay-bin.000002 123 master-bin.000001 Yes No 0 Rolling back unfinished transaction (no COMMIT or ROLLBACK) from relay log. A probable cause is that the master died while writing the transaction to its binary log. 0 79 # None 0 No # diff --git a/mysql-test/t/rpl_trunc_binlog.test b/mysql-test/t/rpl_trunc_binlog.test index 32052af9184..2ade41ee96d 100644 --- a/mysql-test/t/rpl_trunc_binlog.test +++ b/mysql-test/t/rpl_trunc_binlog.test @@ -21,5 +21,5 @@ start slave; # can't sync_with_master so we must sleep sleep 3; --replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 33 # +--replace_column 1 # 23 # 33 # show slave status; diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 1bf95b8bded..3aa0e9511a7 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -411,7 +411,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, (ulong) (info.records - info.copied), (ulong) thd->cuted_fields); else sprintf(buff, ER(ER_INSERT_INFO), (ulong) info.records, - (ulong) info.deleted+info.updated, (ulong) thd->cuted_fields); + (ulong) (info.deleted+info.updated), (ulong) thd->cuted_fields); ::send_ok(thd,info.copied+info.deleted+info.updated,(ulonglong)id,buff); } free_underlaid_joins(thd, &thd->lex->select_lex); @@ -1582,7 +1582,7 @@ bool select_insert::send_eof() (ulong) (info.records - info.copied), (ulong) thd->cuted_fields); else sprintf(buff, ER(ER_INSERT_INFO), (ulong) info.records, - (ulong) info.deleted+info.updated, (ulong) thd->cuted_fields); + (ulong) (info.deleted+info.updated), (ulong) thd->cuted_fields); ::send_ok(thd,info.copied+info.deleted+info.updated,last_insert_id,buff); DBUG_RETURN(0); } diff --git a/strings/ctype-big5.c b/strings/ctype-big5.c index 2bde29ecc47..ccb8d07e786 100644 --- a/strings/ctype-big5.c +++ b/strings/ctype-big5.c @@ -223,7 +223,7 @@ static uint16 big5strokexfrm(uint16 i) static int my_strnncoll_big5_internal(const uchar **a_res, const uchar **b_res, uint length) { - const char *a= *a_res, *b= *b_res; + const uchar *a= *a_res, *b= *b_res; while (length--) { @@ -236,10 +236,10 @@ static int my_strnncoll_big5_internal(const uchar **a_res, b+= 2; length--; } - else if (sort_order_big5[(uchar) *a++] != - sort_order_big5[(uchar) *b++]) - return ((int) sort_order_big5[(uchar) a[-1]] - - (int) sort_order_big5[(uchar) b[-1]]); + else if (sort_order_big5[*a++] != + sort_order_big5[*b++]) + return ((int) sort_order_big5[a[-1]] - + (int) sort_order_big5[b[-1]]); } *a_res= a; *b_res= b; diff --git a/strings/ctype-gbk.c b/strings/ctype-gbk.c index 1990060e67b..577f8a33275 100644 --- a/strings/ctype-gbk.c +++ b/strings/ctype-gbk.c @@ -2585,7 +2585,7 @@ static uint16 gbksortorder(uint16 i) int my_strnncoll_gbk_internal(const uchar **a_res, const uchar **b_res, uint length) { - const char *a= *a_res, *b= *b_res; + const uchar *a= *a_res, *b= *b_res; uint a_char,b_char; while (length--) @@ -2601,9 +2601,9 @@ int my_strnncoll_gbk_internal(const uchar **a_res, const uchar **b_res, b+= 2; length--; } - else if (sort_order_gbk[(uchar) *a++] != sort_order_gbk[(uchar) *b++]) - return ((int) sort_order_gbk[(uchar) a[-1]] - - (int) sort_order_gbk[(uchar) b[-1]]); + else if (sort_order_gbk[*a++] != sort_order_gbk[*b++]) + return ((int) sort_order_gbk[a[-1]] - + (int) sort_order_gbk[b[-1]]); } *a_res= a; *b_res= b; diff --git a/strings/ctype-mb.c b/strings/ctype-mb.c index ed772a68845..9b02cd3b3da 100644 --- a/strings/ctype-mb.c +++ b/strings/ctype-mb.c @@ -283,7 +283,7 @@ uint my_well_formed_len_mb(CHARSET_INFO *cs, while (pos) { - if ((mblen= cs->cset->mb_wc(cs, &wc, b, e)) <0) + if ((mblen= cs->cset->mb_wc(cs, &wc, (uchar*) b, (uchar*) e)) <0) break; b+= mblen; pos--; diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c index ac805bf0a5a..72c28d92ca8 100644 --- a/strings/ctype-uca.c +++ b/strings/ctype-uca.c @@ -6750,8 +6750,8 @@ static int my_strnncollsp_uca(CHARSET_INFO *cs, int s_res; int t_res; - slen= cs->cset->lengthsp(cs, s, slen); - tlen= cs->cset->lengthsp(cs, t, tlen); + slen= cs->cset->lengthsp(cs, (char*) s, slen); + tlen= cs->cset->lengthsp(cs, (char*) t, tlen); my_uca_scanner_init(&sscanner, cs, s, slen); my_uca_scanner_init(&tscanner, cs, t, tlen); @@ -6796,7 +6796,7 @@ static void my_hash_sort_uca(CHARSET_INFO *cs, int s_res; my_uca_scanner scanner; - slen= cs->cset->lengthsp(cs, s, slen); + slen= cs->cset->lengthsp(cs, (char*) s, slen); my_uca_scanner_init(&scanner, cs, s, slen); while ((s_res= my_uca_scanner_next(&scanner)) >0) diff --git a/tests/client_test.c b/tests/client_test.c index c244274a2e7..871d09eb324 100644 --- a/tests/client_test.c +++ b/tests/client_test.c @@ -2400,7 +2400,8 @@ static void test_long_data_str() MYSQL_STMT *stmt; int rc, i; char data[255]; - long length, length1; + long length; + ulong length1; MYSQL_RES *result; MYSQL_BIND bind[2]; my_bool is_null[2]; @@ -2495,8 +2496,8 @@ static void test_long_data_str1() MYSQL_STMT *stmt; int rc, i; char data[255]; - long length, length1; - ulong max_blob_length, blob_length; + long length; + ulong max_blob_length, blob_length, length1; my_bool true_value; MYSQL_RES *result; MYSQL_BIND bind[2]; @@ -3084,7 +3085,7 @@ static void test_bind_result_ext() char szData[20], bData[20]; ulong szLength, bLength; MYSQL_BIND bind[8]; - long length[8]; + ulong length[8]; my_bool is_null[8]; myheader("test_bind_result_ext"); @@ -5376,7 +5377,7 @@ static void test_store_result2() MYSQL_STMT *stmt; int rc; int nData; - long length; + ulong length; MYSQL_BIND bind[1]; myheader("test_store_result2"); @@ -8094,7 +8095,7 @@ static void test_ts() MYSQL_TIME ts; MYSQL_RES *prep_res; char strts[30]; - long length; + ulong length; int rc, field_count; char name; @@ -8974,7 +8975,8 @@ static void test_multi() char *query; MYSQL_BIND bind[1]; int rc, i; - long param= 1, length= 1; + long param= 1; + ulong length= 1; myheader("test_multi"); bind[0].buffer_type= MYSQL_TYPE_LONG; @@ -9100,7 +9102,7 @@ static void test_bind_nagative() int rc; MYSQL_BIND bind[1]; long my_val = 0L; - long my_length = 0L; + ulong my_length = 0L; long my_null = 0L; myheader("test_insert_select"); @@ -9141,7 +9143,7 @@ static void test_derived() int rc, i; MYSQL_BIND bind[1]; long my_val = 0L; - long my_length = 0L; + ulong my_length = 0L; long my_null = 0L; const char *query= "select count(1) from (select f.id from t1 f where f.id=?) as x"; From 458f07519c830ddc46d082246dad0ad7cb93f71c Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 19 May 2004 16:42:29 +0400 Subject: [PATCH 121/162] Fix for Bug#3754 "SET GLOBAL myisam_max_sort_file_size doesn't work as expected": precision-losing conversion removed from sys_var_thd_ulonglong. mysql-test/r/variables.result: Test case for Bug#3754 mysql-test/t/variables.test: Test case for Bug#3754 sql/set_var.cc: Fix for Bug#3754: precision-losing conversion removed from sys_var_thd_ulonglong. --- mysql-test/r/variables.result | 4 ++++ mysql-test/t/variables.test | 8 +++++++- sql/set_var.cc | 4 ++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index b4a607cb174..f84364089bc 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -377,3 +377,7 @@ select 1; 1 select @@session.key_buffer_size; Variable 'key_buffer_size' is a GLOBAL variable +set global myisam_max_sort_file_size=4294967296; +show global variables like 'myisam_max_sort_file_size'; +Variable_name Value +myisam_max_sort_file_size 4294967296 diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index ec86a763023..e59667d6af4 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -268,4 +268,10 @@ select @@xxxxxxxxxx; select 1; --error 1238 -select @@session.key_buffer_size; \ No newline at end of file +select @@session.key_buffer_size; + +# Bug#3754 SET GLOBAL myisam_max_sort_file_size doesn't work as +# expected: check that there is no overflow when 64-bit unsigned +# variables are set +set global myisam_max_sort_file_size=4294967296; +show global variables like 'myisam_max_sort_file_size'; diff --git a/sql/set_var.cc b/sql/set_var.cc index eb94ad2ebf6..1657d0d0bcb 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -965,11 +965,11 @@ bool sys_var_thd_ulonglong::update(THD *thd, set_var *var) { ulonglong tmp= var->value->val_int(); - if ((ulonglong) tmp > max_system_variables.*offset) + if (tmp > max_system_variables.*offset) tmp= max_system_variables.*offset; if (option_limits) - tmp= (ulong) getopt_ull_limit_value(tmp, option_limits); + tmp= getopt_ull_limit_value(tmp, option_limits); if (var->type == OPT_GLOBAL) { /* Lock is needed to make things safe on 32 bit systems */ From de2c35230fc68eebcbe64e8e629195f1c4d9e76a Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 19 May 2004 14:51:41 +0200 Subject: [PATCH 122/162] Fixed BUG#3709: SELECT INTO 1 FROM DUAL not parsed as expected Made the combination of INTO and FROM DUAL work, e.g. SELECT 1 INTO @x FROM DUAL. As a consequence, DUAL is made a reserved word. It would work to not have it reserved, but it was deemed to be confusing as a user defined table by the same name then must be qualified with a db (schema). sql/sql_yacc.yy: Made the combination of INTO and FROM DUAL work, e.g. SELECT 1 INTO @x FROM DUAL. As a consequence, DUAL is made a reserved word. It would work to not have it reserved, but it was deemed to be confusing as a user defined table by the same name then must be qualified with a db (schema). --- sql/sql_yacc.yy | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index d7ef1fc8d7f..45e8e6e67e2 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -1153,7 +1153,6 @@ merge_insert_types: opt_select_from: opt_limit_clause {} - | FROM DUAL_SYM {} | select_from select_lock_type; udf_func_type: @@ -2296,17 +2295,19 @@ select_part2: select_into: opt_limit_clause {} - | FROM DUAL_SYM /* oracle compatibility: oracle always requires FROM - clause, and DUAL is system table without fields. - Is "SELECT 1 FROM DUAL" any better than - "SELECT 1" ? Hmmm :) */ | into | select_from | into select_from | select_from into; select_from: - FROM join_table_list where_clause group_clause having_clause opt_order_clause opt_limit_clause procedure_clause; + FROM join_table_list where_clause group_clause having_clause + opt_order_clause opt_limit_clause procedure_clause + | FROM DUAL_SYM /* oracle compatibility: oracle always requires FROM + clause, and DUAL is system table without fields. + Is "SELECT 1 FROM DUAL" any better than + "SELECT 1" ? Hmmm :) */ + ; select_options: /* empty*/ @@ -4929,7 +4930,6 @@ keyword: | DIRECTORY_SYM {} | DISCARD {} | DO_SYM {} - | DUAL_SYM {} | DUMPFILE {} | DUPLICATE_SYM {} | DYNAMIC_SYM {} From 66c96f2c57edf8cff71734a8fa7fcba8b04f2f49 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 19 May 2004 15:03:32 +0200 Subject: [PATCH 123/162] Fix for BUG#3829 "Setting server_id on fly doesn't allow replication to start" (fix by our Harrison Fisk): when one does SET GLOBAL SERVER_ID=x, we must set server_id_supplied to 1. sql/mysql_priv.h: server_id_supplied must be here to be visible in set_var.cc sql/mysqld.cc: rephrasing warnings when server id is not set explicitely. sql/set_var.cc: when one does SET GLOBAL SERVER_ID=x; it should be considered as explicitely setting the server id, so do server_id_supplied=1. sql/slave.cc: Correcting wrong comment --- sql/mysql_priv.h | 2 +- sql/mysqld.cc | 10 +++++----- sql/set_var.cc | 7 ++++++- sql/slave.cc | 6 ++---- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index d4fe5968eff..b03d98f4cb0 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -703,7 +703,7 @@ extern uint protocol_version,dropping_tables; extern uint delay_key_write_options, lower_case_table_names; extern bool opt_endinfo, using_udf_functions, locked_in_memory; extern bool opt_using_transactions, mysql_embedded; -extern bool using_update_log, opt_large_files; +extern bool using_update_log, opt_large_files, server_id_supplied; extern bool opt_log, opt_update_log, opt_bin_log, opt_slow_log, opt_error_log; extern bool opt_disable_networking, opt_skip_show_db; extern bool volatile abort_loop, shutdown_in_progress, grant_option; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index c1ea29caa88..8e5a2745f72 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2354,15 +2354,15 @@ You should consider changing lower_case_table_names to 1 or 2", #ifdef EXTRA_DEBUG case 1: sql_print_error("\ -Warning: You have enabled the binary log, but you haven't set server-id:\n\ -Updates will be logged to the binary log, but connections to slaves will\n\ -not be accepted."); +Warning: You have enabled the binary log, but you haven't set server-id to \ +a non-zero value: we force server id to 1; updates will be logged to the \ +binary log, but connections from slaves will not be accepted."); break; #endif case 2: sql_print_error("\ -Warning: You should set server-id to a non-0 value if master_host is set.\n\ -The server will not act as a slave."); +Warning: You should set server-id to a non-0 value if master_host is set; \ +we force server id to 2, but this MySQL server will not act as a slave."); break; } } diff --git a/sql/set_var.cc b/sql/set_var.cc index eb94ad2ebf6..56208023d94 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -90,6 +90,7 @@ static void fix_max_relay_log_size(THD *thd, enum_var_type type); static void fix_max_connections(THD *thd, enum_var_type type); static void fix_thd_mem_root(THD *thd, enum_var_type type); static void fix_trans_mem_root(THD *thd, enum_var_type type); +static void fix_server_id(THD *thd, enum_var_type type); /* Variable definition list @@ -235,7 +236,7 @@ sys_var_thd_bool sys_query_cache_wlock_invalidate("query_cache_wlock_invalidate", &SV::query_cache_wlock_invalidate); #endif /* HAVE_QUERY_CACHE */ -sys_var_long_ptr sys_server_id("server_id",&server_id); +sys_var_long_ptr sys_server_id("server_id", &server_id, fix_server_id); sys_var_bool_ptr sys_slave_compressed_protocol("slave_compressed_protocol", &opt_slave_compressed_protocol); sys_var_long_ptr sys_slave_net_timeout("slave_net_timeout", @@ -811,6 +812,10 @@ static void fix_trans_mem_root(THD *thd, enum_var_type type) thd->variables.trans_prealloc_size); } +static void fix_server_id(THD *thd, enum_var_type type) +{ + server_id_supplied = 1; +} bool sys_var_long_ptr::update(THD *thd, set_var *var) { diff --git a/sql/slave.cc b/sql/slave.cc index c7a7dac141a..be60b5e6217 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -143,13 +143,11 @@ int init_slave() goto err; } - /* - make sure slave thread gets started if server_id is set, - valid master.info is present, and master_host has not been specified - */ if (server_id && !master_host && active_mi->host[0]) master_host= active_mi->host; + /* If server id is not set, start_slave_thread() will say it */ + if (master_host && !opt_skip_slave_start) { if (start_slave_threads(1 /* need mutex */, From 2d67f1e0cf5270f37816669bc8d7e606abce1469 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 19 May 2004 16:38:12 +0300 Subject: [PATCH 124/162] Added support for projects 'classic', 'classic nt', 'pro' and 'pro nt' Ensured that all projects compile Removed compiler warnings Better setting of server_version variable. Fix that make_win_src_distribution creates the privilege tables. VC++Files/bdb/bdb.dsp: Small, automatic changes VC++Files/client/mysql.dsp: Added support for projects 'classic', 'classic nt', 'pro' and 'pro nt' VC++Files/client/mysqladmin.dsp: Added support for projects 'classic', 'classic nt', 'pro' and 'pro nt' VC++Files/client/mysqlclient.dsp: Removed files that should only be used with mysql command line client VC++Files/client/mysqldump.dsp: Added support for projects 'classic', 'classic nt', 'pro' and 'pro nt' VC++Files/client/mysqlimport.dsp: Added support for projects 'classic', 'classic nt', 'pro' and 'pro nt' VC++Files/client/mysqlshow.dsp: Added support for projects 'classic', 'classic nt', 'pro' and 'pro nt' VC++Files/comp_err/comp_err.dsp: Automatic changes VC++Files/dbug/dbug.dsp: Automatic changes VC++Files/heap/heap.dsp: automatic changes VC++Files/innobase/innobase.dsp: Automatic changes VC++Files/isam/isam.dsp: Automatic changes VC++Files/isamchk/isamchk.dsp: Added support for projects 'classic', 'classic nt', 'pro' and 'pro nt' VC++Files/libmysql/libmysql.dsp: Automatic changes VC++Files/libmysqld/examples/test_libmysqld.dsp: Add missing files VC++Files/libmysqld/libmysqld.dsp: Added support for projects 'classic', 'classic nt', 'pro' and 'pro nt' VC++Files/libmysqltest/myTest.dsp: Automatic changes VC++Files/merge/merge.dsp: Automatic changes VC++Files/my_print_defaults/my_print_defaults.dsp: Added support for projects 'classic', 'classic nt', 'pro' and 'pro nt' VC++Files/myisam/myisam.dsp: automatic changes VC++Files/myisam_ftdump/myisam_ftdump.dsp: automatic changes VC++Files/myisamchk/myisamchk.dsp: Added support for projects 'classic', 'classic nt', 'pro' and 'pro nt' VC++Files/myisamlog/myisamlog.dsp: Added support for projects 'classic', 'classic nt', 'pro' and 'pro nt' VC++Files/myisammrg/myisammrg.dsp: Added support for projects 'classic', 'classic nt', 'pro' and 'pro nt' VC++Files/myisampack/myisampack.dsp: Added support for projects 'classic', 'classic nt', 'pro' and 'pro nt' VC++Files/mysql.dsw: Automatic changes VC++Files/mysqlbinlog/mysqlbinlog.dsp: Added support for projects 'classic', 'classic nt', 'pro' and 'pro nt' VC++Files/mysqlcheck/mysqlcheck.dsp: Added support for projects 'classic', 'classic nt', 'pro' and 'pro nt' VC++Files/mysqldemb/mysqldemb.dsp: Added support for projects 'classic', 'classic nt', 'pro' and 'pro nt' VC++Files/mysqlserver/mysqlserver.dsp: Automatic changes VC++Files/mysqlshutdown/mysqlshutdown.dsp: Automatic changes VC++Files/mysqlwatch/mysqlwatch.dsp: Automatic changes VC++Files/mysys/mysys.dsp: Automatic changes VC++Files/pack_isam/pack_isam.dsp: Added support for projects 'classic', 'classic nt', 'pro' and 'pro nt' VC++Files/perror/perror.dsp: Added support for projects 'classic', 'classic nt', 'pro' and 'pro nt' VC++Files/regex/regex.dsp: Automatic changes VC++Files/replace/replace.dsp: Added support for projects 'classic', 'classic nt', 'pro' and 'pro nt' VC++Files/sql/mysqld.dsp: Added support for projects 'classic', 'classic nt', 'pro' and 'pro nt' VC++Files/strings/strings.dsp: Removed duplicate code for strnlen VC++Files/test1/test1.dsp: Automatic changes VC++Files/thr_test/thr_test.dsp: Automatic changes VC++Files/vio/vio.dsp: Automatic changes VC++Files/zlib/contrib/asm386/zlibvc.dsp: Automatic changes VC++Files/zlib/zlib.dsp: Automatic changes extra/my_print_defaults.c: Fixed bug in --verbose include/m_string.h: Portability fix include/mysql_embed.h: Better setting of server_version variable include/mysql_version.h.in: Better license text handling innobase/pars/pars0lex.l: Remove compiler warnings innobase/trx/trx0sys.c: Remove compiler warnings libmysqld/lib_sql.cc: Better setting of server_version variable libmysqld/libmysqld.def: Add functions needed for mysql command line client myisam/myisam_ftdump.c: Remove compiler warnings mysys/sha1.c: Remove compiler warnings scripts/make_win_src_distribution.sh: Safety fix scripts/mysql_install_db.sh: Backport from 4.1 to allow make_win_src_distribution create the privilege tables sql/Makefile.am: Add new file mysqld_suffix.h Remove not used file sql_olap.h sql/ha_innodb.cc: Remove not used variable sql/mysqld.cc: Better setting of server_version variable sql/set_var.cc: Fixed bug when showing lower_case_file_system strings/ctype-tis620.c: Remove compiler warnings --- VC++Files/README.build-files | 19 + VC++Files/bdb/bdb.dsp | 12 +- VC++Files/client/mysql.dsp | 48 +- VC++Files/client/mysqladmin.dsp | 31 +- VC++Files/client/mysqlclient.dsp | 44 +- VC++Files/client/mysqldump.dsp | 33 +- VC++Files/client/mysqlimport.dsp | 33 +- VC++Files/client/mysqlshow.dsp | 31 +- VC++Files/comp_err/comp_err.dsp | 18 +- VC++Files/copy_mysql_files.bat | 84 +++ VC++Files/dbug/dbug.dsp | 8 +- VC++Files/heap/heap.dsp | 8 +- VC++Files/innobase/innobase.dsp | 6 +- VC++Files/isam/isam.dsp | 8 +- VC++Files/isamchk/isamchk.dsp | 33 +- VC++Files/libmysql/libmysql.dsp | 2 +- .../libmysqld/examples/test_libmysqld.dsp | 18 +- VC++Files/libmysqld/libmysqld.dsp | 64 +- VC++Files/libmysqltest/myTest.dsp | 2 +- VC++Files/merge/merge.dsp | 8 +- .../my_print_defaults/my_print_defaults.dsp | 49 +- VC++Files/myisam/myisam.dsp | 8 +- VC++Files/myisam_ftdump/myisam_ftdump.dsp | 22 +- VC++Files/myisamchk/myisamchk.dsp | 37 +- VC++Files/myisamlog/myisamlog.dsp | 31 +- VC++Files/myisammrg/myisammrg.dsp | 8 +- VC++Files/myisampack/myisampack.dsp | 49 +- VC++Files/mysql.dsw | 1 - VC++Files/mysqlbinlog/mysqlbinlog.dsp | 31 +- VC++Files/mysqlcheck/mysqlcheck.dsp | 29 +- VC++Files/mysqldemb/mysqldemb.dsp | 57 +- VC++Files/mysqlserver/mysqlserver.dsp | 2 +- VC++Files/mysqlshutdown/mysqlshutdown.dsp | 2 +- VC++Files/mysqlwatch/mysqlwatch.dsp | 6 +- VC++Files/mysys/mysys.dsp | 32 +- VC++Files/pack_isam/pack_isam.dsp | 29 +- VC++Files/perror/perror.dsp | 35 +- VC++Files/regex/regex.dsp | 8 +- VC++Files/replace/replace.dsp | 31 +- VC++Files/sql/mysqld.dsp | 647 ++++++++++++++++-- VC++Files/strings/strings.dsp | 12 +- VC++Files/test1/test1.dsp | 2 +- VC++Files/thr_test/thr_test.dsp | 2 +- VC++Files/vio/vio.dsp | 2 +- VC++Files/zlib/contrib/asm386/zlibvc.dsp | 76 +- VC++Files/zlib/zlib.dsp | 2 +- extra/my_print_defaults.c | 2 +- include/m_string.h | 1 + include/mysql_embed.h | 3 - include/mysql_version.h.in | 6 +- innobase/pars/pars0lex.l | 4 +- innobase/trx/trx0sys.c | 2 +- libmysqld/lib_sql.cc | 8 +- libmysqld/libmysqld.def | 3 + myisam/myisam_ftdump.c | 2 +- mysys/sha1.c | 2 +- scripts/make_win_src_distribution.sh | 4 + scripts/mysql_install_db.sh | 42 +- sql/Makefile.am | 4 +- sql/ha_innodb.cc | 1 - sql/mysqld.cc | 54 +- sql/mysqld_suffix.h | 38 + sql/set_var.cc | 4 +- strings/ctype-tis620.c | 8 +- 64 files changed, 1570 insertions(+), 338 deletions(-) create mode 100644 VC++Files/README.build-files create mode 100644 VC++Files/copy_mysql_files.bat create mode 100644 sql/mysqld_suffix.h diff --git a/VC++Files/README.build-files b/VC++Files/README.build-files new file mode 100644 index 00000000000..27624c3dc6f --- /dev/null +++ b/VC++Files/README.build-files @@ -0,0 +1,19 @@ +Some notes about building MySQL with VC++ + +- After bulding all projects, you get the files in the following directories: + +Directory Content + +lib_debug Debug libraries +lib_release Release libraries +lib_classic Embedded server libraries for classic +lib_pro Embedded server libraries for pro +client_debug Debug executables +client_release Client release +client_classic Commerical binaries (classic) +client_pro Commerical binaries (unique for pro version) +include Include files + +The copy_mysql_files.bat script can be used to copy the generated +files to c:\mysql + diff --git a/VC++Files/bdb/bdb.dsp b/VC++Files/bdb/bdb.dsp index 40dfd3900f8..d7ab8391b09 100644 --- a/VC++Files/bdb/bdb.dsp +++ b/VC++Files/bdb/bdb.dsp @@ -25,7 +25,7 @@ CFG=bdb - Win32 Max # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "bdb - Win32 Debug" @@ -48,7 +48,7 @@ RSC=rc.exe BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_debug\bdb.lib" @@ -56,8 +56,8 @@ LIB32=link.exe -lib # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "bdb___Win32_Max" -# PROP BASE Intermediate_Dir "bdb___Win32_Max" +# PROP BASE Output_Dir "max" +# PROP BASE Intermediate_Dir "max" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 @@ -66,13 +66,13 @@ LIB32=link.exe -lib # PROP Target_Dir "" # ADD BASE CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../bdb/build_win32" /I "../bdb/include" /D "__WIN32__" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /FD /c # SUBTRACT BASE CPP /Fr -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../bdb/build_win32" /I "../bdb/include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /Fo"mysys___Win32_Max/" /Fd"mysys___Win32_Max/" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../bdb/build_win32" /I "../bdb/include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /D MYSQL_SERVER_SUFFIX_MAX /Fo"max/" /Fd"max/" /FD /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo /out:"..\lib_debug\bdb.lib" # ADD LIB32 /nologo /out:"..\lib_release\bdb.lib" diff --git a/VC++Files/client/mysql.dsp b/VC++Files/client/mysql.dsp index 9910718778e..1c3f6aab6d1 100644 --- a/VC++Files/client/mysql.dsp +++ b/VC++Files/client/mysql.dsp @@ -19,6 +19,7 @@ CFG=mysql - Win32 Debug !MESSAGE !MESSAGE "mysql - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "mysql - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "mysql - Win32 classic" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project @@ -42,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /WX /O2 /I "../include" /I "../" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /WX /O2 /I "../include" /I "../" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" @@ -79,15 +80,45 @@ LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysql.exe" /pdbtype:sept /libpath:"..\lib_debug\\" +!ELSEIF "$(CFG)" == "mysql - Win32 classic" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "mysql___Win32_classic" +# PROP BASE Intermediate_Dir "mysql___Win32_classic" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "classic" +# PROP Intermediate_Dir "classic" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /WX /O2 /I "../include" /I "../" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /G6 /MT /W3 /WX /O2 /I "../include" /I "../" /D "_CONSOLE" /D "_WINDOWS" /D "MYSQL_COMMERCIAL_LICENSE" /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"../client_release/mysql.exe" /libpath:"..\lib_release\\" +# SUBTRACT BASE LINK32 /incremental:yes +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"../client_classic/mysql.exe" /libpath:"..\lib_release\\" +# SUBTRACT LINK32 /incremental:yes + !ENDIF # Begin Target # Name "mysql - Win32 Release" # Name "mysql - Win32 Debug" +# Name "mysql - Win32 classic" # Begin Source File -SOURCE=..\mysys\my_gethostbyname.c +SOURCE=.\completion_hash.cpp # End Source File # Begin Source File @@ -99,8 +130,21 @@ SOURCE=.\mysql.cpp !ELSEIF "$(CFG)" == "mysql - Win32 Debug" +!ELSEIF "$(CFG)" == "mysql - Win32 classic" + +# ADD BASE CPP /Zi /O2 +# ADD CPP /Zi /O2 + !ENDIF +# End Source File +# Begin Source File + +SOURCE=.\readline.cpp +# End Source File +# Begin Source File + +SOURCE=.\sql_string.cpp # End Source File # End Target # End Project diff --git a/VC++Files/client/mysqladmin.dsp b/VC++Files/client/mysqladmin.dsp index 2c762cd8a24..3f753794883 100644 --- a/VC++Files/client/mysqladmin.dsp +++ b/VC++Files/client/mysqladmin.dsp @@ -19,6 +19,7 @@ CFG=mysqladmin - Win32 Debug !MESSAGE !MESSAGE "mysqladmin - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "mysqladmin - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "mysqladmin - Win32 classic" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project @@ -42,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" @@ -78,12 +79,40 @@ LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqladmin.exe" /pdbtype:sept /libpath:"..\lib_debug\\" +!ELSEIF "$(CFG)" == "mysqladmin - Win32 classic" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "mysqladmin___Win32_classic" +# PROP BASE Intermediate_Dir "mysqladmin___Win32_classic" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "classic" +# PROP Intermediate_Dir "classic" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "_CONSOLE" /D "_WINDOWS" /D MYSQL_COMMERCIAL_LICENSE /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqladmin.exe" /libpath:"..\lib_release\\" +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/mysqladmin.exe" /libpath:"..\lib_release\\" + !ENDIF # Begin Target # Name "mysqladmin - Win32 Release" # Name "mysqladmin - Win32 Debug" +# Name "mysqladmin - Win32 classic" # Begin Source File SOURCE=.\mysqladmin.c diff --git a/VC++Files/client/mysqlclient.dsp b/VC++Files/client/mysqlclient.dsp index 77903eaac04..9bf131f8243 100644 --- a/VC++Files/client/mysqlclient.dsp +++ b/VC++Files/client/mysqlclient.dsp @@ -7,25 +7,25 @@ CFG=mysqlclient - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "mysqlclient.mak". -!MESSAGE +!MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "mysqlclient.mak" CFG="mysqlclient - Win32 Debug" -!MESSAGE +!MESSAGE !MESSAGE Possible choices for configuration are: -!MESSAGE +!MESSAGE !MESSAGE "mysqlclient - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "mysqlclient - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE +!MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "mysqlclient - Win32 Release" @@ -41,14 +41,14 @@ RSC=rc.exe # PROP Intermediate_Dir "release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /D "USE_TLS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "DBUG_OFF" /D "_WINDOWS" /D "USE_TLS" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_release\mysqlclient.lib" @@ -72,11 +72,11 @@ LIB32=link.exe -lib BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_debug\mysqlclient.lib" -!ENDIF +!ENDIF # Begin Target @@ -104,14 +104,6 @@ SOURCE=..\mysys\charset.c # End Source File # Begin Source File -SOURCE=.\completion_hash.cpp -# End Source File -# Begin Source File - -SOURCE=.\completion_hash.h -# End Source File -# Begin Source File - SOURCE="..\strings\ctype-big5.c" # End Source File # Begin Source File @@ -228,7 +220,7 @@ SOURCE=..\mysys\mf_iocache2.c # ADD CPP /Od -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -406,10 +398,6 @@ SOURCE=..\libmysql\password.c # End Source File # Begin Source File -SOURCE=.\readline.cpp -# End Source File -# Begin Source File - SOURCE=..\mysys\safemalloc.c # End Source File # Begin Source File @@ -418,14 +406,6 @@ SOURCE=.\select_test.c # End Source File # Begin Source File -SOURCE=.\sql_string.cpp -# End Source File -# Begin Source File - -SOURCE=.\sql_string.h -# End Source File -# Begin Source File - SOURCE=..\strings\str2int.c # End Source File # Begin Source File diff --git a/VC++Files/client/mysqldump.dsp b/VC++Files/client/mysqldump.dsp index d36664e09ce..b60ab44f4b2 100644 --- a/VC++Files/client/mysqldump.dsp +++ b/VC++Files/client/mysqldump.dsp @@ -19,6 +19,7 @@ CFG=mysqldump - Win32 Debug !MESSAGE !MESSAGE "mysqldump - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "mysqldump - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "mysqldump - Win32 classic" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project @@ -42,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" @@ -78,12 +79,40 @@ LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqldump.exe" /pdbtype:sept /libpath:"..\lib_debug\\" +!ELSEIF "$(CFG)" == "mysqldump - Win32 classic" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "mysqldump___Win32_classic" +# PROP BASE Intermediate_Dir "mysqldump___Win32_classic" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "classic" +# PROP Intermediate_Dir "classic" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "_CONSOLE" /D "_WINDOWS" /D MYSQL_COMMERCIAL_LICENSE /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqldump.exe" /libpath:"..\lib_release\\" +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/mysqldump.exe" /libpath:"..\lib_release\\" + !ENDIF # Begin Target # Name "mysqldump - Win32 Release" # Name "mysqldump - Win32 Debug" +# Name "mysqldump - Win32 classic" # Begin Source File SOURCE=.\mysqldump.c @@ -95,6 +124,8 @@ SOURCE=.\mysqldump.c # ADD CPP /W3 # SUBTRACT CPP /YX +!ELSEIF "$(CFG)" == "mysqldump - Win32 classic" + !ENDIF # End Source File diff --git a/VC++Files/client/mysqlimport.dsp b/VC++Files/client/mysqlimport.dsp index a8b239d226f..7cfc96d5774 100644 --- a/VC++Files/client/mysqlimport.dsp +++ b/VC++Files/client/mysqlimport.dsp @@ -19,6 +19,7 @@ CFG=mysqlimport - Win32 Debug !MESSAGE !MESSAGE "mysqlimport - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "mysqlimport - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "mysqlimport - Win32 classic" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project @@ -42,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" @@ -79,12 +80,42 @@ LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqlimport.exe" /pdbtype:sept /libpath:"..\lib_debug\\" +!ELSEIF "$(CFG)" == "mysqlimport - Win32 classic" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "mysqlimport___Win32_classic" +# PROP BASE Intermediate_Dir "mysqlimport___Win32_classic" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "classic" +# PROP Intermediate_Dir "classic" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "_CONSOLE" /D "_WINDOWS" /D MYSQL_COMMERCIAL_LICENSE /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqlimport.exe" /libpath:"..\lib_release\\" +# SUBTRACT BASE LINK32 /incremental:yes +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/mysqlimport.exe" /libpath:"..\lib_release\\" +# SUBTRACT LINK32 /incremental:yes + !ENDIF # Begin Target # Name "mysqlimport - Win32 Release" # Name "mysqlimport - Win32 Debug" +# Name "mysqlimport - Win32 classic" # Begin Source File SOURCE=.\mysqlimport.c diff --git a/VC++Files/client/mysqlshow.dsp b/VC++Files/client/mysqlshow.dsp index 26705465fec..4434d1a57ef 100644 --- a/VC++Files/client/mysqlshow.dsp +++ b/VC++Files/client/mysqlshow.dsp @@ -19,6 +19,7 @@ CFG=mysqlshow - Win32 Debug !MESSAGE !MESSAGE "mysqlshow - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "mysqlshow - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "mysqlshow - Win32 classic" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project @@ -42,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" @@ -78,12 +79,40 @@ LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqlshow.exe" /pdbtype:sept /libpath:"..\lib_debug\\" +!ELSEIF "$(CFG)" == "mysqlshow - Win32 classic" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "mysqlshow___Win32_classic" +# PROP BASE Intermediate_Dir "mysqlshow___Win32_classic" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "classic" +# PROP Intermediate_Dir "classic" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "_CONSOLE" /D "_WINDOWS" /D MYSQL_COMMERCIAL_LICENSE /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqlshow.exe" /libpath:"..\lib_release\\" +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/mysqlshow.exe" /libpath:"..\lib_release\\" + !ENDIF # Begin Target # Name "mysqlshow - Win32 Release" # Name "mysqlshow - Win32 Debug" +# Name "mysqlshow - Win32 classic" # Begin Source File SOURCE=.\mysqlshow.c diff --git a/VC++Files/comp_err/comp_err.dsp b/VC++Files/comp_err/comp_err.dsp index c6c9ee3eced..f35e69a7884 100644 --- a/VC++Files/comp_err/comp_err.dsp +++ b/VC++Files/comp_err/comp_err.dsp @@ -7,24 +7,24 @@ CFG=comp_err - Win32 Release !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "comp_err.mak". -!MESSAGE +!MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "comp_err.mak" CFG="comp_err - Win32 Release" -!MESSAGE +!MESSAGE !MESSAGE Possible choices for configuration are: -!MESSAGE +!MESSAGE !MESSAGE "comp_err - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE +!MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 @@ -38,13 +38,13 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /W3 /GX /O2 /I "..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCSN" /D "DBUG_OFF" /D "_WINDOWS" /D "__WIN__" /D "_MT" /FR /YX /FD /c +# ADD CPP /nologo /G6 /W3 /GX /O2 /I "..\include" /D "WIN32" /D "_CONSOLE" /D "_MBCSN" /D "DBUG_OFF" /D "_WINDOWS" /D "__WIN__" /D "_MT" /D "NDEBUG" /FR /YX /FD /c # ADD BASE RSC /l 0x416 /d "NDEBUG" # ADD RSC /l 0x416 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\lib_release\mysys.lib wsock32.lib ..\lib_release\strings.lib ..\lib_release\dbug.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"LIBC.lib" /out:"../client_release/comp-err.exe" # Begin Target diff --git a/VC++Files/copy_mysql_files.bat b/VC++Files/copy_mysql_files.bat new file mode 100644 index 00000000000..0570275a7b6 --- /dev/null +++ b/VC++Files/copy_mysql_files.bat @@ -0,0 +1,84 @@ +REM stop any conflicting service + +net stop mysql + +REM Our build system uses M:\mysql-version for the build root dir + +M: +cd \mysql-4.0 + +REM Copy binaries + +copy lib_debug\libmysql.* c:\mysql\lib\debug +copy lib_debug\zlib.* c:\mysql\lib\debug +copy lib_debug\mysqlclient.lib c:\mysql\lib\debug + +copy lib_release\mysqlclient.lib c:\mysql\lib\opt +copy lib_release\libmysql.* c:\mysql\lib\opt +copy lib_release\zlib.* c:\mysql\lib\opt + +IF "%1"=="classic" goto CLASSIC +IF "%1"=="pro" goto PRO + +REM GPL binaries + +copy client_release\*.exe c:\mysql\bin +copy client_debug\mysqld.exe c:\mysql\bin + +goto REST + +:CLASSIC +REM Classic binaries + +copy client_release\*.exe c:\mysql\bin +copy client_classic\*.exe c:\mysql\bin +copy client_debug\mysqld.exe c:\mysql\bin\mysqld-debug.exe +copy lib_classic\*.* c:\mysql\lib\opt + +goto REST + +:PRO +REM Pro binaries + +copy client_release\*.exe c:\mysql\bin +copy client_classic\*.exe c:\mysql\bin +copy client_pro\*.exe c:\mysql\bin +copy client_debug\mysqld.exe c:\mysql\bin\mysqld-debug.exe +copy lib_pro\*.* c:\mysql\lib\opt + +:REST + +REM +REM Copy include files +REM + +copy include\mysql*.h c:\mysql\include +copy include\errmsg.h c:\mysql\include +copy include\my_sys.h c:\mysql\include +copy include\my_list.h c:\mysql\include +copy include\my_pthread.h c:\mysql\include +copy include\my_dbug.h c:\mysql\include +copy include\m_string.h c:\mysql\include +copy include\m_ctype.h c:\mysql\include +copy include\raid.h c:\mysql\include +copy include\conf*.h c:\mysql\include +copy include\my_global.h c:\mysql\include\my_global.h +copy libmysql\libmysql.def c:\mysql\include + +REM Copy test files + +copy libmysqltest\*.* c:\mysql\examples\libmysqltest +copy libmysqltest\release\myTest.exe c:\mysql\examples\libmysqltest + +REM Copy share, docs etc + +xcopy share\*.* c:\mysql\share /E +xcopy scripts\*.* c:\mysql\scripts /E +xcopy docs\*.* c:\mysql\docs /E +xcopy docs\readme c:\mysql\ +xcopy sql-bench\*.* c:\mysql\bench /E + +REM Copy privilege tables (Delete old ones as they may be from a newer version) + +del c:\mysql\data\mysql\*.* /Q +copy data\*.* c:\mysql\data diff --git a/VC++Files/dbug/dbug.dsp b/VC++Files/dbug/dbug.dsp index 5db7b05175b..8d0ebf2878b 100644 --- a/VC++Files/dbug/dbug.dsp +++ b/VC++Files/dbug/dbug.dsp @@ -25,7 +25,7 @@ CFG=dbug - Win32 Debug # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "dbug - Win32 Release" @@ -41,14 +41,14 @@ RSC=rc.exe # PROP Intermediate_Dir "release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_release\dbug.lib" @@ -72,7 +72,7 @@ LIB32=link.exe -lib BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_debug\dbug.lib" diff --git a/VC++Files/heap/heap.dsp b/VC++Files/heap/heap.dsp index 1edeec80e9b..447777b17ef 100644 --- a/VC++Files/heap/heap.dsp +++ b/VC++Files/heap/heap.dsp @@ -25,7 +25,7 @@ CFG=heap - Win32 Debug # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "heap - Win32 Release" @@ -41,14 +41,14 @@ RSC=rc.exe # PROP Intermediate_Dir "release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_release\heap.lib" @@ -72,7 +72,7 @@ LIB32=link.exe -lib BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_debug\heap.lib" diff --git a/VC++Files/innobase/innobase.dsp b/VC++Files/innobase/innobase.dsp index 2687c48ca32..27673e7e162 100644 --- a/VC++Files/innobase/innobase.dsp +++ b/VC++Files/innobase/innobase.dsp @@ -67,7 +67,7 @@ LIB32=xilink6.exe -lib # PROP Intermediate_Dir "release" # PROP Target_Dir "" # ADD BASE CPP /nologo /G6 /MT /W3 /GX /O2 /I "../innobase/include" /I "../include" /D "NDEBUG" /D "_LIB" /D "_WIN32" /D "WIN32" /D "_MBCS" /D "MYSQL_SERVER" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../innobase/include" /I "../include" /D "NDEBUG" /D "_LIB" /D "_WIN32" /D "WIN32" /D "_MBCS" /D "MYSQL_SERVER" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../innobase/include" /I "../include" /D "_LIB" /D "_WIN32" /D "WIN32" /D "_MBCS" /D "MYSQL_SERVER" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x416 /d "NDEBUG" # ADD RSC /l 0x416 /d "NDEBUG" @@ -91,7 +91,7 @@ LIB32=xilink6.exe -lib # PROP Intermediate_Dir "nt" # PROP Target_Dir "" # ADD BASE CPP /nologo /G6 /MT /W3 /GX /O2 /I "../innobase/include" /I "../include" /D "NDEBUG" /D "_LIB" /D "_WIN32" /D "WIN32" /D "_MBCS" /D "MYSQL_SERVER" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../innobase/include" /I "../include" /D "NDEBUG" /D "_LIB" /D "_WIN32" /D "WIN32" /D "_MBCS" /D "MYSQL_SERVER" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../innobase/include" /I "../include" /D "_LIB" /D "_WIN32" /D "WIN32" /D "NDEBUG" /D "MYSQL_SERVER" /D "_MBCS" /D MYSQL_SERVER_SUFFIX_NT /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x416 /d "NDEBUG" # ADD RSC /l 0x416 /d "NDEBUG" @@ -115,7 +115,7 @@ LIB32=xilink6.exe -lib # PROP Intermediate_Dir "max_nt" # PROP Target_Dir "" # ADD BASE CPP /nologo /G6 /MT /W3 /GX /O2 /I "../innobase/include" /I "../include" /D "NDEBUG" /D "_LIB" /D "_WIN32" /D "WIN32" /D "_MBCS" /D "MYSQL_SERVER" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../innobase/include" /I "../include" /D "NDEBUG" /D "_LIB" /D "_WIN32" /D "WIN32" /D "_MBCS" /D "MYSQL_SERVER" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../innobase/include" /I "../include" /D "_LIB" /D "_WIN32" /D "WIN32" /D "NDEBUG" /D "MYSQL_SERVER" /D "_MBCS" /D MYSQL_SERVER_SUFFIX_NT_MAX /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x416 /d "NDEBUG" # ADD RSC /l 0x416 /d "NDEBUG" diff --git a/VC++Files/isam/isam.dsp b/VC++Files/isam/isam.dsp index 12047145f6d..3e1dcf9dc35 100644 --- a/VC++Files/isam/isam.dsp +++ b/VC++Files/isam/isam.dsp @@ -25,7 +25,7 @@ CFG=isam - Win32 Debug # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "isam - Win32 Release" @@ -41,14 +41,14 @@ RSC=rc.exe # PROP Intermediate_Dir "release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_release\isam.lib" @@ -72,7 +72,7 @@ LIB32=link.exe -lib BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_Debug\isam.lib" diff --git a/VC++Files/isamchk/isamchk.dsp b/VC++Files/isamchk/isamchk.dsp index 0e8e2b04bd7..cf8ba2de08d 100644 --- a/VC++Files/isamchk/isamchk.dsp +++ b/VC++Files/isamchk/isamchk.dsp @@ -19,6 +19,7 @@ CFG=isamchk - Win32 Debug !MESSAGE !MESSAGE "isamchk - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "isamchk - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "isamchk - Win32 classic" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project @@ -42,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../isam" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../isam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x41d /d "NDEBUG" # ADD RSC /l 0x41d /d "NDEBUG" @@ -80,12 +81,42 @@ LINK32=xilink6.exe # ADD LINK32 kernel32.lib user32.lib wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/isamchk.exe" /pdbtype:sept # SUBTRACT LINK32 /verbose /pdb:none +!ELSEIF "$(CFG)" == "isamchk - Win32 classic" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "isamchk___Win32_classic" +# PROP BASE Intermediate_Dir "isamchk___Win32_classic" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "classic" +# PROP Intermediate_Dir "classic" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../isam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../isam" /D "_CONSOLE" /D "_WINDOWS" /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /D MYSQL_COMMERCIAL_LICENSE /FD /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x41d /d "NDEBUG" +# ADD RSC /l 0x41d /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /machine:I386 /out:"../client_release/isamchk.exe" +# SUBTRACT BASE LINK32 /pdb:none +# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj ..\lib_release\isam.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/isamchk.exe" /libpath:"..\lib_release\\" +# SUBTRACT LINK32 /pdb:none + !ENDIF # Begin Target # Name "isamchk - Win32 Release" # Name "isamchk - Win32 Debug" +# Name "isamchk - Win32 classic" # Begin Source File SOURCE=..\isam\isamchk.c diff --git a/VC++Files/libmysql/libmysql.dsp b/VC++Files/libmysql/libmysql.dsp index ed8f27ef579..fcc70a47d1d 100644 --- a/VC++Files/libmysql/libmysql.dsp +++ b/VC++Files/libmysql/libmysql.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "." /I "..\include" /I "../zlib" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /D "USE_TLS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "." /I "..\include" /I "../zlib" /D "DBUG_OFF" /D "_WINDOWS" /D "USE_TLS" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 diff --git a/VC++Files/libmysqld/examples/test_libmysqld.dsp b/VC++Files/libmysqld/examples/test_libmysqld.dsp index d5fd0a0982d..26613e51011 100644 --- a/VC++Files/libmysqld/examples/test_libmysqld.dsp +++ b/VC++Files/libmysqld/examples/test_libmysqld.dsp @@ -24,7 +24,7 @@ CFG=test_libmysqld - Win32 Release # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 @@ -38,13 +38,13 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\include" /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "DBUG_OFF" /FR /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\include" /I "../include" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "DBUG_OFF" /D "NDEBUG" /FR /YX /FD /c # ADD BASE RSC /l 0x416 /d "NDEBUG" # ADD RSC /l 0x416 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"LIBCMTD" /out:"Release/mysql-server.exe" # Begin Target @@ -55,8 +55,20 @@ LINK32=link.exe # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File +SOURCE=..\..\client\completion_hash.cpp +# End Source File +# Begin Source File + SOURCE=..\..\client\mysql.cpp # End Source File +# Begin Source File + +SOURCE=..\..\client\readline.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\client\sql_string.cpp +# End Source File # End Group # Begin Source File diff --git a/VC++Files/libmysqld/libmysqld.dsp b/VC++Files/libmysqld/libmysqld.dsp index d2614ae4858..3f7c7708938 100644 --- a/VC++Files/libmysqld/libmysqld.dsp +++ b/VC++Files/libmysqld/libmysqld.dsp @@ -19,6 +19,8 @@ CFG=libmysqld - Win32 Debug !MESSAGE !MESSAGE "libmysqld - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "libmysqld - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "libmysqld - Win32 classic" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "libmysqld - Win32 pro" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project @@ -43,7 +45,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBMYSQLD_EXPORTS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /FR /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /D "NDEBUG" /FR /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x416 /d "NDEBUG" @@ -83,12 +85,72 @@ LINK32=xilink6.exe # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_debug\dbug.lib ..\lib_debug\mysys.lib ..\lib_debug\strings.lib ..\lib_debug\regex.lib ..\lib_debug\heap.lib ..\lib_debug\innodb.lib /nologo /dll /incremental:no /debug /machine:I386 /nodefaultlib:"LIBCMTD" /out:"../lib_debug/libmysqld.dll" /implib:"../lib_debug/libmysqld.lib" /pdbtype:sept # SUBTRACT LINK32 /pdb:none +!ELSEIF "$(CFG)" == "libmysqld - Win32 classic" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "libmysqld___Win32_classic" +# PROP BASE Intermediate_Dir "libmysqld___Win32_classic" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "classic" +# PROP Intermediate_Dir "classic" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /D "NDEBUG" /FR /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "_WINDOWS" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /D "__WIN__" /D MYSQL_COMMERCIAL_LICENSE /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FR /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x416 /d "NDEBUG" +# ADD RSC /l 0x416 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\innodb.lib ..\lib_release\bdb.lib ..\lib_release\zlib.lib /nologo /dll /machine:I386 /out:"../lib_release/libmysqld.dll" /implib:"../lib_release/libmysqld.lib" +# SUBTRACT BASE LINK32 /pdb:none +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\innodb.lib ..\lib_release\bdb.lib ..\lib_release\zlib.lib /nologo /dll /machine:I386 /out:"../lib_classic/libmysqld.dll" /implib:"../lib_release/libmysqld.lib" +# SUBTRACT LINK32 /pdb:none + +!ELSEIF "$(CFG)" == "libmysqld - Win32 pro" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "libmysqld___Win32_pro" +# PROP BASE Intermediate_Dir "libmysqld___Win32_pro" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "pro" +# PROP Intermediate_Dir "pro" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /D "NDEBUG" /FR /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "EMBEDDED_LIBRARY" /D "USE_TLS" /D "__WIN__" /D "MYSQL_SERVER" /D LICENCE=Commercial /D "_MBCS" /D "HAVE_DLOPEN" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "NDEBUG" /D "_WINDOWS" /D "_CONSOLE" /FR /FD /D MYSQL_SEVER_SUFFIX=-pro /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x416 /d "NDEBUG" +# ADD RSC /l 0x416 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\innodb.lib ..\lib_release\bdb.lib ..\lib_release\zlib.lib /nologo /dll /machine:I386 /out:"../lib_classic/libmysqld.dll" /implib:"../lib_release/libmysqld.lib" +# SUBTRACT BASE LINK32 /pdb:none +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\innodb.lib ..\lib_release\bdb.lib ..\lib_release\zlib.lib /nologo /dll /machine:I386 /out:"../lib_pro/libmysqld.dll" /implib:"../lib_release/libmysqld.lib" +# SUBTRACT LINK32 /pdb:none + !ENDIF # Begin Target # Name "libmysqld - Win32 Release" # Name "libmysqld - Win32 Debug" +# Name "libmysqld - Win32 classic" +# Name "libmysqld - Win32 pro" # Begin Source File SOURCE=..\sql\convert.cpp diff --git a/VC++Files/libmysqltest/myTest.dsp b/VC++Files/libmysqltest/myTest.dsp index 1d3a790edd5..ca0f9e6e147 100644 --- a/VC++Files/libmysqltest/myTest.dsp +++ b/VC++Files/libmysqltest/myTest.dsp @@ -42,7 +42,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /W3 /O2 /I "..\include" /D "NDEBUG" /D "DBUG_UFF" /D "_CONSOLE" /D "_MBCS" /FD /c +# ADD CPP /nologo /G6 /W3 /O2 /I "..\include" /D "DBUG_UFF" /D "_CONSOLE" /D "_MBCS" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" diff --git a/VC++Files/merge/merge.dsp b/VC++Files/merge/merge.dsp index 8a8173fd606..e057bd37924 100644 --- a/VC++Files/merge/merge.dsp +++ b/VC++Files/merge/merge.dsp @@ -25,7 +25,7 @@ CFG=merge - Win32 Debug # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "merge - Win32 Release" @@ -41,14 +41,14 @@ RSC=rc.exe # PROP Intermediate_Dir "release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_release\merge.lib" @@ -72,7 +72,7 @@ LIB32=link.exe -lib BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_debug\merge.lib" diff --git a/VC++Files/my_print_defaults/my_print_defaults.dsp b/VC++Files/my_print_defaults/my_print_defaults.dsp index 80178116930..6c90b2e1976 100644 --- a/VC++Files/my_print_defaults/my_print_defaults.dsp +++ b/VC++Files/my_print_defaults/my_print_defaults.dsp @@ -7,25 +7,26 @@ CFG=my_print_defaults - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "my_print_defaults.mak". -!MESSAGE +!MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "my_print_defaults.mak" CFG="my_print_defaults - Win32 Debug" -!MESSAGE +!MESSAGE !MESSAGE Possible choices for configuration are: -!MESSAGE +!MESSAGE !MESSAGE "my_print_defaults - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "my_print_defaults - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE +!MESSAGE "my_print_defaults - Win32 classic" (based on "Win32 (x86) Console Application") +!MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "my_print_defaults - Win32 Release" @@ -42,13 +43,13 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "../include" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "NDEBUG" /YX /FD /c # ADD BASE RSC /l 0x416 /d "NDEBUG" # ADD RSC /l 0x416 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/my_print_defaults.exe" @@ -72,16 +73,42 @@ LINK32=link.exe BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"LIBCMTD.lib" /out:"../client_debug/my_print_defaults.exe" /pdbtype:sept -!ENDIF +!ELSEIF "$(CFG)" == "my_print_defaults - Win32 classic" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "my_print_defaults___Win32_classic" +# PROP BASE Intermediate_Dir "my_print_defaults___Win32_classic" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "classic" +# PROP Intermediate_Dir "classic" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "../include" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "NDEBUG" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "../include" /D "WIN32" /D "_CONSOLE" /D MYSQL_COMMERCIAL_LICENSE /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /YX /FD /c +# ADD BASE RSC /l 0x416 /d "NDEBUG" +# ADD RSC /l 0x416 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/my_print_defaults.exe" +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/my_print_defaults.exe" /libpath:"..\lib_release\\" + +!ENDIF # Begin Target # Name "my_print_defaults - Win32 Release" # Name "my_print_defaults - Win32 Debug" +# Name "my_print_defaults - Win32 classic" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" diff --git a/VC++Files/myisam/myisam.dsp b/VC++Files/myisam/myisam.dsp index 51d4fb73713..e3c1f8cee7b 100644 --- a/VC++Files/myisam/myisam.dsp +++ b/VC++Files/myisam/myisam.dsp @@ -25,7 +25,7 @@ CFG=myisam - Win32 Debug # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "myisam - Win32 Release" @@ -41,13 +41,13 @@ RSC=rc.exe # PROP Intermediate_Dir "release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_release\myisam.lib" @@ -70,7 +70,7 @@ LIB32=link.exe -lib BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_Debug\myisam.lib" diff --git a/VC++Files/myisam_ftdump/myisam_ftdump.dsp b/VC++Files/myisam_ftdump/myisam_ftdump.dsp index 71701f3c656..c89ec73d751 100755 --- a/VC++Files/myisam_ftdump/myisam_ftdump.dsp +++ b/VC++Files/myisam_ftdump/myisam_ftdump.dsp @@ -7,25 +7,25 @@ CFG=myisam_ftdump - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "myisam_ftdump.mak". -!MESSAGE +!MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "myisam_ftdump.mak" CFG="myisam_ftdump - Win32 Debug" -!MESSAGE +!MESSAGE !MESSAGE Possible choices for configuration are: -!MESSAGE +!MESSAGE !MESSAGE "myisam_ftdump - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "myisam_ftdump - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE +!MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "myisam_ftdump - Win32 Release" @@ -42,13 +42,13 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../myisam" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FR /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../myisam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FR /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib setargv.obj /nologo /subsystem:console /machine:I386 /out:"../client_release/myisam_ftdump.exe" @@ -73,11 +73,11 @@ LINK32=link.exe BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/myisam_ftdump.exe" /pdbtype:sept -!ENDIF +!ENDIF # Begin Target diff --git a/VC++Files/myisamchk/myisamchk.dsp b/VC++Files/myisamchk/myisamchk.dsp index 0c8e7c00f1a..f83b10969d1 100644 --- a/VC++Files/myisamchk/myisamchk.dsp +++ b/VC++Files/myisamchk/myisamchk.dsp @@ -19,13 +19,14 @@ CFG=myisamchk - Win32 Debug !MESSAGE !MESSAGE "myisamchk - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "myisamchk - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "myisamchk - Win32 classic" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "myisamchk - Win32 Release" @@ -42,14 +43,14 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../myisam" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FR /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../myisam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FR /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib setargv.obj /nologo /subsystem:console /machine:I386 /out:"../client_release/myisamchk.exe" @@ -74,16 +75,44 @@ LINK32=link.exe BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/myisamchk.exe" /pdbtype:sept +!ELSEIF "$(CFG)" == "myisamchk - Win32 classic" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "myisamchk___Win32_classic" +# PROP BASE Intermediate_Dir "myisamchk___Win32_classic" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "classic" +# PROP Intermediate_Dir "classic" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../myisam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FR /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../myisam" /D "_CONSOLE" /D "_WINDOWS" /D MYSQL_COMMERCIAL_LICENSE /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FR /FD /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib setargv.obj /nologo /subsystem:console /machine:I386 /out:"../client_release/myisamchk.exe" +# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib setargv.obj ..\lib_release\myisam.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/myisamchk.exe" /libpath:"..\lib_release\\" + !ENDIF # Begin Target # Name "myisamchk - Win32 Release" # Name "myisamchk - Win32 Debug" +# Name "myisamchk - Win32 classic" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" diff --git a/VC++Files/myisamlog/myisamlog.dsp b/VC++Files/myisamlog/myisamlog.dsp index 6df65add63c..c3a7283d26d 100644 --- a/VC++Files/myisamlog/myisamlog.dsp +++ b/VC++Files/myisamlog/myisamlog.dsp @@ -19,6 +19,7 @@ CFG=myisamlog - Win32 Debug !MESSAGE !MESSAGE "myisamlog - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "myisamlog - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "myisamlog - Win32 classic" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project @@ -42,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../myisam" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FR /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../myisam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FR /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -79,12 +80,40 @@ LINK32=xilink6.exe # ADD LINK32 kernel32.lib user32.lib wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /incremental:no /pdb:"debug/myisamchk.pdb" /debug /machine:I386 /out:"../client_debug/myisamlog.exe" /pdbtype:sept # SUBTRACT LINK32 /pdb:none +!ELSEIF "$(CFG)" == "myisamlog - Win32 classic" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "myisamlog___Win32_classic" +# PROP BASE Intermediate_Dir "myisamlog___Win32_classic" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "classic" +# PROP Intermediate_Dir "classic" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../myisam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FR /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../myisam" /D "_CONSOLE" /D "_WINDOWS" /D MYSQL_COMMERCIAL_LICENSE /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FR /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib setargv.obj /nologo /subsystem:console /pdb:"release/myisamchk.pdb" /machine:I386 /out:"../client_release/myisamlog.exe" +# SUBTRACT BASE LINK32 /pdb:none +# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib setargv.obj ..\lib_release\myisam.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib /nologo /subsystem:console /pdb:"release/myisamchk.pdb" /machine:I386 /out:"../client_classic/myisamlog.exe" /libpath:"..\lib_release\\" +# SUBTRACT LINK32 /pdb:none + !ENDIF # Begin Target # Name "myisamlog - Win32 Release" # Name "myisamlog - Win32 Debug" +# Name "myisamlog - Win32 classic" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" diff --git a/VC++Files/myisammrg/myisammrg.dsp b/VC++Files/myisammrg/myisammrg.dsp index 9363bd63e62..95befedb670 100644 --- a/VC++Files/myisammrg/myisammrg.dsp +++ b/VC++Files/myisammrg/myisammrg.dsp @@ -25,7 +25,7 @@ CFG=myisammrg - Win32 Debug # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "myisammrg - Win32 Release" @@ -41,13 +41,13 @@ RSC=rc.exe # PROP Intermediate_Dir "release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_release\myisammrg.lib" @@ -71,7 +71,7 @@ LIB32=link.exe -lib BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_Debug\myisammrg.lib" diff --git a/VC++Files/myisampack/myisampack.dsp b/VC++Files/myisampack/myisampack.dsp index c974c86c62d..88955a645e1 100644 --- a/VC++Files/myisampack/myisampack.dsp +++ b/VC++Files/myisampack/myisampack.dsp @@ -7,25 +7,26 @@ CFG=myisampack - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "myisampack.mak". -!MESSAGE +!MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "myisampack.mak" CFG="myisampack - Win32 Debug" -!MESSAGE +!MESSAGE !MESSAGE Possible choices for configuration are: -!MESSAGE +!MESSAGE !MESSAGE "myisampack - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "myisampack - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE +!MESSAGE "myisampack - Win32 classic" (based on "Win32 (x86) Console Application") +!MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "myisampack - Win32 Release" @@ -42,13 +43,13 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../myisam" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FR /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../myisam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FR /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib setargv.obj /nologo /subsystem:console /machine:I386 /out:"../client_release/myisampack.exe" @@ -73,16 +74,42 @@ LINK32=link.exe BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/myisampack.exe" /pdbtype:sept -!ENDIF +!ELSEIF "$(CFG)" == "myisampack - Win32 classic" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "myisampack___Win32_classic" +# PROP BASE Intermediate_Dir "myisampack___Win32_classic" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "classic" +# PROP Intermediate_Dir "classic" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../myisam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FR /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../myisam" /D "_CONSOLE" /D "_WINDOWS" /D MYSQL_COMMERCIAL_LICENSE /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FR /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib setargv.obj /nologo /subsystem:console /machine:I386 /out:"../client_release/myisampack.exe" +# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib setargv.obj ..\lib_release\myisam.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/myisampack.exe" /libpath:"..\lib_release\\" + +!ENDIF # Begin Target # Name "myisampack - Win32 Release" # Name "myisampack - Win32 Debug" +# Name "myisampack - Win32 classic" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" diff --git a/VC++Files/mysql.dsw b/VC++Files/mysql.dsw index 007b9eb61cf..20c59d784cc 100644 --- a/VC++Files/mysql.dsw +++ b/VC++Files/mysql.dsw @@ -824,4 +824,3 @@ Package=<3> }}} ############################################################################### - diff --git a/VC++Files/mysqlbinlog/mysqlbinlog.dsp b/VC++Files/mysqlbinlog/mysqlbinlog.dsp index b26b911af77..c453dd430dd 100644 --- a/VC++Files/mysqlbinlog/mysqlbinlog.dsp +++ b/VC++Files/mysqlbinlog/mysqlbinlog.dsp @@ -19,6 +19,7 @@ CFG=mysqlbinlog - Win32 Debug !MESSAGE !MESSAGE "mysqlbinlog - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "mysqlbinlog - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "mysqlbinlog - Win32 classic" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project @@ -42,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /I "../sql" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "MYSQL_SERVER" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /I "../sql" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "MYSQL_SERVER" /D "NDEBUG" /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -77,12 +78,40 @@ LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqlbinlog.exe" /pdbtype:sept /libpath:"..\lib_debug\\" +!ELSEIF "$(CFG)" == "mysqlbinlog - Win32 classic" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "mysqlbinlog___Win32_classic" +# PROP BASE Intermediate_Dir "mysqlbinlog___Win32_classic" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "classic" +# PROP Intermediate_Dir "classic" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /I "../sql" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "MYSQL_SERVER" /D "NDEBUG" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /I "../sql" /D "MYSQL_SERVER" /D "_CONSOLE" /D "_WINDOWS" /D MYSQL_COMMERCIAL_LICENSE /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqlbinlog.exe" /libpath:"..\lib_release\\" +# SUBTRACT BASE LINK32 /pdb:none /debug +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/mysqlbinlog.exe" /libpath:"..\lib_release\\" +# SUBTRACT LINK32 /pdb:none /debug + !ENDIF # Begin Target # Name "mysqlbinlog - Win32 Release" # Name "mysqlbinlog - Win32 Debug" +# Name "mysqlbinlog - Win32 classic" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" diff --git a/VC++Files/mysqlcheck/mysqlcheck.dsp b/VC++Files/mysqlcheck/mysqlcheck.dsp index f8487119da3..5ef885cb305 100644 --- a/VC++Files/mysqlcheck/mysqlcheck.dsp +++ b/VC++Files/mysqlcheck/mysqlcheck.dsp @@ -19,6 +19,7 @@ CFG=mysqlcheck - Win32 Debug !MESSAGE !MESSAGE "mysqlcheck - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "mysqlcheck - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "mysqlcheck - Win32 classic" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project @@ -42,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "MYSQL_SERVER" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "MYSQL_SERVER" /D "NDEBUG" /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -76,12 +77,38 @@ LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqlcheck.exe" /pdbtype:sept /libpath:"..\lib_debug\\" +!ELSEIF "$(CFG)" == "mysqlcheck - Win32 classic" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "mysqlcheck___Win32_classic" +# PROP BASE Intermediate_Dir "mysqlcheck___Win32_classic" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "classic" +# PROP Intermediate_Dir "classic" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "MYSQL_SERVER" /D "NDEBUG" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "MYSQL_SERVER" /D "_CONSOLE" /D "_WINDOWS" /D MYSQL_COMMERCIAL_LICENSE /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqlcheck.exe" /libpath:"..\lib_release\\" +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/mysqlcheck.exe" /libpath:"..\lib_release\\" + !ENDIF # Begin Target # Name "mysqlcheck - Win32 Release" # Name "mysqlcheck - Win32 Debug" +# Name "mysqlcheck - Win32 classic" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" diff --git a/VC++Files/mysqldemb/mysqldemb.dsp b/VC++Files/mysqldemb/mysqldemb.dsp index 3d27f5cfc7f..506aabdab3a 100644 --- a/VC++Files/mysqldemb/mysqldemb.dsp +++ b/VC++Files/mysqldemb/mysqldemb.dsp @@ -19,6 +19,8 @@ CFG=mysqldemb - Win32 Debug !MESSAGE !MESSAGE "mysqldemb - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "mysqldemb - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE "mysqldemb - Win32 classic" (based on "Win32 (x86) Static Library") +!MESSAGE "mysqldemb - Win32 pro" (based on "Win32 (x86) Static Library") !MESSAGE # Begin Project @@ -41,7 +43,7 @@ RSC=rc.exe # PROP Intermediate_Dir "release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /FD /c +# ADD CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "_MBCS" /D "_LIB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x416 /d "NDEBUG" # ADD RSC /l 0x416 /d "NDEBUG" @@ -74,7 +76,56 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo +# ADD LIB32 /nologo /out:"../lib_debug/mysqldemb.lib" + +!ELSEIF "$(CFG)" == "mysqldemb - Win32 classic" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "mysqldemb___Win32_classic" +# PROP BASE Intermediate_Dir "mysqldemb___Win32_classic" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "classic" +# PROP Intermediate_Dir "classic" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "_MBCS" /D "_LIB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /D "NDEBUG" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "_LIB" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /D "__WIN__" /D LICENCE=Commercial /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x416 /d "NDEBUG" +# ADD RSC /l 0x416 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=xilink6.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"..\lib_classic\mysqldemb.lib" + +!ELSEIF "$(CFG)" == "mysqldemb - Win32 pro" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "mysqldemb___Win32_pro" +# PROP BASE Intermediate_Dir "mysqldemb___Win32_pro" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "pro" +# PROP Intermediate_Dir "pro" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "_MBCS" /D "_LIB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /D "NDEBUG" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "_LIB" /D "SIGNAL_WITH_VIO_CLOSE" /D "EMBEDDED_LIBRARY" /D "USE_TLS" /D "__WIN__" /D "USE_SYMDIR" /D "MYSQL_SERVER" /D LICENCE=Commercial /D "_MBCS" /D "HAVE_DLOPEN" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "NDEBUG" /D "_WINDOWS" /D "_CONSOLE" /FD /D MYSQL_SEVER_SUFFIX=-pro /c +# ADD BASE RSC /l 0x416 /d "NDEBUG" +# ADD RSC /l 0x416 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=xilink6.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"..\lib_pro\mysqldemb.lib" !ENDIF @@ -82,6 +133,8 @@ LIB32=xilink6.exe -lib # Name "mysqldemb - Win32 Release" # Name "mysqldemb - Win32 Debug" +# Name "mysqldemb - Win32 classic" +# Name "mysqldemb - Win32 pro" # Begin Source File SOURCE=..\sql\convert.cpp diff --git a/VC++Files/mysqlserver/mysqlserver.dsp b/VC++Files/mysqlserver/mysqlserver.dsp index d8df71ebbb2..9c23975f5f6 100644 --- a/VC++Files/mysqlserver/mysqlserver.dsp +++ b/VC++Files/mysqlserver/mysqlserver.dsp @@ -41,7 +41,7 @@ RSC=rc.exe # PROP Intermediate_Dir "release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "HAVE_BERKELEY_DB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /YX /FD /c +# ADD CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "_MBCS" /D "_LIB" /D "HAVE_BERKELEY_DB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "NDEBUG" /YX /FD /c # ADD BASE RSC /l 0x416 /d "NDEBUG" # ADD RSC /l 0x416 /d "NDEBUG" BSC32=bscmake.exe diff --git a/VC++Files/mysqlshutdown/mysqlshutdown.dsp b/VC++Files/mysqlshutdown/mysqlshutdown.dsp index d4dd389e99d..5d46f63aa6f 100644 --- a/VC++Files/mysqlshutdown/mysqlshutdown.dsp +++ b/VC++Files/mysqlshutdown/mysqlshutdown.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /W3 /O2 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c +# ADD CPP /nologo /G6 /W3 /O2 /D "_WINDOWS" /D "_MBCS" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 diff --git a/VC++Files/mysqlwatch/mysqlwatch.dsp b/VC++Files/mysqlwatch/mysqlwatch.dsp index 5c209f55e51..ee683c60351 100644 --- a/VC++Files/mysqlwatch/mysqlwatch.dsp +++ b/VC++Files/mysqlwatch/mysqlwatch.dsp @@ -24,7 +24,7 @@ CFG=mysqlwatch - Win32 Release # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 @@ -38,13 +38,13 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /W3 /GX- /O2 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c +# ADD CPP /nologo /G6 /W3 /O2 /D "_WINDOWS" /D "_MBCS" /D "NDEBUG" /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqlwatch.exe" # Begin Target diff --git a/VC++Files/mysys/mysys.dsp b/VC++Files/mysys/mysys.dsp index 067d73351b2..d847ce55abd 100644 --- a/VC++Files/mysys/mysys.dsp +++ b/VC++Files/mysys/mysys.dsp @@ -7,26 +7,26 @@ CFG=mysys - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "mysys.mak". -!MESSAGE +!MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "mysys.mak" CFG="mysys - Win32 Debug" -!MESSAGE +!MESSAGE !MESSAGE Possible choices for configuration are: -!MESSAGE +!MESSAGE !MESSAGE "mysys - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "mysys - Win32 Debug" (based on "Win32 (x86) Static Library") !MESSAGE "mysys - Win32 Max" (based on "Win32 (x86) Static Library") -!MESSAGE +!MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "mysys - Win32 Release" @@ -42,14 +42,14 @@ RSC=rc.exe # PROP Intermediate_Dir "release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../zlib" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /D "USE_SYMLINK" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../zlib" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_release\mysys.lib" @@ -66,14 +66,14 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../include" /I "../zlib" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_SYMDIR" /D "USE_SYMLINK" /FD /c +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../include" /I "../zlib" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_SYMDIR" /FD /c # SUBTRACT CPP /Fr # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_debug\mysys.lib" @@ -91,18 +91,18 @@ LIB32=link.exe -lib # PROP Target_Dir "" # ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c # SUBTRACT BASE CPP /YX -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../zlib" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /D "USE_SYMDIR" /D "USE_SYMLINK" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../zlib" /D "USE_SYMDIR" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /D MYSQL_SERVER_SUFFIX_MAX /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo /out:"..\lib_release\mysys.lib" # ADD LIB32 /nologo /out:"..\lib_release\mysys-max.lib" -!ENDIF +!ENDIF # Begin Target @@ -121,7 +121,7 @@ SOURCE=.\array.c !ELSEIF "$(CFG)" == "mysys - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -504,7 +504,7 @@ SOURCE=.\thr_lock.c !ELSEIF "$(CFG)" == "mysys - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File diff --git a/VC++Files/pack_isam/pack_isam.dsp b/VC++Files/pack_isam/pack_isam.dsp index cdcba702e15..86fb851b478 100644 --- a/VC++Files/pack_isam/pack_isam.dsp +++ b/VC++Files/pack_isam/pack_isam.dsp @@ -19,6 +19,7 @@ CFG=pack_isam - Win32 Debug !MESSAGE !MESSAGE "pack_isam - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "pack_isam - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "pack_isam - Win32 classic" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project @@ -42,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../isam" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../isam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -77,12 +78,38 @@ LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /debug /machine:I386 /out:"../client_debug/pack_isam.exe" /pdbtype:sept +!ELSEIF "$(CFG)" == "pack_isam - Win32 classic" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "pack_isam___Win32_classic" +# PROP BASE Intermediate_Dir "pack_isam___Win32_classic" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "classic" +# PROP Intermediate_Dir "classic" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../isam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../isam" /D "_CONSOLE" /D "_WINDOWS" /D MYSQL_COMMERCIAL_LICENSE /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /machine:I386 /out:"../client_release/pack_isam.exe" +# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj ..\lib_release\isam.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/pack_isam.exe" /libpath:"..\lib_release\\" + !ENDIF # Begin Target # Name "pack_isam - Win32 Release" # Name "pack_isam - Win32 Debug" +# Name "pack_isam - Win32 classic" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" diff --git a/VC++Files/perror/perror.dsp b/VC++Files/perror/perror.dsp index 99bd8f67ae2..6549fff9bfc 100644 --- a/VC++Files/perror/perror.dsp +++ b/VC++Files/perror/perror.dsp @@ -19,6 +19,7 @@ CFG=perror - Win32 Debug !MESSAGE !MESSAGE "perror - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "perror - Win32 Debug" (based on "Win32 (x86) Application") +!MESSAGE "perror - Win32 classic" (based on "Win32 (x86) Application") !MESSAGE # Begin Project @@ -43,7 +44,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 @@ -85,12 +86,44 @@ LINK32=xilink6.exe # ADD LINK32 kernel32.lib user32.lib wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /incremental:no /debug /machine:I386 /pdbtype:sept # SUBTRACT LINK32 /pdb:none +!ELSEIF "$(CFG)" == "perror - Win32 classic" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "perror___Win32_classic" +# PROP BASE Intermediate_Dir "perror___Win32_classic" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "classic" +# PROP Intermediate_Dir "classic" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "NDEBUG" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "WIN32" /D "_WINDOWS" /D MYSQL_COMMERCIAL_LICENSE /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c +# SUBTRACT CPP /YX +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/perror.exe" +# SUBTRACT BASE LINK32 /pdb:none +# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/perror.exe" /libpath:"..\lib_release\\" +# SUBTRACT LINK32 /pdb:none + !ENDIF # Begin Target # Name "perror - Win32 Release" # Name "perror - Win32 Debug" +# Name "perror - Win32 classic" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" diff --git a/VC++Files/regex/regex.dsp b/VC++Files/regex/regex.dsp index 59b55ffe46f..ecca45178f9 100644 --- a/VC++Files/regex/regex.dsp +++ b/VC++Files/regex/regex.dsp @@ -25,7 +25,7 @@ CFG=regex - Win32 Debug # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "regex - Win32 Release" @@ -41,14 +41,14 @@ RSC=rc.exe # PROP Intermediate_Dir "release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "./" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "./" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_release\regex.lib" @@ -72,7 +72,7 @@ LIB32=link.exe -lib BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_debug\regex.lib" diff --git a/VC++Files/replace/replace.dsp b/VC++Files/replace/replace.dsp index 2fe763ff388..dacd6130be7 100644 --- a/VC++Files/replace/replace.dsp +++ b/VC++Files/replace/replace.dsp @@ -19,6 +19,7 @@ CFG=replace - Win32 Debug !MESSAGE !MESSAGE "replace - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "replace - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "replace - Win32 classic" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project @@ -42,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x40b /d "NDEBUG" # ADD RSC /l 0x40b /d "NDEBUG" @@ -79,12 +80,40 @@ LINK32=xilink6.exe # ADD LINK32 kernel32.lib user32.lib wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /incremental:no /machine:I386 /out:"../client_debug/replace.exe" /pdbtype:sept # SUBTRACT LINK32 /debug +!ELSEIF "$(CFG)" == "replace - Win32 classic" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "replace___Win32_classic" +# PROP BASE Intermediate_Dir "replace___Win32_classic" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "classic" +# PROP Intermediate_Dir "classic" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "_CONSOLE" /D "_WINDOWS" /D MYSQL_COMMERCIAL_LICENSE /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x40b /d "NDEBUG" +# ADD RSC /l 0x40b /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /machine:I386 /out:"../client_release/replace.exe" +# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj ..\lib_release\mysys.lib ..\lib_release\strings.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/replace.exe" /libpath:"..\lib_release\\" + !ENDIF # Begin Target # Name "replace - Win32 Release" # Name "replace - Win32 Debug" +# Name "replace - Win32 classic" # Begin Source File SOURCE=..\extra\replace.c diff --git a/VC++Files/sql/mysqld.dsp b/VC++Files/sql/mysqld.dsp index 6a808659276..d7bb281a215 100644 --- a/VC++Files/sql/mysqld.dsp +++ b/VC++Files/sql/mysqld.dsp @@ -7,28 +7,32 @@ CFG=mysqld - Win32 Release !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "mysqld.mak". -!MESSAGE +!MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "mysqld.mak" CFG="mysqld - Win32 Release" -!MESSAGE +!MESSAGE !MESSAGE Possible choices for configuration are: -!MESSAGE +!MESSAGE !MESSAGE "mysqld - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "mysqld - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE "mysqld - Win32 nt" (based on "Win32 (x86) Console Application") !MESSAGE "mysqld - Win32 Max nt" (based on "Win32 (x86) Console Application") !MESSAGE "mysqld - Win32 Max" (based on "Win32 (x86) Console Application") -!MESSAGE +!MESSAGE "mysqld - Win32 classic" (based on "Win32 (x86) Console Application") +!MESSAGE "mysqld - Win32 pro" (based on "Win32 (x86) Console Application") +!MESSAGE "mysqld - Win32 classic nt" (based on "Win32 (x86) Console Application") +!MESSAGE "mysqld - Win32 pro nt" (based on "Win32 (x86) Console Application") +!MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "mysqld - Win32 Release" @@ -45,14 +49,14 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D "NDEBUG" /D "DBUG_OFF" /D "HAVE_INNOBASE_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "USE_SYMDIR" /D "HAVE_DLOPEN" /D "USE_SYMLINK" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D "DBUG_OFF" /D "HAVE_INNOBASE_DB" /D "NDEBUG" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x410 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../client_release/mysqld-opt.exe" # SUBTRACT LINK32 /debug @@ -71,14 +75,14 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../include" /I "../regex" /I "../bdb/build_win32" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "USE_SYMDIR" /D "HAVE_DLOPEN" /D "USE_SYMLINK" /FD /c +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../include" /I "../regex" /I "../bdb/build_win32" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /c # SUBTRACT CPP /Fr /YX # ADD BASE RSC /l 0x410 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_debug\dbug.lib ..\lib_debug\vio.lib ..\lib_debug\isam.lib ..\lib_debug\merge.lib ..\lib_debug\mysys.lib ..\lib_debug\strings.lib ..\lib_debug\regex.lib ..\lib_debug\heap.lib ..\lib_debug\bdb.lib ..\lib_debug\innodb.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqld.exe" /pdbtype:sept @@ -98,14 +102,14 @@ LINK32=link.exe # PROP Target_Dir "" # ADD BASE CPP /nologo /G5 /MT /W3 /O2 /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "__WIN32__" /D "DBUG_OFF" /FD /c # SUBTRACT BASE CPP /YX -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /D "__NT__" /D "DBUG_OFF" /D "HAVE_INNOBASE_DB" /D "_WINDOWS" /D "_CONSOLE" /D "USE_SYMDIR" /D "HAVE_DLOPEN" /D "USE_SYMLINK" /D "NDEBUG" /D "MYSQL_SERVER" /D "_MBCS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /D "__NT__" /D "DBUG_OFF" /D "HAVE_INNOBASE_DB" /D "NDEBUG" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /D MYSQL_SERVER_SUFFIX_NT /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x410 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\dbug.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /debug /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\innodb.lib ..\lib_release\zlib.lib /nologo /subsystem:console /map /machine:I386 /out:"../client_release/mysqld-nt.exe" # SUBTRACT LINK32 /pdb:none /debug @@ -126,14 +130,14 @@ LINK32=link.exe # PROP Target_Dir "" # ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /D "NDEBUG" /D "__NT__" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /FD /c # SUBTRACT BASE CPP /YX -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../bdb/build_win32" /D "__NT__" /D "DBUG_OFF" /D "USE_SYMDIR" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "_WINDOWS" /D "_CONSOLE" /D "HAVE_DLOPEN" /D "USE_SYMLINK" /D "NDEBUG" /D "MYSQL_SERVER" /D "_MBCS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../bdb/build_win32" /D "__NT__" /D "DBUG_OFF" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "_WINDOWS" /D "_CONSOLE" /D "HAVE_DLOPEN" /D "NDEBUG" /D "MYSQL_SERVER" /D "_MBCS" /FD /D MYSQL_SERVER_SUFFIX_NT_MAX /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\zlib.lib /nologo /subsystem:console /map /machine:I386 /out:"../client_release/mysqld-nt.exe" # SUBTRACT BASE LINK32 /pdb:none /debug # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys-max.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\zlib.lib ..\lib_release\innodb.lib ..\lib_release\bdb.lib /nologo /subsystem:console /map /machine:I386 /out:"../client_release/mysqld-max-nt.exe" @@ -155,19 +159,132 @@ LINK32=link.exe # PROP Target_Dir "" # ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /D "NDEBUG" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /FD /c # SUBTRACT BASE CPP /YX -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../bdb/build_win32" /D "NDEBUG" /D "DBUG_OFF" /D "USE_SYMDIR" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /D "USE_SYMLINK" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../bdb/build_win32" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "NDEBUG" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /D MYSQL_SERVER_SUFFIX_MAX /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /out:"../client_release/mysqld-opt.exe" # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys-max.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\innodb.lib ..\lib_release\bdb.lib ..\lib_release\zlib.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../client_release/mysqld-max.exe" # SUBTRACT LINK32 /debug -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "mysqld___Win32_classic" +# PROP BASE Intermediate_Dir "mysqld___Win32_classic" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "classic" +# PROP Intermediate_Dir "classic" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D "DBUG_OFF" /D "HAVE_INNOBASE_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "USE_SYMDIR" /D "HAVE_DLOPEN" /D "NDEBUG" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D MYSQL_COMMERCIAL_LICENSE /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "HAVE_DLOPEN" /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../client_release/mysqld-opt.exe" +# SUBTRACT BASE LINK32 /debug +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\innodb.lib ..\lib_release\zlib.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../client_classic/mysqld.exe" /libpath:"..\lib_release" +# SUBTRACT LINK32 /debug + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "mysqld___Win32_pro" +# PROP BASE Intermediate_Dir "mysqld___Win32_pro" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "pro" +# PROP Intermediate_Dir "pro" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "USE_SYMDIR" /D "HAVE_DLOPEN" /D "NDEBUG" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D "MYSQL_SERVER" /D LICENCE=Commercial /D "_MBCS" /D "HAVE_DLOPEN" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "NDEBUG" /D "_WINDOWS" /D "_CONSOLE" /FD /D MYSQL_SERVER_SUFFIX_PRO /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../client_commercial/mysqld-opt.exe" +# SUBTRACT BASE LINK32 /debug +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\innodb.lib ..\lib_release\zlib.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../client_pro/mysqld.exe" /libpath:"..\lib_release" +# SUBTRACT LINK32 /debug + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "mysqld___Win32_classic_nt" +# PROP BASE Intermediate_Dir "mysqld___Win32_classic_nt" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "classic_nt" +# PROP Intermediate_Dir "classic_nt" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "USE_SYMDIR" /D "HAVE_DLOPEN" /D "NDEBUG" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D "__NT__" /D "DBUG_OFF" /D "NDEBUG" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /D MYSQL_SERVER_SUFFIX_NT /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../client_classic/mysqld-opt.exe" +# SUBTRACT BASE LINK32 /debug +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\innodb.lib ..\lib_release\zlib.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../client_classic/mysqld-nt.exe" /libpath:"..\lib_release" +# SUBTRACT LINK32 /debug + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "mysqld___Win32_pro_nt" +# PROP BASE Intermediate_Dir "mysqld___Win32_pro_nt" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "pro_nt" +# PROP Intermediate_Dir "pro_nt" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "USE_SYMDIR" /D "HAVE_DLOPEN" /D "NDEBUG" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D "__NT__" /D "DBUG_OFF" /D "HAVE_INNOBASE_DB" /D LICENCE=Commercial /D "NDEBUG" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /D MYSQL_SERVER_SUFFIX_PRO_NT +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../client_classic/mysqld-opt.exe" +# SUBTRACT BASE LINK32 /debug +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\innodb.lib ..\lib_release\zlib.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../client_pro/mysqld-nt.exe" /libpath:"..\lib_release" +# SUBTRACT LINK32 /debug + +!ENDIF # Begin Target @@ -176,6 +293,10 @@ LINK32=link.exe # Name "mysqld - Win32 nt" # Name "mysqld - Win32 Max nt" # Name "mysqld - Win32 Max" +# Name "mysqld - Win32 classic" +# Name "mysqld - Win32 pro" +# Name "mysqld - Win32 classic nt" +# Name "mysqld - Win32 pro nt" # Begin Source File SOURCE=.\convert.cpp @@ -193,7 +314,15 @@ SOURCE=.\convert.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -213,7 +342,15 @@ SOURCE=.\derror.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -237,7 +374,15 @@ SOURCE=.\field.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -257,7 +402,15 @@ SOURCE=.\field_conv.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -277,7 +430,15 @@ SOURCE=.\filesort.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -325,7 +486,15 @@ SOURCE=.\handler.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -344,7 +513,15 @@ SOURCE=.\hash_filo.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -367,7 +544,15 @@ SOURCE=.\hostname.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -387,7 +572,15 @@ SOURCE=.\init.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -407,7 +600,15 @@ SOURCE=.\item.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -427,7 +628,15 @@ SOURCE=.\item_buff.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -447,7 +656,15 @@ SOURCE=.\item_cmpfunc.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -471,7 +688,15 @@ SOURCE=.\item_func.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -491,7 +716,15 @@ SOURCE=.\item_strfunc.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -511,7 +744,15 @@ SOURCE=.\item_sum.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -530,7 +771,15 @@ SOURCE=.\item_timefunc.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -550,7 +799,15 @@ SOURCE=.\item_uniq.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -570,7 +827,15 @@ SOURCE=.\key.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -590,7 +855,15 @@ SOURCE=.\lock.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -610,7 +883,15 @@ SOURCE=.\log.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -633,7 +914,15 @@ SOURCE=.\mf_iocache.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -657,7 +946,15 @@ SOURCE=.\mysqld.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -677,7 +974,15 @@ SOURCE=.\net_pkg.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -700,7 +1005,15 @@ SOURCE=.\nt_servc.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -727,7 +1040,15 @@ SOURCE=.\opt_range.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -754,7 +1075,15 @@ SOURCE=.\password.c !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -774,7 +1103,15 @@ SOURCE=.\procedure.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -794,7 +1131,15 @@ SOURCE=.\records.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -826,7 +1171,15 @@ SOURCE=.\sql_acl.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -850,7 +1203,15 @@ SOURCE=.\sql_base.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -874,7 +1235,15 @@ SOURCE=.\sql_class.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -902,7 +1271,15 @@ SOURCE=.\sql_db.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -922,7 +1299,15 @@ SOURCE=.\sql_delete.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -950,7 +1335,15 @@ SOURCE=.\sql_insert.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -970,7 +1363,15 @@ SOURCE=.\sql_lex.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -990,7 +1391,15 @@ SOURCE=.\sql_list.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -1010,7 +1419,15 @@ SOURCE=.\sql_load.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -1034,7 +1451,15 @@ SOURCE=.\sql_map.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -1054,7 +1479,15 @@ SOURCE=.\sql_parse.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -1082,7 +1515,15 @@ SOURCE=.\sql_select.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -1102,7 +1543,15 @@ SOURCE=.\sql_show.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -1122,7 +1571,15 @@ SOURCE=.\sql_string.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -1142,7 +1599,15 @@ SOURCE=.\sql_table.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -1162,7 +1627,15 @@ SOURCE=.\sql_test.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -1190,7 +1663,15 @@ SOURCE=.\sql_update.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -1210,7 +1691,15 @@ SOURCE=.\sql_yacc.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -1234,7 +1723,15 @@ SOURCE=.\thr_malloc.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -1254,7 +1751,15 @@ SOURCE=.\time.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # Begin Source File @@ -1278,7 +1783,15 @@ SOURCE=.\unireg.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ELSEIF "$(CFG)" == "mysqld - Win32 classic" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro" + +!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" + +!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" + +!ENDIF # End Source File # End Target diff --git a/VC++Files/strings/strings.dsp b/VC++Files/strings/strings.dsp index dec308efa60..63aec7e8e1d 100644 --- a/VC++Files/strings/strings.dsp +++ b/VC++Files/strings/strings.dsp @@ -25,7 +25,7 @@ CFG=strings - Win32 Debug # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "strings - Win32 Release" @@ -41,14 +41,14 @@ RSC=rc.exe # PROP Intermediate_Dir "release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_release\strings.lib" @@ -72,7 +72,7 @@ LIB32=link.exe -lib BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_debug\strings.lib" @@ -164,10 +164,6 @@ SOURCE=.\str2int.c # End Source File # Begin Source File -SOURCE=.\strnlen.c -# End Source File -# Begin Source File - SOURCE=.\Strings.asm !IF "$(CFG)" == "strings - Win32 Release" diff --git a/VC++Files/test1/test1.dsp b/VC++Files/test1/test1.dsp index df4b31d684e..e3be8f7a315 100644 --- a/VC++Files/test1/test1.dsp +++ b/VC++Files/test1/test1.dsp @@ -42,7 +42,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /W3 /O2 /I "../include" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /W3 /O2 /I "../include" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" diff --git a/VC++Files/thr_test/thr_test.dsp b/VC++Files/thr_test/thr_test.dsp index 0c80de42521..0d2b8e0d24b 100644 --- a/VC++Files/thr_test/thr_test.dsp +++ b/VC++Files/thr_test/thr_test.dsp @@ -42,7 +42,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x40b /d "NDEBUG" # ADD RSC /l 0x40b /d "NDEBUG" diff --git a/VC++Files/vio/vio.dsp b/VC++Files/vio/vio.dsp index c250e693995..5daa5800dbd 100644 --- a/VC++Files/vio/vio.dsp +++ b/VC++Files/vio/vio.dsp @@ -41,7 +41,7 @@ RSC=rc.exe # PROP Intermediate_Dir "release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe diff --git a/VC++Files/zlib/contrib/asm386/zlibvc.dsp b/VC++Files/zlib/contrib/asm386/zlibvc.dsp index a70d4d4a6b0..63d8fee6511 100644 --- a/VC++Files/zlib/contrib/asm386/zlibvc.dsp +++ b/VC++Files/zlib/contrib/asm386/zlibvc.dsp @@ -8,16 +8,16 @@ CFG=zlibvc - Win32 Release !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "zlibvc.mak". -!MESSAGE +!MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "zlibvc.mak" CFG="zlibvc - Win32 Release" -!MESSAGE +!MESSAGE !MESSAGE Possible choices for configuration are: -!MESSAGE +!MESSAGE !MESSAGE "zlibvc - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "zlibvc - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "zlibvc - Win32 ReleaseAxp" (based on\ @@ -26,7 +26,7 @@ CFG=zlibvc - Win32 Release "Win32 (x86) Dynamic-Link Library") !MESSAGE "zlibvc - Win32 ReleaseWithoutCrtdll" (based on\ "Win32 (x86) Dynamic-Link Library") -!MESSAGE +!MESSAGE # Begin Project # PROP Scc_ProjName "" @@ -191,7 +191,7 @@ LINK32=link.exe # ADD LINK32 gvmat32.obj kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\zlibvc_1\zlib.dll" # SUBTRACT LINK32 /pdb:none -!ENDIF +!ENDIF # Begin Target @@ -216,13 +216,13 @@ SOURCE=.\adler32.c DEP_CPP_ADLER=\ ".\zconf.h"\ ".\zlib.h"\ - + !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -238,13 +238,13 @@ SOURCE=.\compress.c DEP_CPP_COMPR=\ ".\zconf.h"\ ".\zlib.h"\ - + !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -260,13 +260,13 @@ SOURCE=.\crc32.c DEP_CPP_CRC32=\ ".\zconf.h"\ ".\zlib.h"\ - + !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -284,13 +284,13 @@ DEP_CPP_DEFLA=\ ".\zconf.h"\ ".\zlib.h"\ ".\zutil.h"\ - + !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -307,7 +307,7 @@ SOURCE=.\gvmat32c.c !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -324,13 +324,13 @@ DEP_CPP_GZIO_=\ ".\zconf.h"\ ".\zlib.h"\ ".\zutil.h"\ - + !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -351,13 +351,13 @@ DEP_CPP_INFBL=\ ".\zconf.h"\ ".\zlib.h"\ ".\zutil.h"\ - + !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -379,13 +379,13 @@ DEP_CPP_INFCO=\ ".\zconf.h"\ ".\zlib.h"\ ".\zutil.h"\ - + !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -407,13 +407,13 @@ DEP_CPP_INFFA=\ ".\zconf.h"\ ".\zlib.h"\ ".\zutil.h"\ - + !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -431,13 +431,13 @@ DEP_CPP_INFLA=\ ".\zconf.h"\ ".\zlib.h"\ ".\zutil.h"\ - + !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -455,13 +455,13 @@ DEP_CPP_INFTR=\ ".\zconf.h"\ ".\zlib.h"\ ".\zutil.h"\ - + !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -482,13 +482,13 @@ DEP_CPP_INFUT=\ ".\zconf.h"\ ".\zlib.h"\ ".\zutil.h"\ - + !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -506,13 +506,13 @@ DEP_CPP_TREES=\ ".\zconf.h"\ ".\zlib.h"\ ".\zutil.h"\ - + !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -528,13 +528,13 @@ SOURCE=.\uncompr.c DEP_CPP_UNCOM=\ ".\zconf.h"\ ".\zlib.h"\ - + !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -551,7 +551,7 @@ SOURCE=.\unzip.c !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -568,7 +568,7 @@ SOURCE=.\zip.c !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -593,13 +593,13 @@ DEP_CPP_ZUTIL=\ ".\zconf.h"\ ".\zlib.h"\ ".\zutil.h"\ - + !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" !ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" -!ENDIF +!ENDIF # End Source File # End Group diff --git a/VC++Files/zlib/zlib.dsp b/VC++Files/zlib/zlib.dsp index 40aaadaa4e1..6edab34d93c 100644 --- a/VC++Files/zlib/zlib.dsp +++ b/VC++Files/zlib/zlib.dsp @@ -41,7 +41,7 @@ RSC=rc.exe # PROP Intermediate_Dir "release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /O2 /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 diff --git a/extra/my_print_defaults.c b/extra/my_print_defaults.c index 07d6c0ca555..f8a7995432b 100644 --- a/extra/my_print_defaults.c +++ b/extra/my_print_defaults.c @@ -49,7 +49,7 @@ static struct my_option my_long_options[] = {"help", '?', "Display this help message and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"verbose", 'v', "Increase the output level", - 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} diff --git a/include/m_string.h b/include/m_string.h index 934ad1c42b5..eb2758ec506 100644 --- a/include/m_string.h +++ b/include/m_string.h @@ -232,6 +232,7 @@ extern char *str2int(const char *src,int radix,long lower,long upper, #if SIZEOF_LONG == SIZEOF_LONG_LONG #define longlong2str(A,B,C) int2str((A),(B),(C)) #define longlong10_to_str(A,B,C) int10_to_str((A),(B),(C)) +#undef strtoll #define strtoll(A,B,C) strtol((A),(B),(C)) #define strtoull(A,B,C) strtoul((A),(B),(C)) #ifndef HAVE_STRTOULL diff --git a/include/mysql_embed.h b/include/mysql_embed.h index bc75c3fbcb8..a061e68a974 100644 --- a/include/mysql_embed.h +++ b/include/mysql_embed.h @@ -28,7 +28,4 @@ #define DONT_USE_RAID -#undef MYSQL_SERVER_SUFFIX -#define MYSQL_SERVER_SUFFIX "-embedded" - #endif /* EMBEDDED_LIBRARY */ diff --git a/include/mysql_version.h.in b/include/mysql_version.h.in index de5294a82cf..4ccc4ee1e45 100644 --- a/include/mysql_version.h.in +++ b/include/mysql_version.h.in @@ -28,7 +28,11 @@ #endif /* _CUSTOMCONFIG_ */ #ifndef LICENSE -#define LICENSE "GPL" +#ifdef MYSQL_COMMERICAL_LICENSE +#define LICENSE "Commerical" +#else +#define LICENSE "GPL" +#endif #endif /* LICENSE */ #endif /* _mysql_version_h */ diff --git a/innobase/pars/pars0lex.l b/innobase/pars/pars0lex.l index 7b65770b3da..0b1af554bed 100644 --- a/innobase/pars/pars0lex.l +++ b/innobase/pars/pars0lex.l @@ -123,7 +123,7 @@ ID [a-z_A-Z][a-z_A-Z0-9]* BEGIN(INITIAL); yylval = sym_tab_add_str_lit( pars_sym_tab_global, - stringbuf, stringbuf_len); + (byte*) stringbuf, stringbuf_len); return(PARS_STR_LIT); } } @@ -137,7 +137,7 @@ ID [a-z_A-Z][a-z_A-Z0-9]* "SQL" { /* Implicit cursor name */ yylval = sym_tab_add_str_lit(pars_sym_tab_global, - yytext, yyleng); + (byte*) yytext, yyleng); return(PARS_SQL_TOKEN); } diff --git a/innobase/trx/trx0sys.c b/innobase/trx/trx0sys.c index b52ec2bae0f..43dd457c540 100644 --- a/innobase/trx/trx0sys.c +++ b/innobase/trx/trx0sys.c @@ -576,7 +576,7 @@ trx_sys_update_mysql_binlog_offset( MLOG_4BYTES, mtr); } - if (0 != strcmp(sys_header + field + TRX_SYS_MYSQL_LOG_NAME, file_name)) { + if (0 != strcmp((char*) (sys_header + field + TRX_SYS_MYSQL_LOG_NAME), file_name)) { mlog_write_string((byte*) (sys_header + field + TRX_SYS_MYSQL_LOG_NAME), diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 2c54603ea7a..4a96cb64ce4 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -385,11 +385,6 @@ int STDCALL mysql_server_init(int argc, char **argv, char **groups) if (gethostname(glob_hostname,sizeof(glob_hostname)-4) < 0) strmov(glob_hostname,"mysql"); -#ifndef DBUG_OFF - strxmov(strend(server_version),MYSQL_SERVER_SUFFIX,"-debug",NullS); -#else - strmov(strend(server_version),MYSQL_SERVER_SUFFIX); -#endif load_defaults("my", (const char **) groups, argcp, argvp); defaults_argv=*argvp; @@ -406,9 +401,8 @@ int STDCALL mysql_server_init(int argc, char **argv, char **groups) set_options(); get_options(*argcp, *argvp); + set_server_version(); - if (opt_log || opt_update_log || opt_slow_log || opt_bin_log) - strcat(server_version,"-log"); DBUG_PRINT("info",("%s Ver %s for %s on %s\n",my_progname, server_version, SYSTEM_TYPE,MACHINE_TYPE)); diff --git a/libmysqld/libmysqld.def b/libmysqld/libmysqld.def index c6615ee971c..1c9bdea0a01 100644 --- a/libmysqld/libmysqld.def +++ b/libmysqld/libmysqld.def @@ -63,3 +63,6 @@ EXPORTS mysql_refresh mysql_odbc_escape_string myodbc_remove_escape + net_buffer_length + max_allowed_packet + get_tty_password diff --git a/myisam/myisam_ftdump.c b/myisam/myisam_ftdump.c index d06cb46bdc1..06b5f057fbb 100644 --- a/myisam/myisam_ftdump.c +++ b/myisam/myisam_ftdump.c @@ -81,7 +81,7 @@ int main(int argc,char *argv[]) { char *end; - inx= strtoll(argv[1], &end, 10); + inx= (uint) strtoll(argv[1], &end, 10); if (*end) usage(); } diff --git a/mysys/sha1.c b/mysys/sha1.c index 5271b369b6c..d93b4571baf 100644 --- a/mysys/sha1.c +++ b/mysys/sha1.c @@ -342,7 +342,7 @@ static void SHA1ProcessMessageBlock(SHA1_CONTEXT *context) */ -void SHA1PadMessage(SHA1_CONTEXT *context) +static void SHA1PadMessage(SHA1_CONTEXT *context) { /* Check to see if the current message block is too small to hold diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 3556b00cbc7..54c25b49035 100755 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -327,6 +327,10 @@ mv $BASE/README $BASE/README.txt if [ -f scripts/mysql_install_db ]; then print_debug "Initializing the 'data' directory" scripts/mysql_install_db --no-defaults --windows --datadir=$BASE/data + if test "$?" = 1 + then + exit 1; + fi fi # diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 012725265a1..c03049c6a91 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (C) 2002 MySQL AB +# Copyright (C) 2002-2004 MySQL AB # For a more info consult the file COPYRIGHT distributed with this file. # This scripts creates the privilege tables db, host, user, tables_priv, @@ -7,13 +7,14 @@ # # All unrecognized arguments to this script are passed to mysqld. -IN_RPM=0 +in_rpm=0 +windows=0 +defaults="" case "$1" in -IN-RPM) - IN_RPM="1"; shift + in_rpm="1"; shift ;; esac -defaults= case "$1" in --no-defaults|--defaults-file=*|--defaults-extra-file=*) defaults="$1"; shift @@ -38,6 +39,9 @@ parse_arguments() { --ldata=*|--datadir=*) ldata=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; --user=*) user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; --skip-name-resolve) ip_only=1 ;; + --verbose) verbose=1 ;; + --rpm) in_rpm=1 ;; + --windows) windows=1 ;; *) if test -n "$pick_args" then @@ -55,6 +59,9 @@ parse_arguments() { if test -x ./bin/my_print_defaults then print_defaults="./bin/my_print_defaults" +elif test -x ./extra/my_print_defaults +then + print_defaults="./extra/my_print_defaults" elif test -x @bindir@/my_print_defaults then print_defaults="@bindir@/my_print_defaults" @@ -80,6 +87,7 @@ then basedir=@prefix@ bindir=@bindir@ execdir=@libexecdir@ + pkgdatadir=@pkgdatadir@ else bindir="$basedir/bin" if test -x "$basedir/libexec/mysqld" @@ -94,15 +102,25 @@ fi fi mdata=$ldata/mysql +mysqld=$execdir/mysqld +mysqld_opt="" +scriptdir=$bindir -if test ! -x $execdir/mysqld +if test "$windows" = 1 then - if test "$IN_RPM" = "1" + mysqld="./sql/mysqld" + mysqld_opt="--language=./sql/share/english" + scriptdir="./scripts" +fi + +if test ! -x $mysqld +then + if test "$in_rpm" = 1 then - echo "FATAL ERROR $execdir/mysqld not found!" + echo "FATAL ERROR $mysqld not found!" exit 1 else - echo "Didn't find $execdir/mysqld" + echo "Didn't find $mysqld" echo "You should do a 'make install' before executing this script" exit 1 fi @@ -112,7 +130,7 @@ fi hostname=`@HOSTNAME@` # Check if hostname is valid -if test "$IN_RPM" = "0" -a $force = "0" +if test "$windows" = 0 -a "$in_rpm" = 0 -a $force = 0 then resolved=`$bindir/resolveip $hostname 2>&1` if [ $? -ne 0 ] @@ -313,7 +331,7 @@ then fi echo "Installing all prepared tables" -if eval "$execdir/mysqld $defaults --bootstrap --skip-grant-tables \ +if eval "$mysqld $defaults $mysqld_opt --bootstrap --skip-grant-tables \ --basedir=$basedir --datadir=$ldata --skip-innodb --skip-bdb $args" << END_OF_DATA use mysql; $c_d @@ -333,7 +351,7 @@ $c_c END_OF_DATA then echo "" - if test "$IN_RPM" = "0" + if test "$in_rpm" = "0" then echo "To start mysqld at boot time you have to copy support-files/mysql.server" echo "to the right place for your system" @@ -354,7 +372,7 @@ then echo "able to use the new GRANT command!" fi echo - if test "$IN_RPM" = "0" + if test "$in_rpm" = "0" then echo "You can start the MySQL daemon with:" echo "cd @prefix@ ; $bindir/mysqld_safe &" diff --git a/sql/Makefile.am b/sql/Makefile.am index e2494e50d96..f3751eabd25 100644 --- a/sql/Makefile.am +++ b/sql/Makefile.am @@ -49,7 +49,7 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \ item_create.h mysql_priv.h \ procedure.h sql_class.h sql_lex.h sql_list.h \ sql_manager.h sql_map.h sql_string.h unireg.h \ - field.h handler.h \ + field.h handler.h mysqld_suffix.h \ ha_isammrg.h ha_isam.h ha_myisammrg.h\ ha_heap.h ha_myisam.h ha_berkeley.h ha_innodb.h \ opt_range.h opt_ft.h \ @@ -81,7 +81,7 @@ mysqld_SOURCES = sql_lex.cc sql_handler.cc \ sql_udf.cc sql_analyse.cc sql_analyse.h sql_cache.cc \ slave.cc sql_repl.cc sql_union.cc \ mini_client.cc mini_client_errors.c \ - stacktrace.c repl_failsafe.h repl_failsafe.cc sql_olap.cc + stacktrace.c repl_failsafe.h repl_failsafe.cc gen_lex_hash_SOURCES = gen_lex_hash.cc gen_lex_hash_LDADD = $(LDADD) $(CXXLDFLAGS) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 4a50e2d8ccf..dee34b47ccb 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -4671,7 +4671,6 @@ innodb_show_status( THD* thd) /* in: the MySQL query thread of the caller */ { String* packet = &thd->packet; - char* buf; trx_t* trx; DBUG_ENTER("innodb_show_status"); diff --git a/sql/mysqld.cc b/sql/mysqld.cc index c1ea29caa88..20836038131 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -22,6 +22,7 @@ #include "sql_repl.h" #include "repl_failsafe.h" #include "stacktrace.h" +#include "mysqld_suffix.h" #ifdef HAVE_BERKELEY_DB #include "ha_berkeley.h" #endif @@ -202,22 +203,6 @@ static int opt_argc; static char **opt_argv; #endif -/* Set prefix for windows binary */ -#ifdef __WIN__ -#undef MYSQL_SERVER_SUFFIX -#ifdef __NT__ -#if defined(HAVE_BERKELEY_DB) -#define MYSQL_SERVER_SUFFIX "-max-nt" -#else -#define MYSQL_SERVER_SUFFIX "-nt" -#endif /* ...DB */ -#elif defined(HAVE_BERKELEY_DB) -#define MYSQL_SERVER_SUFFIX "-max" -#else -#define MYSQL_SERVER_SUFFIX "" -#endif /* __NT__ */ -#endif /* __WIN__ */ - #ifdef HAVE_BERKELEY_DB SHOW_COMP_OPTION have_berkeley_db=SHOW_OPTION_YES; #else @@ -420,7 +405,7 @@ bool mysql_embedded=1; static char *opt_bin_logname = 0; char *opt_relay_logname = 0, *opt_relaylog_index_name=0; -char server_version[SERVER_VERSION_LENGTH]=MYSQL_SERVER_VERSION; +char server_version[SERVER_VERSION_LENGTH]; const char *first_keyword="first"; const char **errmesg; /* Error messages */ const char *myisam_recover_options_str="OFF"; @@ -485,6 +470,7 @@ static void start_signal_handler(void); extern "C" pthread_handler_decl(signal_hand, arg); static void set_options(void); static void get_options(int argc,char **argv); +static void set_server_version(void); static char *get_relative_path(const char *path); static void fix_paths(void); extern "C" pthread_handler_decl(handle_connections_sockets,arg); @@ -2037,11 +2023,7 @@ int main(int argc, char **argv) strmov(glob_hostname,"mysql"); strmake(pidfile_name, glob_hostname, sizeof(pidfile_name)-5); strmov(fn_ext(pidfile_name),".pid"); // Add proper extension -#ifndef DBUG_OFF - strxmov(strend(server_version),MYSQL_SERVER_SUFFIX,"-debug",NullS); -#else - strmov(strend(server_version),MYSQL_SERVER_SUFFIX); -#endif + #ifdef _CUSTOMSTARTUPCONFIG_ if (_cust_check_startup()) { @@ -2065,8 +2047,8 @@ int main(int argc, char **argv) set_options(); get_options(argc,argv); - if (opt_log || opt_update_log || opt_slow_log || opt_bin_log) - strcat(server_version,"-log"); + set_server_version(); + DBUG_PRINT("info",("%s Ver %s for %s on %s\n",my_progname, server_version, SYSTEM_TYPE,MACHINE_TYPE)); @@ -4330,6 +4312,7 @@ struct show_var_st status_vars[]= { static void print_version(void) { + set_server_version(); printf("%s Ver %s for %s on %s (%s)\n",my_progname, server_version,SYSTEM_TYPE,MACHINE_TYPE, MYSQL_COMPILATION_COMMENT); } @@ -4944,6 +4927,29 @@ static void get_options(int argc,char **argv) } +/* + Create version name for running mysqld version + We automaticly add suffixes -debug, -embedded and -log to the version + name to make the version more descriptive. + (MYSQL_SERVER_SUFFIX is set by the compilation environment) +*/ + +static void set_server_version(void) +{ + char *end= strxmov(server_version, MYSQL_SERVER_VERSION, + MYSQL_SERVER_SUFFIX, NullS); +#ifdef EMBEDDED_LIBRARY + end= strmov(end, "-embedded"); +#endif +#ifndef DBUG_OFF + if (!strstr(MYSQL_SERVER_SUFFIX, "-debug")) + end= strmov(end, "-debug"); +#endif + if (opt_log || opt_update_log || opt_slow_log || opt_bin_log) + strmov(end, "-log"); // This may slow down system +} + + static char *get_relative_path(const char *path) { if (test_if_hard_path(path) && diff --git a/sql/mysqld_suffix.h b/sql/mysqld_suffix.h new file mode 100644 index 00000000000..502cdeed75f --- /dev/null +++ b/sql/mysqld_suffix.h @@ -0,0 +1,38 @@ +/* Copyright (C) 2000-2004 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Set MYSQL_SERVER_SUFFIX + The following code is quite ugly as there is no portable way to set a + string to the value of a macro +*/ + +#if defined(MYSQL_SERVER_SUFFIX_NT) +#undef MYSQL_SERVER_SUFFIX +#define MYSQL_SERVER_SUFFIX "-nt" +#elif defined(MYSQL_SERVER_SUFFIX_MAX) +#undef MYSQL_SERVER_SUFFIX +#define MYSQL_SERVER_SUFFIX "-max" +#elif defined(MYSQL_SERVER_SUFFIX_NT_MAX) +#undef MYSQL_SERVER_SUFFIX +#define MYSQL_SERVER_SUFFIX "-nt-max" +#elif defined(MYSQL_SERVER_SUFFIX_PRO) +#undef MYSQL_SERVER_SUFFIX +#define MYSQL_SERVER_SUFFIX "-pro" +#elif defined(MYSQL_SERVER_SUFFIX_PRO_NT) +#undef MYSQL_SERVER_SUFFIX +#define MYSQL_SERVER_SUFFIX "-pro-nt" +#endif diff --git a/sql/set_var.cc b/sql/set_var.cc index eb94ad2ebf6..da4734d766c 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -342,8 +342,6 @@ sys_var_const_str sys_os("version_compile_os", SYSTEM_TYPE); sys_var_const_str sys_license("license", LICENSE); - - /* List of all variables for initialisation and storage in hash This is sorted in alphabetical order to make it easy to add new variables @@ -540,7 +538,7 @@ struct show_var_st init_vars[]= { {sys_log_warnings.name, (char*) &sys_log_warnings, SHOW_SYS}, {sys_long_query_time.name, (char*) &sys_long_query_time, SHOW_SYS}, {sys_low_priority_updates.name, (char*) &sys_low_priority_updates, SHOW_SYS}, - {"lower_case_file_system", (char*) &lower_case_file_system, SHOW_BOOL}, + {"lower_case_file_system", (char*) &lower_case_file_system, SHOW_MY_BOOL}, {"lower_case_table_names", (char*) &lower_case_table_names, SHOW_INT}, {sys_max_allowed_packet.name,(char*) &sys_max_allowed_packet, SHOW_SYS}, {sys_max_binlog_cache_size.name,(char*) &sys_max_binlog_cache_size, SHOW_SYS}, diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c index 671aa74d806..aed8ac74949 100644 --- a/strings/ctype-tis620.c +++ b/strings/ctype-tis620.c @@ -462,7 +462,7 @@ static void _thai2sortable(uchar *tstr) int len, tlen; uchar l2bias; - tlen= len= strlen (tstr); + tlen= len= strlen((char*) tstr); l2bias= 256 - 8; for (p= tstr; tlen > 0; p++, tlen--) { @@ -491,7 +491,7 @@ static void _thai2sortable(uchar *tstr) l2bias use to control position weight of l2char example (*=l2char) XX*X must come before X*XX */ - strmov(p,p+1); + strmov((char*) p, (char*) p+1); tstr[len-1]= l2bias + t_ctype0[1]- L2_GARAN +1; p--; continue; @@ -550,10 +550,10 @@ int my_strnxfrm_tis620(uchar * dest, const uchar * src, int len, int srclen) { if (len > srclen) len= srclen ; - strnmov(dest, src, len) ; + strnmov((char*) dest, (char*) src, len) ; dest[len]= 0; /* if length(src) > len, need to put 'end of string' */ _thai2sortable(dest); - return strlen(dest); + return strlen((char*) dest); } From 707bd523de04539a81257924ed88d4fd09f1bc85 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 19 May 2004 17:43:50 +0400 Subject: [PATCH 125/162] Moved testing of binlog_cache_use/binlog_cache_disk_use statistical variables from rpl_relayrotate.test to innodb.test since this test requires innodb support. mysql-test/t/innodb-master.opt: Rename: mysql-test/t/rpl_relayrotate-master.opt -> mysql-test/t/innodb-master.opt --- mysql-test/r/innodb.result | 23 +++++++++++++ mysql-test/r/rpl_relayrotate.result | 15 --------- ...layrotate-master.opt => innodb-master.opt} | 0 mysql-test/t/innodb.test | 33 +++++++++++++++++++ mysql-test/t/rpl_relayrotate.test | 16 --------- 5 files changed, 56 insertions(+), 31 deletions(-) rename mysql-test/t/{rpl_relayrotate-master.opt => innodb-master.opt} (100%) diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 981ef23c779..83d042cd279 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1595,3 +1595,26 @@ t2 CREATE TABLE `t2` ( CONSTRAINT `t2_ibfk_2` FOREIGN KEY (`b`) REFERENCES `t1` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t2, t1; +show status like "binlog_cache_use"; +Variable_name Value +Binlog_cache_use 24 +show status like "binlog_cache_disk_use"; +Variable_name Value +Binlog_cache_disk_use 0 +create table t1 (a int) engine=innodb; +show status like "binlog_cache_use"; +Variable_name Value +Binlog_cache_use 25 +show status like "binlog_cache_disk_use"; +Variable_name Value +Binlog_cache_disk_use 1 +begin; +delete from t1; +commit; +show status like "binlog_cache_use"; +Variable_name Value +Binlog_cache_use 26 +show status like "binlog_cache_disk_use"; +Variable_name Value +Binlog_cache_disk_use 1 +drop table t1; diff --git a/mysql-test/r/rpl_relayrotate.result b/mysql-test/r/rpl_relayrotate.result index 96ec06a69aa..bf9bbbb9b93 100644 --- a/mysql-test/r/rpl_relayrotate.result +++ b/mysql-test/r/rpl_relayrotate.result @@ -16,19 +16,4 @@ master_pos_wait('master-bin.001',3000)>=0 select * from t1 where a=8000; a 8000 -show status like "binlog_cache_use"; -Variable_name Value -Binlog_cache_use 1 -show status like "binlog_cache_disk_use"; -Variable_name Value -Binlog_cache_disk_use 1 -begin; -delete from t1; -commit; -show status like "binlog_cache_use"; -Variable_name Value -Binlog_cache_use 2 -show status like "binlog_cache_disk_use"; -Variable_name Value -Binlog_cache_disk_use 1 drop table t1; diff --git a/mysql-test/t/rpl_relayrotate-master.opt b/mysql-test/t/innodb-master.opt similarity index 100% rename from mysql-test/t/rpl_relayrotate-master.opt rename to mysql-test/t/innodb-master.opt diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index 47e82db2dc4..e0cc96ccb32 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -1106,4 +1106,37 @@ show create table t2; drop table t2, t1; +# +# Let us test binlog_cache_use and binlog_cache_disk_use status vars. +# Actually this test has nothing to do with innodb per se, it just requires +# transactional table. +# +show status like "binlog_cache_use"; +show status like "binlog_cache_disk_use"; +create table t1 (a int) engine=innodb; + +# Now we are going to create transaction which is long enough so its +# transaction binlog will be flushed to disk... +let $1=2000; +disable_query_log; +begin; +while ($1) +{ + eval insert into t1 values( $1 ); + dec $1; +} +commit; +enable_query_log; +show status like "binlog_cache_use"; +show status like "binlog_cache_disk_use"; + +# Transaction which should not be flushed to disk and so should not +# increase binlog_cache_disk_use. +begin; +delete from t1; +commit; +show status like "binlog_cache_use"; +show status like "binlog_cache_disk_use"; + +drop table t1; diff --git a/mysql-test/t/rpl_relayrotate.test b/mysql-test/t/rpl_relayrotate.test index ca3bff81608..46e6f1bd157 100644 --- a/mysql-test/t/rpl_relayrotate.test +++ b/mysql-test/t/rpl_relayrotate.test @@ -60,22 +60,6 @@ select * from t1 where a=8000; connection master; -# binlog_cache_use and binlog_cache_disk_use status vars test -# This test uses the previous test. Namely, it needs the long -# transaction that adds 8000 lines to the t1 table. - -show status like "binlog_cache_use"; -show status like "binlog_cache_disk_use"; - -# transaction which should not be flushed to disk and so should not -# increase binlog_cache_disk_use -begin; -delete from t1; -commit; - -show status like "binlog_cache_use"; -show status like "binlog_cache_disk_use"; - # The following DROP is a very important cleaning task: # imagine the next test is run with --skip-innodb: it will do # DROP TABLE IF EXISTS t1; but this will delete the frm and leave From 9fb55cefac8204fb77e28e9141977a72b7017483 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 19 May 2004 17:07:28 +0300 Subject: [PATCH 126/162] after review changes mysql-test/r/derived.result: explain of hidden subselect changed according to review mysql-test/r/subselect.result: explain of hidden subselect changed according to review mysql-test/r/union.result: explain of hidden subselect changed according to review sql/sql_class.h: we bo not need sign for now sql/sql_lex.h: we do not need sign for now --- mysql-test/r/derived.result | 8 +++--- mysql-test/r/subselect.result | 14 +++++------ mysql-test/r/union.result | 10 ++++---- sql/sql_class.h | 2 +- sql/sql_lex.h | 2 +- sql/sql_select.cc | 47 +++++++++++++++++++++++++---------- 6 files changed, 52 insertions(+), 31 deletions(-) diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result index cdbca9aa2aa..dd4c32403b5 100644 --- a/mysql-test/r/derived.result +++ b/mysql-test/r/derived.result @@ -94,13 +94,13 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY ALL NULL NULL NULL NULL 3 2 DERIVED t1 ALL NULL NULL NULL NULL 4 3 UNION t1 ALL NULL NULL NULL NULL 4 --2 UNION RESULT ALL NULL NULL NULL NULL NULL +NULL UNION RESULT ALL NULL NULL NULL NULL NULL explain select * from (select * from t1 union all select * from t1) a; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY ALL NULL NULL NULL NULL 8 2 DERIVED t1 ALL NULL NULL NULL NULL 4 3 UNION t1 ALL NULL NULL NULL NULL 4 --2 UNION RESULT ALL NULL NULL NULL NULL NULL +NULL UNION RESULT ALL NULL NULL NULL NULL NULL CREATE TABLE t2 (a int not null); insert into t2 values(1); select * from (select * from t1 where t1.a=(select a from t2 where t2.a=t1.a)) a; @@ -248,10 +248,10 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY ALL NULL NULL NULL NULL 2 4 DERIVED t1 ALL NULL NULL NULL NULL 2 5 UNION t1 ALL NULL NULL NULL NULL 2 --4 UNION RESULT ALL NULL NULL NULL NULL NULL +NULL UNION RESULT ALL NULL NULL NULL NULL NULL 2 DERIVED t1 ALL NULL NULL NULL NULL 2 3 UNION t1 ALL NULL NULL NULL NULL 2 --2 UNION RESULT ALL NULL NULL NULL NULL NULL +NULL UNION RESULT ALL NULL NULL NULL NULL NULL drop table t1; CREATE TABLE `t1` ( `N` int(11) unsigned NOT NULL default '0', diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index ea0fd7217a8..9ad3a5a9cf2 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -16,7 +16,7 @@ explain extended SELECT (SELECT 1) UNION SELECT (SELECT 2); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used 3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used --1 UNION RESULT ALL NULL NULL NULL NULL NULL +NULL UNION RESULT ALL NULL NULL NULL NULL NULL Warnings: Note 1249 Select 2 was reduced during optimisation Note 1249 Select 4 was reduced during optimisation @@ -29,7 +29,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used 3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used 4 UNION NULL NULL NULL NULL NULL NULL NULL No tables used --3 UNION RESULT ALL NULL NULL NULL NULL NULL +NULL UNION RESULT ALL NULL NULL NULL NULL NULL Warnings: Note 1249 Select 2 was reduced during optimisation Note 1003 select (select 0 AS `0` union select 0 AS `0`) AS `(SELECT (SELECT 0 UNION SELECT 0))` @@ -184,7 +184,7 @@ id select_type table type possible_keys key key_len ref rows Extra 2 SUBQUERY t3 ALL NULL NULL NULL NULL 3 Using filesort 3 UNION t4 ALL NULL NULL NULL NULL 3 Using where; Using filesort 4 SUBQUERY t2 ALL NULL NULL NULL NULL 2 --1 UNION RESULT ALL NULL NULL NULL NULL NULL +NULL UNION RESULT ALL NULL NULL NULL NULL NULL Warnings: Note 1003 (select test.t2.a AS `a`,test.t2.b AS `b` from test.t2 where (test.t2.b = (select test.t3.a AS `a` from test.t3 order by test.t3.a desc limit 1))) union (select test.t4.a AS `a`,test.t4.b AS `b` from test.t4 where (test.t4.b = (select (max(test.t2.a) * 4) AS `max(t2.a)*4` from test.t2)) order by test.t4.a) select (select a from t3 where a ALL NULL NULL NULL NULL NULL +NULL UNION RESULT ALL NULL NULL NULL NULL NULL Warnings: Note 1276 Field or reference 't2.a' of SELECT #2 was resolved in SELECT #1 Note 1276 Field or reference 't2.a' of SELECT #3 was resolved in SELECT #1 @@ -417,7 +417,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 index NULL topic 3 NULL 2 Using index 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used 3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used --2 UNION RESULT ALL NULL NULL NULL NULL NULL +NULL UNION RESULT ALL NULL NULL NULL NULL NULL Warnings: Note 1003 select 1 AS `1` from test.t1 drop table t1; @@ -732,7 +732,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 index NULL id 5 NULL 2 Using where; Using index 2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used 3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL No tables used --2 UNION RESULT ALL NULL NULL NULL NULL NULL +NULL UNION RESULT ALL NULL NULL NULL NULL NULL Warnings: Note 1003 select test.t2.id AS `id` from test.t2 where (test.t2.id,(select 1 AS `Not_used` having ((test.t2.id) = (1)) union select 1 AS `Not_used` having ((test.t2.id) = (3)))) SELECT * FROM t2 WHERE id IN (SELECT 5 UNION SELECT 3); @@ -1547,7 +1547,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system NULL NULL NULL NULL 1 2 SUBQUERY t1 system NULL NULL NULL NULL 1 3 UNION t1 system NULL NULL NULL NULL 1 --2 UNION RESULT ALL NULL NULL NULL NULL NULL +NULL UNION RESULT ALL NULL NULL NULL NULL NULL Warnings: Note 1003 select test.t1.s1 AS `s1` from test.t1 drop table t1; diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index 4655f92c7d7..0735ea4dc40 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -86,7 +86,7 @@ explain extended (select a,b from t1 limit 2) union all (select a,b from t2 ord id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 4 2 UNION t2 ALL NULL NULL NULL NULL 4 Using filesort --1 UNION RESULT ALL NULL NULL NULL NULL NULL Using filesort +NULL UNION RESULT ALL NULL NULL NULL NULL NULL Using filesort Warnings: Note 1003 (select test.t1.a AS `a`,test.t1.b AS `b` from test.t1 limit 2) union all (select test.t2.a AS `a`,test.t2.b AS `b` from test.t2 order by test.t2.a limit 1) order by b desc (select sql_calc_found_rows a,b from t1 limit 2) union all (select a,b from t2 order by a) limit 2; @@ -107,7 +107,7 @@ explain select a,b from t1 union all select a,b from t2; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 4 2 UNION t2 ALL NULL NULL NULL NULL 4 --1 UNION RESULT ALL NULL NULL NULL NULL NULL +NULL UNION RESULT ALL NULL NULL NULL NULL NULL explain select xx from t1 union select 1; ERROR 42S22: Unknown column 'xx' in 'field list' explain select a,b from t1 union select 1; @@ -470,7 +470,7 @@ explain extended (select * from t1 where a=1) union (select * from t2 where a=1) id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 const PRIMARY PRIMARY 4 const 1 2 UNION t2 const PRIMARY PRIMARY 4 const 1 --1 UNION RESULT ALL NULL NULL NULL NULL NULL +NULL UNION RESULT ALL NULL NULL NULL NULL NULL Warnings: Note 1003 (select test.t1.a AS `a`,test.t1.b AS `b` from test.t1 where (test.t1.a = 1)) union (select test.t2.a AS `a`,test.t2.b AS `b` from test.t2 where (test.t2.a = 1)) (select * from t1 where a=5) union (select * from t2 where a=1); @@ -493,12 +493,12 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 2 UNION t1 index PRIMARY PRIMARY 4 NULL 4 Using index 2 UNION t2 index PRIMARY PRIMARY 4 NULL 3 Using where; Using index --1 UNION RESULT ALL NULL NULL NULL NULL NULL +NULL UNION RESULT ALL NULL NULL NULL NULL NULL explain (select * from t1 where a=1) union (select * from t1 where b=1); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 const PRIMARY PRIMARY 4 const 1 2 UNION t1 ref b b 5 const 1 Using where --1 UNION RESULT ALL NULL NULL NULL NULL NULL +NULL UNION RESULT ALL NULL NULL NULL NULL NULL drop table t1,t2; create table t1 ( id int not null auto_increment, primary key (id) ,user_name text ); create table t2 ( id int not null auto_increment, primary key (id) ,group_name text ); diff --git a/sql/sql_class.h b/sql/sql_class.h index 9ed49c22119..493ac8e1256 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -773,7 +773,7 @@ public: uint current_tablenr,tmp_table; uint server_status,open_options,system_thread; uint32 db_length; - int select_number; //number of select (used for EXPLAIN) + uint select_number; //number of select (used for EXPLAIN) /* variables.transaction_isolation is reset to this after each commit */ enum_tx_isolation session_tx_isolation; enum_check_fields count_cuted_fields; diff --git a/sql/sql_lex.h b/sql/sql_lex.h index e6a2dcdb754..2df2c998ff0 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -425,7 +425,7 @@ public: ulong table_join_options; uint in_sum_expr; - int select_number; /* number of select (used for EXPLAIN) */ + uint select_number; /* number of select (used for EXPLAIN) */ uint with_wild; /* item list contain '*' */ bool braces; /* SELECT ... UNION (SELECT ... ) <- this braces */ /* TRUE when having fix field called in processing of this SELECT */ diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 891efb50d11..194f27e6fb8 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -9133,7 +9133,7 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order, if (message) { - item_list.push_back(new Item_int((longlong) + item_list.push_back(new Item_int((int32) join->select_lex->select_number)); item_list.push_back(new Item_string(join->select_lex->type, strlen(join->select_lex->type), cs)); @@ -9146,23 +9146,44 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order, else if (join->select_lex == join->unit->fake_select_lex) { /* - Here is guessing about fake_select_lex to avoid union SELECT - execution to get accurate information + here we assume that the query will return at least two rows, so we + show "filesort" in EXPLAIN. Of course, sometimes we'll be wrong + and no filesort will be actually done, but executing all selects in + the UNION to provide precise EXPLAIN information will hardly be + appreciated :) */ - char table_name_buffer[64]; + char table_name_buffer[NAME_LEN]; item_list.empty(); /* id */ - item_list.push_back(new Item_int((int32) - join->select_lex->select_number)); + item_list.push_back(new Item_null); /* select_type */ item_list.push_back(new Item_string(join->select_lex->type, strlen(join->select_lex->type), cs)); /* table */ - int len= my_snprintf(table_name_buffer, sizeof(table_name_buffer)-1, - "", - -join->select_lex->select_number); - item_list.push_back(new Item_string(table_name_buffer, len, cs)); + { + SELECT_LEX *sl= join->unit->first_select(); + uint len= 6, lastop= 0; + memcpy(table_name_buffer, "next_select()) + { + len+= lastop; + lastop= my_snprintf(table_name_buffer + len, NAME_LEN - len, + "%u,", sl->select_number); + } + if (sl || len + lastop >= NAME_LEN) + { + memcpy(table_name_buffer + len, "...>", 5); + len+= 4; + } + else + { + len+= lastop; + table_name_buffer[len - 1]= '>'; // change ',' to '>' + } + item_list.push_back(new Item_string(table_name_buffer, len, cs)); + } + /* type */ item_list.push_back(new Item_string(join_type_str[JT_ALL], strlen(join_type_str[JT_ALL]), cs)); @@ -9195,7 +9216,7 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order, TABLE *table=tab->table; char buff[512],*buff_ptr=buff; char buff1[512], buff2[512]; - char table_name_buffer[64]; + char table_name_buffer[NAME_LEN]; String tmp1(buff1,sizeof(buff1),cs); String tmp2(buff2,sizeof(buff2),cs); tmp1.length(0); @@ -9203,7 +9224,7 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order, item_list.empty(); /* id */ - item_list.push_back(new Item_int((int32) + item_list.push_back(new Item_uint((uint32) join->select_lex->select_number)); /* select_type */ item_list.push_back(new Item_string(join->select_lex->type, @@ -9379,7 +9400,7 @@ int mysql_explain_union(THD *thd, SELECT_LEX_UNIT *unit, select_result *result) } if (first->next_select()) { - unit->fake_select_lex->select_number= -first->select_number; + unit->fake_select_lex->select_number= UINT_MAX; // jost for initialization unit->fake_select_lex->type= "UNION RESULT"; unit->fake_select_lex->options|= SELECT_DESCRIBE; if (!(res= unit->prepare(thd, result, SELECT_NO_UNLOCK | SELECT_DESCRIBE))) From a63184a6a353ef26d87b554e5df17bbeddfb1ca4 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 19 May 2004 18:13:21 +0300 Subject: [PATCH 127/162] after merge fix sql/sql_union.cc: describe should go until the end --- sql/sql_union.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/sql_union.cc b/sql/sql_union.cc index ec1abc57a51..e56dd4b476e 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -361,7 +361,8 @@ int st_select_lex_unit::exec() item->reset(); table->file->delete_all_rows(); } - if (union_distinct && table->file->enable_indexes(HA_KEY_SWITCH_ALL)) + if (union_distinct && table->file->enable_indexes(HA_KEY_SWITCH_ALL) && + !describe) DBUG_RETURN(1); // For sub-selects for (SELECT_LEX *sl= select_cursor; sl; sl= sl->next_select()) { From a61ddac656e77171bfe0d45b2c0ca82fec2d6155 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 20 May 2004 01:32:02 +0300 Subject: [PATCH 128/162] InnoDB cleanup: Remove unused functions ut_sprintf() and ut_fprintf() innobase/include/ut0ut.h: Remove unused functions ut_sprintf() and ut_fprintf() innobase/ut/ut0ut.c: Remove unused functions ut_sprintf() and ut_fprintf() --- innobase/include/ut0ut.h | 32 --------- innobase/ut/ut0ut.c | 148 --------------------------------------- 2 files changed, 180 deletions(-) diff --git a/innobase/include/ut0ut.h b/innobase/include/ut0ut.h index 04516535965..f4a682c57ec 100644 --- a/innobase/include/ut0ut.h +++ b/innobase/include/ut0ut.h @@ -17,38 +17,6 @@ Created 1/20/1994 Heikki Tuuri typedef time_t ib_time_t; -/************************************************************ -On the 64-bit Windows we substitute the format string -%l -> %I64 -because we define ulint as unsigned __int64 and lint as __int64 on Windows, -and both the Microsoft and Intel C compilers require the format string -%I64 in that case instead of %l. */ - -int -ut_sprintf( -/*=======*/ - /* out: the number of characters written, or - negative in case of an error */ - char* buf, /* in: buffer where to print */ - const char* format, /* in: format of prints */ - ...); /* in: arguments to be printed */ -/************************************************************ -On the 64-bit Windows we substitute the format string -%l -> %I64 -because we define ulint as unsigned __int64 and lint as __int64 on Windows, -and both the Microsoft and Intel C compilers require the format string -%I64 in that case instead of %l. */ - -int -ut_fprintf( -/*=======*/ - /* out: the number of characters written, or - negative in case of an error */ - FILE* stream, /* in: stream where to print */ - const char* format, /* in: format of prints */ - ...) /* in: arguments to be printed */ - __attribute__((__format__ (__printf__, 2, 3))); - /************************************************************ Gets the high 32 bits in a ulint. That is makes a shift >> 32, but since there seem to be compiler bugs in both gcc and Visual C++, diff --git a/innobase/ut/ut0ut.c b/innobase/ut/ut0ut.c index cce98cf5644..39850227162 100644 --- a/innobase/ut/ut0ut.c +++ b/innobase/ut/ut0ut.c @@ -29,154 +29,6 @@ mysql_get_identifier_quote_char(void); /* out: quote character to be used in SQL identifiers */ -/************************************************************ -On the 64-bit Windows we substitute the format string -%l -> %I64 -because we define ulint as unsigned __int64 and lint as __int64 on Windows, -and both the Microsoft and Intel C compilers require the format string -%I64 in that case instead of %l. */ - -int -ut_sprintf( -/*=======*/ - /* out: the number of characters written, or - negative in case of an error */ - char* buf, /* in: buffer where to print */ - const char* format, /* in: format of prints */ - ...) /* in: arguments to be printed */ -{ - va_list args; - ulint len; - char* format_end; - char* newformat; - char* ptr; - char* newptr; - int ret; - char format_buf_in_stack[500]; - - len = strlen(format); - - if (len > 250) { - newformat = malloc(2 * len); - } else { - newformat = format_buf_in_stack; - } - - format_end = (char*)format + len; - - ptr = (char*)format; - newptr = newformat; - -#if defined(__WIN__) && (defined(WIN64) || defined(_WIN64)) - /* Replace %l with %I64 if it is not preceded with '\' */ - - while (ptr < format_end) { - if (*ptr == '%' && *(ptr + 1) == 'l' - && (ptr == format || *(ptr - 1) != '\\')) { - - memcpy(newptr, "%I64", 4); - ptr += 2; - newptr += 4; - } else { - *newptr = *ptr; - ptr++; - newptr++; - } - } - - *newptr = '\0'; - - ut_a(newptr < newformat + 2 * len); -#else - strcpy(newformat, format); -#endif - va_start(args, format); - - ret = vsprintf(buf, (const char*)newformat, args); - - va_end(args); - - if (newformat != format_buf_in_stack) { - free(newformat); - } - - return(ret); -} - -/************************************************************ -On the 64-bit Windows we substitute the format string -%l -> %I64 -because we define ulint as unsigned __int64 and lint as __int64 on Windows, -and both the Microsoft and Intel C compilers require the format string -%I64 in that case instead of %l. */ - -int -ut_fprintf( -/*=======*/ - /* out: the number of characters written, or - negative in case of an error */ - FILE* stream, /* in: stream where to print */ - const char* format, /* in: format of prints */ - ...) /* in: arguments to be printed */ -{ - va_list args; - ulint len; - char* format_end; - char* newformat; - char* ptr; - char* newptr; - int ret; - char format_buf_in_stack[500]; - - len = strlen(format); - - if (len > 250) { - newformat = malloc(2 * len); - } else { - newformat = format_buf_in_stack; - } - - format_end = (char*)format + len; - - ptr = (char*)format; - newptr = newformat; - -#if defined(__WIN__) && (defined(WIN64) || defined(_WIN64)) - /* Replace %l with %I64 if it is not preceded with '\' */ - - while (ptr < format_end) { - if (*ptr == '%' && *(ptr + 1) == 'l' - && (ptr == format || *(ptr - 1) != '\\')) { - - memcpy(newptr, "%I64", 4); - ptr += 2; - newptr += 4; - } else { - *newptr = *ptr; - ptr++; - newptr++; - } - } - - *newptr = '\0'; - - ut_a(newptr < newformat + 2 * len); -#else - strcpy(newformat, format); -#endif - va_start(args, format); - - ret = vfprintf(stream, (const char*)newformat, args); - - va_end(args); - - if (newformat != format_buf_in_stack) { - free(newformat); - } - - return(ret); -} - /************************************************************ Gets the high 32 bits in a ulint. That is makes a shift >> 32, but since there seem to be compiler bugs in both gcc and Visual C++, From 001d4cf9d4d4aa5e99141cfc29b7aed866898caa Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 20 May 2004 14:21:30 +0500 Subject: [PATCH 129/162] A comment for str_to_datetime(). --- sql/time.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sql/time.cc b/sql/time.cc index a5e081dfb30..db05d606292 100644 --- a/sql/time.cc +++ b/sql/time.cc @@ -663,6 +663,20 @@ time_t str_to_timestamp(const char *str,uint length) } +/* + Convert a string to datetime. + + SYNOPSIS + str_to_datetime() + str String to parse (see str_to_TIME() synopsis) + length Length of str + fuzzy_date Flags (see str_to_TIME() synopsis) + + RETURN + -1 if error + datetime value otherwise +*/ + longlong str_to_datetime(const char *str,uint length, uint fuzzy_date) { TIME l_time; From 220b9e3a86f8239052f1d101541daf9a99ec0487 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 20 May 2004 13:54:52 +0300 Subject: [PATCH 130/162] Bug fixes: Use %windir% instead of c:\winnt\ (Bug #3786) Fixed wrong foreign key test in crash-me (Bug #3740) VC++Files/libmysql/libmysql.dsp: Use %windir% instead of c:\winnt\ (Bug #3786) sql-bench/crash-me.sh: Fixed wrong foreign key test (Bug #3740) sql-bench/limits/mysql.cfg: Updated results --- VC++Files/libmysql/libmysql.dsp | 2 +- sql-bench/crash-me.sh | 3 +- sql-bench/limits/mysql.cfg | 251 +++++++++++++++++++++++++++++++- 3 files changed, 252 insertions(+), 4 deletions(-) diff --git a/VC++Files/libmysql/libmysql.dsp b/VC++Files/libmysql/libmysql.dsp index fcc70a47d1d..9e760e52a74 100644 --- a/VC++Files/libmysql/libmysql.dsp +++ b/VC++Files/libmysql/libmysql.dsp @@ -92,7 +92,7 @@ LINK32=xilink6.exe # Begin Special Build Tool SOURCE="$(InputPath)" PostBuild_Desc=Move DLL export lib -PostBuild_Cmds=xcopy ..\lib_debug\libmysql.dll C:\winnt\system32\ /y xcopy debug\libmysql.lib ..\lib_debug\ /y +PostBuild_Cmds=xcopy ..\lib_debug\libmysql.dll %windir%\system32\ /y xcopy debug\libmysql.lib ..\lib_debug\ /y # End Special Build Tool !ENDIF diff --git a/sql-bench/crash-me.sh b/sql-bench/crash-me.sh index 00989fc0bc8..8009fc36586 100644 --- a/sql-bench/crash-me.sh +++ b/sql-bench/crash-me.sh @@ -414,8 +414,7 @@ if ($dbh->do("create table crash_q (a integer, b integer,c1 CHAR(10))") && ["with add primary key", "alter table crash_q1 add primary key(c1)"]); report("Alter table add foreign key",'alter_add_foreign_key', - "alter table crash_q add constraint f1 foreign key(c1)", - " references crash_q1(c1)"); + "alter table crash_q add constraint f1 foreign key(c1) references crash_q1(c1)"); try_and_report("Alter table drop foreign key",'alter_drop_foreign_key', ["with drop constraint", "alter table crash_q drop constraint f1"], diff --git a/sql-bench/limits/mysql.cfg b/sql-bench/limits/mysql.cfg index feaa79e43e9..35bdc9fa842 100644 --- a/sql-bench/limits/mysql.cfg +++ b/sql-bench/limits/mysql.cfg @@ -13,6 +13,8 @@ NEG=yes # update of column= -column ###As far as all queries returned OK, result is YES Need_cast_for_null=no # Need to cast NULL for arithmetic ### Check if numeric_null (NULL) is 'NULL' + ### Check if numeric_null (NULL) is 'NULL' + ### Check if numeric_null (NULL) is 'NULL' alter_add_col=yes # Alter table add column ###< alter table crash_q add d integer ###> OK @@ -187,6 +189,22 @@ constraint_check=syntax only # Column constraints ### ###< drop table crash_q ###> OK + ###< create table crash_q (a int check (a>0)) + ###> OK + ### + ###< insert into crash_q values(0) + ###> OK + ### + ###< drop table crash_q + ###> OK + ###< create table crash_q (a int check (a>0)) + ###> OK + ### + ###< insert into crash_q values(0) + ###> OK + ### + ###< drop table crash_q + ###> OK constraint_check_named=syntax only # Named constraints ###< create table crash_q (a int ,b int, constraint abc check (a>b)) ###> OK @@ -196,6 +214,22 @@ constraint_check_named=syntax only # Named constraints ### ###< drop table crash_q ###> OK + ###< create table crash_q (a int ,b int, constraint abc check (a>b)) + ###> OK + ### + ###< insert into crash_q values(0,0) + ###> OK + ### + ###< drop table crash_q + ###> OK + ###< create table crash_q (a int ,b int, constraint abc check (a>b)) + ###> OK + ### + ###< insert into crash_q values(0,0) + ###> OK + ### + ###< drop table crash_q + ###> OK constraint_check_table=syntax only # Table constraints ###< create table crash_q (a int ,b int, check (a>b)) ###> OK @@ -205,6 +239,22 @@ constraint_check_table=syntax only # Table constraints ### ###< drop table crash_q ###> OK + ###< create table crash_q (a int ,b int, check (a>b)) + ###> OK + ### + ###< insert into crash_q values(0,0) + ###> OK + ### + ###< drop table crash_q + ###> OK + ###< create table crash_q (a int ,b int, check (a>b)) + ###> OK + ### + ###< insert into crash_q values(0,0) + ###> OK + ### + ###< drop table crash_q + ###> OK constraint_null=yes # NULL constraint (SyBase style) ###< create table crash_q (a int null) ###> OK @@ -348,6 +398,20 @@ date_format_inresult=iso # Date format in result ###> 2003-08-27 ###< delete from crash_me_d ###> OK + ###< insert into crash_me_d values( sysdate() ) + ###> OK + ### + ###< select a from crash_me_d + ###> 2004-05-20 + ###< delete from crash_me_d + ###> OK + ###< insert into crash_me_d values( sysdate() ) + ###> OK + ### + ###< select a from crash_me_d + ###> 2004-05-20 + ###< delete from crash_me_d + ###> OK date_infinity=error # Supports 'infinity dates ###< create table crash_me2 (a date not null) ###> OK @@ -460,6 +524,14 @@ drop_requires_cascade=no # drop table require cascade/restrict ###> OK ###< drop table crash_me ###> OK + ###< create table crash_me (a integer not null) + ###> OK + ###< drop table crash_me + ###> OK + ###< create table crash_me (a integer not null) + ###> OK + ###< drop table crash_me + ###> OK drop_restrict=yes # drop table with cascade/restrict ###< create table crash_q (a int) ###> OK @@ -524,6 +596,40 @@ foreign_key=syntax only # foreign keys ### ###< drop table crash_me_qf ###> OK + ###< create table crash_me_qf (a integer not null,primary key (a)) + ###> OK + ### + ###< create table crash_me_qf2 (a integer not null,foreign key (a) references crash_me_qf (a)) + ###> OK + ### + ###< insert into crash_me_qf values (1) + ###> OK + ### + ###< insert into crash_me_qf2 values (2) + ###> OK + ### + ###< drop table crash_me_qf2 + ###> OK + ### + ###< drop table crash_me_qf + ###> OK + ###< create table crash_me_qf (a integer not null,primary key (a)) + ###> OK + ### + ###< create table crash_me_qf2 (a integer not null,foreign key (a) references crash_me_qf (a)) + ###> OK + ### + ###< insert into crash_me_qf values (1) + ###> OK + ### + ###< insert into crash_me_qf2 values (2) + ###> OK + ### + ###< drop table crash_me_qf2 + ###> OK + ### + ###< drop table crash_me_qf + ###> OK full_outer_join=no # full outer join ###< select crash_me.a from crash_me full join crash_me2 ON ### crash_me.a=crash_me2.a @@ -856,6 +962,10 @@ func_extra_months_between=no # Function MONTHS_BETWEEN func_extra_noround=no # Function NOROUND ###< select noround(22.6) ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(22.6)' at line 1 + ###< select noround(22.6) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(22.6)' at line 1 + ###< select noround(22.6) + ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(22.6)' at line 1 func_extra_not=yes # Function NOT in SELECT ### ###1 + ###< insert into crash_me_d values('1997-02-01') + ###< insert into crash_me_d values('1997-02-01') func_odbc_dayofweek=yes # Function DAYOFWEEK ###< insert into crash_me_d values('1997-02-01') ### ###32 + ###< insert into crash_me_d values('1997-02-01') + ###< insert into crash_me_d values('1997-02-01') func_odbc_degrees=yes # Function DEGREES ### ###12 + ###< insert into crash_me_t values(20:08:16) + ###< insert into crash_me_t values(20:08:16) func_odbc_ifnull=yes # Function IFNULL ### ###2 + ###< insert into crash_me_d values('1997-02-01') + ###< insert into crash_me_d values('1997-02-01') func_odbc_monthname=yes # Function MONTHNAME ###< insert into crash_me_d values('1997-02-01') ### ###1 + ###< insert into crash_me_d values('1997-02-01') + ###< insert into crash_me_d values('1997-02-01') func_odbc_radians=yes # Function RADIANS ### ###4 ###We expected '5' but got '4' + ###4 + ###We expected '5' but got '4' func_odbc_year=yes # Function YEAR ###< insert into crash_me_d values('1997-02-01') ### ### OK + ###< select CURRENT_USER + ###> OK + ###< select CURRENT_USER + ###> execute error:Unknown column 'CURRENT_USER' in 'field list' + ### + ###< select CURRENT_USER() + ###> OK func_sql_extract_sql=yes # Function EXTRACT ### ### OK + ###< select SYSTEM_USER + ###> execute error:Unknown column 'SYSTEM_USER' in 'field list' + ### + ###< select SYSTEM_USER() + ###> OK + ###< select SYSTEM_USER + ###> execute error:Unknown column 'SYSTEM_USER' in 'field list' + ### + ###< select SYSTEM_USER() + ###> OK func_sql_trim=yes # Function TRIM ### ### execute error:Unknown column 'true' in 'field list' + ###< select (1=1)=true + ###> OK + ###< select (1=1)=true + ###> execute error:Unknown column 'true' in 'field list' having=yes # Having ### didn't return any result: + ### + ###< drop table crash_me_b + ###> OK + ###< create table crash_me_b (i int) + ###> OK + ###< insert into crash_me_b values(2) + ###> OK + ###< insert into crash_me_b values(5) + ###> OK + ### + ### 2 ###> 3 ###> 4 + ###< insert into crash_me_n (i) values(1) + ###> OK + ###< insert into crash_me_n values(2,2) + ###> OK + ###< insert into crash_me_n values(3,3) + ###> OK + ###< insert into crash_me_n values(4,4) + ###> OK + ###< insert into crash_me_n (i) values(5) + ###> OK + ###< insert into crash_me_n (i) values(1) + ###> OK + ###< insert into crash_me_n values(2,2) + ###> OK + ###< insert into crash_me_n values(3,3) + ###> OK + ###< insert into crash_me_n values(4,4) + ###> OK + ###< insert into crash_me_n (i) values(5) + ###> OK position_of_null_desc=last # Where is null values in sorted recordset (DESC) ###< select r from crash_me_n order by r desc ###> 4 @@ -6053,7 +6288,7 @@ select_without_from=yes # SELECT without FROM ###> OK ### ###As far as all queries returned OK, result is YES -server_version=MySQL 4.0.15 debug log/ # server version +server_version=MySQL 4.0.20 debug/ # server version simple_joins=yes # ANSI SQL simple joins ###< select crash_me.a from crash_me, crash_me t0 ###> OK @@ -6223,6 +6458,20 @@ time_format_inresult=iso # Time format in result ###> 19:55:21 ###< delete from crash_me_t ###> OK + ###< insert into crash_me_t values(CURRENT_TIME) + ###> OK + ### + ###< select a from crash_me_t + ###> 13:45:04 + ###< delete from crash_me_t + ###> OK + ###< insert into crash_me_t values(CURRENT_TIME) + ###> OK + ### + ###< select a from crash_me_t + ###> 13:47:18 + ###< delete from crash_me_t + ###> OK transactions=yes # transactions ###