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
1=== modified file 'plugin/console/console.cc'
2--- plugin/console/console.cc 2010-06-20 19:25:46 +0000
3+++ plugin/console/console.cc 2010-09-29 18:24:47 +0000
4@@ -29,7 +29,6 @@
5
6 namespace po= boost::program_options;
7
8-static bool enabled= false;
9 static bool debug_enabled= false;
10 static char* username= NULL;
11 static char* password= NULL;
12@@ -293,12 +292,6 @@
13
14 virtual bool getFileDescriptors(std::vector<int> &fds)
15 {
16- if (debug_enabled)
17- enabled= true;
18-
19- if (enabled == false)
20- return false;
21-
22 if (pipe(pipe_fds) == -1)
23 {
24 errmsg_printf(ERRMSG_LVL_ERROR, _("pipe() failed with errno %d"), errno);
25@@ -342,8 +335,6 @@
26 return 0;
27 }
28
29-static DRIZZLE_SYSVAR_BOOL(enable, enabled, PLUGIN_VAR_NOCMDARG,
30- N_("Enable the console."), NULL, NULL, false);
31 static DRIZZLE_SYSVAR_BOOL(debug, debug_enabled, PLUGIN_VAR_NOCMDARG,
32 N_("Turn on extra debugging."), NULL, NULL, false);
33
34@@ -356,9 +347,6 @@
35
36 static void init_options(drizzled::module::option_context &context)
37 {
38- context("enable",
39- po::value<bool>(&enabled)->default_value(false)->zero_tokens(),
40- N_("Enable the console."));
41 context("debug",
42 po::value<bool>(&debug_enabled)->default_value(false)->zero_tokens(),
43 N_("Turn on extra debugging."));
44@@ -374,7 +362,6 @@
45 }
46
47 static drizzle_sys_var* vars[]= {
48- DRIZZLE_SYSVAR(enable),
49 DRIZZLE_SYSVAR(debug),
50 DRIZZLE_SYSVAR(username),
51 DRIZZLE_SYSVAR(password),
52
53=== modified file 'plugin/innobase/dict/dict0crea.c'
54--- plugin/innobase/dict/dict0crea.c 2009-11-29 19:05:11 +0000
55+++ plugin/innobase/dict/dict0crea.c 2010-09-29 18:24:47 +0000
56@@ -242,7 +242,7 @@
57
58 thr_get_trx(thr)->table_id = table->id;
59
60- if (srv_file_per_table) {
61+ if (! srv_single_data_file) {
62 /* We create a new single-table tablespace for the table.
63 We initially let it be 4 pages:
64 - page 0 is the fsp header and an extent descriptor page,
65
66=== modified file 'plugin/innobase/handler/ha_innodb.cc'
67--- plugin/innobase/handler/ha_innodb.cc 2010-09-26 01:35:56 +0000
68+++ plugin/innobase/handler/ha_innodb.cc 2010-09-29 18:24:47 +0000
69@@ -5691,13 +5691,13 @@
70
71 if (SessionVAR(&session, strict_mode))
72 {
73- if (! srv_file_per_table)
74+ if (srv_single_data_file)
75 {
76 push_warning_printf(
77 &session,
78 DRIZZLE_ERROR::WARN_LEVEL_WARN,
79 ER_ILLEGAL_HA_CREATE_OPTION,
80- "InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table.");
81+ "InnoDB: ROW_FORMAT=COMPRESSED is not compatible with single_data_file.");
82 }
83 else if (file_format < DICT_TF_FORMAT_ZIP)
84 {
85@@ -8612,7 +8612,7 @@
86 ".",
87 NULL, NULL, 1, 0, 2, 0);
88
89-static DRIZZLE_SYSVAR_BOOL(file_per_table, srv_file_per_table,
90+static DRIZZLE_SYSVAR_BOOL(single_data_file, srv_single_data_file,
91 PLUGIN_VAR_NOCMDARG,
92 "Stores each InnoDB table to an .ibd file in the database dir.",
93 NULL, NULL, FALSE);
94@@ -8823,9 +8823,9 @@
95 context("fast-shutdown",
96 po::value<unsigned long>(&innobase_fast_shutdown)->default_value(1),
97 "Speeds up the shutdown process of the InnoDB storage engine. Possible values are 0, 1 (faster) or 2 (fastest - crash-like).");
98- context("file-per-table",
99- po::value<bool>(&srv_file_per_table)->default_value(false)->zero_tokens(),
100- "Stores each InnoDB table to an .ibd file in the database dir.");
101+ context("single-data-file",
102+ po::value<bool>(&srv_single_data_file)->default_value(false)->zero_tokens(),
103+ "Stores all InnoDB Tables in a single .ibd file.");
104 context("file-format",
105 po::value<string>()->default_value("Antelope"),
106 "File format to use for new tables in .ibd files.");
107@@ -8960,7 +8960,7 @@
108 DRIZZLE_SYSVAR(fast_shutdown),
109 DRIZZLE_SYSVAR(read_io_threads),
110 DRIZZLE_SYSVAR(write_io_threads),
111- DRIZZLE_SYSVAR(file_per_table),
112+ DRIZZLE_SYSVAR(single_data_file),
113 DRIZZLE_SYSVAR(file_format),
114 DRIZZLE_SYSVAR(file_format_check),
115 DRIZZLE_SYSVAR(flush_log_at_trx_commit),
116
117=== modified file 'plugin/innobase/include/srv0srv.h'
118--- plugin/innobase/include/srv0srv.h 2010-09-14 06:43:02 +0000
119+++ plugin/innobase/include/srv0srv.h 2010-09-29 18:24:47 +0000
120@@ -110,9 +110,9 @@
121 /** store to its own file each table created by an user; data
122 dictionary tables are in the system tablespace 0 */
123 #ifndef UNIV_HOTBACKUP
124-extern my_bool srv_file_per_table;
125+extern my_bool srv_single_data_file;
126 #else
127-extern ibool srv_file_per_table;
128+extern ibool srv_single_data_file;
129 #endif /* UNIV_HOTBACKUP */
130 /** The file format to use on new *.ibd files. */
131 extern ulint srv_file_format;
132@@ -659,7 +659,7 @@
133 # define srv_win_file_flush_method SRV_WIN_IO_UNBUFFERED
134 # define srv_unix_file_flush_method SRV_UNIX_O_DSYNC
135 # define srv_start_raw_disk_in_use 0
136-# define srv_file_per_table 1
137+# define srv_single_data_file 1
138 #endif /* !UNIV_HOTBACKUP */
139
140
141
142=== modified file 'plugin/innobase/os/os0file.c'
143--- plugin/innobase/os/os0file.c 2010-02-04 08:14:46 +0000
144+++ plugin/innobase/os/os0file.c 2010-09-29 18:24:47 +0000
145@@ -1300,10 +1300,10 @@
146 if (file == INVALID_HANDLE_VALUE) {
147 *success = FALSE;
148
149- /* When srv_file_per_table is on, file creation failure may not
150- be critical to the whole instance. Do not crash the server in
151- case of unknown errors. */
152- if (srv_file_per_table) {
153+ /* Unless srv_single_data_file is on, file creation failure may
154+ not be critical to the whole instance. Do not crash the
155+ server in case of unknown errors. */
156+ if (not srv_single_data_file) {
157 retry = os_file_handle_error_no_exit(name,
158 create_mode == OS_FILE_CREATE ?
159 "create" : "open");
160@@ -1387,10 +1387,10 @@
161 if (file == -1) {
162 *success = FALSE;
163
164- /* When srv_file_per_table is on, file creation failure may not
165- be critical to the whole instance. Do not crash the server in
166- case of unknown errors. */
167- if (srv_file_per_table) {
168+ /* Unless srv_single_data_file is on, file creation failure may
169+ not be critical to the whole instance. Do not crash the
170+ server in case of unknown errors. */
171+ if (! srv_single_data_file) {
172 retry = os_file_handle_error_no_exit(name,
173 create_mode == OS_FILE_CREATE ?
174 "create" : "open");
175
176=== modified file 'plugin/innobase/srv/srv0srv.c'
177--- plugin/innobase/srv/srv0srv.c 2010-09-14 06:43:02 +0000
178+++ plugin/innobase/srv/srv0srv.c 2010-09-29 18:24:47 +0000
179@@ -138,7 +138,7 @@
180
181 /** store to its own file each table created by an user; data
182 dictionary tables are in the system tablespace 0 */
183-UNIV_INTERN my_bool srv_file_per_table;
184+UNIV_INTERN my_bool srv_single_data_file;
185 /** The file format to use on new *.ibd files. */
186 UNIV_INTERN ulint srv_file_format = 0;
187 /** Whether to check file format during startup. A value of
188
189=== modified file 'plugin/innobase/srv/srv0start.c'
190--- plugin/innobase/srv/srv0start.c 2010-09-21 04:08:05 +0000
191+++ plugin/innobase/srv/srv0start.c 2010-09-29 18:24:47 +0000
192@@ -1036,8 +1036,8 @@
193 ulint err;
194 ulint i;
195 ulint io_limit;
196- my_bool srv_file_per_table_original_value
197- = srv_file_per_table;
198+ my_bool srv_single_data_file_original_value
199+ = srv_single_data_file;
200 mtr_t mtr;
201 #ifdef HAVE_DARWIN_THREADS
202 # ifdef F_FULLFSYNC
203@@ -1073,10 +1073,10 @@
204 }
205
206 /* System tables are created in tablespace 0. Thus, we must
207- temporarily clear srv_file_per_table. This is ok, because the
208+ temporarily clear srv_single_data_file. This is ok, because the
209 server will not accept connections (which could modify
210- innodb_file_per_table) until this function has returned. */
211- srv_file_per_table = FALSE;
212+ innodb_single_data_file) until this function has returned. */
213+ srv_single_data_file = TRUE;
214 #ifdef UNIV_DEBUG
215 fprintf(stderr,
216 "InnoDB: !!!!!!!! UNIV_DEBUG switched on !!!!!!!!!\n");
217@@ -1319,7 +1319,7 @@
218 srv_n_write_io_threads,
219 SRV_MAX_N_PENDING_SYNC_IOS);
220
221- fil_init(srv_file_per_table ? 50000 : 5000,
222+ fil_init(srv_single_data_file ? 5000 : 50000,
223 srv_max_n_open_files);
224
225 ret = buf_pool_init();
226@@ -1878,7 +1878,7 @@
227 ibuf_update_max_tablespace_id();
228 }
229
230- srv_file_per_table = srv_file_per_table_original_value;
231+ srv_single_data_file = srv_single_data_file_original_value;
232
233 srv_was_started = TRUE;
234