Commit 153f2336 authored by jimw@mysql.com's avatar jimw@mysql.com

Merge mysql.com:/home/jimw/my/mysql-4.1-clean

into  mysql.com:/home/jimw/my/mysql-5.0-clean
parents a5285b14 21f46b39
...@@ -442,33 +442,33 @@ PS=$ac_cv_path_PS ...@@ -442,33 +442,33 @@ PS=$ac_cv_path_PS
# Linux style # Linux style
if $PS p $$ 2> /dev/null | grep $0 > /dev/null if $PS p $$ 2> /dev/null | grep $0 > /dev/null
then then
FIND_PROC="$PS p \$\$PID | grep \$\$MYSQLD > /dev/null" FIND_PROC="$PS p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
# Solaris # Solaris
elif $PS -fp $$ 2> /dev/null | grep $0 > /dev/null elif $PS -fp $$ 2> /dev/null | grep $0 > /dev/null
then then
FIND_PROC="$PS -p \$\$PID | grep \$\$MYSQLD > /dev/null" FIND_PROC="$PS -p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
# BSD style # BSD style
elif $PS -uaxww 2> /dev/null | grep $0 > /dev/null elif $PS -uaxww 2> /dev/null | grep $0 > /dev/null
then 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 # SysV style
elif $PS -ef 2> /dev/null | grep $0 > /dev/null elif $PS -ef 2> /dev/null | grep $0 > /dev/null
then 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? # Do anybody use this?
elif $PS $$ 2> /dev/null | grep $0 > /dev/null elif $PS $$ 2> /dev/null | grep $0 > /dev/null
then then
FIND_PROC="$PS \$\$PID | grep \$\$MYSQLD > /dev/null" FIND_PROC="$PS \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
else else
case $SYSTEM_TYPE in case $SYSTEM_TYPE in
*freebsd*) *freebsd*)
FIND_PROC="$PS p \$\$PID | grep \$\$MYSQLD > /dev/null" FIND_PROC="$PS p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
;; ;;
*darwin*) *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*) *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*) *netware*)
FIND_PROC= FIND_PROC=
......
...@@ -696,3 +696,8 @@ drop table t1; ...@@ -696,3 +696,8 @@ drop table t1;
create table t1 (a int not null, b int not null auto_increment, create table t1 (a int not null, b int not null auto_increment,
primary key(a, b)) engine=heap; 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 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; ...@@ -426,3 +426,12 @@ drop table t1;
--error 1075 --error 1075
create table t1 (a int not null, b int not null auto_increment, create table t1 (a int not null, b int not null auto_increment,
primary key(a, b)) engine=heap; 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;
...@@ -262,7 +262,25 @@ static void movelink(HASH_LINK *array,uint find,uint next_link,uint newlink) ...@@ -262,7 +262,25 @@ static void movelink(HASH_LINK *array,uint find,uint next_link,uint newlink)
return; 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) 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) ...@@ -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); byte *rec_key= (byte*) hash_key(hash,pos->data,&rec_keylength,1);
return ((length && length != rec_keylength) || return ((length && length != rec_keylength) ||
my_strnncoll(hash->charset, (uchar*) rec_key, rec_keylength, my_strnncoll(hash->charset, (uchar*) rec_key, rec_keylength,
(uchar*) key, length)); (uchar*) key, rec_keylength));
} }
......
...@@ -57,6 +57,7 @@ class ha_heap: public handler ...@@ -57,6 +57,7 @@ class ha_heap: public handler
} }
const key_map *keys_to_use_for_scanning() { return &btree_keys; } const key_map *keys_to_use_for_scanning() { return &btree_keys; }
uint max_supported_keys() const { return MAX_KEY; } 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 scan_time() { return (double) (records+deleted) / 20.0+10; }
double read_time(uint index, uint ranges, ha_rows rows) double read_time(uint index, uint ranges, ha_rows rows)
{ return (double) rows / 20.0+1; } { return (double) rows / 20.0+1; }
......
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