From 395137e1b209ef5542a482274691959101d0a72a Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 18 Jan 2005 15:59:39 -0800 Subject: [PATCH 01/12] Fix query cache to not respond to old clients with a 4.1-protocol response. (Bug #6511) sql/mysql_priv.h: Add bit for storing client protocol info sql/sql_cache.cc: Record whether 4.1 or old protocol is used for query --- sql/mysql_priv.h | 1 + sql/sql_cache.cc | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 4b785aafc5f..314c6928c1c 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -377,6 +377,7 @@ Item *negate_expression(THD *thd, Item *expr); struct Query_cache_query_flags { unsigned int client_long_flag:1; + unsigned int client_protocol_41:1; uint character_set_client_num; uint character_set_results_num; uint collation_connection_num; diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index bd42a2c1720..8491457179f 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -776,6 +776,8 @@ void Query_cache::store_query(THD *thd, TABLE_LIST *tables_used) bzero(&flags, QUERY_CACHE_FLAGS_SIZE); flags.client_long_flag= (thd->client_capabilities & CLIENT_LONG_FLAG ? 1 : 0); + flags.client_protocol_41= (thd->client_capabilities & CLIENT_PROTOCOL_41 ? + 1 : 0); flags.character_set_client_num= thd->variables.character_set_client->number; flags.character_set_results_num= @@ -968,6 +970,8 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length) bzero(&flags, QUERY_CACHE_FLAGS_SIZE); flags.client_long_flag= (thd->client_capabilities & CLIENT_LONG_FLAG ? 1 : 0); + flags.client_protocol_41= (thd->client_capabilities & CLIENT_PROTOCOL_41 ? + 1 : 0); flags.character_set_client_num= thd->variables.character_set_client->number; flags.character_set_results_num= (thd->variables.character_set_results ? From f35117ea34b679b0ac07593ab1cc7b14b7dc334b Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 25 Jan 2005 16:27:13 +0200 Subject: [PATCH 02/12] InnoDB: Backport innodb_autoextend_increment from 4.1 innobase/include/srv0srv.h: Add configuration variable srv_auto_extend_increment innobase/srv/srv0srv.c: Add configuration variable srv_auto_extend_increment sql/ha_innodb.h: Add configuration variable srv_auto_extend_increment sql/mysqld.cc: Add startup option innodb_autoextend_increment sql/set_var.cc: Add settable global variable innodb_autoextend_increment --- innobase/include/srv0srv.h | 4 +++- innobase/srv/srv0srv.c | 3 +++ sql/ha_innodb.h | 1 + sql/mysqld.cc | 6 ++++++ sql/set_var.cc | 4 ++++ 5 files changed, 17 insertions(+), 1 deletion(-) diff --git a/innobase/include/srv0srv.h b/innobase/include/srv0srv.h index c76a1917615..aa2fead53c2 100644 --- a/innobase/include/srv0srv.h +++ b/innobase/include/srv0srv.h @@ -27,7 +27,8 @@ extern os_event_t srv_lock_timeout_thread_event; /* If the last data file is auto-extended, we add this many pages to it at a time */ -#define SRV_AUTO_EXTEND_INCREMENT (8 * ((1024 * 1024) / UNIV_PAGE_SIZE)) +#define SRV_AUTO_EXTEND_INCREMENT \ + (srv_auto_extend_increment * ((1024 * 1024) / UNIV_PAGE_SIZE)) /* This is set to TRUE if the MySQL user has set it in MySQL */ extern ibool srv_lower_case_table_names; @@ -49,6 +50,7 @@ extern ulint* srv_data_file_is_raw_partition; extern ibool srv_auto_extend_last_data_file; extern ulint srv_last_file_size_max; +extern ulint srv_auto_extend_increment; extern ibool srv_created_new_raw; diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c index d633c67cdf3..217a97d84a2 100644 --- a/innobase/srv/srv0srv.c +++ b/innobase/srv/srv0srv.c @@ -86,6 +86,9 @@ ulint srv_last_file_size_max = 0; /* if != 0, this tells the max size auto-extending may increase the last data file size */ +ulint srv_auto_extend_increment = 8; /* If the last data file is + auto-extended, we add this + many pages to it at a time */ ulint* srv_data_file_is_raw_partition = NULL; /* If the following is TRUE we do not allow inserts etc. This protects diff --git a/sql/ha_innodb.h b/sql/ha_innodb.h index 74acc0640c9..7bf20771680 100644 --- a/sql/ha_innodb.h +++ b/sql/ha_innodb.h @@ -208,6 +208,7 @@ extern my_bool innobase_log_archive, extern "C" { extern ulong srv_max_buf_pool_modified_pct; extern ulong srv_max_purge_lag; +extern ulong srv_auto_extend_increment; } extern TYPELIB innobase_lock_typelib; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index c6ec942d0d9..f104e461d6a 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -3518,6 +3518,7 @@ enum options_mysqld { OPT_INNODB_FORCE_RECOVERY, OPT_INNODB_STATUS_FILE, OPT_INNODB_MAX_DIRTY_PAGES_PCT, + OPT_INNODB_AUTOEXTEND_INCREMENT, OPT_INNODB_TABLE_LOCKS, OPT_BDB_CACHE_SIZE, OPT_BDB_LOG_BUFFER_SIZE, @@ -3659,6 +3660,11 @@ struct my_option my_long_options[] = "Path to individual files and their sizes", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #ifdef HAVE_INNOBASE_DB + {"innodb_autoextend_increment", OPT_INNODB_AUTOEXTEND_INCREMENT, + "Data file autoextend increment in megabytes", + (gptr*) &srv_auto_extend_increment, + (gptr*) &srv_auto_extend_increment, + 0, GET_LONG, REQUIRED_ARG, 8L, 1L, 1000L, 0, 1L, 0}, {"innodb_data_home_dir", OPT_INNODB_DATA_HOME_DIR, "The common part for Innodb table spaces", (gptr*) &innobase_data_home_dir, (gptr*) &innobase_data_home_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, diff --git a/sql/set_var.cc b/sql/set_var.cc index 122daa0ea95..aa6ddb63a04 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -265,6 +265,8 @@ sys_var_long_ptr sys_innodb_max_dirty_pages_pct("innodb_max_dirty_pages_p &srv_max_buf_pool_modified_pct); sys_var_long_ptr sys_innodb_max_purge_lag("innodb_max_purge_lag", &srv_max_purge_lag); +sys_var_long_ptr sys_innodb_autoextend_increment("innodb_autoextend_increment", + &srv_auto_extend_increment); sys_var_thd_bool sys_innodb_table_locks("innodb_table_locks", &SV::innodb_table_locks); #endif @@ -454,6 +456,7 @@ sys_var *sys_variables[]= #ifdef HAVE_INNOBASE_DB &sys_innodb_max_dirty_pages_pct, &sys_innodb_max_purge_lag, + &sys_innodb_autoextend_increment, &sys_innodb_table_locks, #endif &sys_unique_checks @@ -508,6 +511,7 @@ struct show_var_st init_vars[]= { {"init_file", (char*) &opt_init_file, SHOW_CHAR_PTR}, #ifdef HAVE_INNOBASE_DB {"innodb_additional_mem_pool_size", (char*) &innobase_additional_mem_pool_size, SHOW_LONG }, + {sys_innodb_autoextend_increment.name, (char*) &sys_innodb_autoextend_increment, SHOW_SYS}, {"innodb_buffer_pool_size", (char*) &innobase_buffer_pool_size, SHOW_LONG }, {"innodb_data_file_path", (char*) &innobase_data_file_path, SHOW_CHAR_PTR}, {"innodb_data_home_dir", (char*) &innobase_data_home_dir, SHOW_CHAR_PTR}, From d8f3934148a1a92458fc0f206c6b0a804f30a001 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 25 Jan 2005 14:25:40 -0800 Subject: [PATCH 03/12] Change 'mysql' client to output XML like the 'mysqldump' tool does, with the column names as attributes on elements, instead of trying to use the column name as the element name. Also fix some encoding issues. (Bug #7811) client/mysql.cc: Quote > and " in XML output, and use instead of , to make the output more like mysqldump --xml and avoid having to turn XXX into a sensible element name. --- client/mysql.cc | 12 +++--- mysql-test/r/client_xml.result | 75 ++++++++++++++++++++++++++++++++++ mysql-test/t/client_xml.test | 18 ++++++++ 3 files changed, 99 insertions(+), 6 deletions(-) create mode 100644 mysql-test/r/client_xml.result create mode 100644 mysql-test/t/client_xml.test diff --git a/client/mysql.cc b/client/mysql.cc index 635973e946c..1223a952264 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -154,6 +154,8 @@ static char mysql_charsets_dir[FN_REFLEN+1]; static const char *xmlmeta[] = { "&", "&", "<", "<", + ">", ">", + "\"", """, 0, 0 }; static const char *day_names[]={"Sun","Mon","Tue","Wed","Thu","Fri","Sat"}; @@ -2116,13 +2118,11 @@ print_table_data_xml(MYSQL_RES *result) (void) tee_fputs("\n \n", PAGER); for (uint i=0; i < mysql_num_fields(result); i++) { - tee_fprintf(PAGER, "\t<%s>", (fields[i].name ? - (fields[i].name[0] ? fields[i].name : - "   ") : "NULL")); + tee_fprintf(PAGER, "\t"); xmlencode_print(cur[i], lengths[i]); - tee_fprintf(PAGER, "\n", (fields[i].name ? - (fields[i].name[0] ? fields[i].name : - "   ") : "NULL")); + tee_fprintf(PAGER, "\n"); } (void) tee_fputs(" \n", PAGER); } diff --git a/mysql-test/r/client_xml.result b/mysql-test/r/client_xml.result new file mode 100644 index 00000000000..b6cebab98e1 --- /dev/null +++ b/mysql-test/r/client_xml.result @@ -0,0 +1,75 @@ +create table t1 ( +`a&b` int, +`ab` text +); +insert into t1 values (1, 2, 'a&b ab'); + + + + + 1 + 2 + a&b a<b a>b + + + + + + + + + + + + + + 1 + 2 + a&b a<b a>b + + + + + + + + + 1 + + + + + + + 1 + + + + + + + 0 + + + + + + + 1 + + + + + + + NULL + + +drop table t1; diff --git a/mysql-test/t/client_xml.test b/mysql-test/t/client_xml.test new file mode 100644 index 00000000000..3628a510557 --- /dev/null +++ b/mysql-test/t/client_xml.test @@ -0,0 +1,18 @@ +# Test of the xml output of the 'mysql' and 'mysqldump' clients -- makes +# sure that basic encoding issues are handled properly +create table t1 ( + `a&b` int, + `ab` text +); +insert into t1 values (1, 2, 'a&b ab'); +--exec $MYSQL --xml test -e 'select * from t1' +--exec $MYSQL_DUMP --xml test + +--exec $MYSQL --xml test -e 'select count(*) from t1' +--exec $MYSQL --xml test -e 'select 1 < 2 from dual' +--exec $MYSQL --xml test -e 'select 1 > 2 from dual' +--exec $MYSQL --xml test -e 'select 1 & 3 from dual' +--exec $MYSQL --xml test -e 'select null from dual' + +drop table t1; From d848286e70a4e257ee7ebab5966cd33b40e12c03 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 28 Jan 2005 11:16:49 -0800 Subject: [PATCH 04/12] Use single quotes to set SQL_MODE in mysqldump output in case ANSI_QUOTES was already defined on the server the dump is loaded into. (Bug #8148) client/mysqldump.c: Use single quotes when setting SQL_MODE --- client/mysqldump.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index 00f5272e3d7..fb83947346d 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -489,7 +489,7 @@ static void write_header(FILE *sql_file, char *db_name) "); } fprintf(sql_file, - "/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=\"%s%s%s\" */;\n", + "/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='%s%s%s' */;\n", path?"":"NO_AUTO_VALUE_ON_ZERO",compatible_mode_normal_str[0]==0?"":",", compatible_mode_normal_str); check_io(sql_file); @@ -863,7 +863,7 @@ static int dbConnect(char *host, char *user,char *passwd) cannot reconnect. */ sock->reconnect= 0; - sprintf(buff, "/*!40100 SET @@SQL_MODE=\"%s\" */", + sprintf(buff, "/*!40100 SET @@SQL_MODE='%s' */", compatible_mode_normal_str); if (mysql_query_with_error_report(sock, 0, buff)) { From af68c169abb5720b482bcb5163b177473c8cea97 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 28 Jan 2005 12:13:01 -0800 Subject: [PATCH 05/12] Fix test results for mysqldump test. Part of Bug #8148. mysql-test/r/mysqldump.result: Update results --- mysql-test/r/mysqldump.result | 36 +++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 623bd2a0f3c..8f2294caa48 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -60,7 +60,7 @@ INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456) /*!40101 SET NAMES utf8 */; /*!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" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` decimal(10,5) default NULL, @@ -83,7 +83,7 @@ UNLOCK TABLES; /*!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" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; CREATE TABLE `t1` ( `a` decimal(10,5) default NULL, `b` float default NULL @@ -149,7 +149,7 @@ INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5'), (NULL); /*!40101 SET NAMES utf8 */; /*!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" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` varchar(255) default NULL @@ -175,7 +175,7 @@ CREATE TABLE t1 (a int) ENGINE=MYISAM; INSERT INTO t1 VALUES (1), (2); /*!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,MYSQL40" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL40' */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` int(11) default NULL @@ -194,7 +194,7 @@ UNLOCK TABLES; /*!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,MYSQL323" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` int(11) default NULL @@ -225,7 +225,7 @@ create table t1(a int); /*!40101 SET NAMES utf8 */; /*!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" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` int(11) default NULL @@ -246,7 +246,7 @@ UNLOCK TABLES; /*!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" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */; DROP TABLE IF EXISTS "t1"; CREATE TABLE "t1" ( "a" int(11) default NULL @@ -270,7 +270,7 @@ set global sql_mode='ANSI_QUOTES'; /*!40101 SET NAMES utf8 */; /*!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" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` int(11) default NULL @@ -291,7 +291,7 @@ UNLOCK TABLES; /*!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" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */; DROP TABLE IF EXISTS "t1"; CREATE TABLE "t1" ( "a" int(11) default NULL @@ -316,7 +316,7 @@ insert into t1 values (1),(2),(3); /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='' */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` int(11) default NULL @@ -339,7 +339,7 @@ drop table t1; /*!40101 SET NAMES utf8 */; /*!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" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */; @@ -360,7 +360,7 @@ create database mysqldump_test_db character set latin2 collate latin2_bin; /*!40101 SET NAMES utf8 */; /*!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" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_test_db` /*!40100 DEFAULT CHARACTER SET latin2 COLLATE latin2_bin */; @@ -383,7 +383,7 @@ INSERT INTO t1 VALUES (_latin1 ' /*!40101 SET NAMES utf8 */; /*!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" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` char(10) default NULL @@ -405,7 +405,7 @@ UNLOCK TABLES; /*!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,MYSQL323" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` char(10) default NULL @@ -424,7 +424,7 @@ UNLOCK TABLES; /*!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,MYSQL323" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` char(10) default NULL @@ -443,7 +443,7 @@ UNLOCK TABLES; /*!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,MYSQL323" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` char(10) default NULL @@ -462,7 +462,7 @@ UNLOCK TABLES; /*!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,MYSQL323" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` char(10) default NULL @@ -491,7 +491,7 @@ INSERT INTO t2 VALUES (4),(5),(6); /*!40101 SET NAMES utf8 */; /*!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" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; DROP TABLE IF EXISTS `t2`; CREATE TABLE `t2` ( `a` int(11) default NULL From c2383412b243e05ec01434b8667aafa3559225b3 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 28 Jan 2005 17:18:35 -0800 Subject: [PATCH 06/12] Fix error in string comparisons with CHAR(31) against the space-padding of strings of unequal length. (Bug #8134) mysql-test/t/compare.test: Add new regression test strings/ctype-simple.c: Fix value used for swapping negative/positive values using XOR mysql-test/r/compare.result: Add new test result --- mysql-test/r/compare.result | 3 +++ mysql-test/t/compare.test | 3 +++ strings/ctype-simple.c | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/compare.result b/mysql-test/r/compare.result index bf8a5106044..49ec2dd85cc 100644 --- a/mysql-test/r/compare.result +++ b/mysql-test/r/compare.result @@ -36,3 +36,6 @@ hex(a) STRCMP(a,'a') STRCMP(a,'a ') 6109 -1 -1 61 0 0 DROP TABLE t1; +SELECT CHAR(31) = '', '' = CHAR(31); +CHAR(31) = '' '' = CHAR(31) +0 0 diff --git a/mysql-test/t/compare.test b/mysql-test/t/compare.test index b0cef48dd3f..e3c042e608a 100644 --- a/mysql-test/t/compare.test +++ b/mysql-test/t/compare.test @@ -30,3 +30,6 @@ CREATE TABLE t1 (a char(10) not null); INSERT INTO t1 VALUES ('a'),('a\0'),('a\t'),('a '); SELECT hex(a),STRCMP(a,'a'), STRCMP(a,'a ') FROM t1; DROP TABLE t1; + +# Bug #8134: Comparison against CHAR(31) at end of string +SELECT CHAR(31) = '', '' = CHAR(31); diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c index 5bfa9e52595..4dc6a1be27b 100644 --- a/strings/ctype-simple.c +++ b/strings/ctype-simple.c @@ -153,7 +153,7 @@ int my_strnncollsp_simple(CHARSET_INFO * cs, const uchar *a, uint a_length, /* put shorter key in s */ a_length= b_length; a= b; - swap= -1; /* swap sign of result */ + swap= -1^1; /* swap sign of result */ } for (end= a + a_length-length; a < end ; a++) { From 934fde094cc092baa110dc3821e098d3d286e0c6 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 30 Jan 2005 10:24:03 +0000 Subject: [PATCH 07/12] Bug#7011 Fix replication for multi-update new test - rpl_multi_update2 sql/mysql_priv.h: Bug#7011 New function mysql_multi_update_lock() sql/sql_parse.cc: Bug#7011 New function check_multi_update_lock() For multi-update on slave, perform an early open&lock sql/sql_update.cc: Bug#7011 Split out multi-update locking into its own function, mysql_multi_update_lock() --- mysql-test/r/rpl_multi_update2.result | 42 ++++++++++++ mysql-test/t/rpl_multi_update2-slave.opt | 1 + mysql-test/t/rpl_multi_update2.test | 33 ++++++++++ sql/mysql_priv.h | 3 + sql/sql_parse.cc | 81 +++++++++++++++++++++++- sql/sql_update.cc | 51 +++++++++------ 6 files changed, 192 insertions(+), 19 deletions(-) create mode 100644 mysql-test/r/rpl_multi_update2.result create mode 100644 mysql-test/t/rpl_multi_update2-slave.opt create mode 100644 mysql-test/t/rpl_multi_update2.test diff --git a/mysql-test/r/rpl_multi_update2.result b/mysql-test/r/rpl_multi_update2.result new file mode 100644 index 00000000000..40193f43e49 --- /dev/null +++ b/mysql-test/r/rpl_multi_update2.result @@ -0,0 +1,42 @@ +slave stop; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +slave start; +CREATE TABLE t1 ( +a int unsigned not null auto_increment primary key, +b int unsigned +) TYPE=MyISAM; +CREATE TABLE t2 ( +a int unsigned not null auto_increment primary key, +b int unsigned +) TYPE=MyISAM; +INSERT INTO t1 VALUES (NULL, 0); +INSERT INTO t1 SELECT NULL, 0 FROM t1; +INSERT INTO t2 VALUES (NULL, 0), (NULL,1); +SELECT * FROM t1 ORDER BY a; +a b +1 0 +2 0 +SELECT * FROM t2 ORDER BY a; +a b +1 0 +2 1 +UPDATE t1, t2 SET t1.b = (t2.b+4) WHERE t1.a = t2.a; +SELECT * FROM t1 ORDER BY a; +a b +1 4 +2 5 +SELECT * FROM t2 ORDER BY a; +a b +1 0 +2 1 +SELECT * FROM t1 ORDER BY a; +a b +1 4 +2 5 +SELECT * FROM t2 ORDER BY a; +a b +1 0 +2 1 diff --git a/mysql-test/t/rpl_multi_update2-slave.opt b/mysql-test/t/rpl_multi_update2-slave.opt new file mode 100644 index 00000000000..17d4171af0e --- /dev/null +++ b/mysql-test/t/rpl_multi_update2-slave.opt @@ -0,0 +1 @@ +--replicate-ignore-table=nothing.sensible diff --git a/mysql-test/t/rpl_multi_update2.test b/mysql-test/t/rpl_multi_update2.test new file mode 100644 index 00000000000..8216056aca5 --- /dev/null +++ b/mysql-test/t/rpl_multi_update2.test @@ -0,0 +1,33 @@ +# Let's verify that multi-update is not always skipped by slave if +# some replicate-* rules exist. +# (BUG#7011) + +source include/master-slave.inc; + +CREATE TABLE t1 ( + a int unsigned not null auto_increment primary key, + b int unsigned +) TYPE=MyISAM; + +CREATE TABLE t2 ( + a int unsigned not null auto_increment primary key, + b int unsigned +) TYPE=MyISAM; + +INSERT INTO t1 VALUES (NULL, 0); +INSERT INTO t1 SELECT NULL, 0 FROM t1; + +INSERT INTO t2 VALUES (NULL, 0), (NULL,1); + +SELECT * FROM t1 ORDER BY a; +SELECT * FROM t2 ORDER BY a; + +UPDATE t1, t2 SET t1.b = (t2.b+4) WHERE t1.a = t2.a; +SELECT * FROM t1 ORDER BY a; +SELECT * FROM t2 ORDER BY a; + +save_master_pos; +connection slave; +sync_with_master; +SELECT * FROM t1 ORDER BY a; +SELECT * FROM t2 ORDER BY a; diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index b123927d09e..cbbf3b843d3 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -469,6 +469,9 @@ int mysql_update(THD *thd,TABLE_LIST *tables,List &fields, List &values,COND *conds, ORDER *order, ha_rows limit, enum enum_duplicates handle_duplicates); +int mysql_multi_update_lock(THD *thd, + TABLE_LIST *table_list, + List *fields); int mysql_multi_update(THD *thd, TABLE_LIST *table_list, List *fields, List *values, COND *conds, ulong options, diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 1aeb158dc11..275b76db177 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -56,6 +56,8 @@ static int check_for_max_user_connections(USER_CONN *uc); static void decrease_user_connections(USER_CONN *uc); static bool check_db_used(THD *thd,TABLE_LIST *tables); static bool check_merge_table_access(THD *thd, char *db, TABLE_LIST *tables); +static bool check_multi_update_lock(THD *thd, TABLE_LIST *tables, + List *fields); static void mysql_init_query(THD *thd); static void remove_escape(char *name); static void refresh_status(void); @@ -1338,10 +1340,28 @@ mysql_execute_command(void) LEX *lex= &thd->lex; TABLE_LIST *tables=(TABLE_LIST*) lex->select_lex.table_list.first; SELECT_LEX *select_lex = lex->select; + bool slave_fake_lock= 0; + MYSQL_LOCK *fake_prev_lock= 0; DBUG_ENTER("mysql_execute_command"); if (thd->slave_thread) { + if (lex->sql_command == SQLCOM_MULTI_UPDATE) + { + DBUG_PRINT("info",("need faked locked tables")); + + if (check_multi_update_lock(thd, tables, &select_lex->item_list)) + goto error; + + /* Fix for replication, the tables are opened and locked, + now we pretend that we have performed a LOCK TABLES action */ + + fake_prev_lock= thd->locked_tables; + if (thd->lock) + thd->locked_tables= thd->lock; + thd->lock= 0; + slave_fake_lock= 1; + } /* Skip if we are in the slave thread, some table rules have been given and the table list says the query should not be replicated @@ -1949,7 +1969,7 @@ mysql_execute_command(void) if (select_lex->item_list.elements != lex->value_list.elements) { send_error(&thd->net,ER_WRONG_VALUE_COUNT); - DBUG_VOID_RETURN; + goto error; } { const char *msg= 0; @@ -2641,6 +2661,14 @@ mysql_execute_command(void) send_error(&thd->net,thd->killed ? ER_SERVER_SHUTDOWN : 0); error: + if (unlikely(slave_fake_lock)) + { + DBUG_PRINT("info",("undoing faked lock")); + thd->lock= thd->locked_tables; + thd->locked_tables= fake_prev_lock; + if (thd->lock == thd->locked_tables) + thd->lock= 0; + } DBUG_VOID_RETURN; } @@ -3907,3 +3935,54 @@ bool check_simple_select() } return 0; } + +/* + Setup locking for multi-table updates. Used by the replication slave. + Replication slave SQL thread examines (all_tables_not_ok()) the + locking state of referenced tables to determine if the query has to + be executed or ignored. Since in multi-table update, the + 'default' lock is read-only, this lock is corrected early enough by + calling this function, before the slave decides to execute/ignore. + + SYNOPSIS + check_multi_update_lock() + thd Current thread + tables List of user-supplied tables + fields List of fields requiring update + + RETURN VALUES + 0 ok + 1 error +*/ +static bool check_multi_update_lock(THD *thd, TABLE_LIST *tables, + List *fields) +{ + bool res= 1; + TABLE_LIST *table; + DBUG_ENTER("check_multi_update_lock"); + + if (check_db_used(thd, tables)) + goto error; + + /* + Ensure that we have UPDATE or SELECT privilege for each table + The exact privilege is checked in mysql_multi_update() + */ + for (table= tables ; table ; table= table->next) + { + TABLE_LIST *save= table->next; + table->next= 0; + if (check_one_table_access(thd, UPDATE_ACL, table, 1) && + check_one_table_access(thd, SELECT_ACL, table, 0)) + goto error; + table->next= save; + } + + if (mysql_multi_update_lock(thd, tables, fields)) + goto error; + + res= 0; + +error: + DBUG_RETURN(res); +} diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 4f7e34ec74f..b1b30a29639 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -403,26 +403,20 @@ static table_map get_table_map(List *items) } - /* - Setup multi-update handling and call SELECT to do the join + Prepare tables for multi-update + Analyse which tables need specific privileges and perform locking + as required */ -int mysql_multi_update(THD *thd, - TABLE_LIST *table_list, - List *fields, - List *values, - COND *conds, - ulong options, - enum enum_duplicates handle_duplicates) +int mysql_multi_update_lock(THD *thd, + TABLE_LIST *table_list, + List *fields) { int res; - multi_update *result; TABLE_LIST *tl; const bool using_lock_tables= thd->locked_tables != 0; - DBUG_ENTER("mysql_multi_update"); - - thd->select_limit= HA_POS_ERROR; + DBUG_ENTER("mysql_multi_update_lock"); for (;;) { @@ -490,7 +484,7 @@ int mysql_multi_update(THD *thd, (grant_option && check_grant(thd, wants, tl, 0, 0))) { tl->next= save; - DBUG_RETURN(0); + DBUG_RETURN(1); } tl->next= save; } @@ -498,11 +492,7 @@ int mysql_multi_update(THD *thd, /* Relock the tables with the correct modes */ res= lock_tables(thd,table_list); if (using_lock_tables) - { - if (res) - DBUG_RETURN(res); break; // Don't have to do setup_field() - } /* We must setup fields again as the file may have been reopened @@ -535,6 +525,31 @@ int mysql_multi_update(THD *thd, */ close_thread_tables(thd); } + + DBUG_RETURN(res); +} + +/* + Setup multi-update handling and call SELECT to do the join +*/ + +int mysql_multi_update(THD *thd, + TABLE_LIST *table_list, + List *fields, + List *values, + COND *conds, + ulong options, + enum enum_duplicates handle_duplicates) +{ + int res; + TABLE_LIST *tl; + multi_update *result; + DBUG_ENTER("mysql_multi_update"); + + thd->select_limit= HA_POS_ERROR; + + if ((res= mysql_multi_update_lock(thd, table_list, fields))) + DBUG_RETURN(res); /* Count tables and setup timestamp handling From 4faf77a9fe079dde6d9f8f563a5eb10fba44c87f Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 31 Jan 2005 11:47:10 +0100 Subject: [PATCH 08/12] BUG#8208 don't fsync unless something has been written + ion shutdown - don't close files that are not open + abort in debug - if closing a fd == -1 BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp | 14 ++++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index 52b8b0584bc..483f324d89c 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -224,6 +224,7 @@ tonu@x153.internalnet tonu@x3.internalnet tsmith@build.mysql.com tulin@build.mysql.com +tulin@mysql.com ulli@morbus.(none) venu@hundin.mysql.fi venu@myvenu.com diff --git a/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp b/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp index ddf1681479c..ad6c0fd5283 100644 --- a/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp +++ b/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp @@ -219,7 +219,8 @@ AsyncFile::run() rmrfReq(request, (char*)theFileName.c_str(), request->par.rmrf.own_directory); break; case Request:: end: - closeReq(request); + if (theFd > 0) + closeReq(request); endReq(); return; default: @@ -239,6 +240,7 @@ void AsyncFile::openReq(Request* request) { m_openedWithSync = false; m_syncFrequency = 0; + m_syncCount= 0; // for open.flags, see signal FSOPENREQ #ifdef NDB_WIN32 @@ -329,7 +331,6 @@ void AsyncFile::openReq(Request* request) } else { #endif m_openedWithSync = false; - m_syncCount = 0; m_syncFrequency = Global_syncFreq; #if 0 } @@ -656,6 +657,7 @@ AsyncFile::writeBuffer(const char * buf, size_t size, off_t offset, } #endif + m_syncCount+= bytes_written; buf += bytes_written; size -= bytes_written; offset += bytes_written; @@ -682,6 +684,10 @@ AsyncFile::closeReq(Request * request) hFile = INVALID_HANDLE_VALUE; #else if (-1 == ::close(theFd)) { +#ifndef DBUG_OFF + if (theFd == -1) + abort(); +#endif request->error = errno; } theFd = -1; @@ -700,7 +706,8 @@ bool AsyncFile::isOpen(){ void AsyncFile::syncReq(Request * request) { - if(m_openedWithSync){ + if(m_openedWithSync || + m_syncCount == 0){ return; } #ifdef NDB_WIN32 @@ -756,7 +763,6 @@ AsyncFile::appendReq(Request * request){ if(m_syncFrequency != 0 && m_syncCount > m_syncFrequency){ syncReq(request); - request->error = 0; } } From 0bd5c1e3b2a7166e5c5b81570a22af9463b52c46 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 31 Jan 2005 13:18:36 +0000 Subject: [PATCH 09/12] Bug#7011 Fix tests after merge from 4.0 --- mysql-test/r/rpl_multi_update2.result | 8 ++++---- mysql-test/t/rpl_multi_update2.test | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/rpl_multi_update2.result b/mysql-test/r/rpl_multi_update2.result index 40193f43e49..99356ebf970 100644 --- a/mysql-test/r/rpl_multi_update2.result +++ b/mysql-test/r/rpl_multi_update2.result @@ -1,17 +1,17 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; +start slave; CREATE TABLE t1 ( a int unsigned not null auto_increment primary key, b int unsigned -) TYPE=MyISAM; +) ENGINE=MyISAM; CREATE TABLE t2 ( a int unsigned not null auto_increment primary key, b int unsigned -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t1 VALUES (NULL, 0); INSERT INTO t1 SELECT NULL, 0 FROM t1; INSERT INTO t2 VALUES (NULL, 0), (NULL,1); diff --git a/mysql-test/t/rpl_multi_update2.test b/mysql-test/t/rpl_multi_update2.test index 8216056aca5..bba7700a88e 100644 --- a/mysql-test/t/rpl_multi_update2.test +++ b/mysql-test/t/rpl_multi_update2.test @@ -7,12 +7,12 @@ source include/master-slave.inc; CREATE TABLE t1 ( a int unsigned not null auto_increment primary key, b int unsigned -) TYPE=MyISAM; +) ENGINE=MyISAM; CREATE TABLE t2 ( a int unsigned not null auto_increment primary key, b int unsigned -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t1 VALUES (NULL, 0); INSERT INTO t1 SELECT NULL, 0 FROM t1; From dd385f2493f836fa899c8906ac76db5cf160170c Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 31 Jan 2005 20:49:37 +0000 Subject: [PATCH 10/12] Bug#7011 Fix for merge from 4.1 --- sql/sql_parse.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 0dbf97cdc87..820a4f732a3 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -6001,15 +6001,15 @@ static bool check_multi_update_lock(THD *thd) Ensure that we have UPDATE or SELECT privilege for each table The exact privilege is checked in mysql_multi_update() */ - for (table= tables ; table ; table= table->next) + for (table= tables ; table ; table= table->next_local) { - TABLE_LIST *save= table->next; - table->next= 0; + TABLE_LIST *save= table->next_local; + table->next_local= 0; if ((check_access(thd, UPDATE_ACL, table->db, &table->grant.privilege,0,1) || (grant_option && check_grant(thd, UPDATE_ACL, table,0,1,1))) && check_one_table_access(thd, SELECT_ACL, table)) goto error; - table->next= save; + table->next_local= save; } if (mysql_multi_update_prepare(thd)) From ac5e79b9a1c8064af3e21ad37866af9d787792aa Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 31 Jan 2005 17:31:42 -0800 Subject: [PATCH 11/12] Update test results after bug-fix merge. mysql-test/r/mysqldump.result: Fix results --- mysql-test/r/mysqldump.result | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index c3b15b53745..b06909fb1c8 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -344,7 +344,7 @@ create view v1 as select * from t1; /*!40101 SET NAMES utf8 */; /*!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" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` int(11) default NULL From 6e0691f54f8fe396bd5f724c0725f42e211d4450 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 31 Jan 2005 18:48:42 -0800 Subject: [PATCH 12/12] Update client_xml test to avoid timestamp-sensitive part of test. mysql-test/t/client_xml.test: Exclude create in mysqldump test, it includes timestamp mysql-test/r/client_xml.result: Update result file --- mysql-test/r/client_xml.result | 1 - mysql-test/t/client_xml.test | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/mysql-test/r/client_xml.result b/mysql-test/r/client_xml.result index b6cebab98e1..a4164148159 100644 --- a/mysql-test/r/client_xml.result +++ b/mysql-test/r/client_xml.result @@ -21,7 +21,6 @@ insert into t1 values (1, 2, 'a&b ab'); - diff --git a/mysql-test/t/client_xml.test b/mysql-test/t/client_xml.test index 3628a510557..dd7a812b54f 100644 --- a/mysql-test/t/client_xml.test +++ b/mysql-test/t/client_xml.test @@ -7,7 +7,7 @@ create table t1 ( ); insert into t1 values (1, 2, 'a&b ab'); --exec $MYSQL --xml test -e 'select * from t1' ---exec $MYSQL_DUMP --xml test +--exec $MYSQL_DUMP --xml --skip-create test --exec $MYSQL --xml test -e 'select count(*) from t1' --exec $MYSQL --xml test -e 'select 1 < 2 from dual'