summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/suite/federated/federated_partition.result9
-rw-r--r--mysql-test/suite/federated/federated_partition.test3
-rw-r--r--sql/ha_partition.cc7
-rw-r--r--sql/partition_element.h2
-rw-r--r--sql/sql_partition.cc3
-rw-r--r--unittest/mytap/tap.c5
6 files changed, 25 insertions, 4 deletions
diff --git a/mysql-test/suite/federated/federated_partition.result b/mysql-test/suite/federated/federated_partition.result
index ebcafca4563..26a6443ffad 100644
--- a/mysql-test/suite/federated/federated_partition.result
+++ b/mysql-test/suite/federated/federated_partition.result
@@ -9,6 +9,15 @@ partition by list (s1)
connection='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1_1',
partition p2 values in (2,4)
connection='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1_2');
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `s1` int(11) NOT NULL,
+ PRIMARY KEY (`s1`)
+) ENGINE=FEDERATED DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (s1)
+(PARTITION p1 VALUES IN (1,3) CONNECTION = 'mysql://root@127.0.0.1:SLAVE_PORT/federated/t1_1' ENGINE = FEDERATED,
+ PARTITION p2 VALUES IN (2,4) CONNECTION = 'mysql://root@127.0.0.1:SLAVE_PORT/federated/t1_2' ENGINE = FEDERATED) */
insert into t1 values (1), (2), (3), (4);
select * from t1;
s1
diff --git a/mysql-test/suite/federated/federated_partition.test b/mysql-test/suite/federated/federated_partition.test
index 223dab6af16..6f093bfb63d 100644
--- a/mysql-test/suite/federated/federated_partition.test
+++ b/mysql-test/suite/federated/federated_partition.test
@@ -30,6 +30,9 @@ eval create table t1 (s1 int primary key) engine=federated
partition p2 values in (2,4)
connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1_2');
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+show create table t1;
+
insert into t1 values (1), (2), (3), (4);
select * from t1;
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 89d584ef5e1..323cf24ef04 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -2237,9 +2237,10 @@ bool ha_partition::create_handler_file(const char *name)
part_elem= part_it++;
uint length = part_elem->connect_string.length;
int4store(buffer, length);
- result= (my_write(file, buffer, 4, MYF(MY_WME | MY_NABP)) ||
- my_write(file, (uchar *) part_elem->connect_string.str, length,
- MYF(MY_WME | MY_NABP)));
+ if (my_write(file, buffer, 4, MYF(MY_WME | MY_NABP)) ||
+ my_write(file, (uchar *) part_elem->connect_string.str, length,
+ MYF(MY_WME | MY_NABP)))
+ result= TRUE;
}
VOID(my_close(file, MYF(0)));
}
diff --git a/sql/partition_element.h b/sql/partition_element.h
index 382abfc27ca..a0e74a6830f 100644
--- a/sql/partition_element.h
+++ b/sql/partition_element.h
@@ -98,6 +98,8 @@ public:
nodegroup_id(part_elem->nodegroup_id),
has_null_value(FALSE)
{
+ connect_string.str= 0;
+ connect_string.length= 0;
}
~partition_element() {}
};
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index ffa19ae0431..01fb0a299bf 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -1983,6 +1983,9 @@ static int add_partition_options(File fptr, partition_element *p_elem)
}
if (p_elem->part_comment)
err+= add_keyword_string(fptr, "COMMENT", TRUE, p_elem->part_comment);
+ if (p_elem->connect_string.length)
+ err+= add_keyword_string(fptr, "CONNECTION", TRUE,
+ p_elem->connect_string.str);
return err + add_engine(fptr,p_elem->engine_type);
}
diff --git a/unittest/mytap/tap.c b/unittest/mytap/tap.c
index 550920d9d3e..1792c82519b 100644
--- a/unittest/mytap/tap.c
+++ b/unittest/mytap/tap.c
@@ -126,7 +126,7 @@ emit_endl()
static void
handle_core_signal(int signo)
{
- BAIL_OUT("Signal %d thrown", signo);
+ BAIL_OUT("Signal %d thrown\n", signo);
}
void
@@ -136,6 +136,8 @@ BAIL_OUT(char const *fmt, ...)
va_start(ap, fmt);
fprintf(tapout, "Bail out! ");
vfprintf(tapout, fmt, ap);
+ diag("%d tests planned, %d failed, %d was last executed",
+ g_test.plan, g_test.failed, g_test.last);
emit_endl();
va_end(ap);
exit(255);
@@ -159,6 +161,7 @@ typedef struct signal_entry {
} signal_entry;
static signal_entry install_signal[]= {
+ { SIGINT, handle_core_signal },
{ SIGQUIT, handle_core_signal },
{ SIGILL, handle_core_signal },
{ SIGABRT, handle_core_signal },