Commit 1a04b3b4 authored by unknown's avatar unknown

Merge bk-internal:/home/bk/mysql-5.0

into serg.mylan:/usr/home/serg/Abk/mysql-5.0


sql/mysql_priv.h:
  Auto merged
parents e4be7a28 9406b1eb
......@@ -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";;
......
......@@ -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_;
......
......@@ -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,33 +1343,10 @@ 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
}
if (error != DB_LOCK_DEADLOCK)
......
......@@ -218,59 +218,72 @@ 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
......@@ -281,9 +294,6 @@ 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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment