summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-03-12 11:52:41 +0200
committerunknown <monty@hundin.mysql.fi>2002-03-12 11:52:41 +0200
commit6e37987c512b4fb3b11f347b050eeabf30bfae04 (patch)
treecc5ddb707fd6b0aa9b53c89ae0d0fc731486fef9
parent016a6cd3857503cf6e4604e3168d3c860557a572 (diff)
downloadmariadb-git-6e37987c512b4fb3b11f347b050eeabf30bfae04.tar.gz
Fixed mysqldumpslow for new dump format.
Fix for HEAP tables with many rows deleted. Add '' arround database names in SHOW GRANT Docs/manual.texi: Fixed symlink examples. heap/hp_rfirst.c: Remove not needed patch. mysql-test/r/heap.result: Added test case for HEAP + many deletes mysql-test/t/heap.test: Added test case for HEAP + many deletes mysys/mf_loadpath.c: Resolve path's even if they don't end in '/' scripts/mysqldumpslow.sh: Fix for new dump format. sql/handler.cc: Fix for HEAP tables with many rows deleted. sql/sql_acl.cc: Add '' arround database names in SHOW GRANT
-rw-r--r--Docs/manual.texi6
-rw-r--r--heap/hp_rfirst.c5
-rw-r--r--mysql-test/r/heap.result6
-rw-r--r--mysql-test/t/heap.test10
-rw-r--r--mysys/mf_loadpath.c3
-rw-r--r--scripts/mysqldumpslow.sh10
-rw-r--r--sql/handler.cc3
-rw-r--r--sql/sql_acl.cc4
8 files changed, 32 insertions, 15 deletions
diff --git a/Docs/manual.texi b/Docs/manual.texi
index 3ad42252f0c..48571230291 100644
--- a/Docs/manual.texi
+++ b/Docs/manual.texi
@@ -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.
diff --git a/heap/hp_rfirst.c b/heap/hp_rfirst.c
index b20918ff3a7..9a1f09244a0 100644
--- a/heap/hp_rfirst.c
+++ b/heap/hp_rfirst.c
@@ -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;
diff --git a/mysql-test/r/heap.result b/mysql-test/r/heap.result
index a7a69694b65..13f452e26d8 100644
--- a/mysql-test/r/heap.result
+++ b/mysql-test/r/heap.result
@@ -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;
diff --git a/mysql-test/t/heap.test b/mysql-test/t/heap.test
index 1b7175d375c..ef7e3239a96 100644
--- a/mysql-test/t/heap.test
+++ b/mysql-test/t/heap.test
@@ -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;
diff --git a/mysys/mf_loadpath.c b/mysys/mf_loadpath.c
index 68d6e3ceda3..291ad62e297 100644
--- a/mysys/mf_loadpath.c
+++ b/mysys/mf_loadpath.c
@@ -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)))
diff --git a/scripts/mysqldumpslow.sh b/scripts/mysqldumpslow.sh
index 856c8a09b5e..e8f73c25b55 100644
--- a/scripts/mysqldumpslow.sh
+++ b/scripts/mysqldumpslow.sh
@@ -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
diff --git a/sql/handler.cc b/sql/handler.cc
index 8447797442c..e0e9ee25506 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -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) ;
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 869be5b327d..2682122dd8f 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -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);