Commit 29941c07 authored by SergeyV@selena's avatar SergeyV@selena

Merge selena.:H:/MYSQL/bkt/mysql-5.0

into  selena.:H:/MYSQL/bkt/mysql-5.1
parents 27e96276 22b43351
......@@ -30,6 +30,15 @@ check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
drop table t1;
create table t1 (a mediumtext, fulltext key key1(a)) charset utf8 collate utf8_general_ci engine myisam;
insert into t1 values ('hello');
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status Table is already up to date
drop table t1;
CREATE TABLE t1 (a int);
prepare stmt1 from "SELECT * FROM t1 PROCEDURE ANALYSE()";
execute stmt1;
......
......@@ -4046,4 +4046,28 @@ boo
2
drop procedure bug14643_1|
drop procedure bug14643_2|
drop procedure if exists bug14304|
drop table if exists t3, t4|
create table t3(a int primary key auto_increment)|
create table t4(a int primary key auto_increment)|
create procedure bug14304()
begin
insert into t3 set a=null;
insert into t4 set a=null;
insert into t4 set a=null;
insert into t4 set a=null;
insert into t4 set a=null;
insert into t4 set a=null;
insert into t4 select null as a;
insert into t3 set a=null;
insert into t3 set a=null;
select * from t3;
end|
call bug14304()|
a
1
2
3
drop procedure bug14304|
drop table t3, t4|
drop table t1,t2;
......@@ -39,6 +39,20 @@ check table t1;
drop table t1;
# Bug #14902 ANALYZE TABLE fails to recognize up-to-date tables
# minimal test case to get an error.
# The problem is happening when analysing table with FT index that
# contains stopwords only. The first execution of analyze table should
# mark index statistics as up to date so that next execution of this
# statement will end up with Table is up to date status.
create table t1 (a mediumtext, fulltext key key1(a)) charset utf8 collate utf8_general_ci engine myisam;
insert into t1 values ('hello');
analyze table t1;
analyze table t1;
drop table t1;
#
# procedure in PS BUG#13673
#
......
......@@ -4823,6 +4823,37 @@ call bug14643_2()|
drop procedure bug14643_1|
drop procedure bug14643_2|
#
# BUG#14304: auto_increment field incorrect set in SP
#
--disable_warnings
drop procedure if exists bug14304|
drop table if exists t3, t4|
--enable_warnings
create table t3(a int primary key auto_increment)|
create table t4(a int primary key auto_increment)|
create procedure bug14304()
begin
insert into t3 set a=null;
insert into t4 set a=null;
insert into t4 set a=null;
insert into t4 set a=null;
insert into t4 set a=null;
insert into t4 set a=null;
insert into t4 select null as a;
insert into t3 set a=null;
insert into t3 set a=null;
select * from t3;
end|
call bug14304()|
drop procedure bug14304|
drop table t3, t4|
#
# BUG#NNNN: New bug synopsis
......
......@@ -1075,7 +1075,7 @@ int sp_head::execute(THD *thd)
}
/* we should cleanup free_list and memroot, used by instruction */
thd->free_items();
thd->cleanup_after_query();
free_root(&execute_mem_root, MYF(0));
/*
......
......@@ -1951,6 +1951,7 @@ void THD::reset_sub_statement_state(Sub_statement_state *backup,
backup->last_insert_id= last_insert_id;
backup->next_insert_id= next_insert_id;
backup->insert_id_used= insert_id_used;
backup->clear_next_insert_id= clear_next_insert_id;
backup->limit_found_rows= limit_found_rows;
backup->examined_row_count= examined_row_count;
backup->sent_row_count= sent_row_count;
......@@ -2002,6 +2003,7 @@ void THD::restore_sub_statement_state(Sub_statement_state *backup)
last_insert_id= backup->last_insert_id;
next_insert_id= backup->next_insert_id;
insert_id_used= backup->insert_id_used;
clear_next_insert_id= backup->clear_next_insert_id;
limit_found_rows= backup->limit_found_rows;
sent_row_count= backup->sent_row_count;
client_capabilities= backup->client_capabilities;
......
......@@ -1101,7 +1101,7 @@ public:
ha_rows cuted_fields, sent_row_count, examined_row_count;
ulong client_capabilities;
uint in_sub_stmt;
bool enable_slow_log, insert_id_used;
bool enable_slow_log, insert_id_used, clear_next_insert_id;
my_bool no_send_ok;
SAVEPOINT *savepoints;
};
......
......@@ -402,7 +402,7 @@ int chk_key(MI_CHECK *param, register MI_INFO *info)
full_text_keys++;
if (share->state.key_root[key] == HA_OFFSET_ERROR &&
(info->state->records == 0 || keyinfo->flag & HA_FULLTEXT))
continue;
goto do_stat;
if (!_mi_fetch_keypage(info,keyinfo,share->state.key_root[key],
DFLT_INIT_HITS,info->buff,0))
{
......@@ -498,6 +498,7 @@ int chk_key(MI_CHECK *param, register MI_INFO *info)
param->max_level);
all_keydata+=param->keydata; all_totaldata+=param->totaldata; key_totlength+=length;
do_stat:
if (param->testflag & T_STATISTICS)
update_key_parts(keyinfo, rec_per_key_part, param->unique_count,
param->stats_method == MI_STATS_METHOD_IGNORE_NULLS?
......
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