Merge lp:~sergei.glushchenko/percona-xtrabackup/bug711166_part-1.6 into lp:percona-xtrabackup/1.6
- bug711166_part-1.6
- Merge into release-1.6
Status: | Rejected |
---|---|
Rejected by: | Alexey Kopytov |
Proposed branch: | lp:~sergei.glushchenko/percona-xtrabackup/bug711166_part-1.6 |
Merge into: | lp:percona-xtrabackup/1.6 |
Diff against target: |
756 lines (+482/-154) 9 files modified
innobackupex (+27/-11) test/inc/ib_part.sh (+76/-0) test/t/ib_part_databases.sh (+42/-0) test/t/ib_part_include.sh (+51/-0) test/t/ib_part_include_stream.sh (+42/-0) test/t/ib_part_tf_innodb.sh (+49/-0) test/t/ib_part_tf_innodb_stream.sh (+43/-0) test/t/ib_part_tf_myisam.sh (+42/-0) xtrabackup.c (+110/-143) |
To merge this branch: | bzr merge lp:~sergei.glushchenko/percona-xtrabackup/bug711166_part-1.6 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alexey Kopytov (community) | Needs Fixing | ||
Review via email: mp+91013@code.launchpad.net |
Commit message
Description of the change
Bug 711166
Implement full support for backups of partitioned tables.
Fixed support for partitioned tables (both innobackupex and xtrabackup.c)
when --tables-file option specified. This also fixes support for
partitioned tables when --databases option specified. Two testcases
added. First one for MyISAM partitioned table with --tables-file option
and DATA DIRECTORY/INDEX DIRECTORY specified, second one for InnoDB
partitioned table with --tables-file option.
Sergei Glushchenko (sergei.glushchenko) wrote : | # |
Alexey Kopytov (akopytov) wrote : | # |
Sergei,
Partial backups can also be created with the --include option of innobackupex (or its xtrabackup equivalent, --tables). That does not seem to be covered by the fix.
I've amended the bug report so we take that into account in the fix.
Some minor comments:
- innobackupex should be used in tests rather than IB_BIN directly
- please use --copy-back to restored when innobackupex is used to create a backup, so we also test that functionality
- you can use the checksum_table() function from common.sh
- xtrabackup.c (mostly) follows the InnoDB coding style. so the closin */ in comments should be on the last comment line, rather than on a separate one.
- typo ("Cheking")
- typo ("parttition")
Sergei Glushchenko (sergei.glushchenko) wrote : | # |
Alexei,
> Sergei,
>
> Partial backups can also be created with the --include option of innobackupex
> (or its xtrabackup equivalent, --tables). That does not seem to be covered by
> the fix.
>
--include option passed directly to --tables option of xtrabackup.
Each database.table value passed to --tables option considered as regular
expression. So if we pass --tables=test.test, all partitions of database test
would be backed up because of test.test matches all files test/test#P#*
I think it's a good behavior.
Thanks for your comments! I'll do my best to fix tescases.
Alexey Kopytov (akopytov) wrote : | # |
Sergei,
On 01.02.12 21:20, Sergei Glushchenko wrote:
> Alexei,
>
>> Sergei,
>>
>> Partial backups can also be created with the --include option of innobackupex
>> (or its xtrabackup equivalent, --tables). That does not seem to be covered by
>> the fix.
>>
>
> --include option passed directly to --tables option of xtrabackup.
Not always. It is handled in innobackupex for streaming backups.
> Each database.table value passed to --tables option considered as regular
> expression. So if we pass --tables=test.test, all partitions of database test
> would be backed up because of test.test matches all files test/test#P#*
> I think it's a good behavior.
>
Consider a case when I have tables 'test' and 'test_table'. So to be
able to backup only 'test', but not 'test_table', I have to use
--tables='test$'. But that won't work if 'test' is partitioned, right?
Sergei Glushchenko (sergei.glushchenko) wrote : | # |
Bug 711166
Partitioned tables are not correctly handled by the --databases, --include,
--tables-file options of innobackupex, and by the --tables and
--tables-file options of xtrabackup.
Solution is to remove partition suffix (#P#...) before doing filtering.
Testcases cover variants of using filtering options with MyISAM and
InnoDB tables (to test both innobackupex and xtrabackup) with either stream
mode turned on and turned off.
Since last MP request:
added --include option handling
added more testcases
Jenkins build:
lp:~sergei.glushchenko/percona-xtrabackup/bug711166_part-1.6
Sergei Glushchenko (sergei.glushchenko) wrote : | # |
Alexey Kopytov (akopytov) wrote : | # |
Sergei,
- I think you can avoid some code duplication in test cases by
putting the table definition to a common file in the inc/ directory
and using the default_
- you can also reduce the test sizes considerably by not messing with
informatio
storage engine, so it doesn't have any files in the data dir. And
you could just drop the test database before shutting down the
server and restoring, rather than just remove the entire data dir,
so you don't have to care about performance_schema and mysql DBs. I
think that would make test cases much smaller and easier to read,
but without any impact on test coverage.
- you can also make tests faster by not inserting 500 rows into the
table. Inserting that many rows one-by-one by invoking the client
each time actually take significant time. I think the following
would be sufficient for your purposes:
INSERT INTO test VALUES (1), (101), (201), (301), (401);
- Unlike the core server, InnoDB code encloses "if" blocks in braces
even if the block consists of only 1 statement.
- I think changes in xtrabackup.c have to much duplication and
unnecessary work. The whole point of those transformations is to
check whether a specific table should be skipped. Please take a
look at my changes to that code here
http://
Perhaps it even makes sense to backport check_if_
compact backups branch to 1.6/trunk and base your fix on that
function?
Sergei Glushchenko (sergei.glushchenko) wrote : | # |
Alexey,
> - I think you can avoid some code duplication in test cases by
> putting the table definition to a common file in the inc/ directory
> and using the default_
yes. You're right about that.
> - you can also reduce the test sizes considerably by not messing with
> information_schema and performance_schema. I_S is actually not a
> storage engine, so it doesn't have any files in the data dir. And
> you could just drop the test database before shutting down the
> server and restoring, rather than just remove the entire data dir,
> so you don't have to care about performance_schema and mysql DBs. I
> think that would make test cases much smaller and easier to read,
> but without any impact on test coverage.
We can't just drop database `test` and keep other databases in their places.
copy-back function expects that data directory is empty when we are
restoring backup.
> - you can also make tests faster by not inserting 500 rows into the
> table. Inserting that many rows one-by-one by invoking the client
> each time actually take significant time. I think the following
> would be sufficient for your purposes:
> INSERT INTO test VALUES (1), (101), (201), (301), (401);
OK. I'll follow your advice.
> - Unlike the core server, InnoDB code encloses "if" blocks in braces
> even if the block consists of only 1 statement.
Thanks. I should print InnoDB code guidelines somewhere and put it somewhere over my eyes.
> - I think changes in xtrabackup.c have to much duplication and
> unnecessary work. The whole point of those transformations is to
> check whether a specific table should be skipped. Please take a
> look at my changes to that code here
> http://
> backups/
> Perhaps it even makes sense to backport check_if_
> compact backups branch to 1.6/trunk and base your fix on that
> function?
As I can see check_if_skip_table does pretty much the same thing, but does
in-place patching instead of copying. I tried to avoid in-place patching,
because of it is not good from my point of view to modify data which is
not belongs to us. You should look at xtrabackup_
branch. It contains pretty much the same code as check_if_
I'm surely can write something similar to check_if_
in-place patching. What do you think about that?
Alexey Kopytov (akopytov) wrote : | # |
Sergei,
On 17.02.12 14:05, Sergei Glushchenko wrote:
>> - you can also reduce the test sizes considerably by not messing with
>> information_schema and performance_schema. I_S is actually not a
>> storage engine, so it doesn't have any files in the data dir. And
>> you could just drop the test database before shutting down the
>> server and restoring, rather than just remove the entire data dir,
>> so you don't have to care about performance_schema and mysql DBs. I
>> think that would make test cases much smaller and easier to read,
>> but without any impact on test coverage.
>
> We can't just drop database `test` and keep other databases in their places.
> copy-back function expects that data directory is empty when we are
> restoring backup.
>
Right, which means --copy-back is useless for partial backups. It either
creates an unusable datadir, if it was empty originally, or just fails,
if it wasn't empty.
Which in turn means users are expected to restore manually from a
partial backups. And so we should do the same in the test suite?
>
>> - Unlike the core server, InnoDB code encloses "if" blocks in braces
>> even if the block consists of only 1 statement.
>
> Thanks. I should print InnoDB code guidelines somewhere and put it somewhere over my eyes.
>
The problem is that there's no such thing as InnoDB code guidelines. If
you find them, let me know! :)
>> - I think changes in xtrabackup.c have to much duplication and
>> unnecessary work. The whole point of those transformations is to
>> check whether a specific table should be skipped. Please take a
>> look at my changes to that code here
>> http://
>> backups/
>> Perhaps it even makes sense to backport check_if_
>> compact backups branch to 1.6/trunk and base your fix on that
>> function?
>
> As I can see check_if_skip_table does pretty much the same thing, but does
> in-place patching instead of copying. I tried to avoid in-place patching,
> because of it is not good from my point of view to modify data which is
> not belongs to us. You should look at xtrabackup_
> branch. It contains pretty much the same code as check_if_
>
> I'm surely can write something similar to check_if_
> in-place patching. What do you think about that?
>
Sure, my point was that encapsulating the entire logic to decide whether
a table should be skipped or not is better than implementing some
auxiliary functions and passing the buffers around.
In-place modifications are certainly not nice, I just didn't have time
to fix that too, as I was after something completely different, so I
left that work for better times. Such as now :)
But thanks for pointing out the same code is in xtrabackup_
I didn't notice it, because the main object of refactoring was
xtrabackup_
OTOH I think malloc()s can be avoided and replaced with a
stack-allocated bufer.
Sergei Glushchenko (sergei.glushchenko) wrote : | # |
Tescases were reduced and improved a little. It allowed to find mistake in testcase and implementation. (tar command in stream mode didn't relsolve symbolic likns). check_if_skip_table was implemented instead of auxiliary functions.
Jenkins:
http://
Sergei Glushchenko (sergei.glushchenko) wrote : | # |
Updated with current 1.6 trunk.
lp:~sergei.glushchenko/percona-xtrabackup/bug711166_part-1.6
Sergei Glushchenko (sergei.glushchenko) wrote : | # |
Alexey Kopytov (akopytov) wrote : | # |
Sergei,
As discussed previously, we will not be fixing this bug in 1.6. Please create a 2.0 MP.
Unmerged revisions
- 348. By Sergei Glushchenko
-
Partitioned tables are not correctly handled by the --databases, --include,
--tables-file options of innobackupex, and by the --tables and
--tables-file options of xtrabackup.
Solution is to remove partition suffix (#P#...) before doing filtering.
Testcases cover variants of using filtering options with MyISAM and
InnoDB tables (to test both innobackupex and xtrabackup) with either stream
mode turned on and turned off.
Preview Diff
1 | === modified file 'innobackupex' | |||
2 | --- innobackupex 2012-06-08 18:46:19 +0000 | |||
3 | +++ innobackupex 2012-09-18 13:09:33 +0000 | |||
4 | @@ -975,11 +975,9 @@ | |||
5 | 975 | if($option_include) { | 975 | if($option_include) { |
6 | 976 | my $table_name; | 976 | my $table_name; |
7 | 977 | 977 | ||
11 | 978 | $table_name = substr($file, rindex($file, '/')); | 978 | $table_name = get_table_name($file); |
9 | 979 | $table_name = substr($table_name, 1, rindex($table_name, '.') - 1); | ||
10 | 980 | $table_name = $subdir . "." . $table_name; | ||
12 | 981 | 979 | ||
14 | 982 | if (!($table_name =~ /$option_include/)) { | 980 | if (!("$subdir.$table_name" =~ /$option_include/)) { |
15 | 983 | print STDERR "'$file' is skipped.\n"; | 981 | print STDERR "'$file' is skipped.\n"; |
16 | 984 | next; | 982 | next; |
17 | 985 | } | 983 | } |
18 | @@ -1984,7 +1982,8 @@ | |||
19 | 1984 | next unless check_if_required($database, $file); | 1982 | next unless check_if_required($database, $file); |
20 | 1985 | 1983 | ||
21 | 1986 | if($option_include) { | 1984 | if($option_include) { |
23 | 1987 | if (!("$database.$file" =~ /$option_include/)) { | 1985 | my $table_name = get_table_name($file); |
24 | 1986 | if (!("$database.$table_name" =~ /$option_include/)) { | ||
25 | 1988 | print STDERR "$database.$file is skipped because it does not match $option_include.\n"; | 1987 | print STDERR "$database.$file is skipped because it does not match $option_include.\n"; |
26 | 1989 | next; | 1988 | next; |
27 | 1990 | } | 1989 | } |
28 | @@ -2013,7 +2012,7 @@ | |||
29 | 2013 | my $ret = 0; | 2012 | my $ret = 0; |
30 | 2014 | my $file_name = substr($file, rindex($file, '/') + 1); | 2013 | my $file_name = substr($file, rindex($file, '/') + 1); |
31 | 2015 | $file_name=~s/([\$\\\" ])/\\$1/g; | 2014 | $file_name=~s/([\$\\\" ])/\\$1/g; |
33 | 2016 | $ret = system("cd $source_dir; tar cf - $database/$file_name") >> 8; | 2015 | $ret = system("cd $source_dir; tar chf - $database/$file_name") >> 8; |
34 | 2017 | if ($ret == 1) { | 2016 | if ($ret == 1) { |
35 | 2018 | print STDERR "$prefix If you use GNU tar, this warning can be ignored.\n"; | 2017 | print STDERR "$prefix If you use GNU tar, this warning can be ignored.\n"; |
36 | 2019 | # Check for non-zero exit code | 2018 | # Check for non-zero exit code |
37 | @@ -2303,6 +2302,27 @@ | |||
38 | 2303 | return ${$group_hash_ref}{$option_name}; | 2302 | return ${$group_hash_ref}{$option_name}; |
39 | 2304 | } | 2303 | } |
40 | 2305 | 2304 | ||
41 | 2305 | # get_table_name subroutine returns table name of specified file. | ||
42 | 2306 | # Parameters: | ||
43 | 2307 | # $_[0] table path | ||
44 | 2308 | # Return value: | ||
45 | 2309 | # 1 table name | ||
46 | 2310 | # | ||
47 | 2311 | sub get_table_name { | ||
48 | 2312 | my $table_path = shift; | ||
49 | 2313 | my $filename; | ||
50 | 2314 | my $table; | ||
51 | 2315 | |||
52 | 2316 | # get the last component in the table pathname | ||
53 | 2317 | $filename = (reverse(split(/\//, $table_path)))[0]; | ||
54 | 2318 | # get name of the table by removing file suffix | ||
55 | 2319 | $table = (split(/\./, $filename))[0]; | ||
56 | 2320 | # and partition suffix | ||
57 | 2321 | $table = (split('#P#', $table))[0]; | ||
58 | 2322 | |||
59 | 2323 | return $table; | ||
60 | 2324 | } | ||
61 | 2325 | |||
62 | 2306 | # check_if_required subroutine returns 1 if the specified database and | 2326 | # check_if_required subroutine returns 1 if the specified database and |
63 | 2307 | # table needs to be backed up. | 2327 | # table needs to be backed up. |
64 | 2308 | # Parameters: | 2328 | # Parameters: |
65 | @@ -2315,7 +2335,6 @@ | |||
66 | 2315 | my ( $db, $table_path ) = @_; | 2335 | my ( $db, $table_path ) = @_; |
67 | 2316 | my $db_count = scalar keys %databases_list; | 2336 | my $db_count = scalar keys %databases_list; |
68 | 2317 | my $tbl_count = scalar keys %table_list; | 2337 | my $tbl_count = scalar keys %table_list; |
69 | 2318 | my $filename; | ||
70 | 2319 | my $table; | 2338 | my $table; |
71 | 2320 | 2339 | ||
72 | 2321 | if ( $db_count == 0 && $tbl_count == 0 ) { | 2340 | if ( $db_count == 0 && $tbl_count == 0 ) { |
73 | @@ -2325,10 +2344,7 @@ | |||
74 | 2325 | } | 2344 | } |
75 | 2326 | else { | 2345 | else { |
76 | 2327 | if ( $table_path ) { | 2346 | if ( $table_path ) { |
81 | 2328 | # get the last component in the table pathname | 2347 | $table = get_table_name($table_path); |
78 | 2329 | $filename = (reverse(split(/\//, $table_path)))[0]; | ||
79 | 2330 | # get name of the table by removing file suffix | ||
80 | 2331 | $table = (split(/\./, $filename))[0]; | ||
82 | 2332 | } | 2348 | } |
83 | 2333 | } | 2349 | } |
84 | 2334 | 2350 | ||
85 | 2335 | 2351 | ||
86 | === added file 'test/inc/ib_part.sh' | |||
87 | --- test/inc/ib_part.sh 1970-01-01 00:00:00 +0000 | |||
88 | +++ test/inc/ib_part.sh 2012-09-18 13:09:33 +0000 | |||
89 | @@ -0,0 +1,76 @@ | |||
90 | 1 | |||
91 | 2 | function ib_part_schema() | ||
92 | 3 | { | ||
93 | 4 | topdir=$1 | ||
94 | 5 | engine=$2 | ||
95 | 6 | |||
96 | 7 | cat <<EOF | ||
97 | 8 | CREATE TABLE test ( | ||
98 | 9 | a int(11) DEFAULT NULL | ||
99 | 10 | ) ENGINE=$engine DEFAULT CHARSET=latin1 | ||
100 | 11 | PARTITION BY RANGE (a) | ||
101 | 12 | (PARTITION p0 VALUES LESS THAN (100) ENGINE = $engine, | ||
102 | 13 | PARTITION P1 VALUES LESS THAN (200) ENGINE = $engine, | ||
103 | 14 | PARTITION p2 VALUES LESS THAN (300) | ||
104 | 15 | DATA DIRECTORY = '$topdir/ext' INDEX DIRECTORY = '$topdir/ext' | ||
105 | 16 | ENGINE = $engine, | ||
106 | 17 | PARTITION p3 VALUES LESS THAN (400) | ||
107 | 18 | DATA DIRECTORY = '$topdir/ext' INDEX DIRECTORY = '$topdir/ext' | ||
108 | 19 | ENGINE = $engine, | ||
109 | 20 | PARTITION p4 VALUES LESS THAN MAXVALUE ENGINE = $engine); | ||
110 | 21 | EOF | ||
111 | 22 | } | ||
112 | 23 | |||
113 | 24 | function ib_part_data() | ||
114 | 25 | { | ||
115 | 26 | echo 'INSERT INTO test VALUES (1), (101), (201), (301), (401);'; | ||
116 | 27 | } | ||
117 | 28 | |||
118 | 29 | function ib_part_init() | ||
119 | 30 | { | ||
120 | 31 | topdir=$1 | ||
121 | 32 | engine=$2 | ||
122 | 33 | |||
123 | 34 | if [ -d $topdir/ext ] ; then | ||
124 | 35 | rm -rf $topdir/ext | ||
125 | 36 | fi | ||
126 | 37 | mkdir -p $topdir/ext | ||
127 | 38 | |||
128 | 39 | ib_part_schema $topdir $engine | run_cmd $MYSQL $MYSQL_ARGS test | ||
129 | 40 | ib_part_data $topdir $engine | run_cmd $MYSQL $MYSQL_ARGS test | ||
130 | 41 | } | ||
131 | 42 | |||
132 | 43 | function ib_part_restore() | ||
133 | 44 | { | ||
134 | 45 | topdir=$1 | ||
135 | 46 | mysql_datadir=$2 | ||
136 | 47 | |||
137 | 48 | # Remove database | ||
138 | 49 | rm -rf $mysql_datadir/test/* | ||
139 | 50 | rm -rf $topdir/ext/* | ||
140 | 51 | vlog "Original database removed" | ||
141 | 52 | |||
142 | 53 | # Restore database from backup | ||
143 | 54 | cp -rv $topdir/backup/test/* $mysql_datadir/test | ||
144 | 55 | vlog "database restored from backup" | ||
145 | 56 | |||
146 | 57 | } | ||
147 | 58 | |||
148 | 59 | function ib_part_assert_checksum() | ||
149 | 60 | { | ||
150 | 61 | checksum_a=$1 | ||
151 | 62 | |||
152 | 63 | vlog "Checking checksums" | ||
153 | 64 | checksum_b=`checksum_table test test` | ||
154 | 65 | |||
155 | 66 | vlog "Checksums are $checksum_a and $checksum_b" | ||
156 | 67 | |||
157 | 68 | if [ "$checksum_a" != "$checksum_b" ] | ||
158 | 69 | then | ||
159 | 70 | vlog "Checksums are not equal" | ||
160 | 71 | exit -1 | ||
161 | 72 | fi | ||
162 | 73 | |||
163 | 74 | vlog "Checksums are OK" | ||
164 | 75 | |||
165 | 76 | } | ||
166 | 0 | 77 | ||
167 | === added file 'test/t/ib_part_databases.sh' | |||
168 | --- test/t/ib_part_databases.sh 1970-01-01 00:00:00 +0000 | |||
169 | +++ test/t/ib_part_databases.sh 2012-09-18 13:09:33 +0000 | |||
170 | @@ -0,0 +1,42 @@ | |||
171 | 1 | ######################################################################## | ||
172 | 2 | # Bug #711166: Partitioned tables are not correctly handled by the | ||
173 | 3 | # --databases and --tables-file options of innobackupex, | ||
174 | 4 | # and by the --tables option of xtrabackup. | ||
175 | 5 | # Testcase covers using --databases option with MyISAM | ||
176 | 6 | # database | ||
177 | 7 | ######################################################################## | ||
178 | 8 | |||
179 | 9 | . inc/common.sh | ||
180 | 10 | . inc/ib_part.sh | ||
181 | 11 | |||
182 | 12 | start_server | ||
183 | 13 | |||
184 | 14 | if ! ${MYSQL} ${MYSQL_ARGS} -e "SHOW VARIABLES LIKE '%partition%';" | grep YES ; then | ||
185 | 15 | echo "Requires partition support" > $SKIPPED_REASON | ||
186 | 16 | exit $SKIPPED_EXIT_CODE | ||
187 | 17 | fi | ||
188 | 18 | |||
189 | 19 | # Create MyISAM partitioned table with some partitions in | ||
190 | 20 | # different location | ||
191 | 21 | ib_part_init $topdir MyISAM | ||
192 | 22 | |||
193 | 23 | # Saving the checksum of original table | ||
194 | 24 | checksum_a=`checksum_table test test` | ||
195 | 25 | |||
196 | 26 | # Take a backup | ||
197 | 27 | cat >$topdir/databases_file <<EOF | ||
198 | 28 | test.test | ||
199 | 29 | EOF | ||
200 | 30 | innobackupex --no-timestamp --databases=$topdir/databases_file $topdir/backup | ||
201 | 31 | innobackupex --apply-log $topdir/backup | ||
202 | 32 | vlog "Backup taken" | ||
203 | 33 | |||
204 | 34 | stop_server | ||
205 | 35 | |||
206 | 36 | # Restore partial backup | ||
207 | 37 | ib_part_restore $topdir $mysql_datadir | ||
208 | 38 | |||
209 | 39 | start_server | ||
210 | 40 | |||
211 | 41 | # compare checksum | ||
212 | 42 | ib_part_assert_checksum $checksum_a | ||
213 | 0 | 43 | ||
214 | === added file 'test/t/ib_part_include.sh' | |||
215 | --- test/t/ib_part_include.sh 1970-01-01 00:00:00 +0000 | |||
216 | +++ test/t/ib_part_include.sh 2012-09-18 13:09:33 +0000 | |||
217 | @@ -0,0 +1,51 @@ | |||
218 | 1 | ######################################################################## | ||
219 | 2 | # Bug #711166: Partitioned tables are not correctly handled by the | ||
220 | 3 | # --databases and --tables-file options of innobackupex, | ||
221 | 4 | # and by the --tables option of xtrabackup. | ||
222 | 5 | # Testcase covers using --include option with InnoDB | ||
223 | 6 | # database | ||
224 | 7 | ######################################################################## | ||
225 | 8 | |||
226 | 9 | . inc/common.sh | ||
227 | 10 | . inc/ib_part.sh | ||
228 | 11 | |||
229 | 12 | start_server --innodb_file_per_table | ||
230 | 13 | |||
231 | 14 | if ! ${MYSQL} ${MYSQL_ARGS} -e "SHOW VARIABLES LIKE '%partition%';" | grep YES ; then | ||
232 | 15 | echo "Requires partition support" > $SKIPPED_REASON | ||
233 | 16 | exit $SKIPPED_EXIT_CODE | ||
234 | 17 | fi | ||
235 | 18 | |||
236 | 19 | # Create InnoDB partitioned table | ||
237 | 20 | ib_part_init $topdir InnoDB | ||
238 | 21 | |||
239 | 22 | # Saving the checksum of original table | ||
240 | 23 | checksum_a=`checksum_table test test` | ||
241 | 24 | |||
242 | 25 | # Take a backup | ||
243 | 26 | # Only backup of test.test table will be taken | ||
244 | 27 | cat >$topdir/tables <<EOF | ||
245 | 28 | test.test | ||
246 | 29 | EOF | ||
247 | 30 | innobackupex --no-timestamp --include='test.test$' $topdir/backup | ||
248 | 31 | innobackupex --apply-log $topdir/backup | ||
249 | 32 | vlog "Backup taken" | ||
250 | 33 | |||
251 | 34 | # also test xtrabackup --stats work with --tables-file | ||
252 | 35 | COUNT=`xtrabackup --stats --tables='test.test$' --datadir=$topdir/backup 2>&1 \ | ||
253 | 36 | | grep table: | awk '{print $2}' | sort -u | wc -l` | ||
254 | 37 | |||
255 | 38 | if [ $COUNT != 5 ] ; then | ||
256 | 39 | xtrabackup --stats --tables='test.test$' --datadir=$topdir/backup | ||
257 | 40 | vlog "xtrabackup --stats does not work. count = $COUNT" | ||
258 | 41 | exit -1 | ||
259 | 42 | fi | ||
260 | 43 | |||
261 | 44 | stop_server | ||
262 | 45 | |||
263 | 46 | # Restore partial backup | ||
264 | 47 | ib_part_restore $topdir $mysql_datadir | ||
265 | 48 | |||
266 | 49 | start_server | ||
267 | 50 | |||
268 | 51 | ib_part_assert_checksum $checksum_a | ||
269 | 0 | 52 | ||
270 | === added file 'test/t/ib_part_include_stream.sh' | |||
271 | --- test/t/ib_part_include_stream.sh 1970-01-01 00:00:00 +0000 | |||
272 | +++ test/t/ib_part_include_stream.sh 2012-09-18 13:09:33 +0000 | |||
273 | @@ -0,0 +1,42 @@ | |||
274 | 1 | ######################################################################## | ||
275 | 2 | # Bug #711166: Partitioned tables are not correctly handled by the | ||
276 | 3 | # --databases and --tables-file options of innobackupex, | ||
277 | 4 | # and by the --tables option of xtrabackup. | ||
278 | 5 | # Testcase covers using --include option with InnoDB | ||
279 | 6 | # database and --stream mode | ||
280 | 7 | ######################################################################## | ||
281 | 8 | |||
282 | 9 | . inc/common.sh | ||
283 | 10 | . inc/ib_part.sh | ||
284 | 11 | |||
285 | 12 | start_server --innodb_file_per_table | ||
286 | 13 | |||
287 | 14 | if ! ${MYSQL} ${MYSQL_ARGS} -e "SHOW VARIABLES LIKE '%partition%';" | grep YES ; then | ||
288 | 15 | echo "Requires partition support" > $SKIPPED_REASON | ||
289 | 16 | exit $SKIPPED_EXIT_CODE | ||
290 | 17 | fi | ||
291 | 18 | |||
292 | 19 | # Create MyISAM partitioned table | ||
293 | 20 | ib_part_init $topdir MyISAM | ||
294 | 21 | |||
295 | 22 | # Saving the checksum of original table | ||
296 | 23 | checksum_a=`checksum_table test test` | ||
297 | 24 | |||
298 | 25 | # Take a backup | ||
299 | 26 | mkdir -p $topdir/backup | ||
300 | 27 | innobackupex --stream=tar --include='test.test$' $topdir/backup > $topdir/backup/backup.tar | ||
301 | 28 | $TAR ixvf $topdir/backup/backup.tar -C $topdir/backup | ||
302 | 29 | $TAR cvhf $topdir/backup/backup11.tar $mysql_datadir/test/* | ||
303 | 30 | |||
304 | 31 | innobackupex --apply-log $topdir/backup | ||
305 | 32 | |||
306 | 33 | vlog "Backup taken" | ||
307 | 34 | |||
308 | 35 | stop_server | ||
309 | 36 | |||
310 | 37 | # Restore partial backup | ||
311 | 38 | ib_part_restore $topdir $mysql_datadir | ||
312 | 39 | |||
313 | 40 | start_server | ||
314 | 41 | |||
315 | 42 | ib_part_assert_checksum $checksum_a | ||
316 | 0 | 43 | ||
317 | === added file 'test/t/ib_part_tf_innodb.sh' | |||
318 | --- test/t/ib_part_tf_innodb.sh 1970-01-01 00:00:00 +0000 | |||
319 | +++ test/t/ib_part_tf_innodb.sh 2012-09-18 13:09:33 +0000 | |||
320 | @@ -0,0 +1,49 @@ | |||
321 | 1 | ######################################################################## | ||
322 | 2 | # Bug #711166: Partitioned tables are not correctly handled by the | ||
323 | 3 | # --databases and --tables-file options of innobackupex, | ||
324 | 4 | # and by the --tables option of xtrabackup. | ||
325 | 5 | # Testcase covers using --tables-file option with InnoDB | ||
326 | 6 | # database | ||
327 | 7 | ######################################################################## | ||
328 | 8 | |||
329 | 9 | . inc/common.sh | ||
330 | 10 | . inc/ib_part.sh | ||
331 | 11 | |||
332 | 12 | start_server --innodb_file_per_table | ||
333 | 13 | |||
334 | 14 | if ! ${MYSQL} ${MYSQL_ARGS} -e "SHOW VARIABLES LIKE '%partition%';" | grep YES ; then | ||
335 | 15 | echo "Requires partition support" > $SKIPPED_REASON | ||
336 | 16 | exit $SKIPPED_EXIT_CODE | ||
337 | 17 | fi | ||
338 | 18 | |||
339 | 19 | # Create InnoDB partitioned table | ||
340 | 20 | ib_part_init $topdir InnoDB | ||
341 | 21 | |||
342 | 22 | # Saving the checksum of original table | ||
343 | 23 | checksum_a=`checksum_table test test` | ||
344 | 24 | |||
345 | 25 | # Take a backup | ||
346 | 26 | # Only backup of test.test table will be taken | ||
347 | 27 | cat >$topdir/tables <<EOF | ||
348 | 28 | test.test | ||
349 | 29 | EOF | ||
350 | 30 | innobackupex --no-timestamp --tables-file=$topdir/tables $topdir/backup | ||
351 | 31 | innobackupex --apply-log $topdir/backup | ||
352 | 32 | vlog "Backup taken" | ||
353 | 33 | |||
354 | 34 | COUNT=`xtrabackup --stats --tables-file=$topdir/tables --datadir=$topdir/backup 2>&1 \ | ||
355 | 35 | | grep table: | awk '{print $2}' | sort -u | wc -l` | ||
356 | 36 | |||
357 | 37 | if [ $COUNT != 5 ] ; then | ||
358 | 38 | vlog "xtrabackup --stats does not work" | ||
359 | 39 | exit -1 | ||
360 | 40 | fi | ||
361 | 41 | |||
362 | 42 | stop_server | ||
363 | 43 | |||
364 | 44 | # Restore partial backup | ||
365 | 45 | ib_part_restore $topdir $mysql_datadir | ||
366 | 46 | |||
367 | 47 | start_server | ||
368 | 48 | |||
369 | 49 | ib_part_assert_checksum $checksum_a | ||
370 | 0 | 50 | ||
371 | === added file 'test/t/ib_part_tf_innodb_stream.sh' | |||
372 | --- test/t/ib_part_tf_innodb_stream.sh 1970-01-01 00:00:00 +0000 | |||
373 | +++ test/t/ib_part_tf_innodb_stream.sh 2012-09-18 13:09:33 +0000 | |||
374 | @@ -0,0 +1,43 @@ | |||
375 | 1 | ######################################################################## | ||
376 | 2 | # Bug #711166: Partitioned tables are not correctly handled by the | ||
377 | 3 | # --databases and --tables-file options of innobackupex, | ||
378 | 4 | # and by the --tables option of xtrabackup. | ||
379 | 5 | # Testcase covers using --tables-file option with InnoDB | ||
380 | 6 | # database and --stream mode | ||
381 | 7 | ######################################################################## | ||
382 | 8 | |||
383 | 9 | . inc/common.sh | ||
384 | 10 | . inc/ib_part.sh | ||
385 | 11 | |||
386 | 12 | start_server --innodb_file_per_table | ||
387 | 13 | |||
388 | 14 | if ! ${MYSQL} ${MYSQL_ARGS} -e "SHOW VARIABLES LIKE '%partition%';" | grep YES ; then | ||
389 | 15 | echo "Requires partition support" > $SKIPPED_REASON | ||
390 | 16 | exit $SKIPPED_EXIT_CODE | ||
391 | 17 | fi | ||
392 | 18 | |||
393 | 19 | # Create InnoDB partitioned table | ||
394 | 20 | ib_part_init $topdir InnoDB | ||
395 | 21 | |||
396 | 22 | # Saving the checksum of original table | ||
397 | 23 | checksum_a=`checksum_table test test` | ||
398 | 24 | |||
399 | 25 | # Take a backup | ||
400 | 26 | # Only backup of test.test table will be taken | ||
401 | 27 | cat >$topdir/tables <<EOF | ||
402 | 28 | test.test | ||
403 | 29 | EOF | ||
404 | 30 | mkdir -p $topdir/backup | ||
405 | 31 | innobackupex --stream=tar --no-timestamp --tables-file=$topdir/tables $topdir/backup > $topdir/backup/backup.tar | ||
406 | 32 | $TAR ixvf $topdir/backup/backup.tar -C $topdir/backup | ||
407 | 33 | innobackupex --apply-log $topdir/backup | ||
408 | 34 | vlog "Backup taken" | ||
409 | 35 | |||
410 | 36 | stop_server | ||
411 | 37 | |||
412 | 38 | # Restore partial backup | ||
413 | 39 | ib_part_restore $topdir $mysql_datadir | ||
414 | 40 | |||
415 | 41 | start_server | ||
416 | 42 | |||
417 | 43 | ib_part_assert_checksum $checksum_a | ||
418 | 0 | 44 | ||
419 | === added file 'test/t/ib_part_tf_myisam.sh' | |||
420 | --- test/t/ib_part_tf_myisam.sh 1970-01-01 00:00:00 +0000 | |||
421 | +++ test/t/ib_part_tf_myisam.sh 2012-09-18 13:09:33 +0000 | |||
422 | @@ -0,0 +1,42 @@ | |||
423 | 1 | ######################################################################## | ||
424 | 2 | # Bug #711166: Partitioned tables are not correctly handled by the | ||
425 | 3 | # --databases and --tables-file options of innobackupex, | ||
426 | 4 | # and by the --tables option of xtrabackup. | ||
427 | 5 | # Testcase covers using --tables-file option with MyISAM | ||
428 | 6 | # database | ||
429 | 7 | ######################################################################## | ||
430 | 8 | |||
431 | 9 | . inc/common.sh | ||
432 | 10 | . inc/ib_part.sh | ||
433 | 11 | |||
434 | 12 | start_server | ||
435 | 13 | |||
436 | 14 | if ! ${MYSQL} ${MYSQL_ARGS} -e "SHOW VARIABLES LIKE '%partition%';" | grep YES ; then | ||
437 | 15 | echo "Requires partition support" > $SKIPPED_REASON | ||
438 | 16 | exit $SKIPPED_EXIT_CODE | ||
439 | 17 | fi | ||
440 | 18 | |||
441 | 19 | # Create MyISAM partitioned table with some partitions in | ||
442 | 20 | # different location | ||
443 | 21 | ib_part_init $topdir MyISAM | ||
444 | 22 | |||
445 | 23 | # Saving the checksum of original table | ||
446 | 24 | checksum_a=`checksum_table test test` | ||
447 | 25 | |||
448 | 26 | # Take a backup | ||
449 | 27 | # Only backup of test.test table will be taken | ||
450 | 28 | cat >$topdir/tables <<EOF | ||
451 | 29 | test.test | ||
452 | 30 | EOF | ||
453 | 31 | innobackupex --no-timestamp --tables-file=$topdir/tables $topdir/backup | ||
454 | 32 | innobackupex --apply-log $topdir/backup | ||
455 | 33 | vlog "Backup taken" | ||
456 | 34 | |||
457 | 35 | stop_server | ||
458 | 36 | |||
459 | 37 | # Restore partial backup | ||
460 | 38 | ib_part_restore $topdir $mysql_datadir | ||
461 | 39 | |||
462 | 40 | start_server | ||
463 | 41 | |||
464 | 42 | ib_part_assert_checksum $checksum_a | ||
465 | 0 | 43 | ||
466 | === modified file 'xtrabackup.c' | |||
467 | --- xtrabackup.c 2012-05-28 16:37:00 +0000 | |||
468 | +++ xtrabackup.c 2012-09-18 13:09:33 +0000 | |||
469 | @@ -576,6 +576,15 @@ | |||
470 | 576 | 576 | ||
471 | 577 | #endif /* INNODB_VERSION_SHORT */ | 577 | #endif /* INNODB_VERSION_SHORT */ |
472 | 578 | 578 | ||
473 | 579 | #ifdef INNODB_VERSION_SHORT | ||
474 | 580 | #define XB_HASH_SEARCH(NAME, TABLE, FOLD, DATA, ASSERTION, TEST) \ | ||
475 | 581 | HASH_SEARCH(NAME, TABLE, FOLD, xtrabackup_tables_t*, DATA, ASSERTION, \ | ||
476 | 582 | TEST) | ||
477 | 583 | #else | ||
478 | 584 | #define XB_HASH_SEARCH(NAME, TABLE, FOLD, DATA, ASSERTION, TEST) \ | ||
479 | 585 | HASH_SEARCH(NAME, TABLE, FOLD, DATA, TEST) | ||
480 | 586 | #endif | ||
481 | 587 | |||
482 | 579 | typedef struct { | 588 | typedef struct { |
483 | 580 | ulint page_size; | 589 | ulint page_size; |
484 | 581 | } xb_delta_info_t; | 590 | } xb_delta_info_t; |
485 | @@ -2518,6 +2527,73 @@ | |||
486 | 2518 | return(r); | 2527 | return(r); |
487 | 2519 | } | 2528 | } |
488 | 2520 | 2529 | ||
489 | 2530 | static my_bool | ||
490 | 2531 | check_if_skip_table(const char *path, const char *suffix) | ||
491 | 2532 | { | ||
492 | 2533 | char buf[FN_REFLEN]; | ||
493 | 2534 | const char *dbname, *tbname; | ||
494 | 2535 | const char *ptr; | ||
495 | 2536 | char *eptr; | ||
496 | 2537 | int dbname_len; | ||
497 | 2538 | |||
498 | 2539 | if (xtrabackup_tables == NULL && xtrabackup_tables_file == NULL) { | ||
499 | 2540 | return(FALSE); | ||
500 | 2541 | } | ||
501 | 2542 | |||
502 | 2543 | dbname= NULL; | ||
503 | 2544 | tbname= path; | ||
504 | 2545 | while ((ptr= strstr(tbname, SRV_PATH_SEPARATOR_STR)) != NULL) { | ||
505 | 2546 | dbname= tbname; | ||
506 | 2547 | tbname= ptr + 1; | ||
507 | 2548 | } | ||
508 | 2549 | |||
509 | 2550 | if (dbname == NULL) { | ||
510 | 2551 | return(TRUE); | ||
511 | 2552 | } | ||
512 | 2553 | |||
513 | 2554 | strncpy(buf, dbname, FN_REFLEN); | ||
514 | 2555 | buf[FN_REFLEN - 1]= 0; | ||
515 | 2556 | buf[tbname - 1 - dbname]= '.'; | ||
516 | 2557 | |||
517 | 2558 | dbname_len= strlen(dbname) - strlen(suffix); | ||
518 | 2559 | if (dbname_len < 1) { | ||
519 | 2560 | return(TRUE); | ||
520 | 2561 | } | ||
521 | 2562 | buf[dbname_len - 1]= 0; | ||
522 | 2563 | |||
523 | 2564 | if ((eptr= strstr(buf, "#P")) != NULL) { | ||
524 | 2565 | *eptr= 0; | ||
525 | 2566 | } | ||
526 | 2567 | |||
527 | 2568 | if (xtrabackup_tables) { | ||
528 | 2569 | int regres = REG_NOMATCH; | ||
529 | 2570 | int i; | ||
530 | 2571 | for (i = 0; i < tables_regex_num; i++) { | ||
531 | 2572 | regres = regexec(&tables_regex[i], buf, 1, | ||
532 | 2573 | tables_regmatch, 0); | ||
533 | 2574 | if (regres != REG_NOMATCH) { | ||
534 | 2575 | break; | ||
535 | 2576 | } | ||
536 | 2577 | } | ||
537 | 2578 | if (regres == REG_NOMATCH) { | ||
538 | 2579 | return(TRUE); | ||
539 | 2580 | } | ||
540 | 2581 | } | ||
541 | 2582 | |||
542 | 2583 | if (xtrabackup_tables_file) { | ||
543 | 2584 | xtrabackup_tables_t* table; | ||
544 | 2585 | |||
545 | 2586 | XB_HASH_SEARCH(name_hash, tables_hash, ut_fold_string(buf), | ||
546 | 2587 | table, ut_ad(table->name), | ||
547 | 2588 | !strcmp(table->name, buf)); | ||
548 | 2589 | if (!table) { | ||
549 | 2590 | return(TRUE); | ||
550 | 2591 | } | ||
551 | 2592 | } | ||
552 | 2593 | |||
553 | 2594 | return(FALSE); | ||
554 | 2595 | } | ||
555 | 2596 | |||
556 | 2521 | /*********************************************************************** | 2597 | /*********************************************************************** |
557 | 2522 | Read meta info for an incremental delta. | 2598 | Read meta info for an incremental delta. |
558 | 2523 | @return TRUE on success, FALSE on failure. */ | 2599 | @return TRUE on success, FALSE on failure. */ |
559 | @@ -2639,102 +2715,38 @@ | |||
560 | 2639 | info.page_size = 0; | 2715 | info.page_size = 0; |
561 | 2640 | 2716 | ||
562 | 2641 | #ifdef XTRADB_BASED | 2717 | #ifdef XTRADB_BASED |
659 | 2642 | if (xtrabackup_tables && (!trx_sys_sys_space(node->space->id))) | 2718 | if (xtrabackup_tables && (!trx_sys_sys_space(node->space->id)) |
660 | 2643 | #else | 2719 | #else |
661 | 2644 | if (xtrabackup_tables && (node->space->id != 0)) | 2720 | if (xtrabackup_tables && (node->space->id != 0) |
662 | 2645 | #endif | 2721 | #endif |
663 | 2646 | { /* must backup id==0 */ | 2722 | && check_if_skip_table(node->name, "ibd")) { |
664 | 2647 | char *p; | 2723 | printf("[%02u] Copying %s is skipped.\n", |
665 | 2648 | int p_len, regres= 0; | 2724 | thread_n, node->name); |
666 | 2649 | char *next, *prev; | 2725 | return(FALSE); |
667 | 2650 | char tmp; | 2726 | } |
668 | 2651 | int i; | 2727 | |
669 | 2652 | 2728 | #ifndef INNODB_VERSION_SHORT | |
670 | 2653 | p = node->name; | 2729 | page_size = UNIV_PAGE_SIZE; |
671 | 2654 | prev = NULL; | 2730 | page_size_shift = UNIV_PAGE_SIZE_SHIFT; |
672 | 2655 | while ((next = strstr(p, SRV_PATH_SEPARATOR_STR)) != NULL) | 2731 | #else |
673 | 2656 | { | 2732 | zip_size = fil_space_get_zip_size(node->space->id); |
674 | 2657 | prev = p; | 2733 | if (zip_size == ULINT_UNDEFINED) { |
675 | 2658 | p = next + 1; | 2734 | goto skip; |
676 | 2659 | } | 2735 | } else if (zip_size) { |
677 | 2660 | p_len = strlen(p) - strlen(".ibd"); | 2736 | page_size = zip_size; |
678 | 2661 | 2737 | page_size_shift = get_bit_shift(page_size); | |
679 | 2662 | if (p_len < 1) { | 2738 | fprintf(stderr, "[%02u] %s is compressed with page size = " |
680 | 2663 | /* unknown situation: skip filtering */ | 2739 | "%lu bytes\n", thread_n, node->name, page_size); |
681 | 2664 | goto skip_filter; | 2740 | if (page_size_shift < 10 || page_size_shift > 14) { |
682 | 2665 | } | 2741 | fprintf(stderr, "[%02u] xtrabackup: Error: Invalid " |
683 | 2666 | 2742 | "page size.\n", thread_n); | |
684 | 2667 | /* TODO: Fix this lazy implementation... */ | 2743 | ut_error; |
685 | 2668 | tmp = p[p_len]; | 2744 | } |
686 | 2669 | p[p_len] = 0; | 2745 | } else { |
687 | 2670 | *(p - 1) = '.'; | 2746 | page_size = UNIV_PAGE_SIZE; |
688 | 2671 | 2747 | page_size_shift = UNIV_PAGE_SIZE_SHIFT; | |
689 | 2672 | for (i = 0; i < tables_regex_num; i++) { | 2748 | } |
690 | 2673 | regres = regexec(&tables_regex[i], prev, 1, tables_regmatch, 0); | 2749 | #endif |
595 | 2674 | if (regres != REG_NOMATCH) | ||
596 | 2675 | break; | ||
597 | 2676 | } | ||
598 | 2677 | |||
599 | 2678 | p[p_len] = tmp; | ||
600 | 2679 | *(p - 1) = SRV_PATH_SEPARATOR; | ||
601 | 2680 | |||
602 | 2681 | if ( regres == REG_NOMATCH ) { | ||
603 | 2682 | printf("[%02u] Copying %s is skipped.\n", | ||
604 | 2683 | thread_n, node->name); | ||
605 | 2684 | return(FALSE); | ||
606 | 2685 | } | ||
607 | 2686 | } | ||
608 | 2687 | |||
609 | 2688 | #ifdef XTRADB_BASED | ||
610 | 2689 | if (xtrabackup_tables_file && (!trx_sys_sys_space(node->space->id))) | ||
611 | 2690 | #else | ||
612 | 2691 | if (xtrabackup_tables_file && (node->space->id != 0)) | ||
613 | 2692 | #endif | ||
614 | 2693 | { /* must backup id==0 */ | ||
615 | 2694 | xtrabackup_tables_t* table; | ||
616 | 2695 | char *p; | ||
617 | 2696 | int p_len; | ||
618 | 2697 | char *next, *prev; | ||
619 | 2698 | char tmp; | ||
620 | 2699 | |||
621 | 2700 | p = node->name; | ||
622 | 2701 | prev = NULL; | ||
623 | 2702 | while ((next = strstr(p, SRV_PATH_SEPARATOR_STR)) != NULL) | ||
624 | 2703 | { | ||
625 | 2704 | prev = p; | ||
626 | 2705 | p = next + 1; | ||
627 | 2706 | } | ||
628 | 2707 | p_len = strlen(p) - strlen(".ibd"); | ||
629 | 2708 | |||
630 | 2709 | if (p_len < 1) { | ||
631 | 2710 | /* unknown situation: skip filtering */ | ||
632 | 2711 | goto skip_filter; | ||
633 | 2712 | } | ||
634 | 2713 | |||
635 | 2714 | /* TODO: Fix this lazy implementation... */ | ||
636 | 2715 | tmp = p[p_len]; | ||
637 | 2716 | p[p_len] = 0; | ||
638 | 2717 | |||
639 | 2718 | HASH_SEARCH(name_hash, tables_hash, ut_fold_string(prev), | ||
640 | 2719 | #ifdef INNODB_VERSION_SHORT | ||
641 | 2720 | xtrabackup_tables_t*, | ||
642 | 2721 | #endif | ||
643 | 2722 | table, | ||
644 | 2723 | #ifdef INNODB_VERSION_SHORT | ||
645 | 2724 | ut_ad(table->name), | ||
646 | 2725 | #endif | ||
647 | 2726 | !strcmp(table->name, prev)); | ||
648 | 2727 | |||
649 | 2728 | p[p_len] = tmp; | ||
650 | 2729 | |||
651 | 2730 | if (!table) { | ||
652 | 2731 | printf("[%02u] Copying %s is skipped.\n", | ||
653 | 2732 | thread_n, node->name); | ||
654 | 2733 | return(FALSE); | ||
655 | 2734 | } | ||
656 | 2735 | } | ||
657 | 2736 | |||
658 | 2737 | skip_filter: | ||
691 | 2738 | 2750 | ||
692 | 2739 | #ifdef XTRADB_BASED | 2751 | #ifdef XTRADB_BASED |
693 | 2740 | if (trx_sys_sys_space(node->space->id)) | 2752 | if (trx_sys_sys_space(node->space->id)) |
694 | @@ -4610,47 +4622,8 @@ | |||
695 | 4610 | table = dict_table_get_low(table_name); | 4622 | table = dict_table_get_low(table_name); |
696 | 4611 | mem_free(table_name); | 4623 | mem_free(table_name); |
697 | 4612 | 4624 | ||
739 | 4613 | 4625 | if (table && check_if_skip_table(table->name, "")) | |
740 | 4614 | if (xtrabackup_tables) { | 4626 | goto skip; |
700 | 4615 | char *p; | ||
701 | 4616 | int regres= 0; | ||
702 | 4617 | int i; | ||
703 | 4618 | |||
704 | 4619 | p = strstr(table->name, SRV_PATH_SEPARATOR_STR); | ||
705 | 4620 | |||
706 | 4621 | if (p) | ||
707 | 4622 | *p = '.'; | ||
708 | 4623 | |||
709 | 4624 | for (i = 0; i < tables_regex_num; i++) { | ||
710 | 4625 | regres = regexec(&tables_regex[i], table->name, 1, tables_regmatch, 0); | ||
711 | 4626 | if (regres != REG_NOMATCH) | ||
712 | 4627 | break; | ||
713 | 4628 | } | ||
714 | 4629 | |||
715 | 4630 | if (p) | ||
716 | 4631 | *p = SRV_PATH_SEPARATOR; | ||
717 | 4632 | |||
718 | 4633 | if ( regres == REG_NOMATCH ) | ||
719 | 4634 | goto skip; | ||
720 | 4635 | } | ||
721 | 4636 | |||
722 | 4637 | if (xtrabackup_tables_file) { | ||
723 | 4638 | xtrabackup_tables_t* xtable; | ||
724 | 4639 | |||
725 | 4640 | HASH_SEARCH(name_hash, tables_hash, ut_fold_string(table->name), | ||
726 | 4641 | #ifdef INNODB_VERSION_SHORT | ||
727 | 4642 | xtrabackup_tables_t*, | ||
728 | 4643 | #endif | ||
729 | 4644 | xtable, | ||
730 | 4645 | #ifdef INNODB_VERSION_SHORT | ||
731 | 4646 | ut_ad(xtable->name), | ||
732 | 4647 | #endif | ||
733 | 4648 | !strcmp(xtable->name, table->name)); | ||
734 | 4649 | |||
735 | 4650 | if (!xtable) | ||
736 | 4651 | goto skip; | ||
737 | 4652 | } | ||
738 | 4653 | |||
741 | 4654 | 4627 | ||
742 | 4655 | if (table == NULL) { | 4628 | if (table == NULL) { |
743 | 4656 | fputs("InnoDB: Failed to load table ", stderr); | 4629 | fputs("InnoDB: Failed to load table ", stderr); |
744 | @@ -6174,12 +6147,6 @@ | |||
745 | 6174 | break; | 6147 | break; |
746 | 6175 | } | 6148 | } |
747 | 6176 | 6149 | ||
748 | 6177 | while (*p != '\0') { | ||
749 | 6178 | if (*p == '.') { | ||
750 | 6179 | *p = '/'; | ||
751 | 6180 | } | ||
752 | 6181 | p++; | ||
753 | 6182 | } | ||
754 | 6183 | p = strchr(name_buf, '\n'); | 6150 | p = strchr(name_buf, '\n'); |
755 | 6184 | if (p) | 6151 | if (p) |
756 | 6185 | { | 6152 | { |
Jenkins build: jenkins. percona. com/view/ Percona% 20Xtrabackup/ job/percona- xtrabackup- 1.6-param/ 107/
http://