Loading mysql-test/r/view.result +18 −0 Original line number Diff line number Diff line Loading @@ -1694,3 +1694,21 @@ col1 col2 col2 col3 5 david NULL NULL DROP VIEW v1,v2,v3; DROP TABLE t1,t2; create table t1 as select 1 A union select 2 union select 3; create table t2 as select * from t1; create view v1 as select * from t1 where a in (select * from t2); select * from v1 A, v1 B where A.a = B.a; A A 1 1 2 2 3 3 create table t3 as select a a,a b from t2; create view v2 as select * from t3 where a in (select * from t1) or b in (select * from t2); select * from v2 A, v2 B where A.a = B.b; a b a b 1 1 1 1 2 2 2 2 3 3 3 3 drop view v1, v2; drop table t1, t2, t3; mysql-test/t/view.test +14 −0 Original line number Diff line number Diff line Loading @@ -1519,3 +1519,17 @@ SELECT a.col1,a.col2,b.col2,b.col3 DROP VIEW v1,v2,v3; DROP TABLE t1,t2; # BUG#8490 Select from views containing subqueries causes server to hang # forever. create table t1 as select 1 A union select 2 union select 3; create table t2 as select * from t1; create view v1 as select * from t1 where a in (select * from t2); select * from v1 A, v1 B where A.a = B.a; create table t3 as select a a,a b from t2; create view v2 as select * from t3 where a in (select * from t1) or b in (select * from t2); select * from v2 A, v2 B where A.a = B.b; drop view v1, v2; drop table t1, t2, t3; scripts/mysql_tableinfo.sh +25 −7 Original line number Diff line number Diff line Loading @@ -6,6 +6,14 @@ use DBI; =head1 NAME WARNING: MySQL versions 5.0 and above feature the INFORMATION_SCHEMA pseudo-database which contains always up-to-date metadata information about all tables. So instead of using this script one can now simply query the INFORMATION_SCHEMA.SCHEMATA, INFORMATION_SCHEMA.TABLES, INFORMATION_SCHEMA.COLUMNS, INFORMATION_SCHEMA.STATISTICS pseudo-tables. Please see the MySQL manual for more information about INFORMATION_SCHEMA. This script will be removed from the MySQL distribution in version 5.1. mysql_tableinfo - creates and populates information tables with the output of SHOW DATABASES, SHOW TABLES (or SHOW TABLE STATUS), SHOW COLUMNS and SHOW INDEX. Loading Loading @@ -62,6 +70,19 @@ GetOptions( \%opt, "quiet|q", ) or usage("Invalid option"); if (!$opt{'quiet'}) { print <<EOF WARNING: MySQL versions 5.0 and above feature the INFORMATION_SCHEMA pseudo-database which contains always up-to-date metadata information about all tables. So instead of using this script one can now simply query the INFORMATION_SCHEMA.SCHEMATA, INFORMATION_SCHEMA.TABLES, INFORMATION_SCHEMA.COLUMNS, INFORMATION_SCHEMA.STATISTICS pseudo-tables. Please see the MySQL manual for more information about INFORMATION_SCHEMA. This script will be removed from the MySQL distribution in version 5.1. EOF } if ($opt{'help'}) {usage();} my ($db_to_write,$db_like_wild,$tbl_like_wild); Loading Loading @@ -104,7 +125,7 @@ $tbl_like_wild=$dbh->quote($tbl_like_wild); if (!$opt{'quiet'}) { print "\n!! This program is doing to do:\n\n"; print "\n!! This program is going to do:\n\n"; print "**DROP** TABLE ...\n" if ($opt{'clear'} or $opt{'clear-only'}); print "**DELETE** FROM ... WHERE `Database` LIKE $db_like_wild AND `Table` LIKE $tbl_like_wild **INSERT** INTO ... Loading Loading @@ -456,17 +477,14 @@ UNIX domain socket to use when connecting to server =head1 WARRANTY This software is free and comes without warranty of any kind. You should never trust backup software without studying the code yourself. Study the code inside this script and only rely on it if I<you> believe that it does the right thing for you. This software is free and comes without warranty of any kind. Patches adding bug fixes, documentation and new features are welcome. =head1 TO DO Use extended inserts to be faster (for servers with many databases or tables). But to do that, must care about net-buffer-length. Nothing: starting from MySQL 5.0, this program is replaced by the INFORMATION_SCHEMA pseudo-database. =head1 AUTHOR Loading sql/ha_ndbcluster.cc +13 −4 Original line number Diff line number Diff line Loading @@ -4479,6 +4479,7 @@ int ndbcluster_drop_database(const char *path) uint i; char *tabname; List<char> drop_list; int ret= 0; ha_ndbcluster::set_dbname(path, (char *)&dbname); DBUG_PRINT("enter", ("db: %s", dbname)); Loading @@ -4505,10 +4506,18 @@ int ndbcluster_drop_database(const char *path) ndb->setDatabaseName(dbname); List_iterator_fast<char> it(drop_list); while ((tabname=it++)) { if (dict->dropTable(tabname)) ERR_RETURN(dict->getNdbError()); DBUG_RETURN(0); { const NdbError err= dict->getNdbError(); if (err.code != 709) { ERR_PRINT(err); ret= ndb_to_mysql_error(&err); } } } DBUG_RETURN(ret); } Loading sql/item_timefunc.cc +2 −2 Original line number Diff line number Diff line Loading @@ -814,14 +814,14 @@ static bool calc_time_diff(TIME *l_time1, TIME *l_time2, int l_sign, We should check it before calc_time_diff call. */ if (l_time1->time_type == MYSQL_TIMESTAMP_TIME) // Time value days= l_time1->day - l_sign*l_time2->day; days= (long)l_time1->day - l_sign * (long)l_time2->day; else { days= calc_daynr((uint) l_time1->year, (uint) l_time1->month, (uint) l_time1->day); if (l_time2->time_type == MYSQL_TIMESTAMP_TIME) days-= l_sign*l_time2->day; days-= l_sign * (long)l_time2->day; else days-= l_sign*calc_daynr((uint) l_time2->year, (uint) l_time2->month, Loading Loading
mysql-test/r/view.result +18 −0 Original line number Diff line number Diff line Loading @@ -1694,3 +1694,21 @@ col1 col2 col2 col3 5 david NULL NULL DROP VIEW v1,v2,v3; DROP TABLE t1,t2; create table t1 as select 1 A union select 2 union select 3; create table t2 as select * from t1; create view v1 as select * from t1 where a in (select * from t2); select * from v1 A, v1 B where A.a = B.a; A A 1 1 2 2 3 3 create table t3 as select a a,a b from t2; create view v2 as select * from t3 where a in (select * from t1) or b in (select * from t2); select * from v2 A, v2 B where A.a = B.b; a b a b 1 1 1 1 2 2 2 2 3 3 3 3 drop view v1, v2; drop table t1, t2, t3;
mysql-test/t/view.test +14 −0 Original line number Diff line number Diff line Loading @@ -1519,3 +1519,17 @@ SELECT a.col1,a.col2,b.col2,b.col3 DROP VIEW v1,v2,v3; DROP TABLE t1,t2; # BUG#8490 Select from views containing subqueries causes server to hang # forever. create table t1 as select 1 A union select 2 union select 3; create table t2 as select * from t1; create view v1 as select * from t1 where a in (select * from t2); select * from v1 A, v1 B where A.a = B.a; create table t3 as select a a,a b from t2; create view v2 as select * from t3 where a in (select * from t1) or b in (select * from t2); select * from v2 A, v2 B where A.a = B.b; drop view v1, v2; drop table t1, t2, t3;
scripts/mysql_tableinfo.sh +25 −7 Original line number Diff line number Diff line Loading @@ -6,6 +6,14 @@ use DBI; =head1 NAME WARNING: MySQL versions 5.0 and above feature the INFORMATION_SCHEMA pseudo-database which contains always up-to-date metadata information about all tables. So instead of using this script one can now simply query the INFORMATION_SCHEMA.SCHEMATA, INFORMATION_SCHEMA.TABLES, INFORMATION_SCHEMA.COLUMNS, INFORMATION_SCHEMA.STATISTICS pseudo-tables. Please see the MySQL manual for more information about INFORMATION_SCHEMA. This script will be removed from the MySQL distribution in version 5.1. mysql_tableinfo - creates and populates information tables with the output of SHOW DATABASES, SHOW TABLES (or SHOW TABLE STATUS), SHOW COLUMNS and SHOW INDEX. Loading Loading @@ -62,6 +70,19 @@ GetOptions( \%opt, "quiet|q", ) or usage("Invalid option"); if (!$opt{'quiet'}) { print <<EOF WARNING: MySQL versions 5.0 and above feature the INFORMATION_SCHEMA pseudo-database which contains always up-to-date metadata information about all tables. So instead of using this script one can now simply query the INFORMATION_SCHEMA.SCHEMATA, INFORMATION_SCHEMA.TABLES, INFORMATION_SCHEMA.COLUMNS, INFORMATION_SCHEMA.STATISTICS pseudo-tables. Please see the MySQL manual for more information about INFORMATION_SCHEMA. This script will be removed from the MySQL distribution in version 5.1. EOF } if ($opt{'help'}) {usage();} my ($db_to_write,$db_like_wild,$tbl_like_wild); Loading Loading @@ -104,7 +125,7 @@ $tbl_like_wild=$dbh->quote($tbl_like_wild); if (!$opt{'quiet'}) { print "\n!! This program is doing to do:\n\n"; print "\n!! This program is going to do:\n\n"; print "**DROP** TABLE ...\n" if ($opt{'clear'} or $opt{'clear-only'}); print "**DELETE** FROM ... WHERE `Database` LIKE $db_like_wild AND `Table` LIKE $tbl_like_wild **INSERT** INTO ... Loading Loading @@ -456,17 +477,14 @@ UNIX domain socket to use when connecting to server =head1 WARRANTY This software is free and comes without warranty of any kind. You should never trust backup software without studying the code yourself. Study the code inside this script and only rely on it if I<you> believe that it does the right thing for you. This software is free and comes without warranty of any kind. Patches adding bug fixes, documentation and new features are welcome. =head1 TO DO Use extended inserts to be faster (for servers with many databases or tables). But to do that, must care about net-buffer-length. Nothing: starting from MySQL 5.0, this program is replaced by the INFORMATION_SCHEMA pseudo-database. =head1 AUTHOR Loading
sql/ha_ndbcluster.cc +13 −4 Original line number Diff line number Diff line Loading @@ -4479,6 +4479,7 @@ int ndbcluster_drop_database(const char *path) uint i; char *tabname; List<char> drop_list; int ret= 0; ha_ndbcluster::set_dbname(path, (char *)&dbname); DBUG_PRINT("enter", ("db: %s", dbname)); Loading @@ -4505,10 +4506,18 @@ int ndbcluster_drop_database(const char *path) ndb->setDatabaseName(dbname); List_iterator_fast<char> it(drop_list); while ((tabname=it++)) { if (dict->dropTable(tabname)) ERR_RETURN(dict->getNdbError()); DBUG_RETURN(0); { const NdbError err= dict->getNdbError(); if (err.code != 709) { ERR_PRINT(err); ret= ndb_to_mysql_error(&err); } } } DBUG_RETURN(ret); } Loading
sql/item_timefunc.cc +2 −2 Original line number Diff line number Diff line Loading @@ -814,14 +814,14 @@ static bool calc_time_diff(TIME *l_time1, TIME *l_time2, int l_sign, We should check it before calc_time_diff call. */ if (l_time1->time_type == MYSQL_TIMESTAMP_TIME) // Time value days= l_time1->day - l_sign*l_time2->day; days= (long)l_time1->day - l_sign * (long)l_time2->day; else { days= calc_daynr((uint) l_time1->year, (uint) l_time1->month, (uint) l_time1->day); if (l_time2->time_type == MYSQL_TIMESTAMP_TIME) days-= l_sign*l_time2->day; days-= l_sign * (long)l_time2->day; else days-= l_sign*calc_daynr((uint) l_time2->year, (uint) l_time2->month, Loading