Merge lp:~mordred/drizzle/file-per-table into lp:~drizzle-trunk/drizzle/development

Proposed by Monty Taylor
Status: Work in progress
Proposed branch: lp:~mordred/drizzle/file-per-table
Merge into: lp:~drizzle-trunk/drizzle/development
Diff against target: 233 lines (+27/-40)
7 files modified
plugin/console/console.cc (+0/-13)
plugin/innobase/dict/dict0crea.c (+1/-1)
plugin/innobase/handler/ha_innodb.cc (+7/-7)
plugin/innobase/include/srv0srv.h (+3/-3)
plugin/innobase/os/os0file.c (+8/-8)
plugin/innobase/srv/srv0srv.c (+1/-1)
plugin/innobase/srv/srv0start.c (+7/-7)
To merge this branch: bzr merge lp:~mordred/drizzle/file-per-table
Reviewer Review Type Date Requested Status
Stewart Smith (community) Needs Fixing
Drizzle Merge Team Pending
Review via email: mp+37038@code.launchpad.net

Description of the change

Turn on file-per-table by default.

To post a comment you must log in.
Revision history for this message
Stewart Smith (stewart) wrote :

Will need a change for embedded_innodb/haildb engine.

IN this case we should not modify what it's called in InnoDB/HailDB, instead just modify what the option is in Drizzle.

review: Needs Fixing

Unmerged revisions

1789. By Monty Taylor

It's C, not c++.

1788. By Monty Taylor

Removed the console.enable option... if you did --plugin-add=console, you
want to use it.

1787. By Monty Taylor

