diff options
-rw-r--r-- | bdb/dist/configure.ac | 3 | ||||
-rw-r--r-- | extra/yassl/taocrypt/include/modes.hpp | 2 | ||||
-rw-r--r-- | libmysqld/Makefile.am | 1 | ||||
-rw-r--r-- | mysql-test/mysql-test-run.sh | 5 | ||||
-rw-r--r-- | sql/ha_berkeley.cc | 73 | ||||
-rw-r--r-- | sql/mysql_priv.h | 104 | ||||
-rw-r--r-- | sql/sql_yacc.yy | 4 |
7 files changed, 72 insertions, 120 deletions
diff --git a/bdb/dist/configure.ac b/bdb/dist/configure.ac index 98cf0f63b39..0bf53972f54 100644 --- a/bdb/dist/configure.ac +++ b/bdb/dist/configure.ac @@ -161,7 +161,8 @@ bsdi*) optimize_def="-O2";; freebsd*) optimize_def="-O2" CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" - LDFLAGS="$LDFLAGS -pthread";; + #LDFLAGS="$LDFLAGS -pthread" + ;; hpux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT";; irix*) optimize_def="-O2" CPPFLAGS="$CPPFLAGS -D_SGI_MP_SOURCE";; diff --git a/extra/yassl/taocrypt/include/modes.hpp b/extra/yassl/taocrypt/include/modes.hpp index 585231c9b9e..ccf6c08549f 100644 --- a/extra/yassl/taocrypt/include/modes.hpp +++ b/extra/yassl/taocrypt/include/modes.hpp @@ -71,7 +71,7 @@ public: void SetIV(const byte* iv) { memcpy(reg_, iv, blockSz_); } private: - byte reg_[MaxBlockSz]; + byte __attribute__ ((aligned (sizeof(word32)))) reg_[MaxBlockSz]; byte tmp_[MaxBlockSz]; int blockSz_; diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am index 5f2425d77c8..ba63d213b88 100644 --- a/libmysqld/Makefile.am +++ b/libmysqld/Makefile.am @@ -96,6 +96,7 @@ libmysqld.a: libmysqld_int.a $(INC_LIB) if DARWIN_MWCC mwld -lib -o $@ libmysqld_int.a `echo $(INC_LIB) | sort -u` else + -rm -f libmysqld.a if test "$(host_os)" = "netware" ; \ then \ $(libmysqld_a_AR) libmysqld.a libmysqld_int.a $(INC_LIB) ; \ diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index bdd92e7941b..3f36b1345a5 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -1793,6 +1793,11 @@ then $ECHO "Installing Test Databases" mysql_install_db + if [ -n "$1" -a `expr "X$*" : '.*ndb'` -eq 0 ] + then + USE_NDBCLUSTER="" + fi + start_manager # Do not automagically start daemons if we are in gdb or running only one test diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc index 16cbd782f0c..568fb727e63 100644 --- a/sql/ha_berkeley.cc +++ b/sql/ha_berkeley.cc @@ -948,12 +948,6 @@ int ha_berkeley::write_row(byte * record) for (uint retry=0 ; retry < berkeley_trans_retry ; retry++) { key_map changed_keys(0); - if (using_ignore && (thd_options & OPTION_INTERNAL_SUBTRANSACTIONS)) - { - if ((error=txn_begin(db_env, transaction, &sub_trans, 0))) /* purecov: deadcode */ - break; /* purecov: deadcode */ - DBUG_PRINT("trans",("starting subtransaction")); /* purecov: deadcode */ - } if (!(error=file->put(file, sub_trans, create_key(&prim_key, primary_key, key_buff, record), &row, key_type[primary_key]))) @@ -983,12 +977,7 @@ int ha_berkeley::write_row(byte * record) if (using_ignore) { int new_error = 0; - if (thd_options & OPTION_INTERNAL_SUBTRANSACTIONS) - { - DBUG_PRINT("trans",("aborting subtransaction")); /* purecov: deadcode */ - new_error=txn_abort(sub_trans); /* purecov: deadcode */ - } - else if (!changed_keys.is_clear_all()) + if (!changed_keys.is_clear_all()) { new_error = 0; for (uint keynr=0; @@ -1010,11 +999,6 @@ int ha_berkeley::write_row(byte * record) } } } - else if (using_ignore && (thd_options & OPTION_INTERNAL_SUBTRANSACTIONS)) - { - DBUG_PRINT("trans",("committing subtransaction")); /* purecov: deadcode */ - error=txn_commit(sub_trans, 0); /* purecov: deadcode */ - } if (error != DB_LOCK_DEADLOCK) break; } @@ -1090,8 +1074,7 @@ int ha_berkeley::update_primary_key(DB_TXN *trans, bool primary_key_changed, { // Probably a duplicated key; restore old key and row if needed last_dup_key=primary_key; - if (local_using_ignore && - !(thd_options & OPTION_INTERNAL_SUBTRANSACTIONS)) + if (local_using_ignore) { int new_error; if ((new_error=pack_row(&row, old_row, 0)) || @@ -1202,12 +1185,6 @@ int ha_berkeley::update_row(const byte * old_row, byte * new_row) for (uint retry=0 ; retry < berkeley_trans_retry ; retry++) { key_map changed_keys(0); - if (using_ignore && (thd_options & OPTION_INTERNAL_SUBTRANSACTIONS)) - { - if ((error=txn_begin(db_env, transaction, &sub_trans, 0))) /* purecov: deadcode */ - break; /* purecov: deadcode */ - DBUG_PRINT("trans",("starting subtransaction")); /* purecov: deadcode */ - } /* Start by updating the primary key */ if (!(error=update_primary_key(sub_trans, primary_key_changed, old_row, &old_prim_key, @@ -1223,15 +1200,6 @@ int ha_berkeley::update_row(const byte * old_row, byte * new_row) { if ((error=remove_key(sub_trans, keynr, old_row, &old_prim_key))) { - if (using_ignore && /* purecov: inspected */ - (thd_options & OPTION_INTERNAL_SUBTRANSACTIONS)) - { - int new_error; - DBUG_PRINT("trans",("aborting subtransaction")); - new_error=txn_abort(sub_trans); - if (new_error) - error = new_error; - } table->insert_or_update= 0; DBUG_RETURN(error); // Fatal error /* purecov: inspected */ } @@ -1254,12 +1222,7 @@ int ha_berkeley::update_row(const byte * old_row, byte * new_row) if (using_ignore) { int new_error = 0; - if (thd_options & OPTION_INTERNAL_SUBTRANSACTIONS) - { - DBUG_PRINT("trans",("aborting subtransaction")); /* purecov: deadcode */ - new_error=txn_abort(sub_trans); /* purecov: deadcode */ - } - else if (!changed_keys.is_clear_all()) + if (!changed_keys.is_clear_all()) new_error=restore_keys(transaction, &changed_keys, primary_key, old_row, &old_prim_key, new_row, &prim_key, thd_options); @@ -1271,11 +1234,6 @@ int ha_berkeley::update_row(const byte * old_row, byte * new_row) } } } - else if (using_ignore && (thd_options & OPTION_INTERNAL_SUBTRANSACTIONS)) - { - DBUG_PRINT("trans",("committing subtransaction")); /* purecov: deadcode */ - error=txn_commit(sub_trans, 0); /* purecov: deadcode */ - } if (error != DB_LOCK_DEADLOCK) break; } @@ -1385,34 +1343,11 @@ int ha_berkeley::delete_row(const byte * record) DB_TXN *sub_trans = transaction; for (uint retry=0 ; retry < berkeley_trans_retry ; retry++) { - if (thd_options & OPTION_INTERNAL_SUBTRANSACTIONS) - { - if ((error=txn_begin(db_env, transaction, &sub_trans, 0))) /* purecov: deadcode */ - break; /* purecov: deadcode */ - DBUG_PRINT("trans",("starting sub transaction")); /* purecov: deadcode */ - } error=remove_keys(sub_trans, record, &row, &prim_key, &keys); - if (!error && (thd_options & OPTION_INTERNAL_SUBTRANSACTIONS)) - { - DBUG_PRINT("trans",("ending sub transaction")); /* purecov: deadcode */ - error=txn_commit(sub_trans, 0); /* purecov: deadcode */ - } if (error) { /* purecov: inspected */ DBUG_PRINT("error",("Got error %d",error)); - if (thd_options & OPTION_INTERNAL_SUBTRANSACTIONS) - { - /* retry */ - int new_error; - DBUG_PRINT("trans",("aborting subtransaction")); - if ((new_error=txn_abort(sub_trans))) - { - error=new_error; // This shouldn't happen - break; - } - } - else - break; // No retry - return error + break; // No retry - return error } if (error != DB_LOCK_DEADLOCK) break; diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 10ee5483d19..b6f4b963393 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -218,62 +218,75 @@ extern CHARSET_INFO *national_charset_info, *table_alias_charset; #define TEST_CORE_ON_SIGNAL 256 /* Give core if signal */ #define TEST_NO_STACKTRACE 512 #define TEST_SIGINT 1024 /* Allow sigint on threads */ -#define TEST_SYNCHRONIZATION 2048 /* get server to do sleep in some - places */ +#define TEST_SYNCHRONIZATION 2048 /* get server to do sleep in + some places */ #endif -/* +/* This is included in the server and in the client. Options for select set by the yacc parser (stored in lex->options). - None of the 32 defines below should have its value changed, or this will - break replication. + + XXX: + log_event.h defines OPTIONS_WRITTEN_TO_BIN_LOG to specify what THD + options list are written into binlog. These options can NOT change their + values, or it will break replication between version. + + context is encoded as following: + SELECT - SELECT_LEX_NODE::options + THD - THD::options + intern - neither. used only as + func(..., select_node->options | thd->options | OPTION_XXX, ...) + + TODO: separate three contexts above, move them to separate bitfields. */ -#define SELECT_DISTINCT (1L << 0) -#define SELECT_STRAIGHT_JOIN (1L << 1) -#define SELECT_DESCRIBE (1L << 2) -#define SELECT_SMALL_RESULT (1L << 3) -#define SELECT_BIG_RESULT (1L << 4) -#define OPTION_FOUND_ROWS (1L << 5) -#define OPTION_TO_QUERY_CACHE (1L << 6) -#define SELECT_NO_JOIN_CACHE (1L << 7) /* Intern */ -#define OPTION_BIG_TABLES (1L << 8) /* for SQL OPTION */ -#define OPTION_BIG_SELECTS (1L << 9) /* for SQL OPTION */ -#define OPTION_LOG_OFF (1L << 10) -#define OPTION_UPDATE_LOG (1L << 11) /* update log flag */ -#define TMP_TABLE_ALL_COLUMNS (1L << 12) -#define OPTION_WARNINGS (1L << 13) -#define OPTION_AUTO_IS_NULL (1L << 14) -#define OPTION_FOUND_COMMENT (1L << 15) -#define OPTION_SAFE_UPDATES (1L << 16) -#define OPTION_BUFFER_RESULT (1L << 17) -#define OPTION_BIN_LOG (1L << 18) -#define OPTION_NOT_AUTOCOMMIT (1L << 19) -#define OPTION_BEGIN (1L << 20) -#define OPTION_TABLE_LOCK (1L << 21) -#define OPTION_QUICK (1L << 22) -#define OPTION_QUOTE_SHOW_CREATE (1L << 23) -#define OPTION_INTERNAL_SUBTRANSACTIONS (1L << 24) +#define SELECT_DISTINCT (1L << 0) // SELECT, user +#define SELECT_STRAIGHT_JOIN (1L << 1) // SELECT, user +#define SELECT_DESCRIBE (1L << 2) // SELECT, user +#define SELECT_SMALL_RESULT (1L << 3) // SELECT, user +#define SELECT_BIG_RESULT (1L << 4) // SELECT, user +#define OPTION_FOUND_ROWS (1L << 5) // SELECT, user +#define OPTION_TO_QUERY_CACHE (1L << 6) // SELECT, user +#define SELECT_NO_JOIN_CACHE (1L << 7) // intern +#define OPTION_BIG_TABLES (1L << 8) // THD, user +#define OPTION_BIG_SELECTS (1L << 9) // THD, user +#define OPTION_LOG_OFF (1L << 10) // THD, user +#define OPTION_UPDATE_LOG (1L << 11) // THD, user, unused +#define TMP_TABLE_ALL_COLUMNS (1L << 12) // SELECT, intern +#define OPTION_WARNINGS (1L << 13) // THD, user +#define OPTION_AUTO_IS_NULL (1L << 14) // THD, user, binlog +#define OPTION_FOUND_COMMENT (1L << 15) // SELECT, intern, parser +#define OPTION_SAFE_UPDATES (1L << 16) // THD, user +#define OPTION_BUFFER_RESULT (1L << 17) // SELECT, user +#define OPTION_BIN_LOG (1L << 18) // THD, user +#define OPTION_NOT_AUTOCOMMIT (1L << 19) // THD, user +#define OPTION_BEGIN (1L << 20) // THD, intern +#define OPTION_TABLE_LOCK (1L << 21) // THD, intern +#define OPTION_QUICK (1L << 22) // SELECT (for DELETE) +#define OPTION_QUOTE_SHOW_CREATE (1L << 23) // THD, user + +/* Thr following is used to detect a conflict with DISTINCT + in the user query has requested */ +#define SELECT_ALL (1L << 24) // SELECT, user, parser /* Set if we are updating a non-transaction safe table */ -#define OPTION_STATUS_NO_TRANS_UPDATE (1L << 25) +#define OPTION_STATUS_NO_TRANS_UPDATE (1L << 25) // THD, intern /* The following can be set when importing tables in a 'wrong order' to suppress foreign key checks */ -#define OPTION_NO_FOREIGN_KEY_CHECKS (1L << 26) +#define OPTION_NO_FOREIGN_KEY_CHECKS (1L << 26) // THD, user, binlog /* The following speeds up inserts to InnoDB tables by suppressing unique key checks in some cases */ -#define OPTION_RELAXED_UNIQUE_CHECKS (1L << 27) -#define SELECT_NO_UNLOCK (1L << 28) -#define OPTION_SCHEMA_TABLE (1L << 29) +#define OPTION_RELAXED_UNIQUE_CHECKS (1L << 27) // THD, user, binlog +#define SELECT_NO_UNLOCK (1L << 28) // SELECT, intern +#define OPTION_SCHEMA_TABLE (1L << 29) // SELECT, intern /* Flag set if setup_tables already done */ -#define OPTION_SETUP_TABLES_DONE (1L << 30) -/* Thr following is used to detect a conflict with DISTINCT - in the user query has requested */ -#define SELECT_ALL (ULL(1) << 32) +#define OPTION_SETUP_TABLES_DONE (1L << 30) // intern +/* If not set then the thread will ignore all warnings with level notes. */ +#define OPTION_SQL_NOTES (1L << 31) // THD, user -/* - Maximum length of time zone name that we support +/* + Maximum length of time zone name that we support (Time zone name is char(64) in db). mysqlbinlog needs it. */ #define MAX_TIME_ZONE_NAME_LENGTH 72 @@ -281,13 +294,10 @@ extern CHARSET_INFO *national_charset_info, *table_alias_charset; /* The rest of the file is included in the server only */ #ifndef MYSQL_CLIENT -/* If not set then the thread will ignore all warnings with level notes. */ -#define OPTION_SQL_NOTES (1L << 31) - /* Bits for different SQL modes modes (including ANSI mode) */ -#define MODE_REAL_AS_FLOAT 1 -#define MODE_PIPES_AS_CONCAT 2 -#define MODE_ANSI_QUOTES 4 +#define MODE_REAL_AS_FLOAT 1 +#define MODE_PIPES_AS_CONCAT 2 +#define MODE_ANSI_QUOTES 4 #define MODE_IGNORE_SPACE 8 #define MODE_NOT_USED 16 #define MODE_ONLY_FULL_GROUP_BY 32 diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 33d6c192d07..892d2516808 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -5108,11 +5108,11 @@ derived_table_list: join_table: table_ref normal_join table_ref { TEST_ASSERT($1 && ($$=$3)); } - | table_ref STRAIGHT_JOIN table_ref + | table_ref STRAIGHT_JOIN table_factor { TEST_ASSERT($1 && ($$=$3)); $3->straight=1; } | table_ref normal_join table_ref ON expr { TEST_ASSERT($1 && ($$=$3)); add_join_on($3,$5); } - | table_ref STRAIGHT_JOIN table_ref ON expr + | table_ref STRAIGHT_JOIN table_factor ON expr { TEST_ASSERT($1 && ($$=$3)); $3->straight=1; add_join_on($3,$5); } | table_ref normal_join table_ref USING |