summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authorunknown <pem@mysql.comhem.se>2004-11-11 16:00:50 +0100
committerunknown <pem@mysql.comhem.se>2004-11-11 16:00:50 +0100
commite5fd013fdf6c8664daa0bbdcaf0d22bf44e90d62 (patch)
treef80d33ecc8a7626ef5b8a09b942dd0db73238851 /sql/sql_base.cc
parent25fa68b7f3972b1accbc2d484d176adca4f33314 (diff)
downloadmariadb-git-e5fd013fdf6c8664daa0bbdcaf0d22bf44e90d62.tar.gz
Fixing filename case problems in sql_base.cc for views on MacOS X. (With help from sanja :)
sql/sql_base.cc: Fixing filename case problems for views on MacOS X. (With help from sanja :)
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 4fae481e5f2..1cee6d2c3a6 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -582,6 +582,7 @@ TABLE_LIST *find_table_in_list(TABLE_LIST *table,
if ((!strcmp(table->db, db_name) &&
!strcmp(table->real_name, table_name)) ||
(table->view &&
+ table->table->table_cache_key && // it is not temporary table
!my_strcasecmp(table_alias_charset,
table->table->table_cache_key, db_name) &&
!my_strcasecmp(table_alias_charset,
@@ -626,6 +627,9 @@ TABLE_LIST* unique_table(TABLE_LIST *table, TABLE_LIST *table_list)
TABLE_LIST *res;
const char *d_name= table->db, *t_name= table->real_name;
char d_name_buff[MAX_ALIAS_NAME], t_name_buff[MAX_ALIAS_NAME];
+ /* temporary table is always unique */
+ if (table->table && table->table->tmp_table != NO_TMP_TABLE)
+ return 0;
if (table->view)
{
/* it is view and table opened */
@@ -643,11 +647,6 @@ TABLE_LIST* unique_table(TABLE_LIST *table, TABLE_LIST *table_list)
d_name= table->table->table_cache_key;
t_name= table->table->table_name;
}
- if (d_name == 0)
- {
- /* it's temporary table => always unique */
- return 0;
- }
}
DBUG_PRINT("info", ("real table: %s.%s", d_name, t_name));