summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/t/alter_table.test76
-rw-r--r--scripts/mysqlbug.sh4
-rw-r--r--sql/nt_servc.cc2
-rw-r--r--sql/sql_parse.cc2
4 files changed, 53 insertions, 31 deletions
diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test
index 1937cdbe985..21ea4fcc01f 100644
--- a/mysql-test/t/alter_table.test
+++ b/mysql-test/t/alter_table.test
@@ -3,6 +3,8 @@
#
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,
@@ -77,6 +79,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,0,mysql-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,0,mysql-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,
@@ -99,16 +148,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
#
@@ -204,20 +243,3 @@ 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;
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 8a3757a9768..8ae3aeff2a6 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_parse.cc b/sql/sql_parse.cc
index aeec3808591..be2d81fa372 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1772,7 +1772,7 @@ mysql_execute_command(void)
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))
+ if (check_grant(thd,INSERT_ACL | CREATE_ACL, &tmp_table))
goto error;
}
}