Skip to content

Commit db8f0da

Browse files
committed
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.
1 parent 676f43d commit db8f0da

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

storage/connect/ha_connect.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1815,7 +1815,9 @@ PCSZ ha_connect::GetDBName(PCSZ name)
18151815

18161816
const char *ha_connect::GetTableName(void)
18171817
{
1818-
return tshp ? tshp->table_name.str : table_share->table_name.str;
1818+
const char *path= tshp ? tshp->path.str : table_share->path.str;
1819+
const char *name= strrchr(path, '/');
1820+
return name ? name+1 : path;
18191821
} // end of GetTableName
18201822

18211823
char *ha_connect::GetPartName(void)

0 commit comments

Comments
 (0)