Below is the list of changes that have just been committed into a local
5.1 repository of iggy. When iggy 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://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2006-08-28 21:52:36-04:00, iggy@stripped +6 -0
Merge rolltop.ignatz42.dyndns.org:/mnt/storeage/mysql-5.0-maint_21527
into rolltop.ignatz42.dyndns.org:/mnt/storeage/mysql-5.1-new-maint_mergetest
MERGE: 1.1810.1697.131
client/mysqldump.c@stripped, 2006-08-28 21:52:33-04:00, iggy@stripped +0 -0
manual merge
MERGE: 1.214.1.24
include/mysql.h@stripped, 2006-08-28 21:50:54-04:00, iggy@stripped +0 -0
Auto merged
MERGE: 1.154.1.7
include/mysql_com.h@stripped, 2006-08-28 21:50:54-04:00, iggy@stripped +0 -0
Auto merged
MERGE: 1.100.1.5
mysql-test/r/mysqldump.result@stripped, 2006-08-28 21:52:33-04:00, iggy@stripped +6 -5
manual merge
MERGE: 1.83.1.28
mysql-test/t/mysqldump.test@stripped, 2006-08-28 21:52:33-04:00, iggy@stripped +2 -3
manual merge
MERGE: 1.76.1.25
sql-common/client.c@stripped, 2006-08-28 21:50:54-04:00, iggy@stripped +0 -0
Auto merged
MERGE: 1.83.1.14
# 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: iggy
# Host: rolltop.ignatz42.dyndns.org
# Root: /mnt/storeage/mysql-5.1-new-maint_mergetest/RESYNC
--- 1.245/client/mysqldump.c 2006-08-28 21:52:42 -04:00
+++ 1.246/client/mysqldump.c 2006-08-28 21:52:42 -04:00
@@ -430,7 +430,9 @@
int string_value);
static int dump_selected_tables(char *db, char **table_names, int tables);
static int dump_all_tables_in_db(char *db);
-static int init_dumping(char *);
+static int init_dumping_views(char *);
+static int init_dumping_tables(char *);
+static int init_dumping(char *, int init_func(char*));
static int dump_databases(char **);
static int dump_all_databases();
static char *quote_name(const char *name, char *buff, my_bool force);
@@ -2905,7 +2907,76 @@
} /* dump_databases */
-static int init_dumping(char *database)
+/*
+View Specific database initalization.
+
+SYNOPSIS
+ init_dumping_views
+ qdatabase quoted name of the database
+
+RETURN VALUES
+ 0 Success.
+ 1 Failure.
+*/
+int init_dumping_views(char *qdatabase)
+{
+ return 0;
+} /* init_dumping_views */
+
+
+/*
+Table Specific database initalization.
+
+SYNOPSIS
+ init_dumping_tables
+ qdatabase quoted name of the database
+
+RETURN VALUES
+ 0 Success.
+ 1 Failure.
+*/
+int init_dumping_tables(char *qdatabase)
+{
+ if (!opt_create_db)
+ {
+ char qbuf[256];
+ MYSQL_ROW row;
+ MYSQL_RES *dbinfo;
+
+ my_snprintf(qbuf, sizeof(qbuf),
+ "SHOW CREATE DATABASE IF NOT EXISTS %s",
+ qdatabase);
+
+ if (mysql_query(mysql, qbuf) || !(dbinfo = mysql_store_result(mysql)))
+ {
+ /* Old server version, dump generic CREATE DATABASE */
+ if (opt_drop_database)
+ fprintf(md_result_file,
+ "\n/*!40000 DROP DATABASE IF EXISTS %s;*/\n",
+ qdatabase);
+ fprintf(md_result_file,
+ "\nCREATE DATABASE /*!32312 IF NOT EXISTS*/ %s;\n",
+ qdatabase);
+ }
+ else
+ {
+ if (opt_drop_database)
+ fprintf(md_result_file,
+ "\n/*!40000 DROP DATABASE IF EXISTS %s*/;\n",
+ qdatabase);
+ row = mysql_fetch_row(dbinfo);
+ if (row[1])
+ {
+ fprintf(md_result_file,"\n%s;\n",row[1]);
+ }
+ }
+ }
+
+ return 0;
+} /* init_dumping_tables */
+
+
+static int init_dumping(char *database, int init_func(char*))
{
if (mysql_get_server_version(mysql) >= 50003 &&
!my_strcasecmp(&my_charset_latin1, database, "information_schema"))
@@ -2930,40 +3001,10 @@
fprintf(md_result_file,"\n--\n-- Current Database: %s\n--\n", qdatabase);
check_io(md_result_file);
}
- if (!opt_create_db)
- {
- char qbuf[256];
- MYSQL_ROW row;
- MYSQL_RES *dbinfo;
-
- my_snprintf(qbuf, sizeof(qbuf),
- "SHOW CREATE DATABASE IF NOT EXISTS %s",
- qdatabase);
-
- if (mysql_query(mysql, qbuf) || !(dbinfo = mysql_store_result(mysql)))
- {
- /* Old server version, dump generic CREATE DATABASE */
- if (opt_drop_database)
- fprintf(md_result_file,
- "\n/*!40000 DROP DATABASE IF EXISTS %s;*/\n",
- qdatabase);
- fprintf(md_result_file,
- "\nCREATE DATABASE /*!32312 IF NOT EXISTS*/ %s;\n",
- qdatabase);
- }
- else
- {
- if (opt_drop_database)
- fprintf(md_result_file,
- "\n/*!40000 DROP DATABASE IF EXISTS %s*/;\n",
- qdatabase);
- row = mysql_fetch_row(dbinfo);
- if (row[1])
- {
- fprintf(md_result_file,"\n%s;\n",row[1]);
- }
- }
- }
+
+ /* Call the view or table specific function */
+ init_func(qdatabase);
+
fprintf(md_result_file,"\nUSE %s;\n", qdatabase);
check_io(md_result_file);
}
@@ -2997,7 +3038,7 @@
if (!strcmp(database, NDB_REP_DB)) /* Skip cluster internal database */
return 0;
- if (init_dumping(database))
+ if (init_dumping(database, init_dumping_tables))
return 1;
if (opt_xml)
print_xml_tag1(md_result_file, "", "database name=", database, "\n");
@@ -3075,23 +3116,8 @@
uint numrows;
char table_buff[NAME_LEN*2+3];
- if (mysql_select_db(mysql, database))
- {
- DB_error(mysql, "when selecting the database");
+ if (init_dumping(database, init_dumping_views))
return 1;
- }
- if (opt_databases || opt_alldbs)
- {
- char quoted_database_buf[NAME_LEN*2+3];
- char *qdatabase= quote_name(database,quoted_database_buf,opt_quoted);
- if (opt_comments)
- {
- fprintf(md_result_file,"\n--\n-- Current Database: %s\n--\n", qdatabase);
- check_io(md_result_file);
- }
- fprintf(md_result_file,"\nUSE %s;\n", qdatabase);
- check_io(md_result_file);
- }
if (opt_xml)
print_xml_tag1(md_result_file, "", "database name=", database, "\n");
if (lock_tables)
@@ -3186,7 +3212,7 @@
char **dump_tables, **pos, **end;
DBUG_ENTER("dump_selected_tables");
- if (init_dumping(db))
+ if (init_dumping(db, init_dumping_tables))
DBUG_RETURN(1);
init_alloc_root(&root, 8192, 0);
--- 1.164/include/mysql.h 2006-08-28 21:52:42 -04:00
+++ 1.165/include/mysql.h 2006-08-28 21:52:42 -04:00
@@ -165,7 +165,6 @@
char *ssl_ca; /* PEM CA file */
char *ssl_capath; /* PEM directory of CA-s? */
char *ssl_cipher; /* cipher to use */
- my_bool ssl_verify_server_cert; /* if to verify server cert */
char *shared_memory_base_name;
unsigned long max_allowed_packet;
my_bool use_ssl; /* if to use SSL or not */
--- 1.109/include/mysql_com.h 2006-08-28 21:52:42 -04:00
+++ 1.110/include/mysql_com.h 2006-08-28 21:52:42 -04:00
@@ -138,8 +138,10 @@
#define CLIENT_TRANSACTIONS 8192 /* Client knows about transactions */
#define CLIENT_RESERVED 16384 /* Old flag for 4.1 protocol */
#define CLIENT_SECURE_CONNECTION 32768 /* New 4.1 authentication */
-#define CLIENT_MULTI_STATEMENTS 65536 /* Enable/disable multi-stmt support */
-#define CLIENT_MULTI_RESULTS 131072 /* Enable/disable multi-results */
+#define CLIENT_MULTI_STATEMENTS (((ulong) 1) << 16) /* Enable/disable multi-stmt support */
+#define CLIENT_MULTI_RESULTS (((ulong) 1) << 17) /* Enable/disable multi-results */
+
+#define CLIENT_SSL_VERIFY_SERVER_CERT (((ulong) 1) << 30)
#define CLIENT_REMEMBER_OPTIONS (((ulong) 1) << 31)
#define SERVER_STATUS_IN_TRANS 1 /* Transaction has started */
--- 1.103/sql-common/client.c 2006-08-28 21:52:42 -04:00
+++ 1.104/sql-common/client.c 2006-08-28 21:52:42 -04:00
@@ -1509,7 +1509,6 @@
mysql->options.ssl_ca= strdup_if_not_null(ca);
mysql->options.ssl_capath= strdup_if_not_null(capath);
mysql->options.ssl_cipher= strdup_if_not_null(cipher);
- mysql->options.ssl_verify_server_cert= FALSE; /* Off by default */
#endif /* HAVE_OPENSSL */
DBUG_RETURN(0);
}
@@ -2198,7 +2197,7 @@
DBUG_PRINT("info", ("IO layer change done!"));
/* Verify server cert */
- if (mysql->options.ssl_verify_server_cert &&
+ if ((client_flag & CLIENT_SSL_VERIFY_SERVER_CERT) &&
ssl_verify_server_cert(mysql->net.vio, mysql->host))
{
set_mysql_error(mysql, CR_SSL_CONNECTION_ERROR, unknown_sqlstate);
@@ -2945,7 +2944,10 @@
mysql->reconnect= *(my_bool *) arg;
break;
case MYSQL_OPT_SSL_VERIFY_SERVER_CERT:
- mysql->options.ssl_verify_server_cert= *(my_bool *) arg;
+ if (!arg || test(*(uint*) arg))
+ mysql->options.client_flag|= CLIENT_SSL_VERIFY_SERVER_CERT;
+ else
+ mysql->options.client_flag&= ~CLIENT_SSL_VERIFY_SERVER_CERT;
break;
default:
DBUG_RETURN(1);
--- 1.121/mysql-test/r/mysqldump.result 2006-08-28 21:52:42 -04:00
+++ 1.122/mysql-test/r/mysqldump.result 2006-08-28 21:52:42 -04:00
@@ -434,7 +434,7 @@
drop database mysqldump_test_db;
CREATE TABLE t1 (a CHAR(10));
+INSERT INTO t1 VALUES (_latin1 'ÄÖÜß');
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
@@ -479,7 +479,7 @@
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
+INSERT INTO `t1` VALUES ('á');
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -502,7 +502,7 @@
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
+INSERT INTO `t1` VALUES ('á');
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -1676,11 +1676,11 @@
insert t1 values (0x4F736E616272C3BC636B, 0x4BF66C6E);
select * from t1;
a b
+Osnabrück Köln
test.t1: Records: 1 Deleted: 0 Skipped: 0 Warnings: 0
select * from t1;
a b
+Osnabrück Köln
drop table t1;
create table `t1` (
t1_name varchar(255) default null,
@@ -2925,7 +2925,22 @@
grant REPLICATION CLIENT on *.* to mysqltest_1@localhost;
drop table t1;
drop user mysqltest_1@localhost;
+create database mysqldump_myDB;
+use mysqldump_myDB;
+create user myDB_User;
+grant create view, select on mysqldump_myDB.* to myDB_User@localhost;
+create table t1 (c1 int);
+insert into t1 values (3);
+use mysqldump_myDB;
+create view v1 (c1) as select * from t1;
+use mysqldump_myDB;
+drop view v1;
+drop table t1;
+revoke all privileges on mysqldump_myDB.* from myDB_User@localhost;
+drop user myDB_User;
+drop database mysqldump_myDB;
End of 5.0 tests
+use test;
create table t1 (a text , b text);
create table t2 (a text , b text);
insert t1 values ("Duck, Duck", "goose");
--- 1.115/mysql-test/t/mysqldump.test 2006-08-28 21:52:42 -04:00
+++ 1.116/mysql-test/t/mysqldump.test 2006-08-28 21:52:42 -04:00
@@ -153,7 +153,7 @@
# if it is explicitely set.
CREATE TABLE t1 (a CHAR(10));
+INSERT INTO t1 VALUES (_latin1 'ÄÖÜß');
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments test t1
#
# Bug#8063: make test mysqldump [ fail ]
@@ -1326,8 +1326,37 @@
drop table t1;
drop user mysqltest_1@localhost;
---echo End of 5.0 tests
+#
+# Bug #21527 mysqldump incorrectly tries to LOCK TABLES on the
+# information_schema database.
+#
+connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
+connection root;
+create database mysqldump_myDB;
+use mysqldump_myDB;
+create user myDB_User;
+grant create view, select on mysqldump_myDB.* to myDB_User@localhost;
+create table t1 (c1 int);
+insert into t1 values (3);
+
+connect (user1,localhost,myDB_User,,mysqldump_myDB,$MASTER_MYPORT,$MASTER_MYSOCK);
+connection user1;
+use mysqldump_myDB;
+create view v1 (c1) as select * from t1;
+# Backup should not fail.
+--exec $MYSQL_DUMP --all-databases --add-drop-table > $MYSQLTEST_VARDIR/tmp/bug21527.sql
+
+# Clean up
+connection root;
+use mysqldump_myDB;
+drop view v1;
+drop table t1;
+revoke all privileges on mysqldump_myDB.* from myDB_User@localhost;
+drop user myDB_User;
+drop database mysqldump_myDB;
+--echo End of 5.0 tests
+use test;
#
# Added for use-thread option
#
| Thread |
|---|
| • bk commit into 5.1 tree (iggy:1.2286) | Ignacio Galarza | 29 Aug |