Set file-per-table as the default.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'plugin/console/console.cc'
--- plugin/console/console.cc 2010-06-20 19:25:46 +0000
+++ plugin/console/console.cc 2010-09-29 18:24:47 +0000
@@ -29,7 +29,6 @@
2929
30namespace po= boost::program_options;30namespace po= boost::program_options;
3131
32static bool enabled= false;
33static bool debug_enabled= false;32static bool debug_enabled= false;
34static char* username= NULL;33static char* username= NULL;
35static char* password= NULL;34static char* password= NULL;
@@ -293,12 +292,6 @@
293292
294 virtual bool getFileDescriptors(std::vector<int> &fds)293 virtual bool getFileDescriptors(std::vector<int> &fds)
295 {294 {
296 if (debug_enabled)
297 enabled= true;
298
299 if (enabled == false)
300 return false;
301
302 if (pipe(pipe_fds) == -1)295 if (pipe(pipe_fds) == -1)
303 {296 {
304 errmsg_printf(ERRMSG_LVL_ERROR, _("pipe() failed with errno %d"), errno);297 errmsg_printf(ERRMSG_LVL_ERROR, _("pipe() failed with errno %d"), errno);
@@ -342,8 +335,6 @@
342 return 0;335 return 0;
343}336}
344337
345static DRIZZLE_SYSVAR_BOOL(enable, enabled, PLUGIN_VAR_NOCMDARG,
346 N_("Enable the console."), NULL, NULL, false);
347static DRIZZLE_SYSVAR_BOOL(debug, debug_enabled, PLUGIN_VAR_NOCMDARG,338static DRIZZLE_SYSVAR_BOOL(debug, debug_enabled, PLUGIN_VAR_NOCMDARG,
348 N_("Turn on extra debugging."), NULL, NULL, false);339 N_("Turn on extra debugging."), NULL, NULL, false);
349340
@@ -356,9 +347,6 @@
356347
357static void init_options(drizzled::module::option_context &context)348static void init_options(drizzled::module::option_context &context)
358{349{
359 context("enable",
360 po::value<bool>(&enabled)->default_value(false)->zero_tokens(),
361 N_("Enable the console."));
362 context("debug",350 context("debug",
363 po::value<bool>(&debug_enabled)->default_value(false)->zero_tokens(),351 po::value<bool>(&debug_enabled)->default_value(false)->zero_tokens(),
364 N_("Turn on extra debugging."));352 N_("Turn on extra debugging."));
@@ -374,7 +362,6 @@
374}362}
375363
376static drizzle_sys_var* vars[]= {364static drizzle_sys_var* vars[]= {
377 DRIZZLE_SYSVAR(enable),
378 DRIZZLE_SYSVAR(debug),365 DRIZZLE_SYSVAR(debug),
379 DRIZZLE_SYSVAR(username),366 DRIZZLE_SYSVAR(username),
380 DRIZZLE_SYSVAR(password),367 DRIZZLE_SYSVAR(password),
381368
=== modified file 'plugin/innobase/dict/dict0crea.c'
--- plugin/innobase/dict/dict0crea.c 2009-11-29 19:05:11 +0000
+++ plugin/innobase/dict/dict0crea.c 2010-09-29 18:24:47 +0000
@@ -242,7 +242,7 @@
242242
243 thr_get_trx(thr)->table_id = table->id;243 thr_get_trx(thr)->table_id = table->id;
244244
245 if (srv_file_per_table) {245 if (! srv_single_data_file) {
246 /* We create a new single-table tablespace for the table.246 /* We create a new single-table tablespace for the table.
247 We initially let it be 4 pages:247 We initially let it be 4 pages:
248 - page 0 is the fsp header and an extent descriptor page,248 - page 0 is the fsp header and an extent descriptor page,
249249
=== modified file 'plugin/innobase/handler/ha_innodb.cc'
--- plugin/innobase/handler/ha_innodb.cc 2010-09-26 01:35:56 +0000
+++ plugin/innobase/handler/ha_innodb.cc 2010-09-29 18:24:47 +0000
@@ -5691,13 +5691,13 @@
56915691
5692 if (SessionVAR(&session, strict_mode))5692 if (SessionVAR(&session, strict_mode))
5693 {5693 {
5694 if (! srv_file_per_table)5694 if (srv_single_data_file)
5695 {5695 {
5696 push_warning_printf(5696 push_warning_printf(
5697 &session,5697 &session,
5698 DRIZZLE_ERROR::WARN_LEVEL_WARN,5698 DRIZZLE_ERROR::WARN_LEVEL_WARN,
5699 ER_ILLEGAL_HA_CREATE_OPTION,5699 ER_ILLEGAL_HA_CREATE_OPTION,
5700 "InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table.");5700 "InnoDB: ROW_FORMAT=COMPRESSED is not compatible with single_data_file.");
5701 } 5701 }
5702 else if (file_format < DICT_TF_FORMAT_ZIP) 5702 else if (file_format < DICT_TF_FORMAT_ZIP)
5703 {5703 {
@@ -8612,7 +8612,7 @@
8612 ".",8612 ".",
8613 NULL, NULL, 1, 0, 2, 0);8613 NULL, NULL, 1, 0, 2, 0);
86148614
8615static DRIZZLE_SYSVAR_BOOL(file_per_table, srv_file_per_table,8615static DRIZZLE_SYSVAR_BOOL(single_data_file, srv_single_data_file,
8616 PLUGIN_VAR_NOCMDARG,8616 PLUGIN_VAR_NOCMDARG,
8617 "Stores each InnoDB table to an .ibd file in the database dir.",8617 "Stores each InnoDB table to an .ibd file in the database dir.",
8618 NULL, NULL, FALSE);8618 NULL, NULL, FALSE);
@@ -8823,9 +8823,9 @@
8823 context("fast-shutdown",8823 context("fast-shutdown",
8824 po::value<unsigned long>(&innobase_fast_shutdown)->default_value(1), 8824 po::value<unsigned long>(&innobase_fast_shutdown)->default_value(1),
8825 "Speeds up the shutdown process of the InnoDB storage engine. Possible values are 0, 1 (faster) or 2 (fastest - crash-like).");8825 "Speeds up the shutdown process of the InnoDB storage engine. Possible values are 0, 1 (faster) or 2 (fastest - crash-like).");
8826 context("file-per-table",8826 context("single-data-file",
8827 po::value<bool>(&srv_file_per_table)->default_value(false)->zero_tokens(),8827 po::value<bool>(&srv_single_data_file)->default_value(false)->zero_tokens(),
8828 "Stores each InnoDB table to an .ibd file in the database dir.");8828 "Stores all InnoDB Tables in a single .ibd file.");
8829 context("file-format",8829 context("file-format",
8830 po::value<string>()->default_value("Antelope"),8830 po::value<string>()->default_value("Antelope"),
8831 "File format to use for new tables in .ibd files.");8831 "File format to use for new tables in .ibd files.");
@@ -8960,7 +8960,7 @@
8960 DRIZZLE_SYSVAR(fast_shutdown),8960 DRIZZLE_SYSVAR(fast_shutdown),
8961 DRIZZLE_SYSVAR(read_io_threads),8961 DRIZZLE_SYSVAR(read_io_threads),
8962 DRIZZLE_SYSVAR(write_io_threads),8962 DRIZZLE_SYSVAR(write_io_threads),
8963 DRIZZLE_SYSVAR(file_per_table),8963 DRIZZLE_SYSVAR(single_data_file),
8964 DRIZZLE_SYSVAR(file_format),8964 DRIZZLE_SYSVAR(file_format),
8965 DRIZZLE_SYSVAR(file_format_check),8965 DRIZZLE_SYSVAR(file_format_check),
8966 DRIZZLE_SYSVAR(flush_log_at_trx_commit),8966 DRIZZLE_SYSVAR(flush_log_at_trx_commit),
89678967
=== modified file 'plugin/innobase/include/srv0srv.h'
--- plugin/innobase/include/srv0srv.h 2010-09-14 06:43:02 +0000
+++ plugin/innobase/include/srv0srv.h 2010-09-29 18:24:47 +0000
@@ -110,9 +110,9 @@
110/** store to its own file each table created by an user; data110/** store to its own file each table created by an user; data
111dictionary tables are in the system tablespace 0 */111dictionary tables are in the system tablespace 0 */
112#ifndef UNIV_HOTBACKUP112#ifndef UNIV_HOTBACKUP
113extern my_bool srv_file_per_table;113extern my_bool srv_single_data_file;
114#else114#else
115extern ibool srv_file_per_table;115extern ibool srv_single_data_file;
116#endif /* UNIV_HOTBACKUP */116#endif /* UNIV_HOTBACKUP */
117/** The file format to use on new *.ibd files. */117/** The file format to use on new *.ibd files. */
118extern ulint srv_file_format;118extern ulint srv_file_format;
@@ -659,7 +659,7 @@
659# define srv_win_file_flush_method SRV_WIN_IO_UNBUFFERED659# define srv_win_file_flush_method SRV_WIN_IO_UNBUFFERED
660# define srv_unix_file_flush_method SRV_UNIX_O_DSYNC660# define srv_unix_file_flush_method SRV_UNIX_O_DSYNC
661# define srv_start_raw_disk_in_use 0661# define srv_start_raw_disk_in_use 0
662# define srv_file_per_table 1662# define srv_single_data_file 1
663#endif /* !UNIV_HOTBACKUP */663#endif /* !UNIV_HOTBACKUP */
664664
665665
666666
=== modified file 'plugin/innobase/os/os0file.c'
--- plugin/innobase/os/os0file.c 2010-02-04 08:14:46 +0000
+++ plugin/innobase/os/os0file.c 2010-09-29 18:24:47 +0000
@@ -1300,10 +1300,10 @@
1300 if (file == INVALID_HANDLE_VALUE) {1300 if (file == INVALID_HANDLE_VALUE) {
1301 *success = FALSE;1301 *success = FALSE;
13021302
1303 /* When srv_file_per_table is on, file creation failure may not1303 /* Unless srv_single_data_file is on, file creation failure may
1304 be critical to the whole instance. Do not crash the server in1304 not be critical to the whole instance. Do not crash the
1305 case of unknown errors. */1305 server in case of unknown errors. */
1306 if (srv_file_per_table) {1306 if (not srv_single_data_file) {
1307 retry = os_file_handle_error_no_exit(name,1307 retry = os_file_handle_error_no_exit(name,
1308 create_mode == OS_FILE_CREATE ?1308 create_mode == OS_FILE_CREATE ?
1309 "create" : "open");1309 "create" : "open");
@@ -1387,10 +1387,10 @@
1387 if (file == -1) {1387 if (file == -1) {
1388 *success = FALSE;1388 *success = FALSE;
13891389
1390 /* When srv_file_per_table is on, file creation failure may not1390 /* Unless srv_single_data_file is on, file creation failure may
1391 be critical to the whole instance. Do not crash the server in1391 not be critical to the whole instance. Do not crash the
1392 case of unknown errors. */1392 server in case of unknown errors. */
1393 if (srv_file_per_table) {1393 if (! srv_single_data_file) {
1394 retry = os_file_handle_error_no_exit(name,1394 retry = os_file_handle_error_no_exit(name,
1395 create_mode == OS_FILE_CREATE ?1395 create_mode == OS_FILE_CREATE ?
1396 "create" : "open");1396 "create" : "open");
13971397
=== modified file 'plugin/innobase/srv/srv0srv.c'
--- plugin/innobase/srv/srv0srv.c 2010-09-14 06:43:02 +0000
+++ plugin/innobase/srv/srv0srv.c 2010-09-29 18:24:47 +0000
@@ -138,7 +138,7 @@
138138
139/** store to its own file each table created by an user; data139/** store to its own file each table created by an user; data
140dictionary tables are in the system tablespace 0 */140dictionary tables are in the system tablespace 0 */
141UNIV_INTERN my_bool srv_file_per_table;141UNIV_INTERN my_bool srv_single_data_file;
142/** The file format to use on new *.ibd files. */142/** The file format to use on new *.ibd files. */
143UNIV_INTERN ulint srv_file_format = 0;143UNIV_INTERN ulint srv_file_format = 0;
144/** Whether to check file format during startup. A value of144/** Whether to check file format during startup. A value of
145145
=== modified file 'plugin/innobase/srv/srv0start.c'
--- plugin/innobase/srv/srv0start.c 2010-09-21 04:08:05 +0000
+++ plugin/innobase/srv/srv0start.c 2010-09-29 18:24:47 +0000
@@ -1036,8 +1036,8 @@
1036 ulint err;1036 ulint err;
1037 ulint i;1037 ulint i;
1038 ulint io_limit;1038 ulint io_limit;
1039 my_bool srv_file_per_table_original_value1039 my_bool srv_single_data_file_original_value
1040 = srv_file_per_table;1040 = srv_single_data_file;
1041 mtr_t mtr;1041 mtr_t mtr;
1042#ifdef HAVE_DARWIN_THREADS1042#ifdef HAVE_DARWIN_THREADS
1043# ifdef F_FULLFSYNC1043# ifdef F_FULLFSYNC
@@ -1073,10 +1073,10 @@
1073 }1073 }
10741074
1075 /* System tables are created in tablespace 0. Thus, we must1075 /* System tables are created in tablespace 0. Thus, we must
1076 temporarily clear srv_file_per_table. This is ok, because the1076 temporarily clear srv_single_data_file. This is ok, because the
1077 server will not accept connections (which could modify1077 server will not accept connections (which could modify
1078 innodb_file_per_table) until this function has returned. */1078 innodb_single_data_file) until this function has returned. */
1079 srv_file_per_table = FALSE;1079 srv_single_data_file = TRUE;
1080#ifdef UNIV_DEBUG1080#ifdef UNIV_DEBUG
1081 fprintf(stderr,1081 fprintf(stderr,
1082 "InnoDB: !!!!!!!! UNIV_DEBUG switched on !!!!!!!!!\n");1082 "InnoDB: !!!!!!!! UNIV_DEBUG switched on !!!!!!!!!\n");
@@ -1319,7 +1319,7 @@
1319 srv_n_write_io_threads,1319 srv_n_write_io_threads,
1320 SRV_MAX_N_PENDING_SYNC_IOS);1320 SRV_MAX_N_PENDING_SYNC_IOS);
13211321
1322 fil_init(srv_file_per_table ? 50000 : 5000,1322 fil_init(srv_single_data_file ? 5000 : 50000,
1323 srv_max_n_open_files);1323 srv_max_n_open_files);
13241324
1325 ret = buf_pool_init();1325 ret = buf_pool_init();
@@ -1878,7 +1878,7 @@
1878 ibuf_update_max_tablespace_id();1878 ibuf_update_max_tablespace_id();
1879 }1879 }
18801880
1881 srv_file_per_table = srv_file_per_table_original_value;1881 srv_single_data_file = srv_single_data_file_original_value;
18821882
1883 srv_was_started = TRUE;1883 srv_was_started = TRUE;
18841884