Commit ce79eb9c authored by monty@mysql.com's avatar monty@mysql.com

merge with 3.23

parents 755c068f d6f9fa03
......@@ -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,
......@@ -76,6 +78,53 @@ UNLOCK TABLES;
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
......@@ -98,16 +147,6 @@ alter table t1 enable keys;
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;
......@@ -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
......
......@@ -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);
......
......@@ -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;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment