summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <monty@narttu.mysql.fi>2003-09-29 12:31:35 +0300
committerunknown <monty@narttu.mysql.fi>2003-09-29 12:31:35 +0300
commitd7ab813db833c6600ca93944fc6c65abbf23c89e (patch)
tree0646d11c5212e91d6db4f7118acf7d5183cf88c9
parent534ff256449582b5a730407da798160829b2f4f0 (diff)
downloadmariadb-git-d7ab813db833c6600ca93944fc6c65abbf23c89e.tar.gz
Removed random chars after filename for LOAD DATA INFILE (in mysqlbinlog)
Add quoting for use `database` for mysqlbinlog Removed test ins0000001 Add support for --replace for exec in mysqltest Don't refer to install dir in mysqlbinlog.result BitKeeper/deleted/.del-ins000001.result~f45c599efdf8352b: Delete: mysql-test/r/ins000001.result BitKeeper/deleted/.del-ins000001.test~2428ee5c9b1bc483: Delete: mysql-test/t/ins000001.test client/mysqlbinlog.cc: Removed random chars after filename for LOAD DATA INFILE client/mysqltest.c: Add support for --replace for 'exec' mysql-test/r/drop_temp_table.result: Updated results after quoting change mysql-test/r/fulltext_multi.result: Updated results after quoting change mysql-test/r/fulltext_order_by.result: Updated results after quoting change mysql-test/r/insert.result: New tests mysql-test/r/insert_select.result: Updated results after quoting change mysql-test/r/mix_innodb_myisam_binlog.result: Updated results after quoting change mysql-test/r/mysqlbinlog.result: Updated results after quoting change mysql-test/r/rpl_log.result: Updated results after quoting change mysql-test/t/fulltext_multi.test: Remove 'use' mysql-test/t/fulltext_order_by.test: Remove 'use' mysql-test/t/insert.test: Merge test with ins0000001.test mysql-test/t/mysqlbinlog.test: Don't refer to install dir in result sql/log_event.cc: Add quoting for use `database` for mysqlbinlog support-files/mysql.server.sh: Move pid_file test after arguments have been parsed
-rw-r--r--client/mysqlbinlog.cc11
-rw-r--r--client/mysqltest.c30
-rw-r--r--mysql-test/r/drop_temp_table.result6
-rw-r--r--mysql-test/r/fulltext_multi.result1
-rw-r--r--mysql-test/r/fulltext_order_by.result1
-rw-r--r--mysql-test/r/ins000001.result13
-rw-r--r--mysql-test/r/insert.result22
-rw-r--r--mysql-test/r/insert_select.result2
-rw-r--r--mysql-test/r/mix_innodb_myisam_binlog.result94
-rw-r--r--mysql-test/r/mysqlbinlog.result13
-rw-r--r--mysql-test/r/rpl_log.result56
-rw-r--r--mysql-test/t/fulltext_multi.test2
-rw-r--r--mysql-test/t/fulltext_order_by.test1
-rw-r--r--mysql-test/t/ins000001.test9
-rw-r--r--mysql-test/t/insert.test26
-rw-r--r--mysql-test/t/mysqlbinlog.test6
-rw-r--r--sql/log_event.cc4
-rw-r--r--support-files/mysql.server.sh23
18 files changed, 161 insertions, 159 deletions
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index 910b42d184d..84dcc4a7395 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -202,7 +202,7 @@ const char *Load_log_processor::create_file(Create_file_log_event *ce)
return 0;
}
}
- ce->set_fname_outside_temp_buf(tmp,full_len);
+ ce->set_fname_outside_temp_buf(tmp,strlen(tmp));
return tmp;
}
@@ -622,10 +622,11 @@ Could not read entry at offset %s : Error in log format or read error",
}
}
/*
- We print the event, but with a leading '#': this is just to inform the
- user of the original command; the command we want to execute will be a
- derivation of this original command (we will change the filename and
- use LOCAL), prepared in the 'case EXEC_LOAD_EVENT' below.
+ We print the event, but with a leading '#': this is just to inform
+ the user of the original command; the command we want to execute
+ will be a derivation of this original command (we will change the
+ filename and use LOCAL), prepared in the 'case EXEC_LOAD_EVENT'
+ below.
*/
ce->print(result_file, short_form, last_db, true);
load_processor.process(ce);
diff --git a/client/mysqltest.c b/client/mysqltest.c
index a02fdf30601..fcb9bb7102e 100644
--- a/client/mysqltest.c
+++ b/client/mysqltest.c
@@ -42,7 +42,7 @@
**********************************************************************/
-#define MTEST_VERSION "1.28"
+#define MTEST_VERSION "1.29"
#include <my_global.h>
#include <mysql_embed.h>
@@ -77,6 +77,7 @@
#ifndef MYSQL_MANAGER_PORT
#define MYSQL_MANAGER_PORT 23546
#endif
+#define MAX_SERVER_ARGS 20
/*
Sometimes in a test the client starts before
@@ -121,10 +122,19 @@ static int *block_ok_stack_end;
static int *cur_block, *block_stack_end;
static int block_stack[BLOCK_STACK_DEPTH];
-
static int block_ok_stack[BLOCK_STACK_DEPTH];
static uint global_expected_errno[MAX_EXPECTED_ERRORS], global_expected_errors;
+static int embedded_server_arg_count=0;
+static char *embedded_server_args[MAX_SERVER_ARGS];
+
+static const char *embedded_server_groups[] = {
+ "server",
+ "embedded",
+ "mysqltest_SERVER",
+ NullS
+};
+
#include "sslopt-vars.h"
DYNAMIC_ARRAY q_lines;
@@ -326,18 +336,8 @@ void mysql_disable_rpl_parse(MYSQL* mysql __attribute__((unused))) {}
int mysql_rpl_parse_enabled(MYSQL* mysql __attribute__((unused))) { return 1; }
int mysql_rpl_probe(MYSQL *mysql __attribute__((unused))) { return 1; }
#endif
-
-#define MAX_SERVER_ARGS 20
-
-static int embedded_server_arg_count=0;
-static char *embedded_server_args[MAX_SERVER_ARGS];
-
-static const char *embedded_server_groups[] = {
- "server",
- "embedded",
- "mysqltest_SERVER",
- NullS
-};
+static void replace_dynstr_append_mem(DYNAMIC_STRING *ds, const char *val,
+ int len);
static void do_eval(DYNAMIC_STRING* query_eval, const char* query)
@@ -864,7 +864,7 @@ int do_exec(struct st_query* q)
if (!(res_file= popen(cmd, "r")) && q->abort_on_error)
die("popen() failed\n");
while (fgets(buf, sizeof(buf), res_file))
- dynstr_append(ds, buf);
+ replace_dynstr_append_mem(ds, buf, strlen(buf));
pclose(res_file);
if (record)
{
diff --git a/mysql-test/r/drop_temp_table.result b/mysql-test/r/drop_temp_table.result
index 40e363dbf00..385a3fb6e5c 100644
--- a/mysql-test/r/drop_temp_table.result
+++ b/mysql-test/r/drop_temp_table.result
@@ -5,7 +5,7 @@ create temporary table `table:name` (a int);
show binlog events;
Log_name Pos Event_type Server_id Orig_log_pos Info
master-bin.001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3
-master-bin.001 79 Query 1 79 use test; create database `drop-temp+table-test`
-master-bin.001 152 Query 1 152 use drop-temp+table-test; create temporary table `table:name` (a int)
-master-bin.001 246 Query 1 246 use drop-temp+table-test; DROP /*!40005 TEMPORARY */ TABLE `drop-temp+table-test`.`table:name`
+master-bin.001 79 Query 1 79 use `test`; create database `drop-temp+table-test`
+master-bin.001 152 Query 1 152 use `drop-temp+table-test`; create temporary table `table:name` (a int)
+master-bin.001 246 Query 1 246 use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE `drop-temp+table-test`.`table:name`
drop database `drop-temp+table-test`;
diff --git a/mysql-test/r/fulltext_multi.result b/mysql-test/r/fulltext_multi.result
index 72b7102fd3f..968b00020e2 100644
--- a/mysql-test/r/fulltext_multi.result
+++ b/mysql-test/r/fulltext_multi.result
@@ -1,4 +1,3 @@
-use test;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
a int(11) NOT NULL auto_increment,
diff --git a/mysql-test/r/fulltext_order_by.result b/mysql-test/r/fulltext_order_by.result
index c0e72ff789f..bfee9eba280 100644
--- a/mysql-test/r/fulltext_order_by.result
+++ b/mysql-test/r/fulltext_order_by.result
@@ -1,4 +1,3 @@
-use test;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
a INT AUTO_INCREMENT PRIMARY KEY,
diff --git a/mysql-test/r/ins000001.result b/mysql-test/r/ins000001.result
deleted file mode 100644
index ec4f73e7a5d..00000000000
--- a/mysql-test/r/ins000001.result
+++ /dev/null
@@ -1,13 +0,0 @@
-use test;
-drop table if exists t1,t2;
-create table t1 (email varchar(50));
-insert into t1 values ('sasha@mysql.com'),('monty@mysql.com'),
-('foo@hotmail.com'),('foo@aol.com'),('bar@aol.com');
-create table t2(id int not null auto_increment primary key,
-t2 varchar(50), unique(t2));
-insert into t2 (t2) select distinct substring(email, locate('@', email)+1) from t1;
-select * from t2;
-id t2
-1 mysql.com
-2 hotmail.com
-3 aol.com
diff --git a/mysql-test/r/insert.result b/mysql-test/r/insert.result
index ebcb7721822..270994e3998 100644
--- a/mysql-test/r/insert.result
+++ b/mysql-test/r/insert.result
@@ -1,4 +1,4 @@
-drop table if exists t1;
+drop table if exists t1,t2;
create table t1 (a int not null);
insert into t1 values (1);
insert into t1 values (a+2);
@@ -68,9 +68,19 @@ id
0
2
drop table t1;
-drop database if exists foo;
-create database foo;
-use foo;
+create table t1 (email varchar(50));
+insert into t1 values ('sasha@mysql.com'),('monty@mysql.com'),('foo@hotmail.com'),('foo@aol.com'),('bar@aol.com');
+create table t2(id int not null auto_increment primary key, t2 varchar(50), unique(t2));
+insert into t2 (t2) select distinct substring(email, locate('@', email)+1) from t1;
+select * from t2;
+id t2
+1 mysql.com
+2 hotmail.com
+3 aol.com
+drop table t1,t2;
+drop database if exists mysqltest;
+create database mysqltest;
+use mysqltest;
create table t1 (c int);
-insert into foo.t1 set foo.t1.c = '1';
-drop database foo;
+insert into mysqltest.t1 set mysqltest.t1.c = '1';
+drop database mysqltest;
diff --git a/mysql-test/r/insert_select.result b/mysql-test/r/insert_select.result
index 0142ef68993..23cb7244f48 100644
--- a/mysql-test/r/insert_select.result
+++ b/mysql-test/r/insert_select.result
@@ -75,7 +75,7 @@ Duplicate entry '2' for key 1
show binlog events;
Log_name Pos Event_type Server_id Orig_log_pos Info
master-bin.001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3
-master-bin.001 79 Query 1 79 use test; insert into t1 select * from t2
+master-bin.001 79 Query 1 79 use `test`; insert into t1 select * from t2
drop table t1, t2;
drop table if exists t1, t2;
create table t1 (a int not null);
diff --git a/mysql-test/r/mix_innodb_myisam_binlog.result b/mysql-test/r/mix_innodb_myisam_binlog.result
index cd96584b6a4..7b266544c92 100644
--- a/mysql-test/r/mix_innodb_myisam_binlog.result
+++ b/mysql-test/r/mix_innodb_myisam_binlog.result
@@ -8,10 +8,10 @@ insert into t2 select * from t1;
commit;
show binlog events from 79;
Log_name Pos Event_type Server_id Orig_log_pos Info
-master-bin.001 79 Query 1 79 use test; BEGIN
-master-bin.001 119 Query 1 79 use test; insert into t1 values(1)
-master-bin.001 178 Query 1 79 use test; insert into t2 select * from t1
-master-bin.001 244 Query 1 244 use test; COMMIT
+master-bin.001 79 Query 1 79 use `test`; BEGIN
+master-bin.001 119 Query 1 79 use `test`; insert into t1 values(1)
+master-bin.001 178 Query 1 79 use `test`; insert into t2 select * from t1
+master-bin.001 244 Query 1 244 use `test`; COMMIT
delete from t1;
delete from t2;
reset master;
@@ -22,10 +22,10 @@ rollback;
Warning: Some non-transactional changed tables couldn't be rolled back
show binlog events from 79;
Log_name Pos Event_type Server_id Orig_log_pos Info
-master-bin.001 79 Query 1 79 use test; BEGIN
-master-bin.001 119 Query 1 79 use test; insert into t1 values(2)
-master-bin.001 178 Query 1 79 use test; insert into t2 select * from t1
-master-bin.001 244 Query 1 244 use test; ROLLBACK
+master-bin.001 79 Query 1 79 use `test`; BEGIN
+master-bin.001 119 Query 1 79 use `test`; insert into t1 values(2)
+master-bin.001 178 Query 1 79 use `test`; insert into t2 select * from t1
+master-bin.001 244 Query 1 244 use `test`; ROLLBACK
delete from t1;
delete from t2;
reset master;
@@ -39,13 +39,13 @@ Warning: Some non-transactional changed tables couldn't be rolled back
commit;
show binlog events from 79;
Log_name Pos Event_type Server_id Orig_log_pos Info
-master-bin.001 79 Query 1 79 use test; BEGIN
-master-bin.001 119 Query 1 79 use test; insert into t1 values(3)
-master-bin.001 178 Query 1 79 use test; savepoint my_savepoint
-master-bin.001 235 Query 1 79 use test; insert into t1 values(4)
-master-bin.001 294 Query 1 79 use test; insert into t2 select * from t1
-master-bin.001 360 Query 1 79 use test; rollback to savepoint my_savepoint
-master-bin.001 429 Query 1 429 use test; COMMIT
+master-bin.001 79 Query 1 79 use `test`; BEGIN
+master-bin.001 119 Query 1 79 use `test`; insert into t1 values(3)
+master-bin.001 178 Query 1 79 use `test`; savepoint my_savepoint
+master-bin.001 235 Query 1 79 use `test`; insert into t1 values(4)
+master-bin.001 294 Query 1 79 use `test`; insert into t2 select * from t1
+master-bin.001 360 Query 1 79 use `test`; rollback to savepoint my_savepoint
+master-bin.001 429 Query 1 429 use `test`; COMMIT
delete from t1;
delete from t2;
reset master;
@@ -64,14 +64,14 @@ a
7
show binlog events from 79;
Log_name Pos Event_type Server_id Orig_log_pos Info
-master-bin.001 79 Query 1 79 use test; BEGIN
-master-bin.001 119 Query 1 79 use test; insert into t1 values(5)
-master-bin.001 178 Query 1 79 use test; savepoint my_savepoint
-master-bin.001 235 Query 1 79 use test; insert into t1 values(6)
-master-bin.001 294 Query 1 79 use test; insert into t2 select * from t1
-master-bin.001 360 Query 1 79 use test; rollback to savepoint my_savepoint
-master-bin.001 429 Query 1 79 use test; insert into t1 values(7)
-master-bin.001 488 Query 1 488 use test; COMMIT
+master-bin.001 79 Query 1 79 use `test`; BEGIN
+master-bin.001 119 Query 1 79 use `test`; insert into t1 values(5)
+master-bin.001 178 Query 1 79 use `test`; savepoint my_savepoint
+master-bin.001 235 Query 1 79 use `test`; insert into t1 values(6)
+master-bin.001 294 Query 1 79 use `test`; insert into t2 select * from t1
+master-bin.001 360 Query 1 79 use `test`; rollback to savepoint my_savepoint
+master-bin.001 429 Query 1 79 use `test`; insert into t1 values(7)
+master-bin.001 488 Query 1 488 use `test`; COMMIT
delete from t1;
delete from t2;
reset master;
@@ -86,10 +86,10 @@ get_lock("a",10)
1
show binlog events from 79;
Log_name Pos Event_type Server_id Orig_log_pos Info
-master-bin.001 79 Query 1 79 use test; BEGIN
-master-bin.001 119 Query 1 79 use test; insert into t1 values(8)
-master-bin.001 178 Query 1 79 use test; insert into t2 select * from t1
-master-bin.001 244 Query 1 244 use test; ROLLBACK
+master-bin.001 79 Query 1 79 use `test`; BEGIN
+master-bin.001 119 Query 1 79 use `test`; insert into t1 values(8)
+master-bin.001 178 Query 1 79 use `test`; insert into t2 select * from t1
+master-bin.001 244 Query 1 244 use `test`; ROLLBACK
delete from t1;
delete from t2;
reset master;
@@ -97,8 +97,8 @@ insert into t1 values(9);
insert into t2 select * from t1;
show binlog events from 79;
Log_name Pos Event_type Server_id Orig_log_pos Info
-master-bin.001 79 Query 1 79 use test; insert into t1 values(9)
-master-bin.001 138 Query 1 138 use test; insert into t2 select * from t1
+master-bin.001 79 Query 1 79 use `test`; insert into t1 values(9)
+master-bin.001 138 Query 1 138 use `test`; insert into t2 select * from t1
delete from t1;
delete from t2;
reset master;
@@ -107,17 +107,17 @@ begin;
insert into t2 select * from t1;
show binlog events from 79;
Log_name Pos Event_type Server_id Orig_log_pos Info
-master-bin.001 79 Query 1 79 use test; insert into t1 values(10)
-master-bin.001 139 Query 1 139 use test; insert into t2 select * from t1
+master-bin.001 79 Query 1 79 use `test`; insert into t1 values(10)
+master-bin.001 139 Query 1 139 use `test`; insert into t2 select * from t1
insert into t1 values(11);
commit;
show binlog events from 79;
Log_name Pos Event_type Server_id Orig_log_pos Info
-master-bin.001 79 Query 1 79 use test; insert into t1 values(10)
-master-bin.001 139 Query 1 139 use test; insert into t2 select * from t1
-master-bin.001 205 Query 1 205 use test; BEGIN
-master-bin.001 245 Query 1 205 use test; insert into t1 values(11)
-master-bin.001 305 Query 1 305 use test; COMMIT
+master-bin.001 79 Query 1 79 use `test`; insert into t1 values(10)
+master-bin.001 139 Query 1 139 use `test`; insert into t2 select * from t1
+master-bin.001 205 Query 1 205 use `test`; BEGIN
+master-bin.001 245 Query 1 205 use `test`; insert into t1 values(11)
+master-bin.001 305 Query 1 305 use `test`; COMMIT
alter table t2 type=INNODB;
delete from t1;
delete from t2;
@@ -128,10 +128,10 @@ insert into t2 select * from t1;
commit;
show binlog events from 79;
Log_name Pos Event_type Server_id Orig_log_pos Info
-master-bin.001 79 Query 1 79 use test; BEGIN
-master-bin.001 119 Query 1 79 use test; insert into t1 values(12)
-master-bin.001 179 Query 1 79 use test; insert into t2 select * from t1
-master-bin.001 245 Query 1 245 use test; COMMIT
+master-bin.001 79 Query 1 79 use `test`; BEGIN
+master-bin.001 119 Query 1 79 use `test`; insert into t1 values(12)
+master-bin.001 179 Query 1 79 use `test`; insert into t2 select * from t1
+master-bin.001 245 Query 1 245 use `test`; COMMIT
delete from t1;
delete from t2;
reset master;
@@ -153,9 +153,9 @@ rollback to savepoint my_savepoint;
commit;
show binlog events from 79;
Log_name Pos Event_type Server_id Orig_log_pos Info
-master-bin.001 79 Query 1 79 use test; BEGIN
-master-bin.001 119 Query 1 79 use test; insert into t1 values(14)
-master-bin.001 179 Query 1 179 use test; COMMIT
+master-bin.001 79 Query 1 79 use `test`; BEGIN
+master-bin.001 119 Query 1 79 use `test`; insert into t1 values(14)
+master-bin.001 179 Query 1 179 use `test`; COMMIT
delete from t1;
delete from t2;
reset master;
@@ -173,8 +173,8 @@ a
18
show binlog events from 79;
Log_name Pos Event_type Server_id Orig_log_pos Info
-master-bin.001 79 Query 1 79 use test; BEGIN
-master-bin.001 119 Query 1 79 use test; insert into t1 values(16)
-master-bin.001 179 Query 1 79 use test; insert into t1 values(18)
-master-bin.001 239 Query 1 239 use test; COMMIT
+master-bin.001 79 Query 1 79 use `test`; BEGIN
+master-bin.001 119 Query 1 79 use `test`; insert into t1 values(16)
+master-bin.001 179 Query 1 79 use `test`; insert into t1 values(18)
+master-bin.001 239 Query 1 239 use `test`; COMMIT
drop table t1,t2;
diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result
index 63f026274af..eeac31ba40b 100644
--- a/mysql-test/r/mysqlbinlog.result
+++ b/mysql-test/r/mysqlbinlog.result
@@ -1,5 +1,4 @@
-drop table if exists t1;
-drop table if exists t2;
+drop table if exists t1,t2;
set timestamp=1000000000;
create table t1 (word varchar(20));
create table t2 (id int auto_increment not null primary key);
@@ -25,11 +24,11 @@ insert into t1 values ("abirvalg");
SET INSERT_ID=1;
SET TIMESTAMP=1000000000;
insert into t2 values ();
-LOAD DATA LOCAL INFILE '/home/dlenev/src/mysql-4.0-binlog/mysql-test/var/tmp/words.dat-1-0 ' INTO TABLE t1 FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
-LOAD DATA LOCAL INFILE '/home/dlenev/src/mysql-4.0-binlog/mysql-test/var/tmp/words.dat-2-0 ' INTO TABLE t1 FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
-LOAD DATA LOCAL INFILE '/home/dlenev/src/mysql-4.0-binlog/mysql-test/var/tmp/words.dat-3-0 ' INTO TABLE t1 FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
-LOAD DATA LOCAL INFILE '/home/dlenev/src/mysql-4.0-binlog/mysql-test/var/tmp/words.dat-4-0 ' INTO TABLE t1 FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
-LOAD DATA LOCAL INFILE '/home/dlenev/src/mysql-4.0-binlog/mysql-test/var/tmp/words.dat-5-0 ' INTO TABLE t1 FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
+LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-1-0' INTO TABLE t1 FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
+LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-2-0' INTO TABLE t1 FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
+LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-3-0' INTO TABLE t1 FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
+LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-4-0' INTO TABLE t1 FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
+LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-5-0' INTO TABLE t1 FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
--- Broken LOAD DATA --
use test;
diff --git a/mysql-test/r/rpl_log.result b/mysql-test/r/rpl_log.result
index 26e465f9c3b..7e2a8df75ac 100644
--- a/mysql-test/r/rpl_log.result
+++ b/mysql-test/r/rpl_log.result
@@ -20,24 +20,24 @@ drop table t1;
show binlog events;
Log_name Pos Event_type Server_id Orig_log_pos Info
master-bin.001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3
-master-bin.001 79 Query 1 79 use test; create table t1(n int not null auto_increment primary key)
+master-bin.001 79 Query 1 79 use `test`; create table t1(n int not null auto_increment primary key)
master-bin.001 172 Intvar 1 172 INSERT_ID=1
-master-bin.001 200 Query 1 200 use test; insert into t1 values (NULL)
-master-bin.001 263 Query 1 263 use test; drop table t1
-master-bin.001 311 Query 1 311 use test; create table t1 (word char(20) not null)
+master-bin.001 200 Query 1 200 use `test`; insert into t1 values (NULL)
+master-bin.001 263 Query 1 263 use `test`; drop table t1
+master-bin.001 311 Query 1 311 use `test`; create table t1 (word char(20) not null)
master-bin.001 386 Create_file 1 386 db=test;table=t1;file_id=1;block_len=581
master-bin.001 1056 Exec_load 1 1056 ;file_id=1
-master-bin.001 1079 Query 1 1079 use test; drop table t1
+master-bin.001 1079 Query 1 1079 use `test`; drop table t1
show binlog events from 79 limit 1;
Log_name Pos Event_type Server_id Orig_log_pos Info
-master-bin.001 79 Query 1 79 use test; create table t1(n int not null auto_increment primary key)
+master-bin.001 79 Query 1 79 use `test`; create table t1(n int not null auto_increment primary key)
show binlog events from 79 limit 2;
Log_name Pos Event_type Server_id Orig_log_pos Info
-master-bin.001 79 Query 1 79 use test; create table t1(n int not null auto_increment primary key)
+master-bin.001 79 Query 1 79 use `test`; create table t1(n int not null auto_increment primary key)
master-bin.001 172 Intvar 1 172 INSERT_ID=1
show binlog events from 79 limit 2,1;
Log_name Pos Event_type Server_id Orig_log_pos Info
-master-bin.001 200 Query 1 200 use test; insert into t1 values (NULL)
+master-bin.001 200 Query 1 200 use `test`; insert into t1 values (NULL)
flush logs;
create table t5 (a int);
drop table t5;
@@ -50,22 +50,22 @@ drop table t1;
show binlog events;
Log_name Pos Event_type Server_id Orig_log_pos Info
master-bin.001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3
-master-bin.001 79 Query 1 79 use test; create table t1(n int not null auto_increment primary key)
+master-bin.001 79 Query 1 79 use `test`; create table t1(n int not null auto_increment primary key)
master-bin.001 172 Intvar 1 172 INSERT_ID=1
-master-bin.001 200 Query 1 200 use test; insert into t1 values (NULL)
-master-bin.001 263 Query 1 263 use test; drop table t1
-master-bin.001 311 Query 1 311 use test; create table t1 (word char(20) not null)
+master-bin.001 200 Query 1 200 use `test`; insert into t1 values (NULL)
+master-bin.001 263 Query 1 263 use `test`; drop table t1
+master-bin.001 311 Query 1 311 use `test`; create table t1 (word char(20) not null)
master-bin.001 386 Create_file 1 386 db=test;table=t1;file_id=1;block_len=581
master-bin.001 1056 Exec_load 1 1056 ;file_id=1
-master-bin.001 1079 Query 1 1079 use test; drop table t1
+master-bin.001 1079 Query 1 1079 use `test`; drop table t1
master-bin.001 1127 Rotate 1 1127 master-bin.002;pos=4
show binlog events in 'master-bin.002';
Log_name Pos Event_type Server_id Orig_log_pos Info
-master-bin.002 4 Query 1 4 use test; create table t5 (a int)
-master-bin.002 62 Query 1 62 use test; drop table t5
-master-bin.002 110 Query 1 110 use test; create table t1 (n int)
-master-bin.002 168 Query 1 168 use test; insert into t1 values (1)
-master-bin.002 228 Query 1 228 use test; drop table t1
+master-bin.002 4 Query 1 4 use `test`; create table t5 (a int)
+master-bin.002 62 Query 1 62 use `test`; drop table t5
+master-bin.002 110 Query 1 110 use `test`; create table t1 (n int)
+master-bin.002 168 Query 1 168 use `test`; insert into t1 values (1)
+master-bin.002 228 Query 1 228 use `test`; drop table t1
show master logs;
Log_name
master-bin.001
@@ -78,22 +78,22 @@ slave-bin.002
show binlog events in 'slave-bin.001' from 4;
Log_name Pos Event_type Server_id Orig_log_pos Info
slave-bin.001 4 Start 2 4 Server ver: VERSION, Binlog ver: 3
-slave-bin.001 79 Query 1 79 use test; create table t1(n int not null auto_increment primary key)
+slave-bin.001 79 Query 1 79 use `test`; create table t1(n int not null auto_increment primary key)
slave-bin.001 172 Intvar 1 172 INSERT_ID=1
-slave-bin.001 200 Query 1 200 use test; insert into t1 values (NULL)
-slave-bin.001 263 Query 1 263 use test; drop table t1
-slave-bin.001 311 Query 1 311 use test; create table t1 (word char(20) not null)
+slave-bin.001 200 Query 1 200 use `test`; insert into t1 values (NULL)
+slave-bin.001 263 Query 1 263 use `test`; drop table t1
+slave-bin.001 311 Query 1 311 use `test`; create table t1 (word char(20) not null)
slave-bin.001 386 Create_file 1 386 db=test;table=t1;file_id=1;block_len=581
slave-bin.001 1065 Exec_load 1 1065 ;file_id=1
-slave-bin.001 1088 Query 1 1088 use test; drop table t1
-slave-bin.001 1136 Query 1 1136 use test; create table t5 (a int)
-slave-bin.001 1194 Query 1 1194 use test; drop table t5
+slave-bin.001 1088 Query 1 1088 use `test`; drop table t1
+slave-bin.001 1136 Query 1 1136 use `test`; create table t5 (a int)
+slave-bin.001 1194 Query 1 1194 use `test`; drop table t5
slave-bin.001 1242 Rotate 2 1242 slave-bin.002;pos=4
show binlog events in 'slave-bin.002' from 4;
Log_name Pos Event_type Server_id Orig_log_pos Info
-slave-bin.002 4 Query 1 4 use test; create table t1 (n int)
-slave-bin.002 62 Query 1 62 use test; insert into t1 values (1)
-slave-bin.002 122 Query 1 122 use test; drop table t1
+slave-bin.002 4 Query 1 4 use `test`; create table t1 (n int)
+slave-bin.002 62 Query 1 62 use `test`; insert into t1 values (1)
+slave-bin.002 122 Query 1 122 use `test`; drop table t1
show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
127.0.0.1 root MASTER_PORT 1 master-bin.002 276 slave-relay-bin.003 211 master-bin.002 Yes Yes 0 0 276 211
diff --git a/mysql-test/t/fulltext_multi.test b/mysql-test/t/fulltext_multi.test
index 233c243146e..f71704e1bb9 100644
--- a/mysql-test/t/fulltext_multi.test
+++ b/mysql-test/t/fulltext_multi.test
@@ -1,5 +1,5 @@
# several FULLTEXT indexes in one table test
-use test;
+
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
a int(11) NOT NULL auto_increment,
diff --git a/mysql-test/t/fulltext_order_by.test b/mysql-test/t/fulltext_order_by.test
index 3b60ee77db2..8c34230cfe3 100644
--- a/mysql-test/t/fulltext_order_by.test
+++ b/mysql-test/t/fulltext_order_by.test
@@ -1,4 +1,3 @@
-use test;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
a INT AUTO_INCREMENT PRIMARY KEY,
diff --git a/mysql-test/t/ins000001.test b/mysql-test/t/ins000001.test
deleted file mode 100644
index 4d75b4e7fe3..00000000000
--- a/mysql-test/t/ins000001.test
+++ /dev/null
@@ -1,9 +0,0 @@
-use test;
-drop table if exists t1,t2;
-create table t1 (email varchar(50));
-insert into t1 values ('sasha@mysql.com'),('monty@mysql.com'),
-('foo@hotmail.com'),('foo@aol.com'),('bar@aol.com');
-create table t2(id int not null auto_increment primary key,
- t2 varchar(50), unique(t2));
-insert into t2 (t2) select distinct substring(email, locate('@', email)+1) from t1;
-select * from t2;
diff --git a/mysql-test/t/insert.test b/mysql-test/t/insert.test
index be585157e63..fbb9134ff7f 100644
--- a/mysql-test/t/insert.test
+++ b/mysql-test/t/insert.test
@@ -2,7 +2,7 @@
# Test of refering to old values
#
-drop table if exists t1;
+drop table if exists t1,t2;
create table t1 (a int not null);
insert into t1 values (1);
insert into t1 values (a+2);
@@ -62,13 +62,25 @@ select * from t1;
drop table t1;
#
+# Test if insert ... select distinct
+#
+
+create table t1 (email varchar(50));
+insert into t1 values ('sasha@mysql.com'),('monty@mysql.com'),('foo@hotmail.com'),('foo@aol.com'),('bar@aol.com');
+create table t2(id int not null auto_increment primary key, t2 varchar(50), unique(t2));
+insert into t2 (t2) select distinct substring(email, locate('@', email)+1) from t1;
+select * from t2;
+drop table t1,t2;
+
+#
# Test of mysqld crash with fully qualified column names
#
-drop database if exists foo;
-create database foo;
-use foo;
+--disable_warnings
+drop database if exists mysqltest;
+--enable_warnings
+create database mysqltest;
+use mysqltest;
create table t1 (c int);
-insert into foo.t1 set foo.t1.c = '1';
-drop database foo;
-
+insert into mysqltest.t1 set mysqltest.t1.c = '1';
+drop database mysqltest;
diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test
index 78992cb1e11..736c5e32622 100644
--- a/mysql-test/t/mysqlbinlog.test
+++ b/mysql-test/t/mysqlbinlog.test
@@ -1,7 +1,6 @@
# We are using .opt file since we need small binlog size
--disable_warnings
-drop table if exists t1;
-drop table if exists t2;
+drop table if exists t1,t2;
--enable_warnings
# we need this for getting fixed timestamps inside of this test
@@ -39,6 +38,7 @@ select "--- Local --" as "";
# be time dependend. Better than nothing.
#
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
--exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.001
# this should not fail but shouldn't produce any working statements
--disable_query_log
@@ -50,12 +50,14 @@ select "--- Broken LOAD DATA --" as "";
--disable_query_log
select "--- --database --" as "";
--enable_query_log
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
--exec $MYSQL_BINLOG --short-form --database=nottest $MYSQL_TEST_DIR/var/log/master-bin.001
# this test for position option
--disable_query_log
select "--- --position --" as "";
--enable_query_log
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
--exec $MYSQL_BINLOG --short-form --position=27 $MYSQL_TEST_DIR/var/log/master-bin.002
# These are tests for remote binlog.
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 189c4f37252..292e371e4dd 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -244,9 +244,9 @@ void Query_log_event::pack_info(String* packet)
tmp.length(0);
if (db && db_len)
{
- tmp.append("use ");
+ tmp.append("use `",5);
tmp.append(db, db_len);
- tmp.append("; ", 2);
+ tmp.append("`; ", 3);
}
if (query && q_len)
diff --git a/support-files/mysql.server.sh b/support-files/mysql.server.sh
index fe1f0de8477..89d45e0f26d 100644
--- a/support-files/mysql.server.sh
+++ b/support-files/mysql.server.sh
@@ -57,16 +57,6 @@ fi
PATH=/sbin:/usr/sbin:/bin:/usr/bin:$basedir/bin
export PATH
-if test -z "$pid_file"
-then
- pid_file=$datadir/`@HOSTNAME@`.pid
-else
- case "$pid_file" in
- /* ) ;;
- * ) pid_file="$datadir/$pid_file" ;;
- esac
-fi
-
mode=$1 # start or stop
parse_arguments() {
@@ -119,6 +109,19 @@ else
fi
#
+# Set pid file if not given
+#
+if test -z "$pid_file"
+then
+ pid_file=$datadir/`@HOSTNAME@`.pid
+else
+ case "$pid_file" in
+ /* ) ;;
+ * ) pid_file="$datadir/$pid_file" ;;
+ esac
+fi
+
+#
# Test if someone changed datadir; In this case we should also read the
# default arguments from this directory
#