summaryrefslogtreecommitdiff
path: root/sql/table.cc
diff options
context:
space:
mode:
authorunknown <pem@mysql.com>2006-03-03 12:03:27 +0100
committerunknown <pem@mysql.com>2006-03-03 12:03:27 +0100
commit5a78cd7a7294f7a930389874f64d6c252f485704 (patch)
treee2df16ff96563c43b76904332f584b344892a56f /sql/table.cc
parent104b9e789a60c8881e6e82cbbf7b8d919ff1bbf1 (diff)
parente2ba74b8252586bd27ace8603aab33c76b2b50cd (diff)
downloadmariadb-git-5a78cd7a7294f7a930389874f64d6c252f485704.tar.gz
Merge mysql.com:/extern/mysql/5.0/bug17476/mysql-5.0
into mysql.com:/extern/mysql/5.1/generic/mysql-5.1-new mysql-test/mysql-test-run.pl: Auto merged mysql-test/mysql-test-run.sh: Auto merged mysql-test/r/grant2.result: Auto merged mysql-test/r/sp.result: Auto merged mysql-test/t/grant2.test: Auto merged mysql-test/t/skip_grants.test: Auto merged mysql-test/t/sp.test: Auto merged scripts/make_binary_distribution.sh: Auto merged sql/field_conv.cc: Auto merged sql/item.h: Auto merged sql/item_timefunc.cc: Auto merged sql/sql_udf.cc: Auto merged VC++Files/mysql.sln: Manual merge (use local). configure.in: Manual merge. sql/table.cc: Manual merge.
Diffstat (limited to 'sql/table.cc')
-rw-r--r--sql/table.cc19
1 files changed, 17 insertions, 2 deletions
diff --git a/sql/table.cc b/sql/table.cc
index 3e766fe6c0f..d6a715ae1b4 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -3336,8 +3336,15 @@ const char *Natural_join_column::db_name()
if (view_field)
return table_ref->view_db.str;
+ /*
+ Test that TABLE_LIST::db is the same as st_table_share::db to
+ ensure consistency. An exception are I_S schema tables, which
+ are inconsistent in this respect.
+ */
DBUG_ASSERT(!strcmp(table_ref->db,
- table_ref->table->s->db.str));
+ table_ref->table->s->db.str) ||
+ (table_ref->schema_table &&
+ table_ref->table->s->db.str[0] == 0));
return table_ref->db;
}
@@ -3539,7 +3546,15 @@ const char *Field_iterator_table_ref::db_name()
else if (table_ref->is_natural_join)
return natural_join_it.column_ref()->db_name();
- DBUG_ASSERT(!strcmp(table_ref->db, table_ref->table->s->db.str));
+ /*
+ Test that TABLE_LIST::db is the same as st_table_share::db to
+ ensure consistency. An exception are I_S schema tables, which
+ are inconsistent in this respect.
+ */
+ DBUG_ASSERT(!strcmp(table_ref->db, table_ref->table->s->db.str) ||
+ (table_ref->schema_table &&
+ table_ref->table->s->db.str[0] == 0));
+
return table_ref->db;
}