mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge with 4.0
This commit is contained in:
@ -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+
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
@ -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.",
|
||||
|
@ -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));
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
*
|
||||
|
@ -3,6 +3,7 @@
|
||||
#
|
||||
--disable_warnings
|
||||
drop table if exists t1,t2;
|
||||
drop database if exists mysqltest;
|
||||
--enable_warnings
|
||||
|
||||
create table t1 (
|
||||
@ -78,6 +79,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,$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
|
||||
|
||||
@ -100,16 +148,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
|
||||
#
|
||||
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
#
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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())
|
||||
|
Reference in New Issue
Block a user