Commit 6271cf51 authored by reggie@mdk10.(none)'s avatar reggie@mdk10.(none)

Merge rburnett@bk-internal.mysql.com:/home/bk/mysql-4.1

into mdk10.(none):/home/reggie/bk/41test3
parents 68c6470a abaae49c
......@@ -501,33 +501,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* | *modesto*)
FIND_PROC=
......
......@@ -264,13 +264,7 @@ C_MODE_START int __cxa_pure_virtual() {\
# endif
#endif /* TIME_WITH_SYS_TIME */
#ifdef HAVE_UNISTD_H
#if defined(HAVE_OPENSSL) && !defined(__FreeBSD__) && !defined(NeXT) && !defined(__OpenBSD__)
#define crypt unistd_crypt
#endif
#include <unistd.h>
#ifdef HAVE_OPENSSL
#undef crypt
#endif
#endif
#if defined(__cplusplus) && defined(NO_CPLUSPLUS_ALLOCA)
#undef HAVE_ALLOCA
......
......@@ -35,7 +35,8 @@ testdir = $(benchdir_root)/mysql-test
EXTRA_SCRIPTS = mysql-test-run.sh mysql-test-run.pl install_test_db.sh
EXTRA_DIST = $(EXTRA_SCRIPTS)
test_SCRIPTS = mysql-test-run install_test_db
test_DATA = std_data/client-key.pem std_data/client-cert.pem std_data/cacert.pem
test_DATA = std_data/client-key.pem std_data/client-cert.pem std_data/cacert.pem \
std_data/server-cert.pem std_data/server-key.pem
CLEANFILES = $(test_SCRIPTS) $(test_DATA)
INCLUDES = -I$(srcdir)/../include -I../include -I..
......
......@@ -580,3 +580,9 @@ ERROR 42000: Incorrect database name 'xyz'
create table t1(t1.name int);
create table t2(test.t2.name int);
drop table t1,t2;
create database mysqltest;
use mysqltest;
drop database mysqltest;
create table test.t1 like x;
ERROR 42000: Incorrect database name 'NULL'
drop table if exists test.t1;
......@@ -291,3 +291,8 @@ a b
1 7
1 8
drop table t1;
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;
......@@ -492,3 +492,14 @@ create table t1(t1.name int);
create table t2(test.t2.name int);
drop table t1,t2;
#
# Bug#11028: Crash on create table like
#
create database mysqltest;
use mysqltest;
drop database mysqltest;
--error 1102
create table test.t1 like x;
--disable_warnings
drop table if exists test.t1;
--enable_warnings
......@@ -224,3 +224,12 @@ insert t1 (a) values (1);
insert t1 (a) values (1);
select * from t1;
drop table t1;
#
# 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)
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));
}
......
......@@ -53,6 +53,7 @@ class ha_heap: public handler
}
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; }
......
......@@ -2298,26 +2298,31 @@ int mysql_create_like_table(THD* thd, TABLE_LIST* table,
char src_path[FN_REFLEN], dst_path[FN_REFLEN];
char *db= table->db;
char *table_name= table->real_name;
char *src_db= thd->db;
char *src_db;
char *src_table= table_ident->table.str;
int err, res= -1;
TABLE_LIST src_tables_list;
DBUG_ENTER("mysql_create_like_table");
src_db= table_ident->db.str ? table_ident->db.str : thd->db;
/*
Validate the source table
*/
if (table_ident->table.length > NAME_LEN ||
(table_ident->table.length &&
check_table_name(src_table,table_ident->table.length)) ||
table_ident->db.str && check_db_name((src_db= table_ident->db.str)))
check_table_name(src_table,table_ident->table.length)))
{
my_error(ER_WRONG_TABLE_NAME, MYF(0), src_table);
DBUG_RETURN(-1);
}
if (!src_db || check_db_name(src_db))
{
my_error(ER_WRONG_DB_NAME, MYF(0), src_db ? src_db : "NULL");
DBUG_RETURN(-1);
}
src_tables_list.db= table_ident->db.str ? table_ident->db.str : thd->db;
src_tables_list.real_name= table_ident->table.str;
src_tables_list.db= src_db;
src_tables_list.real_name= src_table;
src_tables_list.next= 0;
if (lock_and_wait_for_table_name(thd, &src_tables_list))
......
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