mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
Merge mysql.com:/home/jimw/my/mysql-4.1-clean
into mysql.com:/home/jimw/my/mysql-5.0-clean mysys/hash.c: Auto merged sql/ha_heap.h: Auto merged configure.in: Resolve conflicts from 4.1 mysql-test/r/heap.result: Update results mysql-test/t/heap.test: Merge from 4.1
This commit is contained in:
commit
a3fe140963
5 changed files with 43 additions and 10 deletions
16
configure.in
16
configure.in
|
@ -442,33 +442,33 @@ PS=$ac_cv_path_PS
|
|||
# Linux style
|
||||
if $PS p $$ 2> /dev/null | grep $0 > /dev/null
|
||||
then
|
||||
FIND_PROC="$PS p \$\$PID | grep \$\$MYSQLD > /dev/null"
|
||||
FIND_PROC="$PS p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
|
||||
# Solaris
|
||||
elif $PS -fp $$ 2> /dev/null | grep $0 > /dev/null
|
||||
then
|
||||
FIND_PROC="$PS -p \$\$PID | grep \$\$MYSQLD > /dev/null"
|
||||
FIND_PROC="$PS -p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
|
||||
# BSD style
|
||||
elif $PS -uaxww 2> /dev/null | grep $0 > /dev/null
|
||||
then
|
||||
FIND_PROC="$PS -uaxww | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
|
||||
FIND_PROC="$PS -uaxww | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
|
||||
# SysV style
|
||||
elif $PS -ef 2> /dev/null | grep $0 > /dev/null
|
||||
then
|
||||
FIND_PROC="$PS -ef | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
|
||||
FIND_PROC="$PS -ef | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
|
||||
# Do anybody use this?
|
||||
elif $PS $$ 2> /dev/null | grep $0 > /dev/null
|
||||
then
|
||||
FIND_PROC="$PS \$\$PID | grep \$\$MYSQLD > /dev/null"
|
||||
FIND_PROC="$PS \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
|
||||
else
|
||||
case $SYSTEM_TYPE in
|
||||
*freebsd*)
|
||||
FIND_PROC="$PS p \$\$PID | grep \$\$MYSQLD > /dev/null"
|
||||
FIND_PROC="$PS p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
|
||||
;;
|
||||
*darwin*)
|
||||
FIND_PROC="$PS -uaxww | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
|
||||
FIND_PROC="$PS -uaxww | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
|
||||
;;
|
||||
*cygwin*)
|
||||
FIND_PROC="$PS -e | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
|
||||
FIND_PROC="$PS -e | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
|
||||
;;
|
||||
*netware*)
|
||||
FIND_PROC=
|
||||
|
|
|
@ -696,3 +696,8 @@ drop table t1;
|
|||
create table t1 (a int not null, b int not null auto_increment,
|
||||
primary key(a, b)) engine=heap;
|
||||
ERROR 42000: Incorrect table definition; there can be only one auto column and it must be defined as a key
|
||||
create table t1 (c char(255), primary key(c(90)));
|
||||
insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz");
|
||||
insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz");
|
||||
ERROR 23000: Duplicate entry 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl' for key 1
|
||||
drop table t1;
|
||||
|
|
|
@ -426,3 +426,12 @@ drop table t1;
|
|||
--error 1075
|
||||
create table t1 (a int not null, b int not null auto_increment,
|
||||
primary key(a, b)) engine=heap;
|
||||
|
||||
#
|
||||
# Bug #10566: Verify that we can create a prefixed key with length > 255
|
||||
#
|
||||
create table t1 (c char(255), primary key(c(90)));
|
||||
insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz");
|
||||
--error 1062
|
||||
insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz");
|
||||
drop table t1;
|
||||
|
|
22
mysys/hash.c
22
mysys/hash.c
|
@ -262,7 +262,25 @@ static void movelink(HASH_LINK *array,uint find,uint next_link,uint newlink)
|
|||
return;
|
||||
}
|
||||
|
||||
/* Compare a key in a record to a whole key. Return 0 if identical */
|
||||
/*
|
||||
Compare a key in a record to a whole key. Return 0 if identical
|
||||
|
||||
SYNOPSIS
|
||||
hashcmp()
|
||||
hash hash table
|
||||
pos position of hash record to use in comparison
|
||||
key key for comparison
|
||||
length length of key
|
||||
|
||||
NOTES:
|
||||
If length is 0, comparison is done using the length of the
|
||||
record being compared against.
|
||||
|
||||
RETURN
|
||||
< 0 key of record < key
|
||||
= 0 key of record == key
|
||||
> 0 key of record > key
|
||||
*/
|
||||
|
||||
static int hashcmp(HASH *hash,HASH_LINK *pos,const byte *key,uint length)
|
||||
{
|
||||
|
@ -270,7 +288,7 @@ static int hashcmp(HASH *hash,HASH_LINK *pos,const byte *key,uint length)
|
|||
byte *rec_key= (byte*) hash_key(hash,pos->data,&rec_keylength,1);
|
||||
return ((length && length != rec_keylength) ||
|
||||
my_strnncoll(hash->charset, (uchar*) rec_key, rec_keylength,
|
||||
(uchar*) key, length));
|
||||
(uchar*) key, rec_keylength));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -57,6 +57,7 @@ public:
|
|||
}
|
||||
const key_map *keys_to_use_for_scanning() { return &btree_keys; }
|
||||
uint max_supported_keys() const { return MAX_KEY; }
|
||||
uint max_supported_key_part_length() const { return MAX_KEY_LENGTH; }
|
||||
double scan_time() { return (double) (records+deleted) / 20.0+10; }
|
||||
double read_time(uint index, uint ranges, ha_rows rows)
|
||||
{ return (double) rows / 20.0+1; }
|
||||
|
|
Loading…
Reference in a new issue