summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormonty@donna.mysql.fi <>2001-04-16 14:05:55 +0300
committermonty@donna.mysql.fi <>2001-04-16 14:05:55 +0300
commitac77076ff25c00430d1130e2c50cc4ad6b4bb1a4 (patch)
tree71b8dc7684015c297db3e01616c40cfa6acc6324
parent801259b669ea6b1329f7bf58f8cbda52f8a3488f (diff)
downloadmariadb-git-ac77076ff25c00430d1130e2c50cc4ad6b4bb1a4.tar.gz
Fixed bug with HEAP tables when using LIKE
-rw-r--r--Docs/manual.texi67
-rw-r--r--mysql-test/r/heap.result7
-rw-r--r--mysql-test/t/heap.test15
-rw-r--r--sql/field.cc2
-rw-r--r--sql/gen_lex_hash.cc2
5 files changed, 84 insertions, 9 deletions
diff --git a/Docs/manual.texi b/Docs/manual.texi
index ec5d6ef7b12..723239fe32a 100644
--- a/Docs/manual.texi
+++ b/Docs/manual.texi
@@ -519,6 +519,7 @@ BDB or Berkeley_DB Tables
* BDB start::
* BDB characteristic::
* BDB TODO::
+* BDB portability::
* BDB errors::
GEMINI Tables
@@ -7467,11 +7468,6 @@ that you also probably need to raise the @code{core file size} by adding
@code{ulimit -c 1000000} to @code{safe_mysqld} or starting @code{safe_mysqld}
with @code{--core-file-sizes=1000000}. @xref{safe_mysqld}.
-@c the stuff below is really out of date - hardly anybody uses it anymore
-
-If you are using LinuxThreads and @code{mysqladmin shutdown} doesn't work,
-you must upgrade to LinuxThreads Version 0.7.1 or newer.
-
To get a core dump on Linux if mysqld dies with a SIGSEGV signal, you can
start mysqld with the @code{--core-file} option. Note that you also probably
need to raise the @code{core file size} by adding @code{ulimit -c 1000000} to
@@ -23905,6 +23901,7 @@ SUM_OVER_ALL_KEYS(max_length_of_key + sizeof(char*) * 2)
* BDB start::
* BDB characteristic::
* BDB TODO::
+* BDB portability::
* BDB errors::
@end menu
@@ -23923,12 +23920,26 @@ distribution that has a couple of small patches to make it work more
smoothly with @strong{MySQL}. You can't use a not-patched @code{BDB}
version with @strong{MySQL}.
+We at MySQL AB are working in close cooperating with Sleepycat to
+keep the quality of the @strong{MySQL} - BDB interface high.
+
+When it comes to supporting BDB tables, we are committed to help our
+users to locate the problem and help creating a reproducable test case
+for any problems involving BDB tables. Any such test case will be
+forwarded to Sleepycat who in turn will help us find and fix the
+problem. As this is a two stage operating, any problems with BDB tables
+may take a little longer for us to fix than for other table handlers,
+but as the Berkeley code itself has been used by many other applications
+than @strong{MySQL} we don't envision any big problems with this.
+@xref{Table handler support}.
+
@node BDB install, BDB start, BDB overview, BDB
@subsection Installing BDB
If you have downloaded a binary version of @strong{MySQL} that includes
support for Berkeley DB, simply follow the instructions for
installing a binary version of @strong{MySQL}. @xref{Installing binary}.
+@xref{mysqld-max}.
To compile @strong{MySQL} with Berkeley DB support, download @strong{MySQL}
3.23.34 or newer and configure @code{MySQL} with the
@@ -24076,7 +24087,7 @@ contrast with @code{MyISAM} and @code{ISAM} tables where mysqld will
wait for enough free disk before continuing.
@end itemize
-@node BDB TODO, BDB errors, BDB characteristic, BDB
+@node BDB TODO, BDB portability, BDB characteristic, BDB
@subsection Some things we need to fix for BDB in the near future:
@itemize @bullet
@@ -24094,7 +24105,47 @@ Optimize performance.
Change to not use page locks at all when we are scanning tables.
@end itemize
-@node BDB errors, , BDB TODO, BDB
+@node BDB portability, BDB errors, BDB TODO, BDB
+@subsection Operating systems supported by @strong{BDB}
+
+If you after having built @strong{MySQL} with support for BDB tables get
+the following error in the log file when you start @code{mysqld}:
+
+@example
+bdb: architecture lacks fast mutexes: applications cannot be threaded
+Can't init dtabases
+@end example
+
+This means that @code{BDB} tables are not supported for your architecture.
+In this case you have to rebuild @strong{MySQL} without BDB table support.
+
+NOTE: The following list is not complete; We will update this as we get
+more information about this.
+
+Currently we know that BDB tables works with the following operating
+system.
+
+@itemize @bullet
+@item
+Linux 2.x intel
+@item
+Solaris sparc
+@item
+SCO OpenServer
+@item
+SCO UnixWare 7.0.1
+@end itemize
+
+It doesn't work with the following operating systems:
+
+@itemize @bullet
+@item
+Linux 2.x Alpha
+@item
+Max OS X
+@end itemize
+
+@node BDB errors, , BDB portability, BDB
@subsection Errors You May Get When Using BDB Tables
@itemize @bullet
@@ -42938,6 +42989,8 @@ not yet 100% confident in this code.
@appendixsubsec Changes in release 3.23.37
@itemize @bullet
@item
+Fixed a bug when using @code{HEAP} tables with @code{LIKE}.
+@item
Added @code{--mysql-version} to @code{safe_mysqld}
@item
Changed @code{INNOBASE} to @code{INNODB} (because the @code{INNOBASE}
diff --git a/mysql-test/r/heap.result b/mysql-test/r/heap.result
index 1bf34c6ad1b..bf4c468c802 100644
--- a/mysql-test/r/heap.result
+++ b/mysql-test/r/heap.result
@@ -78,3 +78,10 @@ f1 f2
12 ted
12 ted
12 ted
+table type possible_keys key key_len ref rows Extra
+t1 range btn btn 10 NULL 10 where used
+btn
+table type possible_keys key key_len ref rows Extra
+t1 ALL btn NULL NULL NULL 14 where used
+table type possible_keys key key_len ref rows Extra
+t1 ref btn btn 11 const,const 10 where used
diff --git a/mysql-test/t/heap.test b/mysql-test/t/heap.test
index cd21aaff77a..abb9e1fd1bc 100644
--- a/mysql-test/t/heap.test
+++ b/mysql-test/t/heap.test
@@ -2,6 +2,7 @@
# Test of heap tables.
#
+drop table if exists t1;
create table t1 (a int not null,b int not null, primary key (a)) type=heap comment="testing heaps" avg_row_length=100 min_rows=1 max_rows=100;
insert into t1 values(1,1),(2,2),(3,3),(4,4);
delete from t1 where a=1 or a=0;
@@ -85,3 +86,17 @@ INSERT into t1 set f1=12,f2="ted";
delete from t1 where f2="bill";
select * from t1;
drop table t1;
+
+#
+# Test when using part key searches
+#
+
+create table t1 (btn char(10) not null, key(btn)) type=heap;
+insert into t1 values ("hello"),("hello"),("hello"),("hello"),("hello"),("a"),("b"),("c"),("d"),("e"),("f"),("g"),("h"),("i");
+explain select * from t1 where btn like "q%";
+select * from t1 where btn like "q%";
+alter table t1 add column new_col char(1) not null, add key (btn,new_col), drop key btn;
+update t1 set new_col=btn;
+explain select * from t1 where btn="a";
+explain select * from t1 where btn="a" and new_col="a";
+drop table t1;
diff --git a/sql/field.cc b/sql/field.cc
index f7dbd3c72f0..29485797408 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -363,7 +363,7 @@ void Field::store_time(TIME *ltime,timestamp_type type)
bool Field::optimize_range()
{
- return test(table->file->option_flag() & HA_READ_NEXT);
+ return test(table->file->option_flag() & HA_ONLY_WHOLE_INDEX);
}
/****************************************************************************
diff --git a/sql/gen_lex_hash.cc b/sql/gen_lex_hash.cc
index b2925680dd5..4a923e039c4 100644
--- a/sql/gen_lex_hash.cc
+++ b/sql/gen_lex_hash.cc
@@ -472,7 +472,7 @@ int main(int argc,char **argv)
int error;
MY_INIT(argv[0]);
- start_value=6591595L; best_t1=6947666L; best_t2=6561864L; best_type=2; /* mode=4523 add=5 type: 0 */
+ start_value=2663113L; best_t1=1175350L; best_t2=7404531L; best_type=4; /* mode=4327 add=3 type: 0 */
if (get_options(argc,(char **) argv))
exit(1);