Merge lp:~akopytov/percona-xtrabackup/bug1169169-2.1 into lp:percona-xtrabackup/2.1

Proposed by Alexey Kopytov
Status: Merged
Approved by: Laurynas Biveinis
Approved revision: no longer in the source branch.
Merged at revision: 568
Proposed branch: lp:~akopytov/percona-xtrabackup/bug1169169-2.1
Merge into: lp:percona-xtrabackup/2.1
Prerequisite: lp:~akopytov/percona-xtrabackup/support-separate-undo-tablespaces-2.1
Diff against target: 86 lines (+55/-6) (has conflicts)
2 files modified
patches/innodb56.patch (+50/-1)
test/inc/ib_part.sh (+5/-5)
Text conflict in innobackupex
Text conflict in patches/innodb56.patch
Text conflict in src/xtrabackup.cc
Text conflict in test/inc/common.sh
Text conflict in test/t/bug977101.sh
Text conflict in test/t/ib_doublewrite.sh
Text conflict in test/t/xb_basic.sh
To merge this branch: bzr merge lp:~akopytov/percona-xtrabackup/bug1169169-2.1
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) Approve
Review via email: mp+160273@code.launchpad.net

Description of the change

    Bug #1169169: xtrabackup_56 crashes when preparing a backup with
                  partitioned tables

    The problem was that xtrabackup_56 used the implementation of
    innobase_convert_identifier() provided by the InnoDB code, rather than a
    lightweight replacement provided in xtrabackup.cc for other build
    flavors. The full-blown implementation may call explain_filename() which
    requires MySQL localization subsystem to be initialized (which is
    normally initialized in init_common_variables() on server startup). In
    particular, it crashed when explain_filename() was called on a
    partitioned table.

    Since xtrabackup_56 links with ha_innodb.cc containing the full-blown
    implementation of innobase_convert_identifier(), the bug was fixed by
    replicating the lightweight version used by xtrabackup/xtrabackup_55 in
    innodb56.patch.

    An alternative approach would be to mimic localization subsystem
    initialization performed in mysqld.cc, but that pulls way too many
    dependencies.

    This revision also fixes bug #1170340 "require_partitioning in
    test/inc/ib_part.sh does not work with 5.6" (which was the reason why
    bug #1169169 have not been caught by the test suite).

To post a comment you must log in.
Revision history for this message
Alexey Kopytov (akopytov) wrote :

http://jenkins.percona.com/view/XtraBackup/job/percona-xtrabackup-2.1-param/266/

The ib_part* failures on *56 configurations is a result of missing remote tablespaces support (will be fixed in followup dependent MPs).

Revision history for this message
Alexey Kopytov (akopytov) wrote :

Here it shows the correct diff (unlike the 2.0 MP), but some spurious conflicts. It does not in fact have any conflicts with the current 2.1 trunk.

Revision history for this message
Laurynas Biveinis (laurynas-biveinis) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'patches/innodb56.patch'
2--- patches/innodb56.patch 2013-04-23 06:10:54 +0000
3+++ patches/innodb56.patch 2013-04-23 06:10:55 +0000
4@@ -524,7 +524,56 @@
5
6 if (thd && thd_sql_command(thd) == SQLCOM_DROP_TABLE) {
7
8-@@ -16642,45 +16642,21 @@
9+@@ -2423,43 +2423,19 @@
10+ ulint buflen, /*!< in: length of buf, in bytes */
11+ const char* id, /*!< in: identifier to convert */
12+ ulint idlen, /*!< in: length of id, in bytes */
13+- THD* thd, /*!< in: MySQL connection thread, or NULL */
14+- ibool file_id)/*!< in: TRUE=id is a table or database name;
15++ THD* thd __attribute__((unused)),
16++ /*!< in: MySQL connection thread, or NULL */
17++ ibool file_id __attribute__((unused)))
18++ /*!< in: TRUE=id is a table or database name;
19+ FALSE=id is an UTF-8 string */
20+ {
21+- char nz[NAME_LEN + 1];
22+- char nz2[NAME_LEN + 1 + EXPLAIN_FILENAME_MAX_EXTRA_LENGTH];
23+-
24+ const char* s = id;
25+ int q;
26+
27+- if (file_id) {
28+- /* Decode the table name. The MySQL function expects
29+- a NUL-terminated string. The input and output strings
30+- buffers must not be shared. */
31+-
32+- if (UNIV_UNLIKELY(idlen > (sizeof nz) - 1)) {
33+- idlen = (sizeof nz) - 1;
34+- }
35+-
36+- memcpy(nz, id, idlen);
37+- nz[idlen] = 0;
38+-
39+- s = nz2;
40+- idlen = explain_filename(thd, nz, nz2, sizeof nz2,
41+- EXPLAIN_PARTITIONS_AS_COMMENT);
42+- goto no_quote;
43+- }
44+-
45+ /* See if the identifier needs to be quoted. */
46+- if (UNIV_UNLIKELY(!thd)) {
47+- q = '"';
48+- } else {
49+- q = get_quote_char_for_identifier(thd, s, (int) idlen);
50+- }
51++ q = '"';
52+
53+ if (q == EOF) {
54+-no_quote:
55+ if (UNIV_UNLIKELY(idlen > buflen)) {
56+ idlen = buflen;
57+ }
58+@@ -16642,45 +16618,21 @@
59 void
60 ib_logf(
61 /*====*/
62
63=== modified file 'test/inc/ib_part.sh'
64--- test/inc/ib_part.sh 2013-03-07 11:38:14 +0000
65+++ test/inc/ib_part.sh 2013-04-23 06:10:55 +0000
66@@ -2,15 +2,15 @@
67
68 function check_partitioning()
69 {
70- $MYSQL $MYSQL_ARGS -Ns -e "show variables like 'have_partitioning'"
71+ $MYSQL $MYSQL_ARGS -Ns -e "SHOW PLUGINS" 2> /dev/null |
72+ egrep -q "^partition"
73 }
74
75 function require_partitioning()
76 {
77- PARTITION_CHECK=`check_partitioning`
78-
79- if [ -z "$PARTITION_CHECK" ]; then
80- echo "Requires Partitioning." > $SKIPPED_REASON
81+ if ! check_partitioning
82+ then
83+ echo "Requires support for partitioning." > $SKIPPED_REASON
84 exit $SKIPPED_EXIT_CODE
85 fi
86 }

Subscribers

People subscribed via source and target branches

to all changes: