Below is the list of changes that have just been committed into a local
5.0 repository of msvensson. When msvensson 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
1.1920 05/05/26 15:22:15 msvensson@neptunus.(none) +16 -0
Merge from 4.1 to 5.0(second attempt)
sql/sql_repl.cc
1.137 05/05/26 15:22:11 msvensson@neptunus.(none) +0 -2
Merged, function moved to log.cc, the added O_SHARE should probably go into that file
sql/sql_parse.cc
1.435 05/05/26 15:22:11 msvensson@neptunus.(none) +0 -3
Merged, changed code was removed from 5.0. The change was to use select_lex pointer
instead of lex->select_lex. Can be done in several places of 5.0
mysql-test/t/union.test
1.86 05/05/26 15:22:11 msvensson@neptunus.(none) +2 -2
Merged
mysql-test/t/select.test
1.47 05/05/26 15:22:11 msvensson@neptunus.(none) +0 -0
Merged
mysql-test/r/union.result
1.72 05/05/26 15:22:11 msvensson@neptunus.(none) +5 -5
Merged, added tescases
client/client_priv.h
1.36 05/05/26 15:22:11 msvensson@neptunus.(none) +1 -2
Merged, added OPT_DROP_DATABASE
sql/sql_yacc.yy
1.382 05/05/26 14:39:50 msvensson@neptunus.(none) +0 -0
Auto merged
sql/sql_lex.cc
1.145 05/05/26 14:39:49 msvensson@neptunus.(none) +0 -0
Auto merged
sql/item.cc
1.124 05/05/26 14:39:49 msvensson@neptunus.(none) +0 -0
Auto merged
mysys/my_open.c
1.21 05/05/26 14:39:49 msvensson@neptunus.(none) +0 -0
Auto merged
mysql-test/t/mysqldump.test
1.38 05/05/26 14:39:49 msvensson@neptunus.(none) +0 -0
Auto merged
mysql-test/r/select.result
1.62 05/05/26 14:39:48 msvensson@neptunus.(none) +1 -1
Auto merged
mysql-test/r/mysqldump.result
1.44 05/05/26 14:39:48 msvensson@neptunus.(none) +38 -38
Auto merged
include/my_sys.h
1.157 05/05/26 14:39:48 msvensson@neptunus.(none) +0 -0
Auto merged
include/my_global.h
1.89 05/05/26 14:39:48 msvensson@neptunus.(none) +0 -0
Auto merged
client/mysqldump.c
1.181 05/05/26 14:39:48 msvensson@neptunus.(none) +0 -0
Auto merged
# 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: msvensson
# Host: neptunus.(none)
# Root: /home/msvensson/mysql/mysql-5.0/RESYNC
--- 1.180/client/mysqldump.c 2005-05-19 00:40:31 +02:00
+++ 1.181/client/mysqldump.c 2005-05-26 14:39:48 +02:00
@@ -85,7 +85,7 @@
opt_delete_master_logs=0, tty_password=0,
opt_single_transaction=0, opt_comments= 0, opt_compact= 0,
opt_hex_blob=0, opt_order_by_primary=0, opt_ignore=0,
- opt_complete_insert= 0;
+ opt_complete_insert= 0, opt_drop_database= 0;
static ulong opt_max_allowed_packet, opt_net_buffer_length;
static MYSQL mysql_connection,*sock=0;
static my_bool insert_pat_inited=0;
@@ -161,6 +161,9 @@
"Dump all the databases. This will be same as --databases with all databases
selected.",
(gptr*) &opt_alldbs, (gptr*) &opt_alldbs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
+ {"add-drop-database", OPT_DROP_DATABASE, "Add a 'DROP DATABASE' before each create.",
+ (gptr*) &opt_drop_database, (gptr*) &opt_drop_database, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0,
+ 0},
{"add-drop-table", OPT_DROP, "Add a 'drop table' before each create.",
(gptr*) &opt_drop, (gptr*) &opt_drop, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0,
0},
@@ -1144,9 +1147,9 @@
else
dynstr_set(&insert_pat, "");
- insert_option= (opt_delayed && opt_ignore) ? " DELAYED IGNORE " :
- opt_delayed ? " DELAYED " :
- opt_ignore ? " IGNORE " : "";
+ insert_option= ((opt_delayed && opt_ignore) ? " DELAYED IGNORE " :
+ opt_delayed ? " DELAYED " :
+ opt_ignore ? " IGNORE " : "");
if (verbose)
fprintf(stderr, "-- Retrieving table structure for table %s...\n", table);
@@ -2116,12 +2119,20 @@
if (mysql_query(sock, qbuf) || !(dbinfo = mysql_store_result(sock)))
{
/* 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])
{
--- 1.156/include/my_sys.h 2005-05-20 23:31:13 +02:00
+++ 1.157/include/my_sys.h 2005-05-26 14:39:48 +02:00
@@ -605,6 +605,7 @@
#else
#define my_access access
#endif
+extern int check_if_legal_filename(const char *path);
#ifndef TERMINATE
extern void TERMINATE(FILE *file);
--- 1.20/mysys/my_open.c 2005-05-24 00:31:26 +02:00
+++ 1.21/mysys/my_open.c 2005-05-26 14:39:49 +02:00
@@ -47,12 +47,15 @@
FileName, Flags, MyFlags));
#if defined(MSDOS) || defined(__WIN__) || defined(__EMX__) || defined(OS2)
/*
- if we are not creating, then we need to use my_access to make
- sure the file exists since Windows doesn't handle files like
- "com1.sym" very well
+ Check that we don't try to open or create a file name that may
+ cause problems for us in the future (like PRN)
*/
- if (! (Flags & O_CREAT) && my_access(FileName, F_OK))
- return -1;
+ if (check_if_legal_filename(FileName))
+ {
+ errno= EACCES;
+ DBUG_RETURN(my_register_filename(-1, FileName, FILE_BY_OPEN,
+ EE_FILENOTFOUND, MyFlags));
+ }
if (Flags & O_SHARE)
fd = sopen((my_string) FileName, (Flags & ~O_SHARE) | O_BINARY, SH_DENYNO,
MY_S_IREAD | MY_S_IWRITE);
--- 1.123/sql/item.cc 2005-05-25 23:18:20 +02:00
+++ 1.124/sql/item.cc 2005-05-26 14:39:49 +02:00
@@ -3700,6 +3700,7 @@
*ptr=0; // Keep purify happy
collation.set(&my_charset_bin, DERIVATION_COERCIBLE);
fixed= 1;
+ unsigned_flag= 1;
}
longlong Item_hex_string::val_int()
--- 1.144/sql/sql_lex.cc 2005-05-19 03:48:17 +02:00
+++ 1.145/sql/sql_lex.cc 2005-05-26 14:39:49 +02:00
@@ -423,7 +423,7 @@
static const char *unsigned_longlong_str="18446744073709551615";
static const uint unsigned_longlong_len=20;
-inline static uint int_token(const char *str,uint length)
+static inline uint int_token(const char *str,uint length)
{
if (length < long_len) // quick normal case
return NUM;
--- 1.381/sql/sql_yacc.yy 2005-05-25 18:54:59 +02:00
+++ 1.382/sql/sql_yacc.yy 2005-05-26 14:39:50 +02:00
@@ -3972,7 +3972,7 @@
select_into select_lock_type;
select_into:
- opt_limit_clause {}
+ opt_order_clause opt_limit_clause {}
| into
| select_from
| into select_from
--- 1.71/mysql-test/r/union.result 2005-05-05 22:01:35 +02:00
+++ 1.72/mysql-test/r/union.result 2005-05-26 15:22:11 +02:00
@@ -1201,27 +1201,27 @@
value is: 6
some text
CREATE TABLE t1 (
-a ENUM('ä','ö','ü') character set utf8 not null default 'ü',
+a ENUM('ä','ö','ü') character set utf8 not null default 'ü',
b ENUM("one", "two") character set utf8,
c ENUM("one", "two")
);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` enum('ä','ö','ü') character set utf8 NOT NULL default 'ü',
+ `a` enum('ä','ö','ü') character set utf8 NOT NULL default 'ü',
`b` enum('one','two') character set utf8 default NULL,
`c` enum('one','two') default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-insert into t1 values ('ä', 'one', 'one'), ('ö', 'two', 'one'), ('ü', NULL, NULL);
+insert into t1 values ('ä', 'one', 'one'), ('ö', 'two', 'one'), ('ü',
NULL, NULL);
create table t2 select NULL union select a from t1;
show columns from t2;
Field Type Null Key Default Extra
-NULL enum('ä','ö','ü') YES NULL
+NULL enum('ä','ö','ü') YES NULL
drop table t2;
create table t2 select a from t1 union select NULL;
show columns from t2;
Field Type Null Key Default Extra
-a enum('ä','ö','ü') YES NULL
+a enum('ä','ö','ü') YES NULL
drop table t2;
create table t2 select a from t1 union select a from t1;
show columns from t2;
@@ -1235,6 +1235,25 @@
Field Type Null Key Default Extra
a varchar(3) YES NULL
drop table t2, t1;
+create table t1 ( id int not null auto_increment, primary key (id), col1 int);
+insert into t1 (col1) values (2),(3),(4),(5),(6);
+select 99 union all select id from t1 order by 1;
+99
+1
+2
+3
+4
+5
+99
+select id from t1 union all select 99 order by 1;
+id
+1
+2
+3
+4
+5
+99
+drop table t1;
create table t1 (a varchar(5));
create table t2 select * from t1 union select 'abcdefghijkl';
show create table t2;
--- 1.85/mysql-test/t/union.test 2005-04-11 12:08:58 +02:00
+++ 1.86/mysql-test/t/union.test 2005-05-26 15:22:11 +02:00
@@ -740,12 +740,12 @@
# Enum merging test
#
CREATE TABLE t1 (
- a ENUM('ä','ö','ü') character set utf8 not null default 'ü',
+ a ENUM('ä','ö','ü') character set utf8 not null default 'ü',
b ENUM("one", "two") character set utf8,
c ENUM("one", "two")
);
show create table t1;
-insert into t1 values ('ä', 'one', 'one'), ('ö', 'two', 'one'), ('ü', NULL, NULL);
+insert into t1 values ('ä', 'one', 'one'), ('ö', 'two', 'one'), ('ü',
NULL, NULL);
create table t2 select NULL union select a from t1;
show columns from t2;
drop table t2;
@@ -760,6 +760,17 @@
create table t2 select a from t1 union select b from t1;
show columns from t2;
drop table t2, t1;
+
+
+#
+# Bug #10032 Bug in parsing UNION with ORDER BY when one node does not use FROM
+#
+
+create table t1 ( id int not null auto_increment, primary key (id), col1 int);
+insert into t1 (col1) values (2),(3),(4),(5),(6);
+select 99 union all select id from t1 order by 1;
+select id from t1 union all select 99 order by 1;
+drop table t1;
#
# Test that union with VARCHAR produces dynamic row tables
--- 1.61/mysql-test/r/select.result 2005-05-19 20:54:28 +02:00
+++ 1.62/mysql-test/r/select.result 2005-05-26 14:39:48 +02:00
@@ -2676,3 +2676,9 @@
COUNT(*)
0
drop table t1;
+CREATE TABLE t1 (b BIGINT(20) UNSIGNED NOT NULL, PRIMARY KEY (b));
+INSERT INTO t1 VALUES (0x8000000000000000);
+SELECT b FROM t1 WHERE b=0x8000000000000000;
+b
+9223372036854775808
+DROP TABLE t1;
--- 1.46/mysql-test/t/select.test 2005-05-19 15:20:02 +02:00
+++ 1.47/mysql-test/t/select.test 2005-05-26 15:22:11 +02:00
@@ -1998,6 +1998,15 @@
drop table t1;
#
+
+#
+# Test for Bug#8009, SELECT failed on bigint unsigned when using HEX
+#
+
+CREATE TABLE t1 (b BIGINT(20) UNSIGNED NOT NULL, PRIMARY KEY (b));
+INSERT INTO t1 VALUES (0x8000000000000000);
+SELECT b FROM t1 WHERE b=0x8000000000000000;
+DROP TABLE t1;
# Test for bug #6474
#
--- 1.35/client/client_priv.h 2005-05-14 19:28:15 +02:00
+++ 1.36/client/client_priv.h 2005-05-26 15:22:11 +02:00
@@ -49,5 +49,5 @@
#ifdef HAVE_NDBCLUSTER_DB
OPT_NDBCLUSTER, OPT_NDB_CONNECTSTRING,
#endif
- OPT_IGNORE_TABLE,OPT_INSERT_IGNORE,OPT_SHOW_WARNINGS
+ ,OPT_IGNORE_TABLE,OPT_INSERT_IGNORE,OPT_DROP_DATABASE, OPT_SHOW_WARNINGS
};
--- 1.88/include/my_global.h 2005-05-23 20:20:21 +02:00
+++ 1.89/include/my_global.h 2005-05-26 14:39:48 +02:00
@@ -310,12 +310,14 @@
#endif
#if defined(__ia64__)
#define new my_arg_new
+#define need_to_restore_new 1
#endif
C_MODE_START
#include <asm/atomic.h>
C_MODE_END
-#if defined(__ia64__)
+#ifdef need_to_restore_new /* probably safer than #ifdef new */
#undef new
+#undef need_to_restore_new
#endif
#endif
#include <errno.h> /* Recommended by debian */
--- 1.43/mysql-test/r/mysqldump.result 2005-05-19 00:40:31 +02:00
+++ 1.44/mysql-test/r/mysqldump.result 2005-05-26 14:39:48 +02:00
@@ -1384,3 +1384,41 @@
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
drop table t1;
+CREATE TABLE t1 (a int);
+INSERT INTO t1 VALUES (1),(2),(3);
+
+/*!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 */;
+/*!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 */;
+
+/*!40000 DROP DATABASE IF EXISTS `test`*/;
+
+CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */;
+
+USE `test`;
+DROP TABLE IF EXISTS `t1`;
+CREATE TABLE `t1` (
+ `a` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+
+
+/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
+LOCK TABLES `t1` WRITE;
+INSERT INTO `t1` VALUES (1),(2),(3);
+UNLOCK TABLES;
+/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
+
+/*!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;
--- 1.37/mysql-test/t/mysqldump.test 2005-05-18 20:06:31 +02:00
+++ 1.38/mysql-test/t/mysqldump.test 2005-05-26 14:39:49 +02:00
@@ -554,3 +554,12 @@
insert into t1 (F_8d3bba7425e7c98c50f52ca1b52d3735) values (1);
--exec $MYSQL_DUMP --skip-comments -c test
drop table t1;
+
+#
+# Test for --add-drop-database
+#
+
+CREATE TABLE t1 (a int);
+INSERT INTO t1 VALUES (1),(2),(3);
+--exec $MYSQL_DUMP --add-drop-database --skip-comments --databases test
+DROP TABLE t1;
--- 1.136/sql/sql_repl.cc 2005-05-24 16:52:44 +02:00
+++ 1.137/sql/sql_repl.cc 2005-05-26 15:22:11 +02:00
@@ -1479,13 +1479,11 @@
{
IO_CACHE *index_file;
LOG_INFO cur;
- IO_CACHE log;
File file;
- const char *errmsg= 0;
- MY_STAT stat_area;
char fname[FN_REFLEN];
List<Item> field_list;
uint length;
+ int cur_dir_len;
Protocol *protocol= thd->protocol;
DBUG_ENTER("show_binlogs");
@@ -1505,34 +1503,35 @@
index_file=mysql_bin_log.get_index_file();
mysql_bin_log.get_current_log(&cur);
- int cur_dir_len = dirname_length(cur.log_file_name);
+ cur_dir_len= dirname_length(cur.log_file_name);
reinit_io_cache(index_file, READ_CACHE, (my_off_t) 0, 0, 0);
/* The file ends with EOF or empty line */
while ((length=my_b_gets(index_file, fname, sizeof(fname))) > 1)
{
- fname[--length] = '\0'; /* remove the newline */
+ int dir_len;
+ ulonglong file_length= 0; // Length if open fails
+ fname[--length] = '\0'; // remove the newline
protocol->prepare_for_resend();
- int dir_len = dirname_length(fname);
- protocol->store(fname + dir_len, length-dir_len, &my_charset_bin);
- if(!(strncmp(fname+dir_len, cur.log_file_name+cur_dir_len, length-dir_len)))
+ dir_len= dirname_length(fname);
+ length-= dir_len;
+ protocol->store(fname + dir_len, length, &my_charset_bin);
+
+ if (!(strncmp(fname+dir_len, cur.log_file_name+cur_dir_len, length)))
+ file_length= cur.pos; /* The active log, use the active position */
+ else
{
- /* this is the active log, use the active position */
- protocol->store((ulonglong) cur.pos);
- } else {
/* this is an old log, open it and find the size */
- if ((file=open_binlog(&log, fname+dir_len, &errmsg)) >= 0)
+ if ((file= my_open(fname+dir_len, O_RDONLY | O_SHARE | O_BINARY,
+ MYF(0))) >= 0)
{
- protocol->store((ulonglong) my_b_filelength(&log));
- end_io_cache(&log);
+ file_length= (ulonglong) my_seek(file, 0L, MY_SEEK_END, MYF(0));
my_close(file, MYF(0));
- } else {
- /* the file wasn't openable, but 0 is an invalid value anyway */
- protocol->store((ulonglong) 0);
}
}
+ protocol->store(file_length);
if (protocol->write())
goto err;
}
| Thread |
|---|
| • bk commit into 5.0 tree (msvensson:1.1920) | msvensson | 27 May |