Below is the list of changes that have just been committed into a local
4.1 repository of magnus. When magnus does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://www.mysql.com/doc/I/n/Installing_source_tree.html
ChangeSet
1.2065 04/10/08 13:37:13 magnus@neptunus.(none) +3 -0
BUG#5973 ndb table belonging to different database shows up in SHOW TABLES
sql/ha_ndbcluster.cc
1.93 04/10/08 13:36:55 magnus@neptunus.(none) +6 -2
Only find files for the current db
Only add files to files list which can be created i.e has a valid frm blob. This prevents NDB$BLOB tables and tables created from NdbApi to show up.
mysql-test/t/ndb_autodiscover.test
1.10 04/10/08 13:36:55 magnus@neptunus.(none) +25 -0
Added test cases to check that SHOW TABLES only show tables in the selected db.
mysql-test/r/ndb_autodiscover.result
1.9 04/10/08 13:36:54 magnus@neptunus.(none) +28 -0
Added test cases to check that SHOW TABLES only show tables in the selected db.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: magnus
# Host: neptunus.(none)
# Root: /home/magnus/mysql/mysql-4.1
--- 1.8/mysql-test/r/ndb_autodiscover.result Thu Sep 30 14:20:12 2004
+++ 1.9/mysql-test/r/ndb_autodiscover.result Fri Oct 8 13:36:54 2004
@@ -330,6 +330,34 @@
Variable_name Value
Handler_discover 0
drop table t6;
+show tables;
+Tables_in_test
+create table t1 (a int) engine=ndb;
+show tables;
+Tables_in_test
+t1
+create database test2;
+use test2;
+show tables;
+Tables_in_test2
+select * from t1;
+ERROR 42S02: Table 'test2.t1' doesn't exist
+create table t2 (b int) engine=ndb;
+use test;
+select * from t1;
+a
+show tables;
+Tables_in_test
+t1
+drop table t1;
+use test2;
+drop table t2;
+drop database test2;
+show databases;
+Database
+mysql
+test
+use test;
CREATE TABLE t9 (
a int NOT NULL PRIMARY KEY,
b int
--- 1.9/mysql-test/t/ndb_autodiscover.test Thu Sep 30 14:20:12 2004
+++ 1.10/mysql-test/t/ndb_autodiscover.test Fri Oct 8 13:36:55 2004
@@ -427,6 +427,31 @@
drop table t6;
+#####################################################
+# Test that only tables in the current database shows
+# up in SHOW TABLES
+#
+
+show tables;
+
+create table t1 (a int) engine=ndb;
+show tables;
+create database test2;
+use test2;
+show tables;
+--error 1146
+select * from t1;
+create table t2 (b int) engine=ndb;
+use test;
+select * from t1;
+show tables;
+drop table t1;
+use test2;
+drop table t2;
+drop database test2;
+show databases;
+use test;
+
######################################################
# Note! This should always be the last step in this
# file, the table t9 will be used and dropped
--- 1.92/sql/ha_ndbcluster.cc Thu Oct 7 18:01:36 2004
+++ 1.93/sql/ha_ndbcluster.cc Fri Oct 8 13:36:55 2004
@@ -3844,6 +3844,10 @@
NdbDictionary::Dictionary::List::Element& t= list.elements[i];
DBUG_PRINT("info", ("Found %s/%s in NDB", t.database, t.name));
+ // Add only tables that belongs to db
+ if (my_strcasecmp(system_charset_info, t.database, db))
+ continue;
+
// Apply wildcard to list of tables in NDB
if (wild)
{
@@ -3938,8 +3942,8 @@
while ((file_name=it2++))
{
DBUG_PRINT("info", ("Table %s need discovery", name));
- ha_create_table_from_engine(thd, db, file_name, true);
- files->push_back(thd->strdup(file_name));
+ if (ha_create_table_from_engine(thd, db, file_name, true) == 0)
+ files->push_back(thd->strdup(file_name));
}
pthread_mutex_unlock(&LOCK_open);
| Thread |
|---|
| • bk commit into 4.1 tree (magnus:1.2065) | msvensson | 8 Oct |