From db8f0daeb4f86dd5fab1fba292b6682fa4413e8b Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 3 Feb 2019 18:43:42 +0100 Subject: [PATCH] CONNECT: calculate table_name from the path CONNECT used to compute table file path as table->s->db_name + table->s->table_name instead of using table->s->path. This was incorrect and now it breaks for temporary tables during ALTER TABLE. Temporarily "fix" it by making CONNECT to use what it always used as a table name - the last component in the table->s->path. --- storage/connect/ha_connect.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 3745cf6dae5..c5fd9483a65 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -1815,7 +1815,9 @@ PCSZ ha_connect::GetDBName(PCSZ name) const char *ha_connect::GetTableName(void) { - return tshp ? tshp->table_name.str : table_share->table_name.str; + const char *path= tshp ? tshp->path.str : table_share->path.str; + const char *name= strrchr(path, '/'); + return name ? name+1 : path; } // end of GetTableName char *ha_connect::GetPartName(void)