Added new option --sync-frm / --skip-sync-frm

Marked --bdb-no-sync as deprecated
Added --sync-bdb-logs / --disable-sync-bdb-logs as a synonym / alternative.
parent 6a4e32d0
...@@ -43,6 +43,7 @@ jani@janikt.pp.saunalahti.fi ...@@ -43,6 +43,7 @@ jani@janikt.pp.saunalahti.fi
jani@rhols221.adsl.netsonic.fi jani@rhols221.adsl.netsonic.fi
jani@rhols221.arenanet.fi jani@rhols221.arenanet.fi
jani@ua126d19.elisa.omakaista.fi jani@ua126d19.elisa.omakaista.fi
jani@ua141d10.elisa.omakaista.fi
jcole@abel.spaceapes.com jcole@abel.spaceapes.com
jcole@main.burghcom.com jcole@main.burghcom.com
jcole@mugatu.spaceapes.com jcole@mugatu.spaceapes.com
......
...@@ -298,9 +298,11 @@ int handle_options(int *argc, char ***argv, ...@@ -298,9 +298,11 @@ int handle_options(int *argc, char ***argv,
--enable-'option-name'. --enable-'option-name'.
*optend was set to '0' if one used --disable-option *optend was set to '0' if one used --disable-option
*/ */
*((my_bool*) optp->value)= (my_bool) (!optend || *optend == '1'); my_bool tmp= (my_bool) (!optend || *optend == '1');
(*argc)--; *((my_bool*) optp->value)= tmp;
get_one_option(optp->id, optp, argument); (*argc)--;
get_one_option(optp->id, optp,
tmp ? (char*) "1" : disabled_my_option);
continue; continue;
} }
argument= optend; argument= optend;
......
...@@ -711,7 +711,7 @@ extern my_bool opt_sql_bin_update, opt_safe_user_create, opt_no_mix_types; ...@@ -711,7 +711,7 @@ extern my_bool opt_sql_bin_update, opt_safe_user_create, opt_no_mix_types;
extern my_bool opt_safe_show_db, opt_local_infile; extern my_bool opt_safe_show_db, opt_local_infile;
extern my_bool opt_slave_compressed_protocol, use_temp_pool; extern my_bool opt_slave_compressed_protocol, use_temp_pool;
extern my_bool opt_readonly; extern my_bool opt_readonly;
extern my_bool opt_enable_named_pipe; extern my_bool opt_enable_named_pipe, opt_sync_frm;
extern MYSQL_LOG mysql_log,mysql_update_log,mysql_slow_log,mysql_bin_log; extern MYSQL_LOG mysql_log,mysql_update_log,mysql_slow_log,mysql_bin_log;
extern FILE *bootstrap_file; extern FILE *bootstrap_file;
......
...@@ -308,7 +308,7 @@ static my_bool opt_noacl=0, opt_bootstrap=0, opt_myisam_log=0; ...@@ -308,7 +308,7 @@ static my_bool opt_noacl=0, opt_bootstrap=0, opt_myisam_log=0;
my_bool opt_safe_user_create = 0, opt_no_mix_types = 0; my_bool opt_safe_user_create = 0, opt_no_mix_types = 0;
my_bool opt_show_slave_auth_info, opt_sql_bin_update = 0; my_bool opt_show_slave_auth_info, opt_sql_bin_update = 0;
my_bool opt_log_slave_updates= 0, opt_console= 0; my_bool opt_log_slave_updates= 0, opt_console= 0;
my_bool opt_readonly = 0; my_bool opt_readonly = 0, opt_sync_bdb_logs, opt_sync_frm;
volatile bool mqh_used = 0; volatile bool mqh_used = 0;
FILE *bootstrap_file=0; FILE *bootstrap_file=0;
...@@ -3158,7 +3158,7 @@ enum options_mysqld { ...@@ -3158,7 +3158,7 @@ enum options_mysqld {
OPT_DELAY_KEY_WRITE_ALL, OPT_SLOW_QUERY_LOG, OPT_DELAY_KEY_WRITE_ALL, OPT_SLOW_QUERY_LOG,
OPT_DELAY_KEY_WRITE, OPT_CHARSETS_DIR, OPT_DELAY_KEY_WRITE, OPT_CHARSETS_DIR,
OPT_BDB_HOME, OPT_BDB_LOG, OPT_BDB_HOME, OPT_BDB_LOG,
OPT_BDB_TMP, OPT_BDB_NOSYNC, OPT_BDB_TMP, OPT_BDB_SYNC,
OPT_BDB_LOCK, OPT_BDB_SKIP, OPT_BDB_LOCK, OPT_BDB_SKIP,
OPT_BDB_NO_RECOVER, OPT_BDB_SHARED, OPT_BDB_NO_RECOVER, OPT_BDB_SHARED,
OPT_MASTER_HOST, OPT_MASTER_USER, OPT_MASTER_HOST, OPT_MASTER_USER,
...@@ -3251,7 +3251,8 @@ enum options_mysqld { ...@@ -3251,7 +3251,8 @@ enum options_mysqld {
OPT_DEFAULT_WEEK_FORMAT, OPT_DEFAULT_WEEK_FORMAT,
OPT_RANGE_ALLOC_BLOCK_SIZE, OPT_RANGE_ALLOC_BLOCK_SIZE,
OPT_QUERY_ALLOC_BLOCK_SIZE, OPT_QUERY_PREALLOC_SIZE, OPT_QUERY_ALLOC_BLOCK_SIZE, OPT_QUERY_PREALLOC_SIZE,
OPT_TRANS_ALLOC_BLOCK_SIZE, OPT_TRANS_PREALLOC_SIZE OPT_TRANS_ALLOC_BLOCK_SIZE, OPT_TRANS_PREALLOC_SIZE,
OPT_SYNC_FRM, OPT_BDB_NOSYNC
}; };
...@@ -3277,8 +3278,14 @@ struct my_option my_long_options[] = ...@@ -3277,8 +3278,14 @@ struct my_option my_long_options[] =
{"bdb-no-recover", OPT_BDB_NO_RECOVER, {"bdb-no-recover", OPT_BDB_NO_RECOVER,
"Don't try to recover Berkeley DB tables on start", 0, 0, 0, GET_NO_ARG, "Don't try to recover Berkeley DB tables on start", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0}, NO_ARG, 0, 0, 0, 0, 0, 0},
{"bdb-no-sync", OPT_BDB_NOSYNC, "Don't synchronously flush logs", 0, 0, 0, {"bdb-no-sync", OPT_BDB_NOSYNC,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, "Disable synchronously flushing logs. This option is deprecated, use --skip-sync-bdb-logs or sync-bdb-logs=0 instead",
// (gptr*) &opt_sync_bdb_logs, (gptr*) &opt_sync_bdb_logs, 0, GET_BOOL,
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"sync-bdb-logs", OPT_BDB_SYNC,
"Synchronously flush logs. Enabled by default",
(gptr*) &opt_sync_bdb_logs, (gptr*) &opt_sync_bdb_logs, 0, GET_BOOL,
NO_ARG, 1, 0, 0, 0, 0, 0},
{"bdb-shared-data", OPT_BDB_SHARED, {"bdb-shared-data", OPT_BDB_SHARED,
"Start Berkeley DB in multi-process mode", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, "Start Berkeley DB in multi-process mode", 0, 0, 0, GET_NO_ARG, NO_ARG, 0,
0, 0, 0, 0, 0}, 0, 0, 0, 0, 0},
...@@ -3286,6 +3293,9 @@ struct my_option my_long_options[] = ...@@ -3286,6 +3293,9 @@ struct my_option my_long_options[] =
(gptr*) &berkeley_tmpdir, (gptr*) &berkeley_tmpdir, 0, GET_STR, (gptr*) &berkeley_tmpdir, (gptr*) &berkeley_tmpdir, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif /* HAVE_BERKELEY_DB */ #endif /* HAVE_BERKELEY_DB */
{"sync-frm", OPT_SYNC_FRM, "Sync .frm to disk on create. Enabled by default",
(gptr*) &opt_sync_frm, (gptr*) &opt_sync_frm, 0, GET_BOOL, NO_ARG, 1, 0,
0, 0, 0, 0},
{"skip-bdb", OPT_BDB_SKIP, "Don't use berkeley db (will save memory)", {"skip-bdb", OPT_BDB_SKIP, "Don't use berkeley db (will save memory)",
0, 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},
{"big-tables", OPT_BIG_TABLES, {"big-tables", OPT_BIG_TABLES,
...@@ -4728,7 +4738,15 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), ...@@ -4728,7 +4738,15 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
} }
#ifdef HAVE_BERKELEY_DB #ifdef HAVE_BERKELEY_DB
case OPT_BDB_NOSYNC: case OPT_BDB_NOSYNC:
berkeley_env_flags|=DB_TXN_NOSYNC; /* Deprecated option */
opt_sync_bdb_logs= 0;
/* Fall through */
case OPT_BDB_SYNC:
if (!opt_sync_bdb_logs)
berkeley_env_flags|= DB_TXN_NOSYNC;
else
berkeley_env_flags&= ~DB_TXN_NOSYNC;
printf("berkeley_env_flags: %d, arg '%s'\n", berkeley_env_flags, argument);
break; break;
case OPT_BDB_NO_RECOVER: case OPT_BDB_NO_RECOVER:
berkeley_init_flags&= ~(DB_RECOVER); berkeley_init_flags&= ~(DB_RECOVER);
......
...@@ -150,7 +150,7 @@ int rea_create_table(my_string file_name, ...@@ -150,7 +150,7 @@ int rea_create_table(my_string file_name,
my_free((gptr) screen_buff,MYF(0)); my_free((gptr) screen_buff,MYF(0));
my_afree((gptr) keybuff); my_afree((gptr) keybuff);
if (my_sync(file, MYF(MY_WME))) if (opt_sync_frm && my_sync(file, MYF(MY_WME)))
goto err2; goto err2;
if (my_close(file,MYF(MY_WME)) || if (my_close(file,MYF(MY_WME)) ||
ha_create_table(file_name,create_info,0)) ha_create_table(file_name,create_info,0))
......
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