summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/sql_table.cc6
-rw-r--r--storage/federated/ha_federated.cc4
2 files changed, 7 insertions, 3 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index e8de6a6928a..096e3d6be0f 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -5365,6 +5365,10 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
if (create_info->storage_media == HA_SM_DEFAULT)
create_info->storage_media= table->s->default_storage_media;
+ /* Creation of federated table with LIKE clause needs connection string */
+ if (!(used_fields & HA_CREATE_USED_CONNECTION))
+ create_info->connect_string= table->s->connect_string;
+
restore_record(table, s->default_values); // Empty record for DEFAULT
Create_field *def;
diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc
index 541b3327ad4..8209b5a2fcf 100644
--- a/storage/federated/ha_federated.cc
+++ b/storage/federated/ha_federated.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -2944,7 +2944,7 @@ int ha_federated::info(uint flag)
}
- if (flag & HA_STATUS_AUTO)
+ if ((flag & HA_STATUS_AUTO) && mysql)
stats.auto_increment_value= mysql->insert_id;
mysql_free_result(result);