summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2004-03-25 23:29:45 +0200
committerunknown <monty@mysql.com>2004-03-25 23:29:45 +0200
commit526b25e2633bbc44b867b548f5c7f633517e5b0f (patch)
tree7815fb40163d1db39e3991dcd19341ef57d08d74
parentf6e33d67e1132a18e7a6ab49c2b6ff00da5112c8 (diff)
parent922818a79809d789976e64a8b4faabd305863a7c (diff)
downloadmariadb-git-526b25e2633bbc44b867b548f5c7f633517e5b0f.tar.gz
Merge with 4.0
BitKeeper/etc/logging_ok: auto-union BitKeeper/deleted/.del-libmysql.def~f5dffcb3ed925d28: Auto merged BitKeeper/deleted/.del-post-incoming~9f2168f531f09f3b: Auto merged BitKeeper/deleted/.del-post-outgoing~1dd3d8f0f6e8f3cd: Auto merged VC++Files/innobase/innobase.dsp: Auto merged VC++Files/strings/MASM6x/strings.dsp: Auto merged client/mysqldump.c: Auto merged innobase/sync/sync0sync.c: Auto merged myisam/mi_check.c: Auto merged mysql-test/t/union.test: Auto merged mysql-test/t/update.test: Auto merged mysys/mf_iocache.c: Auto merged sql/nt_servc.cc: Auto merged mysql-test/r/system_mysql_db.result: Auto merged sql/sql_base.cc: Auto merged
-rwxr-xr-xBitKeeper/triggers/post-commit25
-rw-r--r--VC++Files/innobase/innobase.dsp8
-rw-r--r--VC++Files/strings/MASM6x/strings.dsp4
-rw-r--r--VC++Files/strings/strings.dsp4
-rw-r--r--client/mysqldump.c4
-rw-r--r--innobase/sync/sync0sync.c2
-rw-r--r--mysql-test/r/alter_table.result71
-rw-r--r--mysql-test/r/union.result2
-rw-r--r--mysql-test/t/alter_table.test77
-rw-r--r--mysql-test/t/union.test2
-rw-r--r--mysql-test/t/update.test1
-rw-r--r--mysys/default.c8
-rw-r--r--mysys/mf_iocache.c3
-rw-r--r--scripts/mysqlbug.sh4
-rw-r--r--sql/nt_servc.cc2
-rw-r--r--sql/sql_base.cc5
-rw-r--r--sql/sql_parse.cc2
-rw-r--r--sql/sql_union.cc14
18 files changed, 148 insertions, 90 deletions
diff --git a/BitKeeper/triggers/post-commit b/BitKeeper/triggers/post-commit
index b0d70c85661..1c4608835d6 100755
--- a/BitKeeper/triggers/post-commit
+++ b/BitKeeper/triggers/post-commit
@@ -1,11 +1,11 @@
#!/bin/sh
#shift
-TO=dev-public@mysql.com
FROM=$USER@mysql.com
INTERNALS=internals@lists.mysql.com
DOCS=docs-commit@mysql.com
LIMIT=10000
+VERSION="4.0"
if [ "$REAL_EMAIL" = "" ]
then
@@ -20,17 +20,24 @@ if [ "$BK_STATUS" = OK ]
then
CHANGESET=`bk -R prs -r+ -h -d':P:::I:' ChangeSet`
+BUG=`bk -R prs -r+ -h -d':C:' ChangeSet | sed -ne 's/^.*[Bb][Uu][Gg] *# *\([0-9][0-9]*\).*$/ BUG#\1/p'`
+if [ "$BUG" = "" ]
+then
+ TO=dev-public@mysql.com
+else
+ TO=dev-bugs@mysql.com
+fi
#++
-# dev-public@
+# dev-public@ / dev-bugs@
#--
echo "Commit successful, notifying developers at $TO"
(
cat <<EOF
-List-ID: <bk.mysql-4.1>
+List-ID: <bk.mysql-$VERSION>
From: $FROM
To: $TO
-Subject: bk commit - 4.1 tree ($CHANGESET)
+Subject: bk commit - $VERSION tree ($CHANGESET)$BUG
EOF
bk changes -v -r+
@@ -43,13 +50,13 @@ EOF
echo "Notifying internals list at $INTERNALS"
(
cat <<EOF
-List-ID: <bk.mysql-4.1>
+List-ID: <bk.mysql-$VERSION>
From: $FROM
To: $INTERNALS
-Subject: bk commit into 4.1 tree ($CHANGESET)
+Subject: bk commit into $VERSION tree ($CHANGESET)
Below is the list of changes that have just been committed into a local
-4.1 repository of $USER. When $USER does a push these changes will
+$VERSION repository of $USER. When $USER 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
@@ -70,10 +77,10 @@ EOF
echo "Notifying docs list at $DOCS"
(
cat <<EOF
-List-ID: <bk.mysql-4.1>
+List-ID: <bk.mysql-$VERSION>
From: $FROM
To: $DOCS
-Subject: bk commit - 4.1 tree (Manual) ($CHANGESET)
+Subject: bk commit - $VERSION tree (Manual) ($CHANGESET)
EOF
bk changes -v -r+
diff --git a/VC++Files/innobase/innobase.dsp b/VC++Files/innobase/innobase.dsp
index e32f242be80..713e3153d17 100644
--- a/VC++Files/innobase/innobase.dsp
+++ b/VC++Files/innobase/innobase.dsp
@@ -168,14 +168,6 @@ SOURCE=.\buf\buf0rea.c
# End Source File
# Begin Source File
-SOURCE=.\com\com0com.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\com\com0shm.c
-# End Source File
-# Begin Source File
-
SOURCE=.\data\data0data.c
# End Source File
# Begin Source File
diff --git a/VC++Files/strings/MASM6x/strings.dsp b/VC++Files/strings/MASM6x/strings.dsp
index 1c5ce5249f5..e7b1c161d83 100644
--- a/VC++Files/strings/MASM6x/strings.dsp
+++ b/VC++Files/strings/MASM6x/strings.dsp
@@ -156,6 +156,10 @@ SOURCE=.\str2int.c
# End Source File
# Begin Source File
+SOURCE=.\strnlen.c
+# End Source File
+# Begin Source File
+
SOURCE=.\Strings.asm
!IF "$(CFG)" == "strings - Win32 Release"
diff --git a/VC++Files/strings/strings.dsp b/VC++Files/strings/strings.dsp
index ffec20f3a59..5755d5d4c99 100644
--- a/VC++Files/strings/strings.dsp
+++ b/VC++Files/strings/strings.dsp
@@ -188,6 +188,10 @@ SOURCE=.\longlong2str.c
# End Source File
# Begin Source File
+SOURCE=.\strnlen.c
+# End Source File
+# Begin Source File
+
SOURCE=.\my_strtoll10.c
# End Source File
# Begin Source File
diff --git a/client/mysqldump.c b/client/mysqldump.c
index 8a5e70649a1..38a855c9cb9 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -173,7 +173,7 @@ static struct my_option my_long_options[] =
(gptr*) &opt_delayed, (gptr*) &opt_delayed, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"delete-master-logs", OPT_DELETE_MASTER_LOGS,
- "Delete logs on master after backup. This will automagically enable --first-slave.",
+ "Delete logs on master after backup. This automatically enables --first-slave.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"disable-keys", 'K',
"'/*!40000 ALTER TABLE tb_name DISABLE KEYS */; and '/*!40000 ALTER TABLE tb_name ENABLE KEYS */; will be put in the output.", (gptr*) &opt_disable_keys,
@@ -215,7 +215,7 @@ static struct my_option my_long_options[] =
{"lock-tables", 'l', "Lock all tables for read.", (gptr*) &lock_tables,
(gptr*) &lock_tables, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
{"master-data", OPT_MASTER_DATA,
- "This will cause the master position and filename to be appended to your output. This will automagically enable --first-slave.",
+ "This causes the master position and filename to be appended to your output. This automatically enables --first-slave.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"no-autocommit", OPT_AUTOCOMMIT,
"Wrap tables with autocommit/commit statements.",
diff --git a/innobase/sync/sync0sync.c b/innobase/sync/sync0sync.c
index 6ad766d8bc8..64f76f5ee77 100644
--- a/innobase/sync/sync0sync.c
+++ b/innobase/sync/sync0sync.c
@@ -180,7 +180,7 @@ mutex_create_func(
char* cfile_name, /* in: file name where created */
ulint cline) /* in: file line where created */
{
-#if defined(_WIN32) && defined(UNIV_CAN_USE_X86_ASSEMBLER) && !defined(__NETWARE)
+#if defined(_WIN32) && defined(UNIV_CAN_USE_X86_ASSEMBLER)
mutex_reset_lock_word(mutex);
#else
os_fast_mutex_init(&(mutex->os_fast_mutex));
diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result
index dee7433404f..c82f181da81 100644
--- a/mysql-test/r/alter_table.result
+++ b/mysql-test/r/alter_table.result
@@ -1,4 +1,5 @@
drop table if exists t1,t2;
+drop database if exists mysqltest;
create table t1 (
col1 int not null auto_increment primary key,
col2 varchar(30) not null,
@@ -85,6 +86,45 @@ OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
DROP TABLE t1;
+create table t1 (i int unsigned not null auto_increment primary key);
+insert into t1 values (null),(null),(null),(null);
+alter table t1 drop i,add i int unsigned not null auto_increment, drop primary key, add primary key (i);
+select * from t1;
+i
+1
+2
+3
+4
+drop table t1;
+create table t1 (name char(15));
+insert into t1 (name) values ("current");
+create database mysqltest;
+create table mysqltest.t1 (name char(15));
+insert into mysqltest.t1 (name) values ("mysqltest");
+select * from t1;
+name
+current
+select * from mysqltest.t1;
+name
+mysqltest
+alter table t1 rename mysqltest.t1;
+ERROR 42S01: Table 't1' already exists
+select * from t1;
+name
+current
+select * from mysqltest.t1;
+name
+mysqltest
+drop table t1;
+drop database mysqltest;
+create database mysqltest;
+create table mysqltest.t1 (a int,b int,c int);
+grant all on mysqltest.t1 to mysqltest_1@localhost;
+alter table t1 rename t2;
+insert command denied to user: 'mysqltest_1@localhost' for table 't2'
+revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
+delete from mysql.user where user='mysqltest_1';
+drop database mysqltest;
create table t1 (n1 int not null, n2 int, n3 int, n4 float,
unique(n1),
key (n1, n2, n3, n4),
@@ -143,16 +183,6 @@ t1 1 n4 3 n2 A 10 NULL NULL YES BTREE
t1 1 n4 4 n3 A 10 NULL NULL YES BTREE
drop table t1;
create table t1 (i int unsigned not null auto_increment primary key);
-insert into t1 values (null),(null),(null),(null);
-alter table t1 drop i,add i int unsigned not null auto_increment, drop primary key, add primary key (i);
-select * from t1;
-i
-1
-2
-3
-4
-drop table t1;
-create table t1 (i int unsigned not null auto_increment primary key);
alter table t1 rename t2;
alter table t2 rename t1, add c char(10) comment "no comment";
show columns from t1;
@@ -428,27 +458,6 @@ t1 0 PRIMARY 1 Host A NULL NULL NULL BTREE
t1 0 PRIMARY 2 User A 0 NULL NULL BTREE
t1 1 Host 1 Host A NULL NULL NULL BTREE disabled
DROP TABLE t1;
-create table t1 (name char(15));
-insert into t1 (name) values ("current");
-create database mysqltest;
-create table mysqltest.t1 (name char(15));
-insert into mysqltest.t1 (name) values ("mysqltest");
-select * from t1;
-name
-current
-select * from mysqltest.t1;
-name
-mysqltest
-alter table t1 rename mysqltest.t1;
-ERROR 42S01: Table 't1' already exists
-select * from t1;
-name
-current
-select * from mysqltest.t1;
-name
-mysqltest
-drop table t1;
-drop database mysqltest;
CREATE TABLE t1 (a int PRIMARY KEY, b INT UNIQUE);
ALTER TABLE t1 DROP PRIMARY KEY;
SHOW CREATE TABLE t1;
diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result
index c00b2732bd1..908c1d285f5 100644
--- a/mysql-test/r/union.result
+++ b/mysql-test/r/union.result
@@ -434,6 +434,8 @@ create temporary table t1 select a from t1 union select a from t2;
drop temporary table t1;
create table t1 select a from t1 union select a from t2;
ERROR HY000: You can't specify target table 't1' for update in FROM clause
+select a from t1 union select a from t2 order by t2.a;
+Unknown column 't2.a' in 'ORDER BY'
drop table t1,t2;
select length(version()) > 1 as `*` UNION select 2;
*
diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test
index bb174c0225a..39c84eceb94 100644
--- a/mysql-test/t/alter_table.test
+++ b/mysql-test/t/alter_table.test
@@ -3,6 +3,7 @@
#
--disable_warnings
drop table if exists t1,t2;
+drop database if exists mysqltest;
--enable_warnings
create table t1 (
@@ -79,6 +80,53 @@ OPTIMIZE TABLE t1;
DROP TABLE t1;
#
+# Drop and add an auto_increment column
+#
+
+create table t1 (i int unsigned not null auto_increment primary key);
+insert into t1 values (null),(null),(null),(null);
+alter table t1 drop i,add i int unsigned not null auto_increment, drop primary key, add primary key (i);
+select * from t1;
+drop table t1;
+
+#
+# Bug #2628: 'alter table t1 rename mysqltest.t1' silently drops mysqltest.t1
+# if it exists
+#
+create table t1 (name char(15));
+insert into t1 (name) values ("current");
+create database mysqltest;
+create table mysqltest.t1 (name char(15));
+insert into mysqltest.t1 (name) values ("mysqltest");
+select * from t1;
+select * from mysqltest.t1;
+--error 1050
+alter table t1 rename mysqltest.t1;
+select * from t1;
+select * from mysqltest.t1;
+drop table t1;
+drop database mysqltest;
+
+#
+# Rights for renaming test (Bug #3270)
+#
+connect (root,localhost,root,,test,$MASTER_MYPORT,master.sock);
+connection root;
+--disable_warnings
+create database mysqltest;
+--enable_warnings
+create table mysqltest.t1 (a int,b int,c int);
+grant all on mysqltest.t1 to mysqltest_1@localhost;
+connect (user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,master.sock);
+connection user1;
+-- error 1142
+alter table t1 rename t2;
+connection root;
+revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
+delete from mysql.user where user='mysqltest_1';
+drop database mysqltest;
+
+#
# ALTER TABLE ... ENABLE/DISABLE KEYS
create table t1 (n1 int not null, n2 int, n3 int, n4 float,
@@ -101,16 +149,6 @@ show keys from t1;
drop table t1;
#
-# Drop and add an auto_increment column
-#
-
-create table t1 (i int unsigned not null auto_increment primary key);
-insert into t1 values (null),(null),(null),(null);
-alter table t1 drop i,add i int unsigned not null auto_increment, drop primary key, add primary key (i);
-select * from t1;
-drop table t1;
-
-#
# Alter table and rename
#
@@ -255,26 +293,9 @@ LOCK TABLES t1 WRITE;
ALTER TABLE t1 DISABLE KEYS;
SHOW INDEX FROM t1;
DROP TABLE t1;
-#
-# Bug #2628: 'alter table t1 rename mysqltest.t1' silently drops mysqltest.t1
-# if it exists
-#
-create table t1 (name char(15));
-insert into t1 (name) values ("current");
-create database mysqltest;
-create table mysqltest.t1 (name char(15));
-insert into mysqltest.t1 (name) values ("mysqltest");
-select * from t1;
-select * from mysqltest.t1;
---error 1050
-alter table t1 rename mysqltest.t1;
-select * from t1;
-select * from mysqltest.t1;
-drop table t1;
-drop database mysqltest;
#
-# Bug 2361
+# Bug 2361 (Don't drop UNIQUE with DROP PRIMARY KEY)
#
CREATE TABLE t1 (a int PRIMARY KEY, b INT UNIQUE);
diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test
index b744610ce3d..eaa1415d41f 100644
--- a/mysql-test/t/union.test
+++ b/mysql-test/t/union.test
@@ -251,6 +251,8 @@ create temporary table t1 select a from t1 union select a from t2;
drop temporary table t1;
--error 1093
create table t1 select a from t1 union select a from t2;
+--error 1054
+select a from t1 union select a from t2 order by t2.a;
drop table t1,t2;
#
diff --git a/mysql-test/t/update.test b/mysql-test/t/update.test
index 3406dfd6158..6ca75cf0c26 100644
--- a/mysql-test/t/update.test
+++ b/mysql-test/t/update.test
@@ -125,7 +125,6 @@ insert into t1 (F1,F2,F3,cnt,groupid) values ('0','0','0',1,6),
('0','1','2',1,5), ('0','2','0',1,3), ('1','0','1',1,2),
('1','2','1',1,1), ('1','2','2',1,1), ('2','0','1',2,4),
('2','2','0',1,7);
-
delete from m1 using t1 m1,t1 m2 where m1.groupid=m2.groupid and (m1.cnt < m2.cnt or m1.cnt=m2.cnt and m1.F3>m2.F3);
select * from t1;
drop table t1;
diff --git a/mysys/default.c b/mysys/default.c
index a01ed4dd39f..d09b0dd97af 100644
--- a/mysys/default.c
+++ b/mysys/default.c
@@ -450,23 +450,25 @@ static int search_default_file(DYNAMIC_ARRAY *args, MEM_ROOT *alloc,
static char *remove_end_comment(char *ptr)
{
- char quote= 0;
+ char quote= 0; /* we are inside quote marks */
+ char escape= 0; /* symbol is protected by escape chagacter */
for (; *ptr; ptr++)
{
- if (*ptr == '\'' || *ptr == '\"')
+ if ((*ptr == '\'' || *ptr == '\"') && !escape)
{
if (!quote)
quote= *ptr;
else if (quote == *ptr)
quote= 0;
}
- /* We are not inside a comment */
+ /* We are not inside a string */
if (!quote && *ptr == '#')
{
*ptr= 0;
return ptr;
}
+ escape= (quote && *ptr == '\\' && !escape);
}
return ptr;
}
diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c
index d2c373ab0c6..288071f7361 100644
--- a/mysys/mf_iocache.c
+++ b/mysys/mf_iocache.c
@@ -506,7 +506,8 @@ static int lock_io_cache(IO_CACHE *info, my_off_t pos)
while (!s->active || s->active->pos_in_file < pos)
pthread_cond_wait(&s->cond, &s->mutex);
- if (s->total < total)
+ if (s->total < total &&
+ (!s->active || s->active->pos_in_file < pos))
return 1;
pthread_mutex_unlock(&s->mutex);
diff --git a/scripts/mysqlbug.sh b/scripts/mysqlbug.sh
index 49ac08d0013..6aed140b79d 100644
--- a/scripts/mysqlbug.sh
+++ b/scripts/mysqlbug.sh
@@ -254,9 +254,9 @@ eval $EDIT $TEMP
if cmp -s $TEMP $TEMP.x
then
echo "File not changed, no bug report submitted."
- cp $TEMP /tmp/failed-mysql-bugreport
+ mv -f $TEMP /tmp/failed-mysql-bugreport
echo "The raw bug report exists in /tmp/failed-mysql-bugreport"
- echo "If you use this remember that the first lines of the report now is a lie.."
+ echo "If you use this remember that the first lines of the report are now a lie.."
exit 1
fi
diff --git a/sql/nt_servc.cc b/sql/nt_servc.cc
index 3e9d68d5fdb..a04f284a3de 100644
--- a/sql/nt_servc.cc
+++ b/sql/nt_servc.cc
@@ -498,7 +498,7 @@ BOOL NTService::IsService(LPCSTR ServiceName)
if ((scm= OpenSCManager(0, 0,SC_MANAGER_ENUMERATE_SERVICE)))
{
- if ((service = OpenService(scm,ServiceName, SERVICE_QUERY_STATUS )))
+ if ((service = OpenService(scm,ServiceName, SERVICE_QUERY_STATUS)))
{
ret_value=TRUE;
CloseServiceHandle(service);
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 4115aac5123..c54892c9341 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -485,7 +485,7 @@ void close_temporary_tables(THD *thd)
return;
LINT_INIT(end);
- query_buf_size= 50; // Enough for DROP ... TABLE
+ query_buf_size= 50; // Enough for DROP ... TABLE IF EXISTS
for (table=thd->temporary_tables ; table ; table=table->next)
/*
@@ -496,7 +496,8 @@ void close_temporary_tables(THD *thd)
query_buf_size+= table->key_length+1;
if ((query = alloc_root(&thd->mem_root, query_buf_size)))
- end=strmov(query, "DROP /*!40005 TEMPORARY */ TABLE ");
+ // Better add "if exists", in case a RESET MASTER has been done
+ end=strmov(query, "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS ");
for (table=thd->temporary_tables ; table ; table=next)
{
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index bfef9a01feb..54d878eb760 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -2337,7 +2337,7 @@ mysql_execute_command(THD *thd)
tmp_table.real_name=lex->name;
tmp_table.db=select_lex->db;
tmp_table.grant.privilege=priv;
- if (check_grant(thd,INSERT_ACL | CREATE_ACL,tables,0,0))
+ if (check_grant(thd, INSERT_ACL | CREATE_ACL, &tmp_table, 0, 0))
goto error;
}
}
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index f5488f59adf..cb385b482cf 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -112,6 +112,7 @@ int st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
SELECT_LEX *lex_select_save= thd_arg->lex->current_select;
SELECT_LEX *sl, *first_select;
select_result *tmp_result;
+ ORDER *tmp_order;
DBUG_ENTER("st_select_lex_unit::prepare");
/*
@@ -207,6 +208,19 @@ int st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
}
}
+ for (tmp_order= (ORDER*) global_parameters->order_list.first;
+ tmp_order ;
+ tmp_order= tmp_order->next;
+ {
+ Item *item= *tmp_order->item;
+ if (((item->type() == Item::FIELD_ITEM) &&
+ ((class Item_field*) item)->table_name))
+ {
+ my_error(ER_BAD_FIELD_ERROR,MYF(0),item->full_name(),"ORDER BY");
+ DBUG_RETURN(-1);
+ }
+ }
+
item_list.empty();
// it is not single select
if (first_select->next_select())