Commit 580cb3dd authored by monty@mysql.com's avatar monty@mysql.com

Merge bk-internal.mysql.com:/home/bk/mysql-4.0

into mysql.com:/home/my/mysql-4.0
parents ad86016e c1f8591d
......@@ -65,6 +65,7 @@ marko@hundin.mysql.fi
miguel@hegel.(none)
miguel@hegel.br
miguel@hegel.local
miguel@hegel.txg
miguel@light.
miguel@light.local
miguel@sartre.local
......@@ -86,6 +87,7 @@ monty@tramp.mysql.fi
monty@work.mysql.com
mwagner@cash.mwagner.org
mwagner@evoq.mwagner.org
mwagner@here.mwagner.org
mwagner@work.mysql.com
mysqldev@build.mysql2.com
nick@mysql.com
......
#!/usr/bin/perl
#
# my_md5sum
#
# Script to clone the 'md5sum' command found on modern systems, since that
# command is not always found on all systems.
#
# Use the "--help" option for more info!
#
# Written by Matt Wagner <matt@mysql.com>
#
use strict;
use Digest::MD5;
use Getopt::Long;
my $VER= "1.1";
#
# Strip the leading path info off the program name ($0). We want 'my_md5sum'
# not './my_md5sum'.
#
$0=~ s/^.*\/(.+)$/$1/;
my ($opt_check, $opt_help)= undef;
GetOptions(
"check|c" => \$opt_check,
"help|h" => \$opt_help,
) || usage();
#
# Put all the [file1 file2 file3 ...]'s into an array
#
my @files = @ARGV;
#
# Give the "--help" text if:
# - "--help|-h" was specified
# - The number of files given as arguments is nil
# - The "--check|-c" option is used with more than one [file] argument
#
usage() if $opt_help || $#files == -1 || ($opt_check && $#files > 0);
# If "--check|-c", then go into checking
if ($opt_check)
{
open (CHECKFILE, $files[0]) or die "$files[0]: $!";
while (<CHECKFILE>)
{
#
# Goto the next line in the file if it does not match a typical
# digest line like:
#
# f1007efa2c72daa693981ec764cdeaca Bootstrap
#
next if $_!~ m/^([a-z0-9]{32})\s+(.+)$/;
# Collect the trappings from the above regex
my $checksum= $1;
my $checkfile= $2;
# Generate a fresh MD5 for the file in question
my $digest= &mkmd5($checkfile);
# Check the fresh MD5 against what is recorded in the file
# Print an error message if they don't match, else print OK
print "$checkfile: FAILED\n" if $digest ne $checksum;
print "$checkfile: OK\n" if $digest eq $checksum;
}
}
# Else generate the MD5 digest to STDOUT
else
{
foreach my $file (@files)
{
my $digest= &mkmd5($file);
print "$digest $file\n";
}
}
#
# This routine generates the MD5 digest of a file
#
sub mkmd5
{
my $file= shift;
open (FILE, $file) or die "$file: $!";
binmode(FILE);
my $digest= Digest::MD5->new->addfile(*FILE)->hexdigest;
close FILE;
return $digest;
}
#
# Print the help text
#
sub usage
{
print <<EOF;
$0 version $VER by Matt Wagner <matt\@mysql.com>
Usage:
$0 [-c [file]] | [file1...]
Generates or checks MD5 message digests.
Options:
-c, --check Check message digests (default is generate)
-h, --help Display this text and exit
The input for -c should be the list of message digests and file names that is
printed on STDOUT by this program when it generates digests.
EOF
exit(0);
}
......@@ -737,14 +737,15 @@ AC_DEFUN(MYSQL_FIND_OPENSSL, [
---)
for d in /usr/ssl/include /usr/local/ssl/include /usr/include \
/usr/include/ssl /opt/ssl/include /opt/openssl/include \
/usr/local/ssl/include /usr/local/include ; do
/usr/local/ssl/include /usr/local/include /usr/freeware/include ; do
if test -f $d/openssl/ssl.h ; then
OPENSSL_INCLUDE=-I$d
fi
done
for d in /usr/ssl/lib /usr/local/ssl/lib /usr/lib/openssl \
/usr/lib /usr/lib64 /opt/ssl/lib /opt/openssl/lib /usr/local/lib/ ; do
/usr/lib /usr/lib64 /opt/ssl/lib /opt/openssl/lib \
/usr/freeware/lib32 /usr/local/lib/ ; do
if test -f $d/libssl.a || test -f $d/libssl.so || test -f $d/libssl.dylib ; then
OPENSSL_LIB=$d
fi
......
......@@ -233,7 +233,7 @@ int main(int argc,char *argv[])
else
{
if (verbose)
printf("MySql error: %3d = %s\n",code,msg);
printf("MySQL error: %3d = %s\n",code,msg);
else
puts(msg);
}
......
......@@ -89,7 +89,7 @@ mach_read_from_4(
/* out: ulint integer */
byte* b); /* in: pointer to four bytes */
/*************************************************************
Writes a ulint in a compressed form. */
Writes a ulint in a compressed form (1..5 bytes). */
UNIV_INLINE
ulint
mach_write_compressed(
......@@ -168,7 +168,7 @@ mach_read_from_8(
/* out: dulint integer */
byte* b); /* in: pointer to 8 bytes */
/*************************************************************
Writes a dulint in a compressed form. */
Writes a dulint in a compressed form (5..9 bytes). */
UNIV_INLINE
ulint
mach_dulint_write_compressed(
......@@ -193,7 +193,7 @@ mach_dulint_read_compressed(
/* out: read dulint */
byte* b); /* in: pointer to memory from where to read */
/*************************************************************
Writes a dulint in a compressed form. */
Writes a dulint in a compressed form (1..11 bytes). */
UNIV_INLINE
ulint
mach_dulint_write_much_compressed(
......
......@@ -366,7 +366,7 @@ mach_read_from_6(
}
/*************************************************************
Writes a dulint in a compressed form. */
Writes a dulint in a compressed form (5..9 bytes). */
UNIV_INLINE
ulint
mach_dulint_write_compressed(
......@@ -422,7 +422,7 @@ mach_dulint_read_compressed(
}
/*************************************************************
Writes a dulint in a compressed form. */
Writes a dulint in a compressed form (1..11 bytes). */
UNIV_INLINE
ulint
mach_dulint_write_much_compressed(
......
......@@ -108,7 +108,9 @@ mlog_close(
mtr_t* mtr, /* in: mtr */
byte* ptr); /* in: buffer space from ptr up was not used */
/************************************************************
Writes the initial part of a log record. */
Writes the initial part of a log record (3..11 bytes).
If the implementation of this function is changed, all
size parameters to mlog_open() should be adjusted accordingly! */
UNIV_INLINE
byte*
mlog_write_initial_log_record_fast(
......
......@@ -137,7 +137,9 @@ mlog_catenate_dulint_compressed(
}
/************************************************************
Writes the initial part of a log record. */
Writes the initial part of a log record (3..11 bytes).
If the implementation of this function is changed, all
size parameters to mlog_open() should be adjusted accordingly! */
UNIV_INLINE
byte*
mlog_write_initial_log_record_fast(
......
......@@ -22,6 +22,7 @@ static ulint mem_n_allocations = 0;
static ulint mem_total_allocated_memory = 0;
ulint mem_current_allocated_memory = 0;
static ulint mem_max_allocated_memory = 0;
static ulint mem_last_print_info = 0;
/* Size of the hash table for memory management tracking */
#define MEM_HASH_SIZE 997
......
This diff is collapsed.
......@@ -114,11 +114,34 @@ ID [a-z_A-Z][a-z_A-Z0-9]*
}
"'" {
/* Quoted character string literals are handled in an explicit
start state 'quoted'. This state is entered and the buffer for
the scanned string is emptied upon encountering a starting quote.
In the state 'quoted', only two actions are possible (defined below). */
BEGIN(quoted);
stringbuf_len = 0;
}
<quoted>[^\']+ string_append(yytext, yyleng);
<quoted>"'"+ { string_append(yytext, yyleng / 2);
<quoted>[^\']+ {
/* Got a sequence of characters other than "'":
append to string buffer */
string_append(yytext, yyleng);
}
<quoted>"'"+ {
/* Got a sequence of "'" characters:
append half of them to string buffer,
as "''" represents a single "'".
We apply truncating division,
so that "'''" will result in "'". */
string_append(yytext, yyleng / 2);
/* If we got an odd number of quotes, then the
last quote we got is the terminating quote.
At the end of the string, we return to the
initial start state and report the scanned
string literal. */
if (yyleng % 2) {
BEGIN(INITIAL);
yylval = sym_tab_add_str_lit(
......
.TH mysqlaccess 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
.SH NAME
.BR mysqlaccess
\- Create new users to mysql.
.BR mysqlaccess \- Create new users to mysql.
.SH USAGE
mysqlaccess [host [user [db]]] OPTIONS
.SH SYNOPSIS
......
.TH mysqldump 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
.SH NAME
mysqldump \- text-based client for dumping or backing up mysql databases , tables and or data.
mysqldump \- text\-based client for dumping or backing up mysql databases, tables and or data.
.SH USAGE
.BR "mysqldump [\fP\fIOPTIONS\fP] database [\fP\fItables\fP]"
......
......@@ -98,7 +98,7 @@ commit;
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
drop table if exists t1;
drop table t3,t2,t1;
CREATE TABLE t1 (id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) TYPE=InnoDB;
select count(*) from t1;
count(*)
......@@ -108,3 +108,22 @@ select count(*) from t1;
count(*)
1
drop table t1;
set GLOBAL query_cache_size=1355776;
CREATE TABLE t1 ( id int(10) NOT NULL auto_increment, a varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY a (a)) TYPE=innodb;
CREATE TABLE t2 ( id int(10) NOT NULL auto_increment, b varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY b (b)) TYPE=innodb;
CREATE TABLE t3 ( id int(10) NOT NULL auto_increment, t1_id int(10) NOT NULL default '0', t2_id int(10) NOT NULL default '0', state int(11) default NULL, PRIMARY KEY (id), UNIQUE KEY t1_id (t1_id,t2_id), KEY t2_id (t2_id,t1_id), CONSTRAINT `t3_ibfk_1` FOREIGN KEY (`t1_id`) REFERENCES `t1` (`id`), CONSTRAINT `t3_ibfk_2` FOREIGN KEY (`t2_id`) REFERENCES `t2` (`id`)) TYPE=innodb;
INSERT INTO t1 VALUES (1,'me');
INSERT INTO t2 VALUES (1,'you');
INSERT INTO t3 VALUES (2,1,1,2);
delete from t3 where t1_id = 1 and t2_id = 1;
select t1.* from t1, t2, t3 where t3.state & 1 = 0 and t3.t1_id = t1.id and t3.t2_id = t2.id and t1.id = 1 order by t1.a asc;
id a
begin;
insert into t3 VALUES ( NULL, 1, 1, 2 );
insert into t3 VALUES ( NULL, 1, 1, 2 );
Duplicate entry '1-1' for key 2
commit;
select t1.* from t1, t2, t3 where t3.state & 1 = 0 and t3.t1_id = t1.id and t3.t2_id = t2.id and t1.id = 1 order by t1.a asc;
id a
1 me
drop table t3,t2,t1;
......@@ -255,7 +255,7 @@ t1 ref y y 5 const 1 Using where
t2 range x x 5 NULL 2 Using where
explain select count(*) from t1 where x in (1);
table type possible_keys key key_len ref rows Extra
t1 range x x 5 NULL 1 Using where; Using index
t1 ref x x 5 const 1 Using where; Using index
explain select count(*) from t1 where x in (1,2);
table type possible_keys key key_len ref rows Extra
t1 range x x 5 NULL 2 Using where; Using index
......
......@@ -48,10 +48,31 @@ show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
commit;
show status like "Qcache_queries_in_cache";
drop table t3,t2,t1;
drop table if exists t1;
CREATE TABLE t1 (id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) TYPE=InnoDB;
select count(*) from t1;
insert into t1 (id) values (0);
select count(*) from t1;
drop table t1;
#
# one statement roll back inside transation
#
set GLOBAL query_cache_size=1355776;
CREATE TABLE t1 ( id int(10) NOT NULL auto_increment, a varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY a (a)) TYPE=innodb;
CREATE TABLE t2 ( id int(10) NOT NULL auto_increment, b varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY b (b)) TYPE=innodb;
CREATE TABLE t3 ( id int(10) NOT NULL auto_increment, t1_id int(10) NOT NULL default '0', t2_id int(10) NOT NULL default '0', state int(11) default NULL, PRIMARY KEY (id), UNIQUE KEY t1_id (t1_id,t2_id), KEY t2_id (t2_id,t1_id), CONSTRAINT `t3_ibfk_1` FOREIGN KEY (`t1_id`) REFERENCES `t1` (`id`), CONSTRAINT `t3_ibfk_2` FOREIGN KEY (`t2_id`) REFERENCES `t2` (`id`)) TYPE=innodb;
INSERT INTO t1 VALUES (1,'me');
INSERT INTO t2 VALUES (1,'you');
INSERT INTO t3 VALUES (2,1,1,2);
delete from t3 where t1_id = 1 and t2_id = 1;
select t1.* from t1, t2, t3 where t3.state & 1 = 0 and t3.t1_id = t1.id and t3.t2_id = t2.id and t1.id = 1 order by t1.a asc;
begin;
insert into t3 VALUES ( NULL, 1, 1, 2 );
-- error 1062
insert into t3 VALUES ( NULL, 1, 1, 2 );
commit;
select t1.* from t1, t2, t3 where t3.state & 1 = 0 and t3.t1_id = t1.id and t3.t2_id = t2.id and t1.id = 1 order by t1.a asc;
drop table t3,t2,t1;
......@@ -182,7 +182,8 @@ uint calc_hashnr_caseup(const byte *key, uint len)
#endif
#ifndef __SUNPRO_C /* SUNPRO can't handle this */
/* for compilers which can not handle inline */
#if !defined(__SUNPRO_C) && !defined(__USLC__) && !defined(__sgi)
inline
#endif
unsigned int rec_hashnr(HASH *hash,const byte *record)
......
......@@ -446,13 +446,12 @@ int ha_rollback_trans(THD *thd, THD_TRANS *trans)
reinit_io_cache(&thd->transaction.trans_log,
WRITE_CACHE, (my_off_t) 0, 0, 1);
thd->transaction.trans_log.end_of_file= max_binlog_cache_size;
if (operation_done)
thd->transaction.cleanup();
}
thd->variables.tx_isolation=thd->session_tx_isolation;
if (operation_done)
{
statistic_increment(ha_rollback_count,&LOCK_status);
thd->transaction.cleanup();
}
}
#endif /* USING_TRANSACTIONS */
DBUG_RETURN(error);
......
......@@ -1590,12 +1590,14 @@ add_key_fields(JOIN_TAB *stat,KEY_FIELD **key_fields,uint *and_level,
// BETWEEN or IN
if (cond_func->key_item()->type() == Item::FIELD_ITEM)
add_key_field(key_fields,*and_level,
((Item_field*) (cond_func->key_item()))->field, 0,
((Item_field*) (cond_func->key_item()))->field,
#ifndef TO_BE_REMOVED_IN_4_1
/* special treatment for IN. Not necessary in 4.1 */
cond_func->argument_count() == 1,
cond_func->arguments() + (cond_func->functype() != Item_func::IN_FUNC),
cond_func->argument_count() - (cond_func->functype() != Item_func::IN_FUNC),
#else
cond_func->argument_count() == 2,
cond_func->arguments()+1, cond_func->argument_count()-1,
#endif
usable_tables);
......
......@@ -91,7 +91,12 @@ main(int argc __attribute__((unused)), char** argv)
struct sockaddr_in sa_cli;
int listen_sd;
int err;
#if defined(__sgi) && _NO_XOPEN4 && _NO_XOPEN5
socklen_t client_len;
#else
size_t client_len;
#endif
int reuseaddr = 1; /* better testing, uh? */
MY_INIT(argv[0]);
......
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