Commit 8eadb024 authored by monty@hundin.mysql.fi's avatar monty@hundin.mysql.fi

Fixed mysqldumpslow for new dump format.

Fix for HEAP tables with many rows deleted.
Add '' arround database names in SHOW GRANT
parent c4b8c1b6
......@@ -6252,7 +6252,7 @@ shell> groupadd mysql
shell> useradd -g mysql mysql
shell> cd /usr/local
shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -
shell> ln -s mysql-VERSION-OS mysql
shell> ln -s full-path-to-mysql-VERSION-OS mysql
shell> cd mysql
shell> scripts/mysql_install_db
shell> chown -R root .
......@@ -6327,7 +6327,7 @@ Unpack the distribution and create the installation directory:
@example
shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -
shell> ln -s mysql-VERSION-OS mysql
shell> ln -s full-path-to-mysql-VERSION-OS mysql
@end example
The first command creates a directory named @file{mysql-VERSION-OS}. The
......@@ -48703,6 +48703,8 @@ Our TODO section contains what we plan to have in 4.0. @xref{TODO MySQL 4.0}.
@itemize @bullet
@item
Fixed wrong error value when doing a @code{SELECT} with an empty HEAP table.
@item
Use @code{ORDER BY column DESC} now sorts @code{NULL} values first.
@item
Fixed bug in @code{SELECT DISTINCT ... ORDER BY DESC} optimization.
......@@ -21,11 +21,6 @@
int heap_rfirst(HP_INFO *info, byte *record)
{
DBUG_ENTER("heap_rfirst");
if (!(info->s->records))
{
my_errno=HA_ERR_END_OF_FILE;
DBUG_RETURN(my_errno);
}
info->current_record=0;
info->current_hash_ptr=0;
info->update=HA_STATE_PREV_FOUND;
......
......@@ -197,3 +197,9 @@ a b
INSERT INTO t1 VALUES (1,3);
Duplicate entry '3' for key 1
DROP TABLE t1;
CREATE TABLE t1 (a int not null, primary key(a)) type=heap;
INSERT into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11);
DELETE from t1 where a < 100;
SELECT * from t1;
a
DROP TABLE t1;
......@@ -128,3 +128,13 @@ SELECT * FROM t1 WHERE b<=>NULL;
--error 1062
INSERT INTO t1 VALUES (1,3);
DROP TABLE t1;
#
# Test when deleting all rows
#
CREATE TABLE t1 (a int not null, primary key(a)) type=heap;
INSERT into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11);
DELETE from t1 where a < 100;
SELECT * from t1;
DROP TABLE t1;
......@@ -36,8 +36,7 @@ my_string my_load_path(my_string to, const char *path,
test_if_hard_path(path))
VOID(strmov(buff,path));
else if ((path[0] == FN_CURLIB && path[1] == FN_LIBCHAR) ||
(is_prefix((gptr) path,FN_PARENTDIR) &&
path[strlen(FN_PARENTDIR)] == FN_LIBCHAR) ||
(is_prefix((gptr) path,FN_PARENTDIR)) ||
! own_path_prefix)
{
if (! my_getwd(buff,(uint) (FN_REFLEN-strlen(path)),MYF(0)))
......
......@@ -75,7 +75,7 @@ while ( defined($_ = shift @pending) or defined($_ = <>) ) {
s/^#? Time: \d{6}\s+\d+:\d+:\d+.*\n//;
my ($user,$host) = s/^#? User\@Host:\s+(\S+)\s+\@\s+(\S+).*\n// ? ($1,$2) : ('','');
s/^# Time: (\d+) Lock_time: (\d+) Rows_sent: (\d+).*\n//;
s/^# Query_time: (\d+) Lock_time: (\d+) Rows_sent: (\d+).*\n//;
my ($t, $l, $r) = ($1, $2, $3);
$t -= $l unless $opt{l};
......@@ -96,8 +96,12 @@ while ( defined($_ = shift @pending) or defined($_ = <>) ) {
unless ($opt{a}) {
s/\b\d+\b/N/g;
s/\b0x[0-9A-Fa-f]+\b/N/g;
s/'([^\\\']|\\.|\'\')+'/'S'/g;
s/"([^\\\"]|\\.|\"\")+"/"S"/g;
s/''/'S'/g;
s/""/"S"/g;
s/(\\')//g;
s/(\\")//g;
s/'[^']+'/'S'/g;
s/"[^"]+"/"S"/g;
# -n=8: turn log_20001231 into log_NNNNNNNN
s/([a-z_]+)(\d{$opt{n},})/$1.('N' x length($2))/ieg if $opt{n};
# abbreviate massive "in (...)" statements and similar
......
......@@ -542,7 +542,8 @@ int handler::read_first_row(byte * buf, uint primary_key)
If there is very few deleted rows in the table, find the first row by
scanning the table.
*/
if (deleted < 10 || primary_key >= MAX_KEY)
if (deleted < 10 || primary_key >= MAX_KEY ||
!(option_flag() & HA_READ_ORDER))
{
(void) rnd_init();
while ((error= rnd_next(buf)) == HA_ERR_RECORD_DELETED) ;
......
......@@ -2743,9 +2743,9 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
}
}
}
db.append (" ON ",4);
db.append (" ON '",5);
db.append(acl_db->db);
db.append (".* TO '",7);
db.append ("'.* TO '",8);
db.append(lex_user->user.str,lex_user->user.length);
db.append ("'@'",3);
db.append(lex_user->host.str, lex_user->host.length);
......
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