mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
Merge mysql.com:/users/lthalmann/bk/MERGE/mysql-5.0-merge
into mysql.com:/users/lthalmann/bk/MERGE/mysql-5.1-merge sql/sql_yacc.yy: Auto merged client/mysqldump.c: Manual merge (rpl 5.0 -> rpl 5.1) mysql-test/r/mysqldump.result: Manual merge (rpl 5.0 -> rpl 5.1) mysql-test/t/mysqldump.test: Manual merge (rpl 5.0 -> rpl 5.1)
This commit is contained in:
@@ -3550,6 +3550,8 @@ static char *primary_key_fields(const char *table_name)
|
|||||||
char show_keys_buff[15 + NAME_LEN * 2 + 3];
|
char show_keys_buff[15 + NAME_LEN * 2 + 3];
|
||||||
uint result_length= 0;
|
uint result_length= 0;
|
||||||
char *result= 0;
|
char *result= 0;
|
||||||
|
char buff[NAME_LEN * 2 + 3];
|
||||||
|
char *quoted_field;
|
||||||
|
|
||||||
my_snprintf(show_keys_buff, sizeof(show_keys_buff),
|
my_snprintf(show_keys_buff, sizeof(show_keys_buff),
|
||||||
"SHOW KEYS FROM %s", table_name);
|
"SHOW KEYS FROM %s", table_name);
|
||||||
@@ -3573,8 +3575,10 @@ static char *primary_key_fields(const char *table_name)
|
|||||||
{
|
{
|
||||||
/* Key is unique */
|
/* Key is unique */
|
||||||
do
|
do
|
||||||
result_length += strlen(row[4]) + 1; /* + 1 for ',' or \0 */
|
{
|
||||||
while ((row = mysql_fetch_row(res)) && atoi(row[3]) > 1);
|
quoted_field= quote_name(row[4], buff, 0);
|
||||||
|
result_length+= strlen(quoted_field) + 1; /* + 1 for ',' or \0 */
|
||||||
|
} while ((row= mysql_fetch_row(res)) && atoi(row[3]) > 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Build the ORDER BY clause result */
|
/* Build the ORDER BY clause result */
|
||||||
@@ -3590,9 +3594,13 @@ static char *primary_key_fields(const char *table_name)
|
|||||||
}
|
}
|
||||||
mysql_data_seek(res, 0);
|
mysql_data_seek(res, 0);
|
||||||
row= mysql_fetch_row(res);
|
row= mysql_fetch_row(res);
|
||||||
end = strmov(result, row[4]);
|
quoted_field= quote_name(row[4], buff, 0);
|
||||||
|
end= strmov(result, quoted_field);
|
||||||
while ((row= mysql_fetch_row(res)) && atoi(row[3]) > 1)
|
while ((row= mysql_fetch_row(res)) && atoi(row[3]) > 1)
|
||||||
end = strxmov(end, ",", row[4], NullS);
|
{
|
||||||
|
quoted_field= quote_name(row[4], buff, 0);
|
||||||
|
end= strxmov(end, ",", quoted_field, NullS);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
|
@@ -2925,6 +2925,131 @@ mysqldump: Couldn't execute 'SHOW MASTER STATUS': Access denied; you need the SU
|
|||||||
grant REPLICATION CLIENT on *.* to mysqltest_1@localhost;
|
grant REPLICATION CLIENT on *.* to mysqltest_1@localhost;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
drop user mysqltest_1@localhost;
|
drop user mysqltest_1@localhost;
|
||||||
|
|
||||||
|
|
||||||
|
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||||
|
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||||
|
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||||
|
/*!40101 SET NAMES utf8 */;
|
||||||
|
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
||||||
|
/*!40103 SET TIME_ZONE='+00:00' */;
|
||||||
|
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||||
|
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||||
|
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||||
|
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||||
|
|
||||||
|
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_tables` /*!40100 DEFAULT CHARACTER SET latin1 */;
|
||||||
|
|
||||||
|
USE `mysqldump_tables`;
|
||||||
|
DROP TABLE IF EXISTS `basetable`;
|
||||||
|
CREATE TABLE `basetable` (
|
||||||
|
`id` bigint(20) unsigned NOT NULL auto_increment,
|
||||||
|
`tag` varchar(64) default NULL,
|
||||||
|
UNIQUE KEY `id` (`id`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||||
|
|
||||||
|
LOCK TABLES `basetable` WRITE;
|
||||||
|
/*!40000 ALTER TABLE `basetable` DISABLE KEYS */;
|
||||||
|
/*!40000 ALTER TABLE `basetable` ENABLE KEYS */;
|
||||||
|
UNLOCK TABLES;
|
||||||
|
|
||||||
|
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_views` /*!40100 DEFAULT CHARACTER SET latin1 */;
|
||||||
|
|
||||||
|
USE `mysqldump_views`;
|
||||||
|
DROP TABLE IF EXISTS `nasishnasifu`;
|
||||||
|
/*!50001 DROP VIEW IF EXISTS `nasishnasifu`*/;
|
||||||
|
/*!50001 CREATE TABLE `nasishnasifu` (
|
||||||
|
`id` bigint(20) unsigned
|
||||||
|
) */;
|
||||||
|
/*!50001 DROP TABLE IF EXISTS `nasishnasifu`*/;
|
||||||
|
/*!50001 DROP VIEW IF EXISTS `nasishnasifu`*/;
|
||||||
|
/*!50001 CREATE ALGORITHM=UNDEFINED */
|
||||||
|
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
|
||||||
|
/*!50001 VIEW `mysqldump_views`.`nasishnasifu` AS select `mysqldump_tables`.`basetable`.`id` AS `id` from `mysqldump_tables`.`basetable` */;
|
||||||
|
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
||||||
|
|
||||||
|
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||||
|
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||||
|
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||||
|
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||||
|
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||||
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||||
|
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||||
|
|
||||||
|
drop view nasishnasifu;
|
||||||
|
drop database mysqldump_views;
|
||||||
|
drop table mysqldump_tables.basetable;
|
||||||
|
drop database mysqldump_tables;
|
||||||
|
USE test;
|
||||||
|
DROP TABLE IF EXISTS `t1`;
|
||||||
|
CREATE TABLE `t1` (
|
||||||
|
`a b` INT,
|
||||||
|
`c"d` INT,
|
||||||
|
`e``f` INT,
|
||||||
|
PRIMARY KEY (`a b`, `c"d`, `e``f`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||||
|
insert into t1 values (0815, 4711, 2006);
|
||||||
|
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
||||||
|
/*!40103 SET TIME_ZONE='+00:00' */;
|
||||||
|
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||||
|
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||||
|
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */;
|
||||||
|
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||||
|
DROP TABLE IF EXISTS "t1";
|
||||||
|
CREATE TABLE "t1" (
|
||||||
|
"a b" int(11) NOT NULL default '0',
|
||||||
|
"c""d" int(11) NOT NULL default '0',
|
||||||
|
"e`f" int(11) NOT NULL default '0',
|
||||||
|
PRIMARY KEY ("a b","c""d","e`f")
|
||||||
|
);
|
||||||
|
|
||||||
|
LOCK TABLES "t1" WRITE;
|
||||||
|
/*!40000 ALTER TABLE "t1" DISABLE KEYS */;
|
||||||
|
INSERT INTO "t1" VALUES (815,4711,2006);
|
||||||
|
/*!40000 ALTER TABLE "t1" ENABLE KEYS */;
|
||||||
|
UNLOCK TABLES;
|
||||||
|
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
||||||
|
|
||||||
|
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||||
|
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||||
|
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||||
|
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||||
|
|
||||||
|
|
||||||
|
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||||
|
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||||
|
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||||
|
/*!40101 SET NAMES utf8 */;
|
||||||
|
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
||||||
|
/*!40103 SET TIME_ZONE='+00:00' */;
|
||||||
|
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||||
|
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||||
|
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||||
|
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||||
|
DROP TABLE IF EXISTS `t1`;
|
||||||
|
CREATE TABLE `t1` (
|
||||||
|
`a b` int(11) NOT NULL default '0',
|
||||||
|
`c"d` int(11) NOT NULL default '0',
|
||||||
|
`e``f` int(11) NOT NULL default '0',
|
||||||
|
PRIMARY KEY (`a b`,`c"d`,`e``f`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||||
|
|
||||||
|
LOCK TABLES `t1` WRITE;
|
||||||
|
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
|
||||||
|
INSERT INTO `t1` VALUES (815,4711,2006);
|
||||||
|
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
|
||||||
|
UNLOCK TABLES;
|
||||||
|
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
||||||
|
|
||||||
|
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||||
|
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||||
|
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||||
|
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||||
|
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||||
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||||
|
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||||
|
|
||||||
|
DROP TABLE `t1`;
|
||||||
End of 5.0 tests
|
End of 5.0 tests
|
||||||
create table t1 (a text , b text);
|
create table t1 (a text , b text);
|
||||||
create table t2 (a text , b text);
|
create table t2 (a text , b text);
|
||||||
|
@@ -1281,6 +1281,7 @@ use mysqldump_dbb;
|
|||||||
drop view v1;
|
drop view v1;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
drop database mysqldump_dbb;
|
drop database mysqldump_dbb;
|
||||||
|
|
||||||
#
|
#
|
||||||
# Bug#21215 mysqldump creating incomplete backups without warning
|
# Bug#21215 mysqldump creating incomplete backups without warning
|
||||||
#
|
#
|
||||||
@@ -1326,6 +1327,25 @@ grant REPLICATION CLIENT on *.* to mysqltest_1@localhost;
|
|||||||
drop table t1;
|
drop table t1;
|
||||||
drop user mysqltest_1@localhost;
|
drop user mysqltest_1@localhost;
|
||||||
|
|
||||||
|
--exec $MYSQL_DUMP --skip-comments --databases mysqldump_tables mysqldump_views;
|
||||||
|
|
||||||
|
#
|
||||||
|
# BUG#13926: --order-by-primary fails if PKEY contains quote character
|
||||||
|
#
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS `t1`;
|
||||||
|
CREATE TABLE `t1` (
|
||||||
|
`a b` INT,
|
||||||
|
`c"d` INT,
|
||||||
|
`e``f` INT,
|
||||||
|
PRIMARY KEY (`a b`, `c"d`, `e``f`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||||
|
insert into t1 values (0815, 4711, 2006);
|
||||||
|
|
||||||
|
--exec $MYSQL_DUMP --skip-comments --compatible=ansi --order-by-primary test t1
|
||||||
|
--exec $MYSQL_DUMP --skip-comments --order-by-primary test t1
|
||||||
|
DROP TABLE `t1`;
|
||||||
|
--enable_warnings
|
||||||
--echo End of 5.0 tests
|
--echo End of 5.0 tests
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@@ -8744,6 +8744,9 @@ load: LOAD DATA_SYM
|
|||||||
YYABORT;
|
YYABORT;
|
||||||
}
|
}
|
||||||
lex->sql_command = SQLCOM_LOAD_MASTER_TABLE;
|
lex->sql_command = SQLCOM_LOAD_MASTER_TABLE;
|
||||||
|
WARN_DEPRECATED("LOAD TABLE FROM MASTER",
|
||||||
|
"mysqldump or future "
|
||||||
|
"BACKUP/RESTORE DATABASE facility");
|
||||||
if (!Select->add_table_to_list(YYTHD, $3, NULL, TL_OPTION_UPDATING))
|
if (!Select->add_table_to_list(YYTHD, $3, NULL, TL_OPTION_UPDATING))
|
||||||
YYABORT;
|
YYABORT;
|
||||||
};
|
};
|
||||||
@@ -8782,6 +8785,9 @@ load_data:
|
|||||||
FROM MASTER_SYM
|
FROM MASTER_SYM
|
||||||
{
|
{
|
||||||
Lex->sql_command = SQLCOM_LOAD_MASTER_DATA;
|
Lex->sql_command = SQLCOM_LOAD_MASTER_DATA;
|
||||||
|
WARN_DEPRECATED("LOAD DATA FROM MASTER",
|
||||||
|
"mysqldump or future "
|
||||||
|
"BACKUP/RESTORE DATABASE facility");
|
||||||
};
|
};
|
||||||
|
|
||||||
opt_local:
|
opt_local:
|
||||||
|
Reference in New Issue
Block a user