Commit 6c6123fb authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

first attempt at UNIQUE_CHECKS=0. address #309

git-svn-id: file:///svn/mysql/tokudb-engine/src@2361 c7de825b-a66e-492c-adef-691d508d4ae1
parent 0b1ccfc1
...@@ -1226,16 +1226,23 @@ int ha_tokudb::write_row(uchar * record) { ...@@ -1226,16 +1226,23 @@ int ha_tokudb::write_row(uchar * record) {
if ((error = pack_row(&row, (const uchar *) record, 1))) if ((error = pack_row(&row, (const uchar *) record, 1)))
DBUG_RETURN(error); DBUG_RETURN(error);
u_int32_t put_flags = key_type[primary_key];
THD *thd = ha_thd();
printf("%s:%d:unique:%d\n", __FILE__, __LINE__,
thd_test_options(thd, OPTION_RELAXED_UNIQUE_CHECKS));
if (thd_test_options(thd, OPTION_RELAXED_UNIQUE_CHECKS))
put_flags = DB_YESOVERWRITE;
table->insert_or_update = 1; // For handling of VARCHAR table->insert_or_update = 1; // For handling of VARCHAR
if (table_share->keys + test(hidden_primary_key) == 1) { if (table_share->keys + test(hidden_primary_key) == 1) {
error = file->put(file, transaction, create_key(&prim_key, primary_key, key_buff, record), &row, key_type[primary_key]); error = file->put(file, transaction, create_key(&prim_key, primary_key, key_buff, record), &row, put_flags);
last_dup_key = primary_key; last_dup_key = primary_key;
} else { } else {
DB_TXN *sub_trans = transaction; DB_TXN *sub_trans = transaction;
/* Don't use sub transactions in temporary tables */ /* QQQ Don't use sub transactions in temporary tables */
for (uint retry = 0; retry < tokudb_trans_retry; retry++) { for (uint retry = 0; retry < tokudb_trans_retry; retry++) {
key_map changed_keys(0); key_map changed_keys(0);
if (!(error = file->put(file, sub_trans, create_key(&prim_key, primary_key, key_buff, record), &row, key_type[primary_key]))) { if (!(error = file->put(file, sub_trans, create_key(&prim_key, primary_key, key_buff, record), &row, put_flags))) {
changed_keys.set_bit(primary_key); changed_keys.set_bit(primary_key);
for (uint keynr = 0; keynr < table_share->keys; keynr++) { for (uint keynr = 0; keynr < table_share->keys; keynr++) {
if (keynr == primary_key) if (keynr == primary_key)
...@@ -2385,17 +2392,17 @@ static MYSQL_SYSVAR_ULONG(max_lock, tokudb_max_lock, PLUGIN_VAR_READONLY, "TokuD ...@@ -2385,17 +2392,17 @@ static MYSQL_SYSVAR_ULONG(max_lock, tokudb_max_lock, PLUGIN_VAR_READONLY, "TokuD
static MYSQL_SYSVAR_STR(logdir, tokudb_logdir, PLUGIN_VAR_READONLY, "TokuDB Log Directory", NULL, NULL, NULL); static MYSQL_SYSVAR_STR(logdir, tokudb_logdir, PLUGIN_VAR_READONLY, "TokuDB Log Directory", NULL, NULL, NULL);
static MYSQL_SYSVAR_ULONG(cache_parts, tokudb_cache_parts, PLUGIN_VAR_READONLY, "Sets bdb set_cachesize ncache", NULL, NULL, 0, 0, ~0L, 0); static MYSQL_SYSVAR_ULONG(cache_parts, tokudb_cache_parts, PLUGIN_VAR_READONLY, "Sets TokuDB set_cache_parts", NULL, NULL, 0, 0, ~0L, 0);
// this is really a u_int32_t // this is really a u_int32_t
// ? use MYSQL_SYSVAR_SET // ? use MYSQL_SYSVAR_SET
static MYSQL_SYSVAR_UINT(env_flags, tokudb_env_flags, PLUGIN_VAR_READONLY, "Sets bdb set_flags", NULL, NULL, DB_LOG_AUTOREMOVE, 0, ~0, 0); static MYSQL_SYSVAR_UINT(env_flags, tokudb_env_flags, PLUGIN_VAR_READONLY, "Sets TokuDB env_flags", NULL, NULL, DB_LOG_AUTOREMOVE, 0, ~0, 0);
static MYSQL_SYSVAR_STR(home, tokudb_home, PLUGIN_VAR_READONLY, "Sets bdb DB_ENV->open db_home", NULL, NULL, NULL); static MYSQL_SYSVAR_STR(home, tokudb_home, PLUGIN_VAR_READONLY, "Sets TokuDB env->open home", NULL, NULL, NULL);
// this is really a u_int32_t // this is really a u_int32_t
//? use MYSQL_SYSVAR_SET //? use MYSQL_SYSVAR_SET
static MYSQL_SYSVAR_UINT(init_flags, tokudb_init_flags, PLUGIN_VAR_READONLY, "Sets bdb DB_ENV->open flags", NULL, NULL, DB_PRIVATE | DB_RECOVER, 0, ~0, 0); static MYSQL_SYSVAR_UINT(init_flags, tokudb_init_flags, PLUGIN_VAR_READONLY, "Sets TokuDB DB_ENV->open flags", NULL, NULL, DB_PRIVATE | DB_RECOVER, 0, ~0, 0);
// this looks to be unused // this looks to be unused
static MYSQL_SYSVAR_LONG(lock_scan_time, tokudb_lock_scan_time, PLUGIN_VAR_READONLY, "Tokudb Lock Scan Time (UNUSED)", NULL, NULL, 0, 0, ~0L, 0); static MYSQL_SYSVAR_LONG(lock_scan_time, tokudb_lock_scan_time, PLUGIN_VAR_READONLY, "Tokudb Lock Scan Time (UNUSED)", NULL, NULL, 0, 0, ~0L, 0);
...@@ -2412,6 +2419,7 @@ static MYSQL_SYSVAR_BOOL(shared_data, tokudb_shared_data, PLUGIN_VAR_READONLY, " ...@@ -2412,6 +2419,7 @@ static MYSQL_SYSVAR_BOOL(shared_data, tokudb_shared_data, PLUGIN_VAR_READONLY, "
static MYSQL_SYSVAR_STR(tmpdir, tokudb_tmpdir, PLUGIN_VAR_READONLY, "Tokudb Tmp Dir", NULL, NULL, NULL); static MYSQL_SYSVAR_STR(tmpdir, tokudb_tmpdir, PLUGIN_VAR_READONLY, "Tokudb Tmp Dir", NULL, NULL, NULL);
#endif #endif
static struct st_mysql_sys_var *tokudb_system_variables[] = { static struct st_mysql_sys_var *tokudb_system_variables[] = {
MYSQL_SYSVAR(cache_size), MYSQL_SYSVAR(cache_size),
MYSQL_SYSVAR(max_lock), MYSQL_SYSVAR(max_lock),
......
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