Skip to content

Commit ad66e7a

Browse files
author
cmiller@zippy.cornsilk.net
committed
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maint
2 parents 5a0ac8a + 45f61a0 commit ad66e7a

File tree

117 files changed

+3687
-650
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+3687
-650
lines changed

BUILD/check-cpu

+27-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@
55
#
66

77
check_cpu () {
8-
if test -r /proc/cpuinfo ; then
8+
CPUINFO=/proc/cpuinfo
9+
if test -n "$TEST_CPUINFO" ; then
10+
CPUINFO=$TEST_CPUINFO
11+
fi
12+
if test -r "$CPUINFO" -a "$CPUINFO" != " " ; then
913
# on Linux (and others?) we can get detailed CPU information out of /proc
10-
cpuinfo="cat /proc/cpuinfo"
14+
cpuinfo="cat $CPUINFO"
1115

1216
# detect CPU family
1317
cpu_family=`$cpuinfo | grep 'family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1`
@@ -33,6 +37,7 @@ check_cpu () {
3337
done
3438
else
3539
# Fallback when there is no /proc/cpuinfo
40+
CPUINFO=" "
3641
case "`uname -s`" in
3742
FreeBSD|OpenBSD)
3843
cpu_family=`uname -m`;
@@ -84,6 +89,18 @@ check_cpu () {
8489
*Pentium*M*pro*)
8590
cpu_arg="pentium-m";
8691
;;
92+
*Celeron\(R\)*\ M*)
93+
cpu_arg="pentium-m";
94+
;;
95+
*Celeron*Coppermine*)
96+
cpu_arg="pentium3"
97+
;;
98+
*Celeron\(R\)*)
99+
cpu_arg="pentium4"
100+
;;
101+
*Celeron*)
102+
cpu_arg="pentium2";
103+
;;
87104
*Athlon*64*)
88105
cpu_arg="athlon64";
89106
;;
@@ -120,7 +137,14 @@ check_cpu () {
120137
esac
121138

122139

123-
if test -z "$cpu_arg"; then
140+
if test -z "$cpu_arg" ; then
141+
if test "$CPUINFO" != " " ; then
142+
# fallback to uname if necessary
143+
TEST_CPUINFO=" "
144+
check_cpu_cflags=""
145+
check_cpu
146+
return
147+
fi
124148
echo "BUILD/check-cpu: Oops, could not find out what kind of cpu this machine is using." >&2
125149
check_cpu_cflags=""
126150
return

cmd-line-utils/readline/undo.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ _rl_fix_last_undo_of_type (type, start, end)
175175

176176
for (rl = rl_undo_list; rl; rl = rl->next)
177177
{
178-
if (rl->what == (uint) type)
178+
if (rl->what == (unsigned int) type)
179179
{
180180
rl->start = start;
181181
rl->end = end;

configure.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -2524,9 +2524,9 @@ linked_client_targets="linked_libmysql_sources"
25242524

25252525
if test "$THREAD_SAFE_CLIENT" = "no"
25262526
then
2527-
sql_client_dirs="strings regex mysys extra libmysql client"
2527+
sql_client_dirs="strings regex mysys dbug extra libmysql client"
25282528
else
2529-
sql_client_dirs="strings regex mysys extra libmysql libmysql_r client"
2529+
sql_client_dirs="strings regex mysys dbug extra libmysql libmysql_r client"
25302530
linked_client_targets="$linked_client_targets linked_libmysql_r_sources"
25312531
AC_CONFIG_FILES(libmysql_r/Makefile)
25322532
AC_DEFINE([THREAD_SAFE_CLIENT], [1], [Should be client be thread safe])

include/thr_lock.h

+1
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ typedef struct st_thr_lock {
121121
void (*get_status)(void*, int); /* When one gets a lock */
122122
void (*copy_status)(void*,void*);
123123
void (*update_status)(void*); /* Before release of write */
124+
void (*restore_status)(void*); /* Before release of read */
124125
my_bool (*check_status)(void *);
125126
} THR_LOCK;
126127

myisam/mi_create.c

+7-6
Original file line numberDiff line numberDiff line change
@@ -815,18 +815,19 @@ uint mi_get_pointer_length(ulonglong file_length, uint def)
815815
if (file_length) /* If not default */
816816
{
817817
#ifdef NOT_YET_READY_FOR_8_BYTE_POINTERS
818-
if (file_length >= (longlong) 1 << 56)
818+
if (file_length >= ULL(1) << 56)
819819
def=8;
820+
else
820821
#endif
821-
if (file_length >= (longlong) 1 << 48)
822+
if (file_length >= ULL(1) << 48)
822823
def=7;
823-
if (file_length >= (longlong) 1 << 40)
824+
else if (file_length >= ULL(1) << 40)
824825
def=6;
825-
else if (file_length >= (longlong) 1 << 32)
826+
else if (file_length >= ULL(1) << 32)
826827
def=5;
827-
else if (file_length >= (1L << 24))
828+
else if (file_length >= ULL(1) << 24)
828829
def=4;
829-
else if (file_length >= (1L << 16))
830+
else if (file_length >= ULL(1) << 16)
830831
def=3;
831832
else
832833
def=2;

myisam/mi_dynrec.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ int _mi_write_blob_record(MI_INFO *info, const byte *record)
8080
#endif
8181
if (!(rec_buff=(byte*) my_alloca(reclength)))
8282
{
83-
my_errno=ENOMEM;
83+
my_errno= HA_ERR_OUT_OF_MEM; /* purecov: inspected */
8484
return(-1);
8585
}
8686
reclength2= _mi_rec_pack(info,rec_buff+ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER),
@@ -114,7 +114,7 @@ int _mi_update_blob_record(MI_INFO *info, my_off_t pos, const byte *record)
114114
#endif
115115
if (!(rec_buff=(byte*) my_alloca(reclength)))
116116
{
117-
my_errno=ENOMEM;
117+
my_errno= HA_ERR_OUT_OF_MEM; /* purecov: inspected */
118118
return(-1);
119119
}
120120
reclength=_mi_rec_pack(info,rec_buff+ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER),

myisam/mi_locking.c

+9
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,15 @@ void mi_update_status(void* param)
325325
}
326326
}
327327

328+
329+
void mi_restore_status(void *param)
330+
{
331+
MI_INFO *info= (MI_INFO*) param;
332+
info->state= &info->s->state.state;
333+
info->append_insert_at_end= 0;
334+
}
335+
336+
328337
void mi_copy_status(void* to,void *from)
329338
{
330339
((MI_INFO*) to)->state= &((MI_INFO*) from)->save_state;

myisam/mi_open.c

+15-1
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,13 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
322322
for (j=0 ; j < share->keyinfo[i].keysegs; j++,pos++)
323323
{
324324
disk_pos=mi_keyseg_read(disk_pos, pos);
325-
325+
if (pos->flag & HA_BLOB_PART &&
326+
! (share->options & (HA_OPTION_COMPRESS_RECORD |
327+
HA_OPTION_PACK_RECORD)))
328+
{
329+
my_errno= HA_ERR_CRASHED;
330+
goto err;
331+
}
326332
if (pos->type == HA_KEYTYPE_TEXT ||
327333
pos->type == HA_KEYTYPE_VARTEXT1 ||
328334
pos->type == HA_KEYTYPE_VARTEXT2)
@@ -440,6 +446,13 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
440446
offset+=share->rec[i].length;
441447
}
442448
share->rec[i].type=(int) FIELD_LAST; /* End marker */
449+
if (offset > share->base.reclength)
450+
{
451+
/* purecov: begin inspected */
452+
my_errno= HA_ERR_CRASHED;
453+
goto err;
454+
/* purecov: end */
455+
}
443456

444457
if (! lock_error)
445458
{
@@ -504,6 +517,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
504517
share->lock.get_status=mi_get_status;
505518
share->lock.copy_status=mi_copy_status;
506519
share->lock.update_status=mi_update_status;
520+
share->lock.restore_status= mi_restore_status;
507521
share->lock.check_status=mi_check_status;
508522
}
509523
}

myisam/mi_update.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,8 @@ int mi_update(register MI_INFO *info, const byte *oldrec, byte *newrec)
196196
save_errno=my_errno;
197197
if (changed)
198198
key_changed|= HA_STATE_CHANGED;
199-
if (my_errno == HA_ERR_FOUND_DUPP_KEY || my_errno == HA_ERR_RECORD_FILE_FULL)
199+
if (my_errno == HA_ERR_FOUND_DUPP_KEY || my_errno == HA_ERR_OUT_OF_MEM ||
200+
my_errno == HA_ERR_RECORD_FILE_FULL)
200201
{
201202
info->errkey= (int) i;
202203
flag=0;

myisam/mi_write.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ int mi_write(MI_INFO *info, byte *record)
168168
err:
169169
save_errno=my_errno;
170170
if (my_errno == HA_ERR_FOUND_DUPP_KEY || my_errno == HA_ERR_RECORD_FILE_FULL ||
171-
my_errno == HA_ERR_NULL_IN_SPATIAL)
171+
my_errno == HA_ERR_NULL_IN_SPATIAL || my_errno == HA_ERR_OUT_OF_MEM)
172172
{
173173
if (info->bulk_insert)
174174
{

myisam/myisamdef.h

+1
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,7 @@ int mi_unique_comp(MI_UNIQUEDEF *def, const byte *a, const byte *b,
731731
my_bool null_are_equal);
732732
void mi_get_status(void* param, int concurrent_insert);
733733
void mi_update_status(void* param);
734+
void mi_restore_status(void* param);
734735
void mi_copy_status(void* to,void *from);
735736
my_bool mi_check_status(void* param);
736737
void mi_disable_non_unique_index(MI_INFO *info, ha_rows rows);
+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# include/wait_show_pattern.inc
2+
#
3+
# SUMMARY
4+
#
5+
# Waits until output produced by SHOW statement which particular type is
6+
# specified as parameter matches certain pattern or maximum time reached.
7+
#
8+
# NOTES
9+
#
10+
# Only the first row produced by the parameter statement is checked.
11+
#
12+
# USAGE
13+
#
14+
# let $show_type= <Tail of SHOW statement>;
15+
# let $show_pattern= 'Pattern to be used for LIKE matching';
16+
# --source wait_show_pattern.inc
17+
#
18+
# EXAMPLES
19+
#
20+
# alter_table-big.test, wait_slave_status.inc
21+
#
22+
# SEE ALSO
23+
#
24+
# wait_slave_status.inc, wait_condition.inc (>=5.1)
25+
#
26+
###############################################################################
27+
28+
--disable_query_log
29+
30+
# We accept to wait maximum 30 seconds (0.2 sec/loop).
31+
let $wait_counter= 150;
32+
while ($wait_counter)
33+
{
34+
let $result= `SHOW $show_type`;
35+
let $success= `SELECT '$result' LIKE $show_pattern`;
36+
if ($success)
37+
{
38+
let $wait_counter= 0;
39+
}
40+
if (!$success)
41+
{
42+
real_sleep 0.2;
43+
dec $wait_counter;
44+
}
45+
}
46+
if (!$success)
47+
{
48+
echo Timeout in wait_show_pattern.inc \$show_type= $show_type \$show_pattern= $show_pattern (\$result= '$result');
49+
}
50+
51+
--enable_query_log

mysql-test/include/wait_slave_status.inc

+7-36
Original file line numberDiff line numberDiff line change
@@ -104,50 +104,21 @@
104104
eval SELECT "let \$result_pattern= $result_pattern ;" AS "";
105105
SELECT '--source include/wait_slave_status.inc' AS "";
106106

107-
# We accept to wait maximum 30 seconds (0.2 sec/loop).
108-
let $max_wait= 150;
109-
while ($max_wait)
110-
{
111-
let $my_val= `SHOW SLAVE STATUS`;
112-
# Now we have the first record of the SHOW result set as one fat string
113-
# within the variable $my_val.
114-
115-
eval SET @my_val = '$my_val';
116-
# DEBUG eval SELECT @my_val AS "response to SHOW SLAVE STATUS";
107+
let $show_type= SLAVE STATUS;
108+
let $show_pattern= $result_pattern;
109+
--enable_query_log
117110

118-
eval SELECT @my_val LIKE $result_pattern INTO @success;
119-
# @success is '1' if we have a match
120-
# '0' if we have no match
121-
# DEBUG SELECT @success;
111+
--source include/wait_show_pattern.inc
122112

123-
let $success= `SELECT @success`;
124-
let $no_success= `SELECT @success = 0`;
125-
if ($success)
126-
{
127-
# We reached the expected result and want to jump out of the loop
128-
# without unneeded sleeps.
129-
# Attention: Do not set $max_wait to 0, because "while" with negative value
130-
# does not work.
131-
let $max_wait= 1;
132-
}
133-
if ($no_success)
134-
{
135-
# We did not reach the expected result and will have to sleep again
136-
# or jump out of the loop, when max_wait is exhausted.
137-
real_sleep 0.2;
138-
}
139-
dec $max_wait;
140-
}
141-
--enable_query_log
142-
if ($no_success)
113+
if (!$success)
143114
{
144115
let $message= ! Attention: Timeout in wait_slave_status.inc.
145116
| Possible reasons with decreasing probability:
146-
| - The LIKE pattern ($result_pattern) is wrong, because the
117+
| - The LIKE pattern is wrong, because the
147118
| testcase was altered or the layout of the
148119
| SHOW SLAVE STATUS result set changed.
149120
| - There is a new bug within the replication.
150-
| - We met an extreme testing environment and $max_wait is
121+
| - We met an extreme testing environment and timeout is
151122
| too small.;
152123
--source include/show_msg80.inc
153124
--echo DEBUG INFO START (wait_slave_status.inc):

mysql-test/mysql-test-run.pl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1039,7 +1039,7 @@ ()
10391039
# On some operating systems, there is a limit to the length of a
10401040
# UNIX domain socket's path far below PATH_MAX, so try to avoid long
10411041
# socket path names.
1042-
$sockdir = tempdir(CLEANUP => 1) if ( length($sockdir) > 80 );
1042+
$sockdir = tempdir(CLEANUP => 0) if ( length($sockdir) > 80 );
10431043

10441044
# Put this into a hash, will be a C struct
10451045

mysql-test/r/alter_table-big.result

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
drop table if exists t1, t2;
2+
create table t1 (n1 int, n2 int, n3 int,
3+
key (n1, n2, n3),
4+
key (n2, n3, n1),
5+
key (n3, n1, n2));
6+
create table t2 (i int);
7+
alter table t1 disable keys;
8+
reset master;
9+
alter table t1 enable keys;;
10+
insert into t2 values (1);
11+
insert into t1 values (1, 1, 1);
12+
show binlog events in 'master-bin.000001' from 98;
13+
Log_name Pos Event_type Server_id End_log_pos Info
14+
master-bin.000001 # Query 1 # use `test`; insert into t2 values (1)
15+
master-bin.000001 # Query 1 # use `test`; alter table t1 enable keys
16+
master-bin.000001 # Query 1 # use `test`; insert into t1 values (1, 1, 1)
17+
drop tables t1, t2;
18+
End of 5.0 tests

0 commit comments

Comments
 (0)