summaryrefslogtreecommitdiff
path: root/Docs
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-06-03 12:59:31 +0300
committerunknown <monty@hundin.mysql.fi>2002-06-03 12:59:31 +0300
commitf0409fa920c7908f2f9ef03919583a32bf84eaad (patch)
treebe04186411dc657ef6bbcbe01267d30f2675c914 /Docs
parentebbcb0f391d7df364e0ccc6bca706456e9aadbf7 (diff)
parent7cb2e2d1dce2c7466388f4a6ade0614564be82fc (diff)
downloadmariadb-git-f0409fa920c7908f2f9ef03919583a32bf84eaad.tar.gz
merge with 4.0
BitKeeper/etc/ignore: auto-union BitKeeper/etc/logging_ok: auto-union BUILD/SETUP.sh: Auto merged BUILD/compile-pentium-debug: Auto merged BitKeeper/triggers/post-commit: Auto merged configure.in: Auto merged Docs/manual.texi: Auto merged client/mysql.cc: Auto merged client/mysqldump.c: Auto merged client/mysqltest.c: Auto merged extra/mysql_install.c: Auto merged extra/resolve_stack_dump.c: Auto merged extra/resolveip.c: Auto merged include/my_sys.h: Auto merged include/mysqld_error.h: Auto merged isam/pack_isam.c: Auto merged libmysql/Makefile.shared: Auto merged libmysql/libmysql.c: Auto merged myisam/ft_dump.c: Auto merged myisam/ft_test1.c: Auto merged myisam/ftdefs.h: Auto merged myisam/mi_check.c: Auto merged myisam/mi_test1.c: Auto merged myisam/mi_write.c: Auto merged myisam/myisamchk.c: Auto merged myisam/myisampack.c: Auto merged mysql-test/mysql-test-run.sh: Auto merged mysql-test/r/select_found.result: Auto merged mysql-test/t/select_found.test: Auto merged mysys/charset.c: Auto merged mysys/default.c: Auto merged mysys/hash.c: Auto merged sql/field.cc: Auto merged sql/gen_lex_hash.cc: Auto merged sql/ha_innodb.cc: Auto merged sql/hostname.cc: Auto merged sql/item_cmpfunc.h: Auto merged sql/item_strfunc.cc: Auto merged sql/item_timefunc.h: Auto merged sql/lex.h: Auto merged sql/log.cc: Auto merged sql/mysql_priv.h: Auto merged sql/repl_failsafe.cc: Auto merged sql/slave.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_cache.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_db.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_string.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_union.cc: Auto merged sql/share/czech/errmsg.txt: Auto merged sql/share/danish/errmsg.txt: Auto merged sql/share/dutch/errmsg.txt: Auto merged sql/share/english/errmsg.txt: Auto merged sql/share/estonian/errmsg.txt: Auto merged sql/share/german/errmsg.txt: Auto merged sql/share/greek/errmsg.txt: Auto merged sql/share/hungarian/errmsg.txt: Auto merged sql/share/italian/errmsg.txt: Auto merged sql/share/japanese/errmsg.txt: Auto merged sql/share/korean/errmsg.txt: Auto merged sql/share/norwegian-ny/errmsg.txt: Auto merged sql/share/norwegian/errmsg.txt: Auto merged sql/sql_update.cc: Auto merged sql/structs.h: Auto merged sql/share/polish/errmsg.txt: Auto merged sql/share/portuguese/errmsg.txt: Auto merged sql/share/romanian/errmsg.txt: Auto merged sql/share/russian/errmsg.txt: Auto merged sql/share/slovak/errmsg.txt: Auto merged sql/share/spanish/errmsg.txt: Auto merged sql/share/swedish/errmsg.txt: Auto merged sql/share/ukrainian/errmsg.txt: Auto merged strings/Makefile.am: Auto merged strings/ctype-ujis.c: Auto merged tools/mysqlmanager.c: Auto merged
Diffstat (limited to 'Docs')
-rw-r--r--Docs/Flags/new-zealand.eps98
-rw-r--r--Docs/Flags/new-zealand.gifbin0 -> 661 bytes
-rw-r--r--Docs/Flags/new-zealand.pdfbin0 -> 1331 bytes
-rw-r--r--Docs/Flags/new-zealand.txt0
-rw-r--r--Docs/ManualStyleGuidelines.wiki279
-rwxr-xr-xDocs/Support/colspec-fix.pl46
-rwxr-xr-xDocs/Support/docbook-fixup.pl45
-rwxr-xr-xDocs/Support/docbook-prefix.pl50
-rwxr-xr-xDocs/Support/make-docbook9
-rw-r--r--Docs/Support/trivial-makeinfo-4.0c.patch11
-rwxr-xr-xDocs/Support/update-reserved-words.pl28
-rw-r--r--Docs/glibc-2.2.5.patch210
-rw-r--r--Docs/internals.texi45
-rw-r--r--Docs/manual.de.texi99
-rw-r--r--Docs/manual.texi5787
-rw-r--r--Docs/mirrors.texi49
-rw-r--r--Docs/mysqld_error.txt458
17 files changed, 4223 insertions, 2991 deletions
diff --git a/Docs/Flags/new-zealand.eps b/Docs/Flags/new-zealand.eps
new file mode 100644
index 00000000000..9177154f8f7
--- /dev/null
+++ b/Docs/Flags/new-zealand.eps
@@ -0,0 +1,98 @@
+%!PS-Adobe-2.0 EPSF-2.0
+%%Creator: pnmtops
+%%Title: new-zealand.ps
+%%Pages: 1
+%%BoundingBox: 290 385 321 407
+%%EndComments
+/readstring {
+ currentfile exch readhexstring pop
+} bind def
+/rpicstr 32 string def
+/gpicstr 32 string def
+/bpicstr 32 string def
+%%EndProlog
+%%Page: 1 1
+gsave
+290.64 385.44 translate
+30.72 21.12 scale
+32 22 8
+[ 32 0 0 -22 0 22 ]
+{ rpicstr readstring }
+{ gpicstr readstring }
+{ bpicstr readstring }
+true 3
+colorimage
+000000000000000000000000000000000000000000000000000000000000
+000000000000000000000000000000000000000000000000000000000000
+000000000000000000000000000000000000000000000000000000000000
+00000000000000ce770d08080874c6770808080c77ce0808080808080808
+0808080808080800003e58050000004d005000000005583e000000000000
+000000000000000000000042b4b6b5b5b5aa00abb5b5b5b6b442b5b5b5b5
+b5b5b5b5b5b5b5b5b5b5b50000aed2b433080874c677080833b4d2ae0808
+0808080808080808080808080800008a3d5e2b00004d005000002b5e3d8a
+0000000000000000000000000000000000bb3d81bfb5b5aa00abb5b5bf81
+3dbbb5b5b5b5b5b5b5b5b5b5b5b5b5b5b500000967d3ce770d74c6770c77
+ced36709080808080808083e230808080808080000015f733e58054d0050
+05583e735f0100000000000000341c0000000000000000b5cb7d42b4b6aa
+00abb6b4427dcbb5b5b5b5b5b5b5b5bfbcb5b5b5b5b5b50000080825aed2
+b49bc69db3d2ae25080808080808080a65a49a5a0808080808000000001e
+893d5e7400765d3d8a1e000000000000000253444c4d00000000000000b5
+b5bdbb3d81b300b4813dbbbdb5b5b5b5b5b5b5b6bf7285c3b5b5b5b5b500
+00d3d3d3d3d6d5d3c6d3d5d6d3d3d3d30808080808081ccfc01308080808
+0800004d4d4d4d4f4d4200424d4f4d4d4d4d00000000000015484a0b0000
+00000000004f4f4f4f4f4d4200424d4f4f4f4f4fb5b5b5b5b5b5ba4e5fb8
+b5b5b5b5b50000d6d6d6d6d6d6d3c6d3d6d6d6d6d6d60808080808082c59
+6b1808080808080000505050505050420042505050505050000000000000
+25475a1000000000000000505050505050420042505050505050b5b5b5b5
+b5b5bfbdc2b9b5b5b5b5b50000080825aed2b49bc69db4d2ae2508080808
+08080908080808080832080808000000001e8a3d5e7400775e3d8a1e0000
+00000000010000000000002c0000000000b5b5bdbb3d81b300b4813dbbbd
+b5b5b5b5b5b5b5b5b5b5b5b5b5c1b5b5b500000967d3ce770d74c6770c77
+ced36709080808086408080808183eb14528080000015f733e58054d0050
+05583e735f010000000058000000001138714021000000b5cb7d42b4b6aa
+00abb6b4427dcbb5b5b5b5b5c6b5b5b5b5b9c49bc6beb50000aed2b43308
+0874c677080833b4d2ae08083188c8821e08080a7ec8a6190800008a3d5e
+2b00004d005000002b5e3d8a00002b534b591700000252074912000000bb
+3d81bfb5b5aa00abb5b5bf813dbbb5b5c09f58abbbb5b5b6a70776bab500
+00ce770d08080874c6770808080c77ce08080882cd5f0808080861798a08
+0800003e58050000004d005000000005583e0000004b2649000000005249
+660000000042b4b6b5b5b5aa00abb5b5b5b6b442b5b5b59a26b9b5b5b5b5
+c2a1b3b5b50000080808080808080808080808080808080808622d540808
+080810081008080000000000000000000000000000000000000000552548
+0000000008000800000000b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5c4
+bec2b5b5b5b5b7b5b7b5b500000808080808080808080808080808080808
+080808080808080808080808080000000000000000000000000000000000
+0000000000000000000000000000000000b5b5b5b5b5b5b5b5b5b5b5b5b5
+b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b500000808080808080808080808
+080808080808080808080808080808080808080000000000000000000000
+0000000000000000000000000000000000000000000000b5b5b5b5b5b5b5
+b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b500000808080808
+080808080808080808080808080808080808080808080808080000000000
+0000000000000000000000000000000000000000000000000000000000b5
+b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b500
+00080808080808080808080808080808080808080808081c080808080808
+080000000000000000000000000000000000000000000000001400000000
+0000000000b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5bab5b5
+b5b5b5b5b500000808080808080808080808080808080808080808080886
+200808080808080000000000000000000000000000000000000000000000
+005f190000000000000000b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5
+b5b5b5adbcb5b5b5b5b5b500000808080808080808080808080808080808
+0808081196cdc94808080808080000000000000000000000000000000000
+00000000000a7728674100000000000000b5b5b5b5b5b5b5b5b5b5b5b5b5
+b5b5b5b5b5b5b5b8bc2978c5b5b5b5b5b500000808080808080808080808
+080808080808080808083dada00808080808080000000000000000000000
+0000000000000000000000003555670000000000000000b5b5b5b5b5b5b5
+b5b5b5b5b5b5b5b5b5b5b5b5b5b5c17e9fb5b5b5b5b5b500000808080808
+08080808080808080808080808080808240a250908080808080000000000
+0000000000000000000000000000000000001d021e0100000000000000b5
+b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5bdb5bdb5b5b5b5b5b500
+000808080808080808080808080808080808080808080808080808080808
+080000000000000000000000000000000000000000000000000000000000
+0000000000b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5
+b5b5b5b5b500000000000000000000000000000000000000000000000000
+000000000000000000000000000000000000000000000000000000000000
+000000000000000000000000000000000000000000000000000000000000
+000000000000000000000000
+grestore
+showpage
+%%Trailer
diff --git a/Docs/Flags/new-zealand.gif b/Docs/Flags/new-zealand.gif
new file mode 100644
index 00000000000..5d74f71ecc0
--- /dev/null
+++ b/Docs/Flags/new-zealand.gif
Binary files differ
diff --git a/Docs/Flags/new-zealand.pdf b/Docs/Flags/new-zealand.pdf
new file mode 100644
index 00000000000..040f8bdb7b0
--- /dev/null
+++ b/Docs/Flags/new-zealand.pdf
Binary files differ
diff --git a/Docs/Flags/new-zealand.txt b/Docs/Flags/new-zealand.txt
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/Docs/Flags/new-zealand.txt
diff --git a/Docs/ManualStyleGuidelines.wiki b/Docs/ManualStyleGuidelines.wiki
new file mode 100644
index 00000000000..3329370411c
--- /dev/null
+++ b/Docs/ManualStyleGuidelines.wiki
@@ -0,0 +1,279 @@
+OriginalAuthor: PaulDuBois
+
+!!! ManualStyleGuidelines
+
+''Version 1.0''
+
+!! Revision History
+
+* 2002-05-17 ArjenLentz - Version 1.0, Posted to Wiki
+
+!! MySQL Manual Style Guidelines
+
+Paul DuBois <paul@snake.net>
+
+The following list of guidelines contains items that I've been jotting
+down over time as style questions have come up in relation to the
+MySQL manual. I wouldn't say they're exactly "official", but they
+do reflect current working practice. Arjen asked me to post this
+on the list some time ago so that it can be discussed with a view
+to adding it (or something like it) to the source tree. So here it is!
+
+Present in the mysql-4.0 source tree: Docs/ManualStyleGuidelines.wiki
+
+
+The manual is written in UK English, not American English. This means:
+
+ colour, not color
+ behaviour, not behavior
+ authorise, not authorize
+ optimise, not optimize
+ etc.
+
+Write MySQL, not @strong{MySQL} (the manual used to use the latter, but no
+more).
+
+Write Unix, not UNIX.
+
+Use uppercase for SQL keywords, functions names, etc., when writing
+SQL statement examples.
+
+To write a list of items, add commas after all items preceding the last one:
+ Correct: Features, products, and services
+ Incorrect: Features, products and services
+
+How to pluralize keywords that are enclosed in @code:
+ Correct: @code{SELECT}s
+ Incorrect: @code{SELECTs} or @code{SELECT}'s or @code{SELECT}:s
+
+Use "its" and "it's" correctly. These words are exceptions to
+the normal use of "'s" to indicate possession:
+
+it's = it is (e.g., "one of the strengths of MySQL is that it's fast")
+its = possession (e.g., "MySQL is fast, which is one of its strengths")
+
+"a lot" is two words. "alot" is rebarbative.
+
+Write lowercase, not lower case
+
+Write uppercase, not upper case
+
+Write lettercase, not letter case
+
+Write "web site" (two words), not "website", and "web page" rather
+than "webpage".
+
+The word "data" is problematic. It's commonly used both in plural and in
+singular form. The manual uses it as plural, which means you use "data are"
+rather than "data is". It's unfortunate that no matter which form we use, it
+will look incorrect to some people. But we can at least be internally
+consistent.
+(Paul: I think that the O'Reilly proofread might have caught one or two of these; could you please pick up on these but don't change them back straight away until the book is finished? Thanks; Arjen).
+
+Write "press Enter", not "hit Return" or "hit Enter".
+
+When reproducing program output, reproduce it exactly, even if it contains
+typos. Don't "fix" it. (If the output is produced by a MySQL program, then
+fix the source for the program to write the output correctly without the
+typo, then update the manual to match.)
+
+Use "okay" rather than "ok" or "Ok" or "OK" in sentences. Exceptions:
+* When describing instructions for a GUI with buttons that say "OK", then use "OK". That is, use the label that the GUI uses.
+* When showing the output from a program, show the output exactly; don't change "ok" to "okay", etc.
+
+Write "Open Source" (inside @code{}), not "open source".
+
+To put something in quotes, do it ``like this,'' not "like this"
+or 'like this.' In the latter two cases, the quotes will come
+out looking rotten in printed formats.
+Exception: quotes in code examples should be written using whatever
+contention the program language requires.
+
+Table types should be written using @code{}; write @code{MyISAM}, not
+MyISAM.
+
+When possible, use table names that are singular, not plural.
+For example, use "item" rather than "items", or "person" rather than
+"people". Sometimes you can add "_list" (as in "item_list") to make it
+more clear that the name refers to a collection of items.
+
+ Some commonly occurring misspelling:
+
+ Correct Incorrect
+ ---------------------------
+ publicly publically
+ statically staticly
+ dynamically dynamicly
+ automatically automaticly
+
+There is no hyphen after "ly" words. Write statically linked, not
+statically-linked.
+
+To refer to ASCII codes, use ASCII n, not ASCII(n), unless you're
+referring to the ASCII() function, which case you use @code{ASCII()}.
+
+ ASCII 13 indicates ASCII character code 13
+ @code{ASCII(13)} indicates a function call
+
+backup is a noun or adjective (as in "a backup file"), back up is a verb
+(as in "to back up a database")
+rollback is a noun or adjective (as in "a rollback operation"), roll back
+is a verb (as in "roll back a transaction")
+
+core dump is a noun or a verb (as in "a core dump file" or "a program
+core dumps when it fails"). In the latter case, however, it's better say
+say "a program dumps core when it fails").
+
+Write character set names in @code{}, e.g., @code{latin1}, @code{win1251}.
+
+To prevent problems with various output formats, there should be no link
+titles in a @uref{}. So @uref{url} is allowed, @uref{url,blabla} is not.
+ Use this format:
+ @uref{url} (WWW)
+ Not this format:
+ @uref{url, WWW}
+ Similarly for FTP sites.
+
+URLs ending in a domain name or directory should have a "/" at the end.
+(For example, the URLs for all mirror sites should be written that way.)
+
+Privilege names are written using @strong and lowercase, as in "the
+@strong{process} privilege". Column names in the grant tables are
+written using @code and the lettercase found in the table definition,
+as in "the @code{Process_priv} column".
+
+Write "e-mail", not "email". Exceptions are the @email{} construct, and
+the Email attribute name in X509 certificate strings.
+
+Write thread-safe, transaction-safe, replication-safe, not thread safe,
+transaction safe, replication safe.
+
+Write wildcard, not wild card or wild-card.
+
+Use "indexes", not "indices": Adding indexes to a table will improve the
+performance of SELECT statements.
+Exception: when returning to array elements, use "indices": The elements
+of the array may be accessed using numeric indices, where the index
+values ranges from 0 to n.
+
+Write "heavy-load production systems" (used as an adjective),
+but "...used under heavy load" (used on its own).
+
+Write PostScript, not Postscript.
+
+When writing a list like "A, B, and C", include a comma before the last and.
+
+Write case-sensitive and case-insensitive (hyphenated).
+
+Write runtime, not run time.
+
+Write backward-compatible, not backward compatible or backwards compatible.
+
+Write application-related, not application related.
+
+Write filesystem, not file system.
+
+Write file-size, not file size.
+
+Write datafile, not data file.
+
+Write power-start, not power start.
+
+Write percent, not per cent.
+
+Write "toward", "and onward", not "towards", "onwards".
+
+Write third-party, not third party.
+
+Write turnkey, not turn-key.
+
+Write "the Net" (capitalised) if referring to the Internet in that way.
+
+Write long-awaited, not long awaited.
+
+Write natural-language, not natural language.
+
+Write low-volume <something> (when used as an adjective).
+
+Write platform-dependent, not platform dependent.
+
+Write something like "mentioned previously" instead of "above", and "later in this section" instead of "below" when making such relative references in your text.
+
+Write "... shown here", not "... shown below".
+
+Write "following some", not "something [shown] below".
+
+Write high-priority <something> (when used as an adjective), not high priority.
+
+Write "whether", not "whether or not".
+
+Write hand-held, not hand held.
+
+Write rewriting, not re-writing.
+
+Write re-issue(ing), not reissue(ing).
+
+Write command-line, not command line.
+
+Write server-side, not server side.
+
+Write "<blabla> only", not "only <blabla>".
+
+Write floating-point, not floating point.
+
+Write heavy-duty, not heavy duty.
+
+Write online, not on-line.
+
+Write user-defined, not user defined.
+
+Write multi-user, not multi user.
+
+Write multi-thread(ed), not multithread(ed).
+
+Write memory-based, not memory based.
+
+Write long-time <something> (when used as an adjective), not long time.
+
+Write 32-bit, not 32 bit or 32 bits. (Same goes for 64-bit, of course! ;-)
+
+Write "different from [what] ...", not "different than ...".
+
+Write "@-e.g., " instead of " e.g. " in the middle of a sentence. (The @- will be turned into a dash, or &mdash; for DocBook output.)
+Following "e.g." by a comma, not a space or a colon.
+
+Write "@-" if you need to put a dash in a text, no surrounding spaces.
+
+Similar story for "for example" as for "e.g."
+
+Write CPU, not cpu (it's an acronym, not a word! ;-)
+
+Write "... uses ... CPU time", not "... uses ... CPU" (unless you're referring the processor itself.)
+
+If a (comment) is at the end of a sentence, start the comment with lowercase and put the . after the closing ), such as (like this).
+If a comment is separate, start with uppercase and put the . inside the closing ). (Like this.)
+
+Write "something cannot do something", not "something can not something".
+
+Write "otherwise, ..." (with the comma) at the start of a sentence.
+
+Paul, could you please check "honoring"... is this proper British English? Thanks, Arjen.
+
+Write "byte-swapping", not "byte swapping".
+
+Write "Note:", not "NOTE:". And then continue with lowercase, it is not the start of a new sentence.
+
+Write "single-CPU" and "multiple-CPU", not "single CPU" and "multiple CPU".
+
+Paul, I think we should also decide whether to write Version or version, and in what situation. I am not changing much now because there's lots of funny instances and I don't want to risk getting it wrong. Thanks, Arjen.
+
+After a semicolon, don't use uppercase. It is NOT the start of a new sentence!
+
+It's "unstable", not "instable". ;-)
+
+It's "full-text", not "fulltext".
+
+Logical NOT/OR/AND are operators, not functions, so they take operands, not arguments.
+
+It's NetWare, not Netware (as per Novell's trademark guidelines).
+
diff --git a/Docs/Support/colspec-fix.pl b/Docs/Support/colspec-fix.pl
index 64269fdbe3a..6c64edd1441 100755
--- a/Docs/Support/colspec-fix.pl
+++ b/Docs/Support/colspec-fix.pl
@@ -8,10 +8,10 @@
use strict;
-my $table_width = 12.75; # cm
-my $gutter_width = 0.09; # cm
+my $table_width = 12.75; # Specify the max width of the table in cm
+my $gutter_width = 0.55; # Specify the width of the gutters in cm
-my $str = join '', <>;
+my $str = join '', <>; # Push stdin (or file)
$str =~ s{([\t ]*(<colspec colwidth=\".+?\" />\s*)+)}
{&rel2abs($1)}ges;
@@ -28,12 +28,17 @@ sub msg {
}
sub rel2abs {
- my $str = shift;
- my $colnum = 1;
+ my $str = shift;
+ my $colnum = 1;
- my @widths = ();
- my $total = 0;
- my $output = '';
+ my @widths = ();
+ my $total = 0;
+ my $output = '';
+
+ my $gutters;
+ my $content_width;
+ my $total_width;
+ my @num_cache;
$str =~ /^(\s+)/;
my $ws = $1;
@@ -43,12 +48,31 @@ sub rel2abs {
push @widths, $1;
}
- my $unit = ($table_width - ($#widths * $gutter_width)) / ($total);
+ msg("!!! WARNING: Total Percent > 100%: $total%") if $total > 100;
+
+ if (! $total) {
+ die 'Something bad has happened - the script believes that there are no columns';
+ }
+
+ $gutters = $#widths * $gutter_width;
+ $content_width = $table_width - $gutters;
+ # Don't forget that $#... is the last offset not the count
foreach (@widths) {
- $output .= $ws . '<colspec colnum="'. $colnum .'" colwidth="'. sprintf ("%0.2f", $_ * $unit) .'cm" />' . "\n";
+ my $temp = sprintf ("%0.2f", $_/100 * $content_width);
+ $total_width += $temp;
+
+ if ($total_width > $content_width) {
+ $temp -= $total_width - $content_width;
+ msg("!!! WARNING: Column width reduced from " .
+ ($temp + ($total_width - $content_width)) . " to $temp !!!");
+ $total_width -= $total_width - $content_width;
+ }
+
+ $output .= $ws . '<colspec colnum="'. $colnum .'" colwidth="'. $temp .'cm" />' . "\n";
++$colnum;
+ push @num_cache, $temp;
}
-
+
return $output . "\n$ws";
}
diff --git a/Docs/Support/docbook-fixup.pl b/Docs/Support/docbook-fixup.pl
index ba2e9b3779d..f9934822f40 100755
--- a/Docs/Support/docbook-fixup.pl
+++ b/Docs/Support/docbook-fixup.pl
@@ -3,7 +3,7 @@
# Fix the output of `makeinfo --docbook` version 4.0c
# Convert the broken docbook output to well-formed XML that conforms to the O'Reilly idiom
# See code for detailed comments
-# Authors: Arjen Lentz and Zak Greant
+# Authors: Arjen Lentz and Zak Greant (original code by Jeremy Cole)
use strict;
@@ -13,7 +13,7 @@ my $apx = '';
my @nodes = ();
my $nodes = '';
-msg ("\n-- Post-processing `makeinfo --docbook` output --");
+msg ("-- Post-processing `makeinfo --docbook` output --");
msg ("** Written to work with makeinfo version 4.0c **\n");
msg ("Discarding DTD - not required by subsequent scripts");
@@ -31,6 +31,26 @@ msg ("Add missing <bookinfo> and <abstract> opening tags");
# ...as soon as we find the first instance, we can stop looking.
$data =~ s/<book lang="en">/<book lang="en"><bookinfo><abstract>/;
+
+# arjen 2002-05-01
+msg ("Processing docbook-prefix special strings");
+$data =~ s/FIXUPmdashFIXUP/\&mdash\;/g;
+
+$data =~ s/FIXUPdoubledashFIXUP/--/g;
+
+$data =~ s/FIXUPstrongFIXUP/<emphasis\ role\=bold>/g;
+$data =~ s/FIXUPendstrongFIXUP/<\/emphasis>/g;
+
+$data =~ s/FIXUPemphFIXUP/<emphasis>/g;
+$data =~ s/FIXUPendemphFIXUP/<\/emphasis>/g;
+
+$data =~ s/FIXUPfileFIXUP/<filename>/g;
+$data =~ s/FIXUPendfileFIXUP/<\/filename>/g;
+
+$data =~ s/FIXUPsampFIXUP/<literal>/g;
+$data =~ s/FIXUPendsampFIXUP/<\/literal>/g;
+
+
msg ("Removing mailto: from email addresses...");
$data =~ s/mailto://g;
@@ -38,9 +58,19 @@ msg ("Removing INFORMALFIGURE...");
$data =~ s{<informalfigure>.+?</informalfigure>}
{}gs;
-msg ("Convert ampersands to XML escape sequences ");
+msg ("Convert ampersand to XML escape sequence...");
$data =~ s/&(?!\w+;)/&amp;/g;
-
+
+# arjen 2002-05-01
+msg ("Changing (TM) to XML escape sequence...");
+$data =~ s/MySQL \(TM\)/MySQL&trade;/g;
+$data =~ s{<command>TM</command>}
+ {&trade;}g;
+
+# arjen 2002-05-01
+msg ("Changing ' -- ' to XML escape sequence...");
+$data =~ s/ -- /&mdash;/g;
+
msg ("Changing @@ to @...");
$data =~ s/@@/@/g;
@@ -68,6 +98,11 @@ msg ("Adding closing / to XREF and COLSPEC tags...");
$data =~ s{<(xref|colspec) (.+?)>}
{<$1 $2 />}gs;
+# arjen 2002-04-26
+msg ("Removing separate target titles from LINKs and make them XREFs...");
+$data =~ s{<link (linkend=.+?)>.+?</link>}
+ {<xref $1 />}gs;
+
# Probably need to strip these
msg ('Adding "See " to XREFs that used to be @xref...');
$data =~ s{([.'!)])\s*<xref }
@@ -137,7 +172,7 @@ exit;
#
sub msg {
- print STDERR shift, "\n";
+ print STDERR "docbook-fixup:", shift, "\n";
}
sub strip_tag($$) {
diff --git a/Docs/Support/docbook-prefix.pl b/Docs/Support/docbook-prefix.pl
new file mode 100755
index 00000000000..e76d84dbfe0
--- /dev/null
+++ b/Docs/Support/docbook-prefix.pl
@@ -0,0 +1,50 @@
+#!/usr/bin/perl -w
+
+# Preprocess the input of `makeinfo --docbook` version 4.0c
+# Authors: Arjen Lentz and Zak Greant (started by arjen 2002-05-01)
+
+use strict;
+
+my $data = '';
+
+msg ("-- Pre-processing `makeinfo --docbook` input --");
+msg ("** Written to work with makeinfo version 4.0c **\n");
+
+# <> is a magic filehandle - either reading lines from stdin or from file(s) specified on the command line
+msg ("Get the data");
+$data = join "", <>;
+
+msg ("Replacing '\@-' with FIXUPmdashFIXUP");
+$data =~ s/\@-/FIXUPmdashFIXUP/g;
+
+msg ("Replacing '--' with FIXUPdoubledashFIXUP");
+$data =~ s/--/FIXUPdoubledashFIXUP/g;
+
+msg ("Turning \@strong{} into LITERAL blocks");
+$data =~ s/\@strong\{(.*?)\}/FIXUPstrongFIXUP$1FIXUPendstrongFIXUP/gs;
+
+msg ("Turning \@emph{} into LITERAL blocks");
+$data =~ s/\@emph\{(.*?)\}/FIXUPemphFIXUP$1FIXUPendemphFIXUP/gs;
+
+msg ("Turning \@file{} into LITERAL blocks");
+$data =~ s/\@file\{(.*?)\}/FIXUPfileFIXUP$1FIXUPendfileFIXUP/gs;
+
+msg ("Turning \@samp{} into LITERAL blocks");
+$data =~ s/\@samp\{\@\{\}/FIXUPsampFIXUP\@\{FIXUPendsampFIXUP/g;
+$data =~ s/\@samp\{\@\}\}/FIXUPsampFIXUP\@\}FIXUPendsampFIXUP/g;
+$data =~ s/\@samp\{\@\{n\@\}\}/FIXUPsampFIXUP\@\{n\@\}FIXUPendsampFIXUP/g;
+$data =~ s/\@samp\{(.*?)\}/FIXUPsampFIXUP$1FIXUPendsampFIXUP/gs;
+
+
+msg ("Write the data");
+print STDOUT $data;
+exit;
+
+#
+# Definitions for helper sub-routines
+#
+
+sub msg {
+ print STDERR "docbook-prefix: ", shift, "\n";
+}
+
diff --git a/Docs/Support/make-docbook b/Docs/Support/make-docbook
index bdca812d7ab..93dbc56c0f8 100755
--- a/Docs/Support/make-docbook
+++ b/Docs/Support/make-docbook
@@ -6,14 +6,19 @@
#create include.texi with version/port #
echo "@c This file is autogenerated by the Makefile" > include.texi
echo -n "@set mysql_version " >> include.texi
+# grep "AM_INIT_AUTOMAKE(mysql, " ../configure.in | \
+# sed -e 's;AM_INIT_AUTOMAKE(mysql, ;;' -e 's;);;' >> include.texi
+# 2002-04-26 arjen - the below just picks #.# instead of #.#.#-alpha
+# (code by mwagner - tnx)
grep "AM_INIT_AUTOMAKE(mysql, " ../configure.in | \
- sed -e 's;AM_INIT_AUTOMAKE(mysql, ;;' -e 's;);;' >> include.texi
+ perl -p -e 's/AM_INIT_AUTOMAKE\(mysql,\s(\d+\.\d+)\..+/$1/' >> include.texi
echo -n "@set default_port " >> include.texi
grep "MYSQL_TCP_PORT_DEFAULT=" ../configure.in | \
sed -e 's;MYSQL_TCP_PORT_DEFAULT=;;' >> include.texi
# produce DocBook XML
- makeinfo --force --no-ifinfo --docbook -o - manual.texi |\
+ Support/docbook-prefix.pl < manual.texi |\
+ makeinfo --force --no-ifinfo --docbook -o - |\
Support/docbook-fixup.pl > mysql.xml
# See if the XML output is well-formed
diff --git a/Docs/Support/trivial-makeinfo-4.0c.patch b/Docs/Support/trivial-makeinfo-4.0c.patch
new file mode 100644
index 00000000000..b2446c0e8bb
--- /dev/null
+++ b/Docs/Support/trivial-makeinfo-4.0c.patch
@@ -0,0 +1,11 @@
+--- alt-multi.c Sun Apr 14 10:03:19 2002
++++ multi.c Tue May 22 20:52:33 2001
+@@ -287,7 +287,7 @@
+ && *params != '\n' && *params != '@')
+ params++;
+ setup_output_environment (i,
+- (int) ((columnfrac * 100.00) + 0.49));
++ (int) (columnfrac * (fill_column - current_indent) + .5));
+ }
+ }
+
diff --git a/Docs/Support/update-reserved-words.pl b/Docs/Support/update-reserved-words.pl
index e7f8329009e..6164698943f 100755
--- a/Docs/Support/update-reserved-words.pl
+++ b/Docs/Support/update-reserved-words.pl
@@ -4,6 +4,8 @@
# Implemented in Perl by jeremy@mysql.com
# 2001-11-20 Fixups by arjen@mysql.com, 2 keywords and 15 synonyms were missing
# 2001-12-07 Fixup by arjen@mysql.com, add column headings for multitable.
+# 2002-05-01 Fixup by arjen@mysql.com, use 3 columns instead of 4.
+# 2002-05-03 Fixup by arjen@mysql.com, fill last row to full # of columns.
print STDERR "Scanning lex.h for symbols..\n";
open LEX, "<../sql/lex.h";
@@ -27,11 +29,6 @@ while(($line = <YACC>) =~ /[\s|]+([A-Z_]+)/) {
close YACC;
-$list = sprintf("\@c Reserved word list updated %s by %s.\n".
- "\@c To regenerate, use Support/update-reserved-words.pl.\n\n",
- &pretty_date, $ENV{USER});
-
-
print STDERR "Copying reserved words to an array...\n";
foreach(keys %words) { push @words, $words{$_}; };
@@ -40,12 +37,16 @@ print STDERR "Sorting array...\n";
printf STDERR "There are %i reserved words.\n", scalar @words;
-@pre = ("\@item", "\@tab", " \@tab", "\@tab");
-@post = ("", "\n", "", "\n");
+@pre = ("\@item", " \@tab", " \@tab");
+$list = "";
for($i=0; $word = shift(@words); $i++) {
- $list .= sprintf "%s %-30s %s", $pre[$i%4], "\@code\{$word\}", $post[$i%4];
-}; $list .= "\n";
+ $list .= sprintf "%s %s\n", $pre[$i%3], "\@code\{$word\}";
+}
+# Fill last row to full # of columns.
+for( ; $i%3; $i++) {
+ $list .= sprintf "%s\n", $pre[$i%3];
+}
open OLD, "<manual.texi";
open NEW, ">manual-tmp.texi";
@@ -53,9 +54,14 @@ open NEW, ">manual-tmp.texi";
print STDERR "Copying beginning of manual.texi...\n";
while(($line = <OLD>) !~ /START_OF_RESERVED_WORDS/) { print NEW $line; };
print NEW "\@c START_OF_RESERVED_WORDS\n\n";
+printf NEW "\@c Reserved word list updated %s by %s.\n".
+ "\@c To regenerate, use Support/update-reserved-words.pl.\n\n",
+ &pretty_date, $ENV{USER};
+
print STDERR "Inserting list of reserved words...\n";
-print NEW "\@multitable \@columnfractions .25 .25 .25 .25\n";
-print NEW "\@item \@strong{Word} \@tab \@strong{Word} \@tab \@strong{Word} \@tab \@strong{Word}\n";
+# Ensure the fractions add up to 100% otherwise it looks funny in print:
+print NEW "\@multitable \@columnfractions .33 .33 .34\n";
+print NEW "\@item \@strong{Word}\n \@tab \@strong{Word}\n \@tab \@strong{Word}\n";
print NEW $list;
print NEW "\@end multitable\n";
print STDERR "Skipping over old list...\n";
diff --git a/Docs/glibc-2.2.5.patch b/Docs/glibc-2.2.5.patch
index c6bc2bf39a8..ef5d40b6899 100644
--- a/Docs/glibc-2.2.5.patch
+++ b/Docs/glibc-2.2.5.patch
@@ -1,73 +1,137 @@
-diff -Nur --exclude=SCCS --exclude=BitKeeper --exclude=ChangeSet ../glibc-2.2.5/linuxthreads/internals.h ./linuxthreads/internals.h
---- ../glibc-2.2.5/linuxthreads/internals.h Thu Nov 29 00:44:16 2001
-+++ ./linuxthreads/internals.h Fri Feb 22 21:18:09 2002
-@@ -343,7 +343,7 @@
- THREAD_SELF implementation is used, this must be a power of two and
- a multiple of PAGE_SIZE. */
- #ifndef STACK_SIZE
--#define STACK_SIZE (2 * 1024 * 1024)
-+#define STACK_SIZE (128 * 1024)
- #endif
-
- /* The initial size of the thread stack. Must be a multiple of PAGE_SIZE. */
-diff -Nur --exclude=SCCS --exclude=BitKeeper --exclude=ChangeSet ../glibc-2.2.5/linuxthreads/sysdeps/unix/sysv/linux/bits/local_lim.h ./linuxthreads/sysdeps/unix/sysv/linux/bits/local_lim.h
---- ../glibc-2.2.5/linuxthreads/sysdeps/unix/sysv/linux/bits/local_lim.h Thu Jun 8 13:49:49 2000
-+++ ./linuxthreads/sysdeps/unix/sysv/linux/bits/local_lim.h Fri Feb 22 21:18:09 2002
-@@ -64,7 +64,7 @@
- /* The number of threads per process. */
- #define _POSIX_THREAD_THREADS_MAX 64
- /* This is the value this implementation supports. */
--#define PTHREAD_THREADS_MAX 1024
-+#define PTHREAD_THREADS_MAX 4096
-
- /* Maximum amount by which a process can descrease its asynchronous I/O
- priority level. */
-diff -Nur --exclude=SCCS --exclude=BitKeeper --exclude=ChangeSet ../glibc-2.2.5/nss/nsswitch.c ./nss/nsswitch.c
---- ../glibc-2.2.5/nss/nsswitch.c Tue Jul 17 02:21:36 2001
-+++ ./nss/nsswitch.c Fri Feb 22 21:18:09 2002
-@@ -515,8 +515,16 @@
- + (line - name + 1));
- if (new_service == NULL)
- return result;
--
-+#ifdef DO_STATIC_NSS
-+ if (strncmp(name,"files",5) == 0 ||
-+ strncmp(name,"dns",3) == 0)
-+#endif
- *((char *) __mempcpy (new_service->name, name, line - name)) = '\0';
-+#ifdef DO_STATIC_NSS
-+ else
-+ *((char *) __mempcpy (new_service->name, "files", 5)) = '\0';
-+#endif
-+
-
- /* Set default actions. */
- new_service->actions[2 + NSS_STATUS_TRYAGAIN] = NSS_ACTION_CONTINUE;
-diff -Nur --exclude=SCCS --exclude=BitKeeper --exclude=ChangeSet ../glibc-2.2.5/time/Makefile ./time/Makefile
---- ../glibc-2.2.5/time/Makefile Fri Feb 22 21:27:19 2002
-+++ ./time/Makefile Fri Feb 22 21:26:47 2002
-@@ -37,8 +37,8 @@
-
- include ../Rules
-
--tz-cflags = -DTZDIR='"$(zonedir)"' \
-- -DTZDEFAULT='"$(localtime-file)"' \
-+tz-cflags = -DTZDIR='"/usr/share/zoneinfo/"' \
-+ -DTZDEFAULT='"/etc/localtime"' \
- -DTZDEFRULES='"$(posixrules-file)"'
-
- CFLAGS-tzfile.c = $(tz-cflags)
-diff -Nur --exclude=SCCS --exclude=BitKeeper --exclude=ChangeSet ../glibc-2.2.5/timezone/Makefile ./timezone/Makefile
---- ../glibc-2.2.5/timezone/Makefile Wed Aug 29 16:45:25 2001
-+++ ./timezone/Makefile Fri Feb 22 21:18:09 2002
-@@ -159,8 +159,8 @@
-
- $(objpfx)zic: $(objpfx)scheck.o $(objpfx)ialloc.o
-
--tz-cflags = -DTZDIR='"$(zonedir)"' \
-- -DTZDEFAULT='"$(localtime-file)"' \
-+tz-cflags = -DTZDIR='"/usr/share/zoneinfo/"' \
-+ -DTZDEFAULT='"/etc/localtime"' \
- -DTZDEFRULES='"$(posixrules-file)"' \
- -DTM_GMTOFF=tm_gmtoff -DTM_ZONE=tm_zone
-
+diff -r -c --exclude='*.info*' glibc-2.2.5.org/linuxthreads/internals.h glibc-2.2.5/linuxthreads/internals.h
+*** glibc-2.2.5.org/linuxthreads/internals.h Thu Nov 29 08:44:16 2001
+--- glibc-2.2.5/linuxthreads/internals.h Tue May 21 10:51:53 2002
+***************
+*** 343,349 ****
+ THREAD_SELF implementation is used, this must be a power of two and
+ a multiple of PAGE_SIZE. */
+ #ifndef STACK_SIZE
+! #define STACK_SIZE (2 * 1024 * 1024)
+ #endif
+
+ /* The initial size of the thread stack. Must be a multiple of PAGE_SIZE. */
+--- 343,349 ----
+ THREAD_SELF implementation is used, this must be a power of two and
+ a multiple of PAGE_SIZE. */
+ #ifndef STACK_SIZE
+! #define STACK_SIZE (128 * 1024)
+ #endif
+
+ /* The initial size of the thread stack. Must be a multiple of PAGE_SIZE. */
+diff -r -c --exclude='*.info*' glibc-2.2.5.org/linuxthreads/sysdeps/unix/sysv/linux/bits/local_lim.h glibc-2.2.5/linuxthreads/sysdeps/unix/sysv/linux/bits/local_lim.h
+*** glibc-2.2.5.org/linuxthreads/sysdeps/unix/sysv/linux/bits/local_lim.h Thu Jun 8 21:49:49 2000
+--- glibc-2.2.5/linuxthreads/sysdeps/unix/sysv/linux/bits/local_lim.h Tue May 21 10:52:58 2002
+***************
+*** 64,70 ****
+ /* The number of threads per process. */
+ #define _POSIX_THREAD_THREADS_MAX 64
+ /* This is the value this implementation supports. */
+! #define PTHREAD_THREADS_MAX 1024
+
+ /* Maximum amount by which a process can descrease its asynchronous I/O
+ priority level. */
+--- 64,70 ----
+ /* The number of threads per process. */
+ #define _POSIX_THREAD_THREADS_MAX 64
+ /* This is the value this implementation supports. */
+! #define PTHREAD_THREADS_MAX 4096
+
+ /* Maximum amount by which a process can descrease its asynchronous I/O
+ priority level. */
+diff -r -c --exclude='*.info*' glibc-2.2.5.org/nss/nsswitch.c glibc-2.2.5/nss/nsswitch.c
+*** glibc-2.2.5.org/nss/nsswitch.c Tue Jul 17 10:21:36 2001
+--- glibc-2.2.5/nss/nsswitch.c Tue May 21 10:59:55 2002
+***************
+*** 496,501 ****
+--- 496,502 ----
+ {
+ service_user *new_service;
+ const char *name;
++ int name_alloc_len;
+
+ while (isspace (line[0]))
+ ++line;
+***************
+*** 510,522 ****
+ if (name == line)
+ return result;
+
+
+ new_service = (service_user *) malloc (sizeof (service_user)
+! + (line - name + 1));
+ if (new_service == NULL)
+ return result;
+
+! *((char *) __mempcpy (new_service->name, name, line - name)) = '\0';
+
+ /* Set default actions. */
+ new_service->actions[2 + NSS_STATUS_TRYAGAIN] = NSS_ACTION_CONTINUE;
+--- 511,534 ----
+ if (name == line)
+ return result;
+
++ name_alloc_len = line - name + 1;
++
++ #ifdef DO_STATIC_NSS
++ if (!((name_alloc_len == 6 && strncmp(name,"files",5) == 0) ||
++ (name_alloc_len == 4 && strncmp(name,"dns",3) == 0)))
++ {
++ name = (char*) "files";
++ name_alloc_len = 6;
++ }
++ #endif
+
+ new_service = (service_user *) malloc (sizeof (service_user)
+! + name_alloc_len);
+ if (new_service == NULL)
+ return result;
+
+! *((char *) __mempcpy (new_service->name, name, name_alloc_len-1)) = '\0';
+!
+
+ /* Set default actions. */
+ new_service->actions[2 + NSS_STATUS_TRYAGAIN] = NSS_ACTION_CONTINUE;
+diff -r -c --exclude='*.info*' glibc-2.2.5.org/time/Makefile glibc-2.2.5/time/Makefile
+*** glibc-2.2.5.org/time/Makefile Fri Aug 10 01:59:41 2001
+--- glibc-2.2.5/time/Makefile Tue May 21 11:01:11 2002
+***************
+*** 37,44 ****
+
+ include ../Rules
+
+! tz-cflags = -DTZDIR='"$(zonedir)"' \
+! -DTZDEFAULT='"$(localtime-file)"' \
+ -DTZDEFRULES='"$(posixrules-file)"'
+
+ CFLAGS-tzfile.c = $(tz-cflags)
+--- 37,44 ----
+
+ include ../Rules
+
+! tz-cflags = -DTZDIR='"/usr/share/zoneinfo/"' \
+! -DTZDEFAULT='"/etc/localtime"' \
+ -DTZDEFRULES='"$(posixrules-file)"'
+
+ CFLAGS-tzfile.c = $(tz-cflags)
+diff -r -c --exclude='*.info*' glibc-2.2.5.org/timezone/Makefile glibc-2.2.5/timezone/Makefile
+*** glibc-2.2.5.org/timezone/Makefile Thu Aug 30 00:45:25 2001
+--- glibc-2.2.5/timezone/Makefile Tue May 21 11:01:57 2002
+***************
+*** 159,166 ****
+
+ $(objpfx)zic: $(objpfx)scheck.o $(objpfx)ialloc.o
+
+! tz-cflags = -DTZDIR='"$(zonedir)"' \
+! -DTZDEFAULT='"$(localtime-file)"' \
+ -DTZDEFRULES='"$(posixrules-file)"' \
+ -DTM_GMTOFF=tm_gmtoff -DTM_ZONE=tm_zone
+
+--- 159,166 ----
+
+ $(objpfx)zic: $(objpfx)scheck.o $(objpfx)ialloc.o
+
+! tz-cflags = -DTZDIR='"/usr/share/zoneinfo/"' \
+! -DTZDEFAULT='"/etc/localtime"' \
+ -DTZDEFRULES='"$(posixrules-file)"' \
+ -DTM_GMTOFF=tm_gmtoff -DTM_ZONE=tm_zone
+
diff --git a/Docs/internals.texi b/Docs/internals.texi
index 8f358982ded..871e51c50bd 100644
--- a/Docs/internals.texi
+++ b/Docs/internals.texi
@@ -57,6 +57,7 @@ This is a manual about @strong{MySQL} internals.
* mysys functions:: Functions In The @code{mysys} Library
* DBUG:: DBUG Tags To Use
* protocol:: MySQL Client/Server Protocol
+* Fulltext Search:: Fulltext Search in MySQL
@end menu
@@ -535,7 +536,7 @@ Print query.
@end table
-@node protocol, , DBUG, Top
+@node protocol, Fulltext Search, DBUG, Top
@chapter MySQL Client/Server Protocol
@menu
@@ -785,6 +786,48 @@ Date 03 0A 00 00 |01 0A |03 00 00 00
@c @printindex fn
+@node Fulltext Search, , protocol, Top
+@chapter Fulltext Search in MySQL
+
+Hopefully, sometime there will be complete description of
+fulltext search algorithms.
+Now it's just unsorted notes.
+
+@menu
+* Weighting in boolean mode::
+@end menu
+
+@node Weighting in boolean mode, , , Fulltext Search
+@section Weighting in boolean mode
+
+The basic idea is as follows: in expression
+@code{A or B or (C and D and E)}, either @code{A} or @code{B} alone
+is enough to match the whole expression. While @code{C},
+@code{D}, and @code{E} should @strong{all} match. So it's
+reasonable to assign weight 1 to @code{A}, @code{B}, and
+@code{(C and D and E)}. And @code{C}, @code{D}, and @code{E}
+should get a weight of 1/3.
+
+Things become more complicated when considering boolean
+operators, as used in MySQL FTB. Obvioulsy, @code{+A +B}
+should be treated as @code{A and B}, and @code{A B} -
+as @code{A or B}. The problem is, that @code{+A B} can @strong{not}
+be rewritten in and/or terms (that's the reason why this - extended -
+set of operators was chosen). Still, aproximations can be used.
+@code{+A B C} can be approximated as @code{A or (A and (B or C))}
+or as @code{A or (A and B) or (A and C) or (A and B and C)}.
+Applying the above logic (and omitting mathematical
+transformations and normalization) one gets that for
+@code{+A_1 +A_2 ... +A_N B_1 B_2 ... B_M} the weights
+should be: @code{A_i = 1/N}, @code{B_j=1} if @code{N==0}, and,
+otherwise, in the first rewritting approach @code{B_j = 1/3},
+and in the second one - @code{B_j = (1+(M-1)*2^M)/(M*(2^(M+1)-1))}.
+
+The second expression gives somewhat steeper increase in total
+weight as number of matched B's increases, because it assigns
+higher weights to individual B's. Also the first expression in
+much simplier. So it is the first one, that is implemented in MySQL.
+
@summarycontents
@contents
diff --git a/Docs/manual.de.texi b/Docs/manual.de.texi
index 2d89b89b50b..94c822b94da 100644
--- a/Docs/manual.de.texi
+++ b/Docs/manual.de.texi
@@ -11573,10 +11573,10 @@ Weile nichts von ihnen gehört.
@node Novell Netware, , BeOS, Operating System Specific Notes
@c German node Novell Netware
-@subsection Anmerkungen zu Novell Netware
+@subsection Anmerkungen zu Novell NetWare
-Wir sind sehr daran interessiert, MySQL auf Netware ans Laufen zu bringen,
-aber leider kennen wir niemanden, der sich mit Netware auskennt oder Zeit hat,
+Wir sind sehr daran interessiert, MySQL auf NetWare ans Laufen zu bringen,
+aber leider kennen wir niemanden, der sich mit NetWare auskennt oder Zeit hat,
eine Portierung durchzuführen.
Wir sind daran interessiert, jemanden für eine Portierung zu finden, und
@@ -16998,6 +16998,7 @@ neu starten, um @code{mysqldump} benutzen zu können.
* Privilege changes::
* Default privileges::
* Adding users::
+* User resources::
* Passwords::
* Password security::
@end menu
@@ -17653,7 +17654,7 @@ müssen Sie sie aus Ihrer MySQL-Distribution zurück kopieren, bevor Sie
@code{mysql_install_db} laufen lassen.
-@node Adding users, Passwords, Default privileges, User Account Management
+@node Adding users, User resources, Default privileges, User Account Management
@c German node Benutzer hinzufügen
@subsection Neue MySQL-Benutzer hinzufügen
@@ -17862,8 +17863,71 @@ einzufügen, zu ändern und zu aktualisieren. Sie finden diese Werkzeuge unter
@uref{http://www.mysql.com/downloads/contrib/,Contrib-Verzeichnis der
MySQL-Website}.
+@node User resources, Passwords, Adding users, User Account Management
+@c New section added by arjen 2002-05-17 to keep en/de in sync
+@subsection Limiting user resources
-@node Passwords, Password security, Adding users, User Account Management
+@c FIX Original section text - to be translated.
+@c FIX Also check manual.texi for other mentions of MAX_..._PER_HOUR
+
+Starting from MySQL 4.0.2 one can limit certain resources per user.
+
+So far, the only available method of limiting user usage of MySQL
+server resources has been setting the @code{max_user_connections}
+startup variable to a non-zero value. But this method is strictly
+global and does not allow for management of individual users, which
+could be of paricular interest to Internet Service Providers.
+
+Therefore, management of three resources is introduced on the
+individual user level:
+
+@itemize @bullet
+@item Number of all queries per hour:
+All commands that could be run by a user.
+@item Number of all updates per hour:
+Any command that changes any table or database.
+@item Number of connections made per hour:
+New connections opened per hour.
+@end itemize
+
+A user in the aforementioned context is a single entry in the
+@code{user} table, which is uniquely identified by its @code{user}
+and @code{host} columns.
+
+All users are by default not limited in using the above resources,
+unless the limits are granted to them. These limits can be granted
+@strong{only} via global @code{GRANT (*.*)}, using this syntax:
+
+@example
+GRANT ... WITH MAX_QUERIES_PER_HOUR = N1
+ MAX_UPDATES_PER_HOUR = N2
+ MAX_CONNECTIONS_PER_HOUR = N3;
+@end example
+
+One can specify any combination of the above resources.
+N1, N2 and N3 are integers and stands for count / hour.
+
+If user reaches any of the above limits withing one hour, his
+connection will be terminated or refused and the appropriate error
+message shall be issued.
+
+Current usage values for a particular user can be flushed (set to zero)
+by issuing a @code{GRANT} statement with any of the above clauses,
+including a @code{GRANT} statement with the current values.
+
+Also, current values for all users will be flushed if privileges are
+reloaded (in the server or using @code{mysqladmin reload})
+or if the @code{FLUSH USER_RESOURCES} command is issued.
+
+The feature is enabled as soon as a single user is granted with any
+of the limiting @code{GRANT} clauses.
+
+As a prerequisite for enabling this feature, the @code{user} table in
+the @code{mysql} database must contain the additional columns, as
+defined in the table creation scripts @code{mysql_install_db} and
+@code{mysql_install_db.sh} in @file{scripts} subdirectory.
+
+@node Passwords, Password security, User resources, User Account Management
@c German node Passwörter
@subsection Passwörter einrichten
@@ -39897,12 +39961,12 @@ gespeichert werden kann.
@menu
-* InnoDB Disk i/o::
+* InnoDB Disk I/O::
* InnoDB File space::
* InnoDB File Defragmenting::
@end menu
-@node InnoDB Disk i/o, InnoDB File space, File space management, File space management
+@node InnoDB Disk I/O, InnoDB File space, File space management, File space management
@c German node Festplatten-Ein- und -Ausgaben bei InnoDB
@subsubsection Festplatten-Ein- und -Ausgaben
@@ -39969,7 +40033,7 @@ Eingelesenwerdens in den Puffer-Pool zu sein scheint. Dann schickt InnoDB
die verbleibenden Lesevorgänge an das Ein-/Ausgabesystem.
-@node InnoDB File space, InnoDB File Defragmenting, InnoDB Disk i/o, File space management
+@node InnoDB File space, InnoDB File Defragmenting, InnoDB Disk I/O, File space management
@c German node Speicherplatz in InnoDB
@subsubsection Speicherplatzverwaltung
@@ -44743,6 +44807,7 @@ wollen. @xref{Threaded clients}.
* my_init::
* mysql_thread_init::
* mysql_thread_end::
+* mysql_thread_safe::
@end menu
@node my_init, mysql_thread_init, C Thread functions, C Thread functions
@@ -44783,7 +44848,7 @@ Diese Funktion wird automatisch von @code{my_init()} und
Keine.
-@node mysql_thread_end, , mysql_thread_init, C Thread functions
+@node mysql_thread_end, mysql_thread_safe, mysql_thread_init, C Thread functions
@c German node mysql_thread_end()
@subsubsection @code{mysql_thread_end()}
@@ -44803,6 +44868,22 @@ Speicherlecks zu vermeiden.
Keine.
+@node mysql_thread_safe, , mysql_thread_end, C Thread functions
+@c Arjen note: new @node 2002-04-19, please translate text!
+@subsubsection @code{mysql_thread_safe()}
+
+@findex @code{mysql_thread_safe()}
+
+@code{unsigned int mysql_thread_safe(void)}
+
+@subsubheading Description
+
+This function indicates whether the client is compiled as thread safe.
+
+@subsubheading Return Values
+
+1 is the client is thread safe, 0 otherwise.
+
@node C Embedded Server func, C API problems, C Thread functions, C
@c German node C-Embedded-Server-Funktionen
@subsection C-Embedded-Server-Funktionsbeschreibungen
diff --git a/Docs/manual.texi b/Docs/manual.texi
index a258582ea3d..c22f8f2152b 100644
--- a/Docs/manual.texi
+++ b/Docs/manual.texi
@@ -148,14 +148,14 @@ for that version.
The @code{MySQL (TM)} software delivers a very fast, multi-threaded,
multi-user, and robust @code{SQL} (@code{Structured Query Language})
database server.
-@code{MySQL Server} is intended for mission-critical, heavy load
+@code{MySQL Server} is intended for mission-critical, heavy-load
production systems as well as for embedding into mass-deployed software.
@code{MySQL} is a trademark of @code{MySQL AB}.
-The @code{MySQL} software has @code{Dual Licensing}, you can use
-@code{MySQL Server} free of charge under the
-@code{GNU GENERAL PUBLIC LICENSE} (@uref{http://www.gnu.org/licenses/}).
-You can also purchase commercial @code{MySQL Server} licenses from
+The @code{MySQL} software has @code{Dual Licensing}, which means you can use
+the @code{MySQL} software free of charge under the
+@code{GNU General Public License} (@uref{http://www.gnu.org/licenses/}).
+You can also purchase commercial @code{MySQL} licenses from
@code{MySQL AB} if you do not wish to be bound by the terms of the
@code{GPL}.
@xref{Licensing and Support}.
@@ -163,7 +163,7 @@ You can also purchase commercial @code{MySQL Server} licenses from
The @code{MySQL} web site (@uref{http://www.mysql.com/}) provides the
latest information about the @code{MySQL} software.
-The following list describes some useful sections of the manual:
+The following list describes some sections of particular interest in this manual:
@itemize @bullet
@item
@@ -210,7 +210,7 @@ For future plans, see @ref{TODO}.
For a list of all the contributors to this project, see @ref{Credits}.
@end itemize
-@strong{IMPORTANT:}
+@strong{Important}:
Reports of errors (often called bugs), as well as questions and comments,
should be sent to the mailing list at @email{mysql@@lists.mysql.com}.
@@ -231,14 +231,14 @@ security bug in @code{MySQL Server}, you should send an e-mail to
@menu
* Manual-info:: About This Manual
-* What-is:: What Is MySQL
-* What is MySQL AB:: What Is MySQL AB
+* What-is:: What Is MySQL?
+* What is MySQL AB:: What Is MySQL AB?
* Licensing and Support:: MySQL Support and Licensing
* MySQL 4.0 In A Nutshell:: MySQL 4.0 In A Nutshell
* MySQL Information Sources:: MySQL Information Sources
* Compatibility:: How Standards-compatible Is MySQL?
* TODO:: MySQL and the future (The TODO)
-* Comparisons:: How MySQL Compares to Other Open Source Databases
+* Comparisons:: How MySQL Compares to Other @code{Open Source} Databases
@end menu
@@ -253,18 +253,18 @@ Version @value{mysql_version}. Being a reference manual, it does not
provide general instruction on @code{SQL} or relational database
concepts.
-As the @code{MySQL Database Software} is under continuous development,
+As the @code{MySQL Database Software} is under constant development,
the manual is also updated frequently.
The most recent version of this manual is available at
@uref{http://www.mysql.com/documentation/} in many different formats,
-currently there are Texinfo, plain text, Info, HTML, PostScript, PDF
+including Texinfo, plain text, Info, HTML, PostScript, PDF,
and Windows HLP versions.
The primary document is the Texinfo file.
The HTML version is produced automatically using a modified version of
@code{texi2html}.
The plain text and Info versions are produced with @code{makeinfo}.
-The Postscript version is produced using @code{texi2dvi} and @code{dvips}.
+The PostScript version is produced using @code{texi2dvi} and @code{dvips}.
The PDF version is produced with @code{pdftex}.
If you have a hard time finding information in the manual, you can try
@@ -290,6 +290,8 @@ The copyright (2002) to this manual is owned by the Swedish company
@node Manual conventions, , Manual-info, Manual-info
@subsection Conventions Used in This Manual
+@c We use British English. But let's not publicise that here yet ;-)
+
This manual uses certain typographical conventions:
@cindex manual, typographical conventions
@@ -299,7 +301,7 @@ This manual uses certain typographical conventions:
@table @asis
@item @code{constant}
Constant-width font is used for command names and options; SQL statements;
-database, table and column names; C and Perl code; and environment variables.
+database, table, and column names; C and Perl code; and environment variables.
Example: ``To see how @code{mysqladmin} works, invoke it with the
@code{--help} option.''
@@ -310,7 +312,7 @@ pathnames. Example: ``The distribution is installed under the
@item @samp{c}
Constant-width font with surrounding quotes is also used to indicate
-character sequences. Example: ``To specify a wild card, use the @samp{%}
+character sequences. Example: ``To specify a wildcard, use the @samp{%}
character.''
@item @emph{italic}
@@ -368,28 +370,12 @@ your own database, table, and column names, perhaps like this:
mysql> SELECT author_name FROM biblio_db.author_list;
@end example
-SQL statements may be written in uppercase or lowercase. When this manual
-shows a SQL statement, uppercase is used for particular keywords if those
-keywords are under discussion (to emphasize them) and lowercase is used for
-the rest of the statement. For example, you might see the following in a
-discussion of the @code{SELECT} statement:
-
-@example
-mysql> SELECT count(*) FROM tbl_name;
-@end example
-
-On the other hand, in a discussion of the @code{COUNT()} function, the
-same statement would be written like this:
-
-@example
-mysql> select COUNT(*) from tbl_name;
-@end example
-
-If no particular emphasis is intended, all keywords are written uniformly
-in uppercase.
+SQL keywords are not case-sensitive and may be written in uppercase or
+lowercase. This manual uses uppercase.
In syntax descriptions, square brackets (@samp{[} and @samp{]}) are used
-to indicate optional words or clauses:
+to indicate optional words or clauses. For example, in the following
+statement, @code{IF EXISTS} is optional:
@example
DROP TABLE [IF EXISTS] tbl_name
@@ -413,7 +399,7 @@ alternatives are listed within braces (@samp{@{} and @samp{@}}):
@node What-is, What is MySQL AB, Manual-info, Introduction
-@section What Is MySQL
+@section What Is MySQL?
@cindex MySQL, defined
@cindex MySQL, introduction
@@ -448,26 +434,26 @@ A relational database stores data in separate tables rather than putting
all the data in one big storeroom. This adds speed and flexibility.
The tables are linked by defined relations making it possible to combine
data from several tables on request. The @code{SQL} part of
-``@code{MySQL}'' stands for ``@code{Structured Query Language}''
-- the most common standardised language used to access databases.
+``@code{MySQL}'' stands for ``@code{Structured Query Language}''@-the
+most common standardised language used to access databases.
@cindex relational databases, defined
@cindex SQL, defined
-@item MySQL Software is Open Source.
+@item MySQL software is @code{Open Source}.
@code{Open Source} means that it is possible for anyone to use and modify.
Anybody can download the @code{MySQL} software from the Internet and use it
without paying anything. Anybody so inclined can study the source code
and change it to fit their needs. The @code{MySQL} software uses the
-@code{GPL} (@code{GNU General Public License})
+@code{GPL} (@code{GNU General Public License}),
@uref{http://www.gnu.org/licenses/}, to define what you
may and may not do with the software in different situations.
If you feel uncomfortable with the @code{GPL} or need to embed
@code{MySQL} code into a commercial application you can buy a
commercially licensed version from us.
-@xref{MySQL server licenses}.
+@xref{MySQL licenses}.
-@cindex Open Source, defined
+@cindex @code{Open Source}, defined
@cindex General Public License
@item Why use the MySQL Database Server?
@@ -483,7 +469,7 @@ of @code{MySQL Server} to some other database managers on our benchmark page.
much faster than existing solutions and has been successfully used in
highly demanding production environments for several years. Though
under constant development, @code{MySQL Server} today offers a rich and
-useful set of functions. The connectivity, speed, and security make
+useful set of functions. Its connectivity, speed, and security make
@code{MySQL Server} highly suited for accessing databases on the Internet.
@item The technical features of MySQL Server
@@ -495,10 +481,10 @@ several different client programs and libraries, administrative tools,
and a wide range of programming interfaces (@code{API}s).
We also provide @code{MySQL Server} as a multi-threaded library which you
-can link into your application to get a smaller, faster, easier to manage
+can link into your application to get a smaller, faster, easier-to-manage
product.
-@item There is a lot of contributed MySQL software available.
+@item There is a large amount of contributed MySQL software available.
It is very likely that you will find that your favorite application or
language already supports the @code{MySQL Database Server}.
@@ -566,10 +552,10 @@ a commercial memory leakage detector.
@item
Works on many different platforms. @xref{Which OS}.
@item
-Uses GNU Automake (1.4), Autoconf (Ver 2.52 or newer), and Libtool for
+Uses GNU Automake (1.4), Autoconf (Version 2.52 or newer), and Libtool for
portability.
@item
-APIs for C, C++, Eiffel, Java, Perl, PHP, Python and Tcl. @xref{Clients}.
+APIs for C, C++, Eiffel, Java, Perl, PHP, Python, and Tcl. @xref{Clients}.
@item
Fully multi-threaded using kernel threads. This means it can easily
use multiple CPUs if available.
@@ -618,9 +604,12 @@ mysql> SELECT CONCAT(first_name, " ", last_name)
@end example
@item
-Full support for SQL @code{GROUP BY} and @code{ORDER BY} clauses. Support
-for group functions (@code{COUNT()}, @code{COUNT(DISTINCT ...)},
-@code{AVG()}, @code{STD()}, @code{SUM()}, @code{MAX()} and @code{MIN()}).
+Full support for SQL @code{GROUP BY} and
+@code{ORDER BY} clauses. Support
+for group functions (@code{COUNT()},
+@code{COUNT(DISTINCT ...)},
+@code{AVG()}, @code{STD()},
+@code{SUM()}, @code{MAX()}, and @code{MIN()}).
@item
Support for @code{LEFT OUTER JOIN} and @code{RIGHT OUTER JOIN} with ANSI
SQL and ODBC syntax.
@@ -657,8 +646,8 @@ password traffic is encrypted when you connect to a server.
@itemize @bullet
@item
Handles large databases. We are using @code{MySQL Server} with some
-databases that contain 50,000,000 records and we know of users that
-uses @code{MySQL Server} with 60,000 tables and about 5,000,000,000 rows.
+databases that contain 50 million records and we know of users that
+use @code{MySQL Server} with 60,000 tables and about 5,000,000,000 rows.
@item
Up to 32 indexes per table are allowed. Each index may consist of 1 to 16
columns or parts of columns. The maximum index width is 500 bytes
@@ -689,13 +678,13 @@ the Scandinavian characters 'å', 'ä' and 'ö' are allowed in table
and column names.
@item
All data is saved in the chosen character set. All comparisons for normal
-string columns are case insensitive.
+string columns are case-insensitive.
@item
Sorting is done according to the chosen character set (the Swedish
way by default). It is possible to change this when the @code{MySQL}
server is started. To see an example of very advanced sorting, look
at the Czech sorting code. @code{MySQL Server} supports many different
-character sets that can be specified at compile and run time.
+character sets that can be specified at compile and runtime.
@end itemize
@item Clients and Tools
@@ -725,8 +714,8 @@ questions that concern many potential users. The information in this
section is based on data gathered from the mailing list, which is
very active in identifying problems as well as reporting types of use.
-Original code stems back from the early 80s, providing a stable code
-base, and the ISAM table format remains backwards compatible.
+Original code stems back from the early '80s, providing a stable code
+base, and the ISAM table format remains backward-compatible.
At TcX, the predecessor of @code{MySQL AB}, @code{MySQL} code has worked
in projects since mid-1996, without any problems.
When the @code{MySQL Database Software} was released to a wider public,
@@ -747,7 +736,7 @@ exception of those listed in the bugs section, which are things that
are design-related. @xref{Bugs}.
The @code{MySQL Server} design is multi-layered with independent modules.
-Some of the newer modules are listed below with an indication of how
+Some of the newer modules are listed here with an indication of how
well-tested each of them is:
@cindex modules, list of
@@ -761,7 +750,7 @@ in @code{MySQL} 4.0.
@item @code{InnoDB} tables -- Stable (in 3.23 from 3.23.49)
The @code{InnoDB} transactional table handler has now been declared
stable in the @code{MySQL} 3.23 tree, starting from version 3.23.49.
-@code{InnoDB} is being used in large, heavy load production systems.
+@code{InnoDB} is being used in large, heavy-load production systems.
@item @code{BDB} tables -- Gamma
The @code{Berkeley DB} code is very stable, but we are still improving
@@ -775,7 +764,7 @@ Important enhancements are being implemented for @code{MySQL} 4.0.
@item @code{MyODBC 2.50} (uses ODBC SDK 2.5) -- Gamma
Increasingly in wide use. Some issues brought up appear to be
-application related and independent of the ODBC driver or underlying
+application-related and independent of the ODBC driver or underlying
database server.
@item Automatic recovery of @code{MyISAM} tables -- Gamma
@@ -792,7 +781,7 @@ This is very system-dependent. On some systems there are big problems
using standard OS locking (@code{fcntl()}). In these cases, you should
run @code{mysqld} with the @code{--skip-locking} flag.
Problems are known to occur on some Linux systems, and on SunOS when
-using NFS-mounted file systems.
+using NFS-mounted filesystems.
@end table
@@ -807,29 +796,29 @@ bugs, there is almost always a new release.
@cindex tables, maximum size
@cindex size of tables
-@cindex operating systems, file size limits
-@cindex limits, file size
+@cindex operating systems, file-size limits
+@cindex limits, file-size
@cindex files, size limits
@code{MySQL} Version 3.22 has a 4G limit on table size. With the new
@code{MyISAM} table type in @code{MySQL} Version 3.23, the maximum table
size is pushed up to 8 million terabytes (2 ^ 63 bytes).
-Note, however, that operating systems have their own file size
+Note, however, that operating systems have their own file-size
limits. Here are some examples:
-@multitable @columnfractions .25 .45
-@item @strong{Operating System} @tab @strong{File Size Limit}
+@multitable @columnfractions .30 .50
+@item @strong{Operating System} @tab @strong{File-Size Limit}
@item Linux-Intel 32 bit @tab 2G, 4G or more, depends on Linux version
@item Linux-Alpha @tab 8T (?)
@item Solaris 2.5.1 @tab 2G (possible 4G with patch)
-@item Solaris 2.6 @tab 4G
+@item Solaris 2.6 @tab 4G (can be changed with flag)
@item Solaris 2.7 Intel @tab 4G
@item Solaris 2.7 UltraSPARC @tab 512G
@end multitable
On Linux 2.2 you can get bigger tables than 2G by using the LFS patch for
-the ext2 file system. On Linux 2.4 there exists also patches for ReiserFS
+the ext2 filesystem. On Linux 2.4 patches also exist for ReiserFS
to get support for big files.
This means that the table size for @code{MySQL} databases is normally
@@ -856,7 +845,7 @@ files by using the @code{RAID} option. @xref{CREATE TABLE}.
Another solution can be the included @code{MERGE} library, which allows
you to handle a collection of identical tables as one.
-@xref{MERGE, MERGE tables}.
+@xref{MERGE, , @code{MERGE} tables}.
@node Year 2000 compliance, , Table size, What-is
@@ -877,8 +866,8 @@ until @code{2069}; all 2-digit years are regarded to be in the range
@code{year} column, @code{MySQL Server} treats it as @code{2001}.
@item
-All @code{MySQL} date functions are stored in one file @file{sql/time.cc}
-and coded very carefully to be year 2000-safe.
+All @code{MySQL} date functions are stored in one file, @file{sql/time.cc},
+and are coded very carefully to be year 2000-safe.
@item
In @code{MySQL} Version 3.22 and later, the new @code{YEAR} column type
@@ -892,7 +881,7 @@ or manipulate years using 2-digit values (which are ambiguous) rather than
4-digit values. This problem may be compounded by applications that use
values such as @code{00} or @code{99} as ``missing'' value indicators.
-Unfortunately, these problems may be difficult to fix, because different
+Unfortunately, these problems may be difficult to fix because different
applications may be written by different programmers, each of whom may
use a different set of conventions and date-handling functions.
@@ -903,9 +892,9 @@ doesn't have any problems with dates until the year 2030:
mysql> DROP TABLE IF EXISTS y2k;
Query OK, 0 rows affected (0.01 sec)
-mysql> CREATE TABLE y2k (date date,
- -> date_time datetime,
- -> time_stamp timestamp);
+mysql> CREATE TABLE y2k (date DATE,
+ -> date_time DATETIME,
+ -> time_stamp TIMESTAMP);
Query OK, 0 rows affected (0.00 sec)
mysql> INSERT INTO y2k VALUES
@@ -964,22 +953,22 @@ year values).
@node What is MySQL AB, Licensing and Support, What-is, Introduction
-@section What Is MySQL AB
+@section What Is MySQL AB?
@cindex MySQL AB, defined
@code{MySQL AB} is the company of the @code{MySQL} founders and main
developers. @code{MySQL AB} was originally established in Sweden by
-David Axmark, Allan Larsson and Michael @code{Monty} Widenius.
+David Axmark, Allan Larsson, and Michael @code{Monty} Widenius.
All the developers of the @code{MySQL} server are employed by the company.
We are a virtual organisation with people in a dozen countries around
-the world. We communicate extensively over the net every day with each
+the world. We communicate extensively over the Net every day with each
other and with our users, supporters and partners.
We are dedicated to developing the @code{MySQL} software and spreading
our database to new users. @code{MySQL AB} owns the copyright to the
-@code{MySQL} source code, the @code{MySQL} logo and trademark and this
+@code{MySQL} source code, the @code{MySQL} logo and trademark, and this
manual. @xref{What-is}.
@menu
@@ -1009,8 +998,8 @@ Free from bugs.
@code{MySQL AB} and the people at @code{MySQL AB}:
@itemize @bullet
@item
-Promote @code{Open Source} Philosophy and support the
-@code{Open Source} Community.
+Promote @code{Open Source} philosophy and support the
+@code{Open Source} community.
@item
Aim to be good citizens.
@item
@@ -1034,7 +1023,7 @@ One of the most common questions we encounter is:
``@emph{How can you make a living from something you give away for free?}''
This is how.
-@code{MySQL AB} makes money on support, services, commercial licenses
+@code{MySQL AB} makes money on support, services, commercial licenses,
and royalties, and we use these revenues to fund product development
and to expand the @code{MySQL} business.
@@ -1075,7 +1064,7 @@ To order support at various levels, please visit the order section at
@cindex certification
@cindex MySQL certification
@code{MySQL AB} delivers @code{MySQL} and related training worldwide.
-We offer both open courses and In-House courses tailored to the
+We offer both open courses and in-house courses tailored to the
specific needs of your company. @code{MySQL Training} is also available
through our partners, the @code{Authorised MySQL Training Centers}.
@@ -1098,7 +1087,7 @@ Reduce or eliminate the need for additional hardware, decreasing cost.
@item
Enhance security.
@item
-Increase customers and co-workers satisfaction.
+Increase customers' and co-workers' satisfaction.
@item
Prepare yourself for @code{MySQL Certification}.
@end itemize
@@ -1108,7 +1097,7 @@ as a training partner, please visit the training section at
@uref{http://www.mysql.com/training/} or contact us at:
@email{training@@mysql.com}.
-We plan to release the @code{MySQL Certification Program} in 2002, for
+We plan to release the @code{MySQL Certification Program} in 2002. For
details see @uref{http://www.mysql.com/training/certification.html}.
If you would like to be kept informed about the
@code{MySQL Certification Program},
@@ -1130,12 +1119,12 @@ applications, and more.
We also help customers embed @code{MySQL Server} in their products and
applications for large-scale deployment.
-Our consultants work in close collaboration with our development team
+Our consultants work in close collaboration with our development team,
which ensures the technical quality of our professional services.
-Consulting assignments range from 2-day power start sessions to
-projects that span weeks and months. Our expertise does not only cover
-@code{MySQL Server}, but extends into programming and scripting
-languages such as PHP, Perl and more.
+Consulting assignments range from 2-day power-start sessions to
+projects that span weeks and months. Our expertise not only covers
+@code{MySQL Server}, but also extends into programming and scripting
+languages such as PHP, Perl, and more.
If you are interested in our consulting services or want to become a
consulting partner, please visit the consulting section of our web site
@@ -1154,10 +1143,10 @@ as well), you may purchase a commercial license for the same product
from @code{MySQL AB} at @uref{https://order.mysql.com/}.
Since @code{MySQL AB} owns the copyright to the @code{MySQL} source code,
we are able to employ @code{Dual Licensing} which means that the same
-product is available both under @code{GPL} and under a commercial
+product is available under @code{GPL} and under a commercial
license. This does not in any way affect the @code{Open Source}
commitment of @code{MySQL AB}. For details about when a commercial
-license is required, please see @ref{MySQL server licenses}.
+license is required, please see @ref{MySQL licenses}.
We also sell commercial licenses of third-party @code{Open Source GPL}
software that adds value to @code{MySQL Server}. A good example is the
@@ -1170,14 +1159,14 @@ key support, and more. @xref{InnoDB}.
@subsubsection Partnering
@cindex partnering with MySQL AB
@code{MySQL AB} has a worldwide partner programme that covers training
-courses, Consulting & Support, publications plus reselling and
+courses, consulting & support, publications plus reselling and
distributing @code{MySQL} and related products. @code{MySQL AB Partners}
get visibility on the @uref{http://www.mysql.com/} web site and the right
to use special versions of the @code{MySQL} trademarks to identify their
products and promote their business.
If you are interested in becoming a @code{MySQL AB Partner}, please e-mail
-to @email{partner@@mysql.com}.
+@email{partner@@mysql.com}.
The word @code{MySQL} and the @code{MySQL} dolphin logo are trademarks of
@code{MySQL AB}. @xref{MySQL AB Logos and Trademarks}.
@@ -1190,13 +1179,13 @@ founders have built over the years.
The @code{MySQL} web site (@uref{http://www.mysql.com/}) is popular among
developers and users. In October 2001, we served 10 million page views.
Our visitors represent a group that makes purchase decisions and
-recommendations for both software and hardware. Twelve per cent of our
-visitors authorise purchase decisions, and only nine per cent are not
+recommendations for both software and hardware. Twelve percent of our
+visitors authorise purchase decisions, and only nine percent are not
involved in purchase decisions at all. More than 65% have made one or
more online business purchase within the last half-year, and 70% plan
to make one in the next months.
-If you are interested in placing banner ads on our web site
+If you are interested in placing banner ads on our web site,
@uref{http://www.mysql.com/}, please send an e-mail message to
@email{advertising@@mysql.com}.
@@ -1218,7 +1207,7 @@ For press service and inquiries not covered in our News releases
(@uref{http://www.mysql.com/news/}), please send e-mail to
@email{press@@mysql.com}.
-If you have a valid support contract with @code{MySQL AB}; you will
+If you have a valid support contract with @code{MySQL AB}, you will
get timely, precise answers to your technical questions about the
@code{MySQL} software. For more information, see @ref{Support}.
You can order your support contract at
@@ -1252,7 +1241,7 @@ license deal, please fill in the contact form on our web site
(@uref{http://www.mysql.com/}) or send an e-mail message
to @email{licensing@@mysql.com} (for licensing questions) or to
@email{sales@@mysql.com} (for sales inquiries).
-@xref{MySQL server licenses}.
+@xref{MySQL licenses}.
If you represent a business that is interested in partnering with
@code{MySQL AB}, please send e-mail to @email{partner@@mysql.com}.
@@ -1274,7 +1263,7 @@ please send an e-mail message to @email{jobs@@mysql.com}.
Please do not send your CV as an attachment, but rather as plain text
at the end of your e-mail message.
-For general discussion amongst our many users, please direct your
+For general discussion among our many users, please direct your
attention to the appropriate mailing list.
@xref{Questions}.
@@ -1313,12 +1302,12 @@ For all other inquires, please send e-mail to @email{info@@mysql.com}.
@cindex licensing terms
@cindex support terms
-This section describes @code{MySQL} support and licensing arrangements:
+This section describes @code{MySQL} support and licensing arrangements.
@menu
* Support:: Support Offered by MySQL AB
* Copyright:: Copyrights and Licenses Used by MySQL
-* MySQL server licenses:: MySQL Server Licenses
+* MySQL licenses:: MySQL Licenses
* MySQL AB Logos and Trademarks:: MySQL AB Logos and Trademarks
@end menu
@@ -1344,13 +1333,13 @@ important to you.
Typically customers seek help on how to get different commands and
utilities to work, remove performance bottlenecks, restore crashed
systems, understand operating system or networking impacts on @code{MySQL},
-set-up best practices for backup and recovery, utilise @code{API}s, etc.
+set up best practices for backup and recovery, utilise @code{API}s, etc.
Our support covers only the @code{MySQL} server and our own utilities,
not third-party products that access the @code{MySQL} server, though we
try to help with these where we can.
Detailed information about our various support options is given at
-@uref{https://order.mysql.com/} where support contracts can also be
+@uref{https://order.mysql.com/}, where support contracts can also be
ordered online. If you have restricted access to the Internet, contact
our sales staff at @email{sales@@mysql.com}.
@@ -1363,7 +1352,7 @@ yourself. You may need immediate access to the most experienced
@code{MySQL} troubleshooters available, those employed by @code{MySQL AB}.
-@node Copyright, MySQL server licenses, Support, Licensing and Support
+@node Copyright, MySQL licenses, Support, Licensing and Support
@subsection Copyrights and Licenses Used by MySQL
@cindex copyrights
@@ -1372,21 +1361,21 @@ yourself. You may need immediate access to the most experienced
@code{MySQL AB} owns the copyright to the @code{MySQL} source code,
the @code{MySQL} logos and trademarks and this manual.
@xref{What is MySQL AB}.
-There are several different licenses relevant to the @code{MySQL}
+Several different licenses are relevant to the @code{MySQL}
distribution:
@enumerate
@item
All the @code{MySQL}-specific source in the server, the @code{mysqlclient}
-library and the client, as well as the @code{GNU} @code{readline} library,
-is covered by the ``GNU GENERAL PUBLIC LICENSE.''
+library and the client, as well as the @code{GNU} @code{readline} library
+is covered by the @code{GNU General Public License}.
@xref{GPL license}.
The text of this license can also be found as the file @file{COPYING}
in the distributions.
@item
The @code{GNU} @code{getopt} library is covered by the
-``GNU LESSER GENERAL PUBLIC LICENSE.''
+@code{GNU Lesser General Public License}.
@xref{LGPL license}.
@item
@@ -1400,7 +1389,7 @@ more strict license
See the documentation of the specific version for information.
@item
-The manual is currently @emph{not} distributed under a @code{GPL} style license.
+The manual is currently @strong{not} distributed under a @code{GPL}-style license.
Use of the manual is subject to the following terms:
@itemize @bullet
@item
@@ -1418,12 +1407,12 @@ if you are interested in doing a translation.
@end enumerate
For information about how the @code{MySQL} licenses work in practice,
-please refer to @ref{MySQL server licenses}.
+please refer to @ref{MySQL licenses}.
Also see @ref{MySQL AB Logos and Trademarks}.
-@node MySQL server licenses, MySQL AB Logos and Trademarks, Copyright, Licensing and Support
-@subsection MySQL Server Licenses
+@node MySQL licenses, MySQL AB Logos and Trademarks, Copyright, Licensing and Support
+@subsection MySQL Licenses
@cindex licensing policy
@cindex technical support, licensing
@@ -1439,7 +1428,8 @@ The @code{MySQL} software is released under the
which probably is the best known @code{Open Source} license.
The formal terms of the @code{GPL} license can be found at
@uref{http://www.gnu.org/licenses/}.
-See also @uref{http://www.gnu.org/licenses/gpl-faq.html}.
+See also @uref{http://www.gnu.org/licenses/gpl-faq.html} and
+@uref{http://www.gnu.org/philosophy/enforcing-gpl.html}.
Since the @code{MySQL} software is released under the @code{GPL},
it may often be used for free, but for certain uses you may want
@@ -1452,18 +1442,18 @@ more strict license
See the documentation of the specific version for information.
Please note that the use of the @code{MySQL} software under commercial
-license, @code{GPL} or the old @code{MySQL} license does not
+license, @code{GPL}, or the old @code{MySQL} license does not
automatically give you the right to use @code{MySQL AB} trademarks.
@xref{MySQL AB Logos and Trademarks}.
@menu
-* Using the MySQL server under a commercial license:: Using the MySQL Server Under a Commercial License
-* Using the MySQL server for free under GPL:: Using the MySQL Server for Free Under GPL
+* Using the MySQL software under a commercial license:: Using the MySQL Software Under a Commercial License
+* Using the MySQL software for free under GPL:: Using the MySQL Software for Free Under GPL
@end menu
-@node Using the MySQL server under a commercial license, Using the MySQL server for free under GPL, MySQL server licenses, MySQL server licenses
-@subsubsection Using the MySQL Server Under a Commercial License
+@node Using the MySQL software under a commercial license, Using the MySQL software for free under GPL, MySQL licenses, MySQL licenses
+@subsubsection Using the MySQL Software Under a Commercial License
The @code{GPL} license is contagious in the sense that when a program
is linked to a @code{GPL} program the resulting product must also be
@@ -1482,7 +1472,7 @@ purchasing commercial licenses, you are not using the @code{MySQL} software
under @code{GPL} even though it's the same code.
@item
-When you distribute a non-@code{GPL} application that ONLY works with the
+When you distribute a non-@code{GPL} application that @strong{only} works with the
@code{MySQL} software and ship it with the @code{MySQL} software. This type
of solution is actually considered to be linking even if it's done over
a network.
@@ -1511,8 +1501,8 @@ licensing needs or you have restricted access to the Internet, please contact
our sales staff at @email{sales@@mysql.com}.
-@node Using the MySQL server for free under GPL, , Using the MySQL server under a commercial license, MySQL server licenses
-@subsubsection Using the MySQL Server for Free Under GPL
+@node Using the MySQL software for free under GPL, , Using the MySQL software under a commercial license, MySQL licenses
+@subsubsection Using the MySQL Software for Free Under GPL
@cindex licensing, free
@cindex free licensing
@@ -1521,28 +1511,18 @@ You can use the @code{MySQL} software for free under the @code{GPL}:
@itemize @bullet
@item
-When you link a program with code from the @code{MYSQL} software and
+When you link a program with code from the @code{MySQL} software and
release the resulting product under @code{GPL}.
@item
When you distribute the @code{MySQL} source code bundled with
-other programs that are not linked to or dependant on @code{MySQL Server}
+other programs that are not linked to or dependent on @code{MySQL Server}
for their functionality even if you sell the distribution commercially.
@item
When using the @code{MySQL} software internally in your company.
@item
-When include the @code{MySQL} client code in a commercial program.
-The client part of the @code{MySQL} software is licensed under the
-@code{LGPL} (@code{GNU Lesser General Public License}).
-The formal terms of the @code{LGPL} license can be found at
-@uref{http://www.gnu.org/licenses/}.
-
-However, the @code{mysql} command-line client does include code
-from the @code{GNU} @code{readline} library that is under the @code{GPL}.
-
-@item
@cindex ISP services
@cindex services, ISP
@cindex services, web
@@ -1559,7 +1539,7 @@ to our @code{announce} mailing list so that they can be aware of
critical issues that may be relevant for their @code{MySQL} installations.
Note that even if an ISP does not have a commercial license for
-@code{MySQL} Server, they should at least give their customers read
+@code{MySQL Server}, they should at least give their customers read
access to the source of the @code{MySQL} installation so that the
customers can verify that it is patched correctly.
@@ -1567,16 +1547,16 @@ customers can verify that it is patched correctly.
@cindex web server, running
@cindex running a web server
When you use the @code{MySQL} Database Software in conjunction with
-a Web server, you do not need a commercial license. This is true even
-if you run a commercial Web server that uses @code{MySQL} Server, because
+a web server, you do not need a commercial license. This is true even
+if you run a commercial web server that uses @code{MySQL Server}, because
you are not selling an embedded @code{MySQL} version yourself. However,
-in this case we would like you to purchase @code{MySQL} support, because
+in this case we would like you to purchase @code{MySQL} support because
the @code{MySQL} software is helping your enterprise.
@end itemize
If your use of @code{MySQL} database software does not require a commercial
license, we encourage you to purchase support from @code{MySQL AB} anyway.
-This way you contribute towards @code{MySQL} development and also gain
+This way you contribute toward @code{MySQL} development and also gain
immediate advantages for yourself. @xref{Support}.
If you use the @code{MySQL} database software in a commercial context
@@ -1589,15 +1569,15 @@ for free something into which we've put a lot a work, you're asking
us to provide free support, too.)
-@node MySQL AB Logos and Trademarks, , MySQL server licenses, Licensing and Support
+@node MySQL AB Logos and Trademarks, , MySQL licenses, Licensing and Support
@subsection MySQL AB Logos and Trademarks
@cindex logos
@cindex trademarks
Many users of the @code{MySQL} database want to display the
-@code{MySQL AB} dolphin logo on their web sites, on their books or
-boxed products. We welcome and encourage this although it should be
+@code{MySQL AB} dolphin logo on their web sites, books, or
+boxed products. We welcome and encourage this, although it should be
noted that the word @code{MySQL} and the @code{MySQL} dolphin logo
are trademarks of @code{MySQL AB} and may only be used as stated in
our trademark policy at
@@ -1620,7 +1600,7 @@ our trademark policy at
The @code{MySQL} dolphin logo was designed by the Finnish advertising
agency Priority in 2001. The dolphin was chosen as a suitable symbol
-for the @code{MySQL} database since it is a smart, fast and lean animal,
+for the @code{MySQL} database since it is a smart, fast, and lean animal,
effortlessly navigating oceans of data. We also happen to like dolphins.
The original @code{MySQL} logo may only be used by representatives of
@@ -1636,10 +1616,10 @@ to do so.
We have designed a set of special @emph{Conditional Use} logos that may be
downloaded from our web site at
@uref{http://www.mysql.com/downloads/logos.html}
-and used on third party web sites without written permission from
+and used on third-party web sites without written permission from
@code{MySQL AB}.
-The use of these logos is not entirely unrestricted, but as the name
-implies subject to our trademark policy that is also available on our
+The use of these logos is not entirely unrestricted but, as the name
+implies, subject to our trademark policy that is also available on our
web site. You should read through the trademark policy if you plan to
use them. The requirements are basically:
@@ -1664,8 +1644,8 @@ to @uref{http://www.mysql.com/}.
@item
If you are using the @code{MySQL} database under @code{GPL} in an
-application, your application must (i) be @code{Open Source},
-(ii) be able to connect to a @code{MySQL} server.
+application, your application must be @code{Open Source} and
+be able to connect to a @code{MySQL} server.
@end itemize
Contact us at @email{trademark@@mysql.com} to inquire about special
@@ -1683,11 +1663,11 @@ When displaying any @code{MySQL AB} logo anywhere except on your web site.
@item
When displaying any @code{MySQL AB} logo except the @emph{Conditional Use}
-logos above on web sites or elsewhere.
+logos mentioned previously on web sites or elsewhere.
@end itemize
Out of legal and commercial reasons we have to monitor the use of MySQL
-trademarks on products, books etc. We will usually require a fee for
+trademarks on products, books, etc. We will usually require a fee for
displaying @code{MySQL AB} logos on commercial products, since we think
it is reasonable that some of the revenue is returned to fund further
development of the @code{MySQL} database.
@@ -1709,9 +1689,9 @@ Please see @ref{Business Services Partnering,,Partnering}.
@code{MySQL AB} welcomes references to the @code{MySQL} database, but
note that the word @code{MySQL} is a trademark of @code{MySQL AB}.
-Because of this, you should append the trademark symbol @code{TM} to
+Because of this, you should append the trademark symbol (@code{TM}) to
the first or most prominent use of the word @code{MySQL} in a text and
-where appropriate use a statement that @code{MySQL} is a trademark of
+where appropriate, state that @code{MySQL} is a trademark of
@code{MySQL AB}. Please refer to our trademark policy at
@uref{http://www.mysql.com/company/trademark.html} for details.
@@ -1732,9 +1712,9 @@ Long promised by @code{MySQL AB} and long awaited by our users,
MySQL Server 4.0 is now available in alpha version for download from
@uref{http://www.mysql.com/} and our mirrors.
-Main new features of MySQL Server 4.0 are geared towards our existing
+Main new features of MySQL Server 4.0 are geared toward our existing
business and community users, enhancing the MySQL database software
-as the solution for mission-critical, heavy load database systems.
+as the solution for mission-critical, heavy-load database systems.
Other new features target the users of embedded databases.
@menu
@@ -1753,7 +1733,7 @@ Other new features target the users of embedded databases.
The rollout of MySQL Server 4.0 will come in several steps, with
the first version labelled 4.0.0 already containing most of the
new features. Additional features will be incorporated into
-MySQL 4.0.1, 4.0.2 onwards; very probably within a couple of months,
+MySQL 4.0.1, 4.0.2, and onward; very probably within a couple of months,
MySQL 4.0 will be labelled beta. Further new features will then
be added in MySQL 4.1, which is targeted for alpha release
in third quarter 2002.
@@ -1781,9 +1761,9 @@ applications. Using the embedded MySQL server library, one can
embed MySQL Server into various applications and electronics devices, where
the end user has no knowledge of there actually being an underlying
database. Embedded MySQL Server is ideal for use behind
-the scenes in internet appliances, public kiosks, turn-key
-hardware/ software combination units, high performance internet
-servers, self-contained databases distributed on CD-ROM etc.
+the scenes in internet appliances, public kiosks, turnkey
+hardware/software combination units, high performance internet
+servers, self-contained databases distributed on CD-ROM, etc.
Many users of @code{libmysqld} will benefit from the MySQL
@emph{Dual Licensing}. For those not wishing to be bound by the GPL,
@@ -1799,8 +1779,8 @@ client library, so it is convenient and easy to use. @xref{libmysqld}.
@item
Version 4.0 further increases @emph{the speed of MySQL Server}
in a number of areas,
-such as bulk @code{INSERT}s, searching on packed indices, creation of
-@code{FULLTEXT} indices as well as @code{COUNT(DISTINCT)}.
+such as bulk @code{INSERT}s, searching on packed indexes, creation of
+@code{FULLTEXT} indexes, as well as @code{COUNT(DISTINCT)}.
@item
The table handler @code{InnoDB} is now offered as a feature of the
@@ -1811,38 +1791,37 @@ and @code{row-level locking}.
MySQL Server 4.0 will support secure traffic between the client and the server,
greatly increasing security against malicious intrusion and unauthorised
access. Web applications being a cornerstone of MySQL use, web developers
-have been able to use SSL to secure the traffic between the
-the end user browser and the Web application, be it written in
-PHP, Perl, ASP or using any other web development tool. However,
-the traffic between the development tool and the mysqld server
+have been able to use @code{Secure Socket Layer} (@code{SSL}) to secure the
+traffic between the the end user browser and the web application, be it
+written in PHP, Perl, ASP or using any other web development tool. However,
+the traffic between the development tool and the @code{mysqld} server
process has been protected only by virtue of them being processes
residing on computers within the same firewall. In MySQL Server 4.0,
-the @emph{mysqld} server daemon process can itself use
-@code{Secure Sockets Layer} (@code{SSL}),
+the @code{mysqld} server daemon process can itself use @code{SSL},
thus enabling secure traffic to MySQL databases from, say, a Windows
application residing outside the firewall.
@item
-Our German, Austrian and Swiss users will note that we have a new character
-set @code{latin_de} which corrects the @emph{German sorting order},
-placing German Umlauts in the same order as German telephone books.
+Our German, Austrian, and Swiss users will note that we have a new character
+set, @code{latin_de}, which corrects the @emph{German sorting order},
+placing German umlauts in the same order as German telephone books.
@item
Features to simplify migration from other database systems to MySQL
Server include @code{TRUNCATE TABLE} (like in Oracle) and @code{IDENTITY} as a
synonym for automatically incremented keys (like in Sybase). Many users will
also be happy to learn that MySQL Server now supports the @code{UNION} statement,
-a long awaited standard SQL feature.
+a long-awaited standard SQL feature.
@item
In the process of building features for new users, we have not forgotten
requests by the community of loyal users.
We have multi-table @code{DELETE} statements.
By adding support for @code{symbolic linking} to @code{MyISAM} on the table
-level (and not just database level as before), as well as by enabling symlink
+level (and not just the database level as before), as well as by enabling symlink
handling by default on Windows, we hope to show that we take enhancement
requests seriously.
-Functions like @code{SQL_CALC_FOUND_ROWS} and @code{FOUND_ROWS()} makes it
+Functions like @code{SQL_CALC_FOUND_ROWS} and @code{FOUND_ROWS()} make it
possible to know how many rows a query would have returned without a
@code{LIMIT} clause.
@end itemize
@@ -1851,7 +1830,7 @@ possible to know how many rows a query would have returned without a
@node Nutshell Future features, Nutshell 4.1 development release, Nutshell Other features, MySQL 4.0 In A Nutshell
@subsection Future MySQL 4.0 Features
-For the upcoming MySQL Server 4.0 releases (4.0.1, 4.0.2 and onwards),
+For the upcoming MySQL Server 4.0 releases (4.0.1, 4.0.2, and onward),
expect the following features now still under development:
@itemize @bullet
@@ -1859,7 +1838,7 @@ expect the following features now still under development:
Mission-critical, heavy-load users of MySQL Server will appreciate
the additions to our replication system and our online hot backup.
Later versions of 4.0 will include @code{fail-safe replication};
-already in existing 4.0.0, the @code{LOAD DATA FROM MASTER} command
+already existing in 4.0.0, the @code{LOAD DATA FROM MASTER} command
will soon automate slave setup. The @code{online backup} will make
it easy to add a new replication slave without taking down
the master, and have a very low performance penalty on
@@ -1871,9 +1850,9 @@ A convenience feature for Database Administrators is that
taking down the servers.
@item
-The new @code{FULLTEXT} search properties of MySQL Server 4.0 enables the
+The new @code{FULLTEXT} search properties of MySQL Server 4.0 enable the
use of @code{FULLTEXT} indexing of large text masses with both binary and
-natural language searching logic. Users can customise minimal word
+natural-language searching logic. Users can customise minimal word
length and define their own stop word lists in any human language,
enabling a new set of applications to be built on MySQL Server.
@@ -1891,7 +1870,8 @@ in the client.
@subsection MySQL 4.1, The Following Development Release
Internally, through a new .frm file format for table definitions,
-MySQL Server 4.0 lays the foundation for the new features of MySQL Server 4.1,
+MySQL Server 4.0 lays the foundation for the new features of
+MySQL Server 4.1 and onward,
such as @code{nested subqueries}, @code{stored procedures}, and
@code{foreign key integrity rules}, which form the top of the
wish list for many of our customers. Along with those, we will
@@ -1939,23 +1919,23 @@ checklist of very demanding buyers.
The @code{MySQL Portals} (@uref{http://www.mysql.com/portal/})
represent the ultimate resource to find @code{MySQL AB Partners},
-as well as books, or other @code{MySQL} related solutions that you
+as well as books, or other @code{MySQL}-related solutions that you
may be looking for. Items are categorised and rated in order to
make it easy for you to locate information.
-By registering as a user, you will have the ability to comment and
+By registering as a user, you will have the ability to comment on and
rate items presented in portals. You will also receive relevant
newsletters according to your user profile that you may update at
any time.
-Some of the current @code{MySQL Portal} categories:
+Some of the current @code{MySQL Portal} categories include:
@table @strong
@item Partners
Find @code{MySQL AB} partners worldwide.
@item Books
-Comment, vote, and buy books related to @code{MySQL}.
+Comment on, vote for, and buy books related to @code{MySQL}.
@item Development
Various links to different sites that are using @code{MySQL Server}
@@ -1968,7 +1948,7 @@ Let us know about @emph{your} site or success story, too!
Visit @uref{http://www.mysql.com/feedback/testimonial.php}.
@item Software
-Find, buy, download several applications and wrappers that make
+Find, buy, and download several applications and wrappers that make
use of the @code{MySQL} server.
@item Distributions
@@ -2018,7 +1998,7 @@ subject line and the body of the message are ignored.
@c the last two addresses in this paragraph are not @email because they
@c shouldn't be live links.
If your reply address is not valid, you can specify your address
-explicitly. Adding a hyphen to the subscribe or unsubscribe command
+explicitly, by adding a hyphen to the subscribe or unsubscribe command
word, followed by your address with the @samp{@@} character in your
address replaced by a @samp{=}. For example, to subscribe
@code{your_name@@host.domain}, send a message to
@@ -2030,13 +2010,13 @@ ezmlm mailing list processor. Information about ezmlm is available at
the ezmlm web site (@uref{http://www.ezmlm.org/}).
To post a message to the list itself, send your message to
-@code{mysql@@lists.mysql.com}. However, please @emph{do not} send mail about
-subscribing or unsubscribing to @email{mysql@@lists.mysql.com}, because any
+@code{mysql@@lists.mysql.com}. However, please @strong{do not} send mail about
+subscribing or unsubscribing to @email{mysql@@lists.mysql.com} because any
mail sent to that address is distributed automatically to thousands of other
users.
Your local site may have many subscribers to @email{mysql@@lists.mysql.com}.
-If so, it may have a local mailing list, so that messages sent from
+If so, it may have a local mailing list, so messages sent from
@code{lists.mysql.com} to your site are propagated to the local list. In such
cases, please contact your system administrator to be added to or dropped
from the local MySQL list.
@@ -2051,7 +2031,7 @@ The following MySQL mailing lists exist:
@table @code
@item @email{announce-subscribe@@lists.mysql.com} announce
This is for announcement of new versions of MySQL and related
-programs. This is a low volume list all MySQL users should
+programs. This is a low-volume list all MySQL users should
subscribe to.
@item @email{mysql-subscribe@@lists.mysql.com} mysql
@@ -2071,7 +2051,7 @@ Preferably, you should test the problem using the latest stable or development
version of MySQL Server before posting! Anyone should be able to repeat the
bug by just using @code{mysql test < script} on the included test case. All
bugs posted on this list will be corrected or documented in the next
-MySQL release! If there are only small code changes involved, we
+MySQL release! If only small code changes are needed, we
will also post a patch that fixes the problem.
@item @email{bugs-digest-subscribe@@lists.mysql.com} bugs-digest
@@ -2104,7 +2084,7 @@ All things about connecting to the MySQL server with ODBC.
A digest version of the @code{myodbc} list.
@item @email{mycc-subscribe@@lists.mysql.com} mycc
-All things about the MySQL MyCC graphical client.
+All things about the MySQL @code{MyCC} graphical client.
@item @email{mycc-digest-subscribe@@lists.mysql.com} mycc-digest
A digest version of the @code{mycc} list.
@@ -2123,7 +2103,7 @@ A digest version of the @code{msql-mysql-modules} list.
@end table
You subscribe or unsubscribe to all lists in the same way as described
-above. In your subscribe or unsubscribe message, just put the appropriate
+previously. In your subscribe or unsubscribe message, just put the appropriate
mailing list name rather than @code{mysql}. For example, to subscribe to or
unsubscribe from the @code{myodbc} list, send a message to
@email{myodbc-subscribe@@lists.mysql.com} or
@@ -2133,7 +2113,7 @@ If you can't get an answer for your questions from the mailing list, one
option is to pay for support from MySQL AB, which will put you
in direct contact with MySQL developers. @xref{Support}.
-The following table shows some MySQL mailing in other languages than
+The following table shows some MySQL mailing in languages other than
English. Note that these are not operated by MySQL AB, so we can't
guarantee the quality on these.
@@ -2177,7 +2157,7 @@ Search the MySQL mailing list archives:
@*
@item
You can also use @uref{http://www.mysql.com/search.html} to search all the
-Web pages (including the manual) that are located at
+web pages (including the manual) that are located at
@uref{http://www.mysql.com/}.
@end itemize
@@ -2207,7 +2187,7 @@ or at all.
We encourage everyone to use the @code{mysqlbug} script to generate a bug
report (or a report about any problem), if possible. @code{mysqlbug} can be
-found in the @file{scripts} directory in the source distribution, or, for a
+found in the @file{scripts} directory in the source distribution, or for a
binary distribution, in the @file{bin} directory under your MySQL
installation directory. If you are unable to use @code{mysqlbug}, you should
still include all the necessary information listed in this section.
@@ -2229,9 +2209,9 @@ MySQL version. Preferably, you should test the problem using
the latest stable or development version of MySQL Server before
posting! Anyone should be able to repeat the bug by just using
``@code{mysql test < script}'' on the included test case or run the
-shell or perl script that is included in the bug report. All bugs
+shell or Perl script that is included in the bug report. All bugs
posted on the @code{bugs} list will be corrected or documented in the next
-MySQL release! If there are only small code changes involved
+MySQL release! If only small code changes are needed
to correct this problem, we will also post a patch that fixes the
problem.
@@ -2252,17 +2232,17 @@ the MySQL distribution they are using, or don't indicate what
platform they have the MySQL server installed on (including the platform
version number). This is highly relevant information, and in 99 cases out of
100 the bug report is useless without it! Very often we get questions like,
-``Why doesn't this work for me?'' then we find that the feature
+``Why doesn't this work for me?'' Then we find that the feature
requested wasn't implemented in that MySQL version, or that a bug
described in a report has been fixed already in newer MySQL
-versions. Sometimes the error is platform dependent; in such cases, it is
+versions. Sometimes the error is platform-dependent; in such cases, it is
next to impossible to fix anything without knowing the operating system and
the version number of the platform.
Remember also to provide information about your compiler, if it is related to
the problem. Often people find bugs in compilers and think the problem is
MySQL-related. Most compilers are under development all the time and
-become better version by version. To determine whether or not your
+become better version by version. To determine whether your
problem depends on your compiler, we need to know what compiler is used.
Note that every compiling problem should be regarded as a bug report and
reported accordingly.
@@ -2285,11 +2265,11 @@ trace file. @xref{MyODBC bug report}.
Please remember that many of the people who will read your report will
do so using an 80-column display. When generating reports or examples
-using the @code{mysql} command line tool, you should therefore use
+using the @code{mysql} command-line tool, you should therefore use
the @code{--vertical} option (or the @code{\G} statement terminator)
for output that would exceed the available width for such a display
(for example, with the @code{EXPLAIN SELECT} statement; see the
-example below).
+example later in this section).
@cindex bug reports, criteria for
Please include the following information in your report:
@@ -2342,7 +2322,7 @@ information you give about your situation, the more likely it is that someone
can help you! For example, the following is an example of a very good bug
report (it should of course be posted with the @code{mysqlbug} script):
-Example run using the @code{mysql} command line tool (note the use of the
+Example run using the @code{mysql} command-line tool (note the use of the
@code{\G} statement terminator for statements whose output width would
otherwise exceed that of an 80-column display device):
@@ -2361,11 +2341,11 @@ mysql> SHOW STATUS;
@end example
@item
-If a bug or problem occurs while running @strong{mysqld}, try to provide an
+If a bug or problem occurs while running @code{mysqld}, try to provide an
input script that will reproduce the anomaly. This script should include any
necessary source files. The more closely the script can reproduce your
situation, the better. If you can make a reproduceable test case, you should
-post this to @email{bugs@@lists.mysql.com} for a high priority treatment!
+post this to @email{bugs@@lists.mysql.com} for a high-priority treatment!
If you can't provide a script, you should at least include the output
from @code{mysqladmin variables extended-status processlist} in your mail to
@@ -2395,8 +2375,8 @@ These cases are rare, perhaps, but it is better to be safe than sorry.
After all, it should be easier for you to provide an example that uses your
actual situation, and it is by all means better for us. In case you have data
you don't want to show to others, you can use @code{ftp} to transfer it to
-@uref{ftp://support.mysql.com/pub/mysql/secret/}. If the data are really top
-secret and you don't want to show them even to us, then go ahead and provide
+@uref{ftp://support.mysql.com/pub/mysql/secret/}. If the data is really top
+secret and you don't want to show it even to us, then go ahead and provide
an example using other names, but please regard this as the last choice.
@item
@@ -2418,9 +2398,9 @@ gives you trouble. @code{mysqlaccess} can be found in the @file{bin}
directory under your MySQL installation directory.
@item
-If you have a patch for a bug, that is good, but don't assume the patch is
+If you have a patch for a bug, that is good. But don't assume the patch is
all we need, or that we will use it, if you don't provide some necessary
-information, such as test cases showing the bug that your patch fixes. We
+information such as test cases showing the bug that your patch fixes. We
might find problems with your patch or we might not understand it at all; if
so, we can't use it.
@@ -2430,13 +2410,13 @@ situations that may occur. If we find a borderline case (even a rare one)
where the patch won't work, it may be useless.
@item
-Guesses about what the bug is, why it occurs, or what it depends on,
+Guesses about what the bug is, why it occurs, or what it depends on
are usually wrong. Even the MySQL team can't guess such things
without first using a debugger to determine the real cause of a bug.
@item
Indicate in your mail message that you have checked the reference manual
-and mail archive so others know that you have tried to solve the
+and mail archive so that others know you have tried to solve the
problem yourself.
@item
@@ -2472,9 +2452,9 @@ it's much easier for us to provide you with a fix for the problem.
@item
If possible, download and install the most recent version of MySQL Server
-and check whether or not it solves your problem. All versions of
+and check whether it solves your problem. All versions of
the MySQL software are thoroughly tested and should work without problems.
-We believe in making everything as backward compatible as possible,
+We believe in making everything as backward-compatible as possible,
and you should be able to switch MySQL versions without any hassle.
@xref{Which version}.
@end itemize
@@ -2484,11 +2464,11 @@ and you should be able to switch MySQL versions without any hassle.
@cindex customer support, mailing address
@cindex mailing address, for customer support
If you are a support customer, please cross-post the bug report to
-@email{mysql-support@@mysql.com} for higher priority treatment, as well as to
+@email{mysql-support@@mysql.com} for higher-priority treatment, as well as to
the appropriate mailing list to see if someone else has experienced (and
perhaps solved) the problem.
-For information on reporting bugs in @strong{MyODBC}, see @ref{ODBC Problems}.
+For information on reporting bugs in @code{MyODBC}, see @ref{ODBC Problems}.
For solutions to some common problems, see @ref{Problems}.
@@ -2529,35 +2509,35 @@ Many users don't read mail with a browser!
This section describes how MySQL relates to the ANSI SQL standards.
MySQL Server has many extensions to the ANSI SQL standards, and here you
-will find out what they are, and how to use them. You will also find
+will find out what they are and how to use them. You will also find
information about functionality missing from MySQL Server, and how to work
around some differences.
Our goal is to not, without a very good reason, restrict MySQL Server usability
for any usage. Even if we don't have the resources to do development
for every possible use, we are always willing to help and offer
-suggestions to people that is trying to use MySQL Server in new territories.
+suggestions to people who are trying to use MySQL Server in new territories.
-One of our main goals with the product is to continue to work towards
+One of our main goals with the product is to continue to work toward
ANSI 99 compliancy, but without sacrificing speed or reliability.
We are not afraid to add extensions to SQL or support for non-SQL
-features if this greatly increase the usability of MySQL Server for a big
+features if this greatly increases the usability of MySQL Server for a big
part of our users. (The new @code{HANDLER} interface in MySQL Server 4.0
-is an example of this strategy. @xref{HANDLER}.)
+is an example of this strategy. @xref{HANDLER, , @code{HANDLER}}.)
-We will continue to support transactional and not transactional
-databases to satisfy both heavy web/logging usage and mission critical
+We will continue to support transactional and non-transactional
+databases to satisfy both heavy web/logging usage and mission-critical
24/7 usage.
-MySQL Server was designed from the start to work with medium large databases
-(10-100 million rows / about 100 MB per table) on small computer
-systems. We will continue to extend MySQL Server to both work even better
-with terabyte size databases, but we are also doing work to make it possible
-to compile a reduced MySQL version that is more suitable for hand held
+MySQL Server was designed from the start to work with medium size databases
+(10-100 million rows, or about 100 MB per table) on small computer
+systems. We will continue to extend MySQL Server to work even better
+with terabyte-size databases, as well as to make it possible
+to compile a reduced MySQL version that is more suitable for hand-held
devices and embedded usage. The compact design of the MySQL server makes both
of these directions possible without any conflicts in the source tree.
-We are currently not targeting real time support or clustered databases
+We are currently not targeting realtime support or clustered databases
(even if you can already do a lot of things with our replication
services).
@@ -2566,7 +2546,7 @@ database, but will instead add the XML support our users request from
us on the client side. We think it's better to keep the main server
code as ``lean and clean'' as possible and instead develop libraries to
deal with the complexity on the client side. This is part of the strategy
-mentioned above of not sacrificing speed or reliability in the
+mentioned previously of not sacrificing speed or reliability in the
server.
@menu
@@ -2581,9 +2561,9 @@ server.
@node Standards, ANSI mode, Compatibility, Compatibility
@subsection What Standards Does MySQL Follow?
-Entry level SQL92. ODBC levels 0-3.51.
+Entry-level SQL92. ODBC levels 0-3.51.
-We are aiming towards supporting the full ANSI SQL99 standard,
+We are aiming toward supporting the full ANSI SQL99 standard,
but without concessions to speed and quality of the code.
@@ -2609,7 +2589,7 @@ This forces all function names to be treated as reserved words.
@samp{`} quote character) and not a string quote character.
@item
-@code{REAL} will be a synonym for @code{FLOAT} instead of a synonym of
+@code{REAL} will be a synonym for @code{FLOAT} instead of a synonym for
@code{DOUBLE}.
@item
@@ -2638,18 +2618,18 @@ statement, but other SQL servers will ignore the extensions. For example:
SELECT /*! STRAIGHT_JOIN */ col_name FROM table1,table2 WHERE ...
@end example
-If you add a version number after the @code{'!'}, the syntax will only be
-executed if the MySQL version is equal to or newer than the used
+If you add a version number after the @code{'!'}, the syntax will be
+executed only if the MySQL version is equal to or newer than the used
version number:
@example
CREATE /*!32302 TEMPORARY */ TABLE (a int);
@end example
-The above means that if you have Version 3.23.02 or newer, then MySQL
+This means that if you have Version 3.23.02 or newer, MySQL
Server will use the @code{TEMPORARY} keyword.
-MySQL extensions are listed below:
+The following is a list of MySQL extensions:
@itemize @bullet
@item
@@ -2661,7 +2641,7 @@ The field attributes @code{AUTO_INCREMENT}, @code{BINARY}, @code{NULL},
@code{UNSIGNED}, and @code{ZEROFILL}.
@item
-All string comparisons are case insensitive by default, with sort
+All string comparisons are case-insensitive by default, with sort
ordering determined by the current character set (ISO-8859-1 Latin1 by
default). If you don't like this, you should declare your columns with
the @code{BINARY} attribute or use the @code{BINARY} cast, which causes
@@ -2683,7 +2663,7 @@ This has a few implications:
@itemize @minus
@item
-Database names and table names are case sensitive in MySQL Server on
+Database names and table names are case-sensitive in MySQL Server on
operating systems that have case-sensitive filenames (like most Unix
systems). @xref{Name case sensitivity}.
@@ -2692,7 +2672,7 @@ Database, table, index, column, or alias names may begin with a digit
(but may not consist solely of digits).
@item
-You can use standard system commands to backup, rename, move, delete, and copy
+You can use standard system commands to back up, rename, move, delete, and copy
tables. For example, to rename a table, rename the @file{.MYD}, @file{.MYI},
and @file{.frm} files to which the table corresponds.
@end itemize
@@ -2726,7 +2706,7 @@ statement. @xref{CREATE TABLE, , @code{CREATE TABLE}}.
Use of @code{TEMPORARY} or @code{IF NOT EXISTS} with @code{CREATE TABLE}.
@item
-Use of @code{COUNT(DISTINCT list)} where 'list' is more than one element.
+Use of @code{COUNT(DISTINCT list)} where @code{list} is more than one element.
@item
Use of @code{CHANGE col_name}, @code{DROP col_name}, or @code{DROP
@@ -2919,7 +2899,7 @@ That is the latest version of the TODO list in this manual. @xref{TODO}.
MySQL Server currently only supports nested queries of the form
@code{INSERT ... SELECT ...} and @code{REPLACE ... SELECT ...}.
-You can however use the function @code{IN()} in other contexts.
+You can, however, use the function @code{IN()} in other contexts.
Sub-selects are scheduled for implementation in Version 4.x.
Meanwhile, you can often rewrite the query without a sub-select:
@@ -2928,7 +2908,7 @@ Meanwhile, you can often rewrite the query without a sub-select:
SELECT * FROM table1 WHERE id IN (SELECT id FROM table2);
@end example
-This can be re-written as:
+This can be rewritten as:
@example
SELECT table1.* FROM table1,table2 WHERE table1.id=table2.id;
@@ -2949,7 +2929,7 @@ SELECT table1.* FROM table1 LEFT JOIN table2 ON table1.id=table2.id
@end example
For more complicated subqueries you can often create temporary tables
-to hold the subquery. In some cases, however this option will not
+to hold the subquery. In some cases, however, this option will not
work. The most frequently encountered of these cases arises with
@code{DELETE} statements, for which standard SQL does not support joins
(except in sub-selects). For this situation there are two options
@@ -2967,7 +2947,7 @@ extension @code{CONCAT()} (in lieu of the standard @code{||} operator).
For example:
@example
-SELECT CONCAT('DELETE FROM tab1 WHERE pkid = ', tab1.pkid, ';')
+SELECT CONCAT('DELETE FROM tab1 WHERE pkid = ', "'", tab1.pkid, "'", ';')
FROM tab1, tab2
WHERE tab1.col1 = tab2.col2;
@end example
@@ -3026,8 +3006,8 @@ However, the non-transactional table types in MySQL Server such as
``@code{Atomic Operations}.'' Atomic operations often offer equal or
even better integrity with much better performance.
With MySQL Server supporting both paradigms, the user is able to decide if
-they need the speed of atomic operations or if they need to use
-transactional features in their applications. This choice can be made
+he needs the speed of atomic operations or if he need to use
+transactional features in his applications. This choice can be made
on a per-table basis.
How does one use the features of MySQL Server to maintain rigorous integrity
@@ -3037,7 +3017,7 @@ and how do these features compare with the transactional paradigm?
@item
In the transactional paradigm, if your applications are written in a
way that is dependent on the calling of @code{ROLLBACK} instead of
-@code{COMMIT} in critical situations, then transactions are more
+@code{COMMIT} in critical situations, transactions are more
convenient. Transactions also ensure that unfinished updates or
corrupting activities are not committed to the database; the server is
given the opportunity to do an automatic rollback and your database is
@@ -3077,7 +3057,7 @@ users and application developers depend on the ease with which they
can code around problems where an abort appears to be, or is necessary.
However, even if you are new to the atomic operations paradigm, or more
familiar with transactions, do consider the speed benefit that
-non-transactional tables can offer, on the order of three to five times
+non-transactional tables can offer on the order of three to five times
the speed of the fastest and most optimally tuned transactional tables.
In situations where integrity is of highest importance, MySQL Server offers
@@ -3085,9 +3065,9 @@ transaction-level or better reliability and integrity even for
non-transactional tables.
If you lock tables with @code{LOCK TABLES}, all updates will stall
until any integrity checks are made. If you only obtain a read lock
-(as opposed to a write lock), then reads and inserts are still allowed
+(as opposed to a write lock), reads and inserts are still allowed
to happen. The new inserted records will not be seen by any of the
-clients that have a @code{READ} lock until they release their read
+clients that have a read lock until they release their read
locks. With @code{INSERT DELAYED} you can queue inserts into a local
queue, until the locks are released, without having the client wait
for the insert to complete. @xref{INSERT DELAYED}.
@@ -3139,16 +3119,16 @@ techniques:
For example, when we are doing updates to some customer information, we
update only the customer data that has changed and test only that none of
-the changed data, or data that depend on the changed data, has changed
+the changed data, or data that depends on the changed data, has changed
compared to the original row. The test for changed data is done with the
@code{WHERE} clause in the @code{UPDATE} statement. If the record wasn't
updated, we give the client a message: "Some of the data you have changed
-have been changed by another user". Then we show the old row versus the new
+has been changed by another user." Then we show the old row versus the new
row in a window, so the user can decide which version of the customer record
he should use.
This gives us something that is similar to column locking but is actually
-even better, because we only update some of the columns, using values that
+even better because we only update some of the columns, using values that
are relative to their current values. This means that typical @code{UPDATE}
statements look something like these:
@@ -3193,10 +3173,10 @@ UPDATE tbl_name SET row_flag=1 WHERE id=ID;
MySQL returns 1 for the number of affected rows if the row was
found and @code{row_flag} wasn't already 1 in the original row.
-You can think of it as MySQL Server changed the above query to:
+You can think of it as though MySQL Server changed the preceding query to:
@example
-UPDATE tbl_name SET row_flag=1 WHERE id=ID and row_flag <> 1;
+UPDATE tbl_name SET row_flag=1 WHERE id=ID AND row_flag <> 1;
@end example
@end itemize
@@ -3209,7 +3189,7 @@ UPDATE tbl_name SET row_flag=1 WHERE id=ID and row_flag <> 1;
@cindex triggers, stored
A stored procedure is a set of SQL commands that can be compiled and stored
-in the server. Once this has been done, clients don't need to keep reissuing
+in the server. Once this has been done, clients don't need to keep re-issuing
the entire query but can refer to the stored procedure. This provides better
performance because the query has to be parsed only once, and less information
needs to be sent between the server and the client. You can also raise the
@@ -3222,8 +3202,8 @@ deletes the corresponding customer from a customer table when all his
transactions are deleted.
The planned update language will be able to handle stored procedures.
-Our aim is to have stored procedures implemented in MySQL Server 4.1.
-We are also looking at triggers.
+Our aim is to have stored procedures implemented in MySQL Server around
+version 4.1. We are also looking at triggers.
@node ANSI diff Foreign Keys, ANSI diff Views, ANSI diff Triggers, Differences from ANSI
@@ -3238,12 +3218,12 @@ you want to get results from multiple tables from a @code{SELECT}
statement, you do this by joining tables:
@example
-SELECT * from table1,table2 where table1.id = table2.id;
+SELECT * FROM table1,table2 WHERE table1.id = table2.id;
@end example
@xref{JOIN, , @code{JOIN}}. @xref{example-Foreign keys}.
-In MySQL Server 3.23.44 and up, @code{InnoDB} tables supports checking of
+In MySQL Server 3.23.44 and up, @code{InnoDB} tables support checking of
foreign key constraints. @xref{InnoDB}. For other table types, MySQL Server
does parse the @code{FOREIGN KEY} syntax in @code{CREATE TABLE}
commands, but without further action being taken.
@@ -3295,8 +3275,8 @@ Disadvantages:
@itemize @bullet
@item
-Mistakes, that are easy to make in designing key relations, can cause
-severe problems, for example, circular rules, or the wrong combination
+Mistakes, which are easy to make in designing key relations, can cause
+severe problems@-for example, circular rules, or the wrong combination
of cascading deletes.
@item
@@ -3307,8 +3287,8 @@ down performance for such an application.
@item
It is not uncommon for a DBA to make such a complex topology of
-relations that it becomes very difficult, and in some cases impossible
-to backup or restore individual tables.
+relations that it becomes very difficult, and in some cases impossible,
+to back up or restore individual tables.
@end itemize
@@ -3317,19 +3297,19 @@ to backup or restore individual tables.
@cindex views
-It is planned to implement views in MySQL Server around Version 4.1.
+It is planned to implement views in MySQL Server around version 4.1.
Views are mostly useful for letting users access a set of relations as one
table (in read-only mode). Many SQL databases don't allow one to update
any rows in a view, but you have to do the updates in the separate tables.
-As MySQL Server is mostly used in applications and on web system where
+As MySQL Server is mostly used in applications and on web systems where
the application writer has full control on the database usage, most of
our users haven't regarded views to be very important.
(At least no one has been interested enough in this to be prepared to
-finance the implementation of views).
+finance the implementation of views.)
-One doesn't need views in MySQL Server to restrict access to columns
+One doesn't need views in MySQL Server to restrict access to columns,
as MySQL Server has a very sophisticated privilege system.
@xref{Privilege system}.
@@ -3345,7 +3325,7 @@ MySQL Server has @samp{#} as the start comment character. You can also use
the C comment style @code{/* this is a comment */} with MySQL Server.
@xref{Comments}.
-MySQL Server Version 3.23.3 and above supports the @samp{--} comment style,
+MySQL Server Version 3.23.3 and above support the @samp{--} comment style,
provided the comment is followed by a space. This is because this
comment style has caused many problems with automatically generated
SQL queries that have used something like the following code, where
@@ -3356,7 +3336,7 @@ we automatically insert the value of the payment for
UPDATE tbl_name SET credit=credit-!payment!
@end example
-Think about what happens if the value of @code{payment} is negative?
+Think about what happens if the value of @code{payment} is negative.
Because @code{1--1} is legal in SQL, the consequences of allowing
comments to start with @samp{--} are terrible.
@@ -3367,8 +3347,8 @@ Another safe feature is that the @code{mysql} command-line client
removes all lines that start with @samp{--}.
-The following information is only relevant if you are running a
-MySQL version earlier than Version 3.23.3:
+The following information is relevant only if you are running a
+MySQL version earlier than 3.23.3:
If you have a SQL program in a text file that contains @samp{--}
comments you should use:
@@ -3421,11 +3401,11 @@ see errors like the following in the MySQL error file:
@item
Don't execute @code{ALTER TABLE} on a @code{BDB} table on which you are
-running not completed multi-statement transactions. (The transaction
-will probably be ignored).
+running multi-statement transactions until all those transactions complete.
+(The transaction will probably be ignored.)
@item
-@code{ANALYZE TABLE}, @code{OPTIMIZE TABLE} and @code{REPAIR TABLE} may
+@code{ANALYZE TABLE}, @code{OPTIMIZE TABLE}, and @code{REPAIR TABLE} may
cause problems on tables for which you are using @code{INSERT DELAYED}.
@item
@@ -3441,7 +3421,7 @@ database if you are not using the @code{-A} option or if you are using
cache.
@item
-Th current replication protocol cannot deal with @code{LOAD DATA INFILE}
+The current replication protocol cannot deal with @code{LOAD DATA INFILE}
and line terminator characters of more than 1 character.
@end itemize
@@ -3451,7 +3431,12 @@ The following problems are known and will be fixed in due time:
@item
When using @code{SET CHARACTER SET}, one can't use translated
-characters in database, table and column names.
+characters in database, table, and column names.
+
+@item
+If you have a @code{DECIMAL} column with a number stored in different
+formats (+01.00, 1.00, 01.00), @code{GROUP BY} may regard each value
+as a different value.
@item
@code{DELETE FROM merge_table} used without a @code{WHERE}
@@ -3466,7 +3451,7 @@ likely to fix this. @xref{MIT-pthreads}.
@item
@code{BLOB} values can't ``reliably'' be used in @code{GROUP BY} or
@code{ORDER BY} or @code{DISTINCT}. Only the first @code{max_sort_length}
-bytes (default 1024) are used when comparing @code{BLOB}bs in these cases.
+bytes (default 1024) are used when comparing @code{BLOB}s in these cases.
This can be changed with the @code{-O max_sort_length} option to
@code{mysqld}. A workaround for most cases is to use a substring:
@code{SELECT DISTINCT LEFT(blob,2048) FROM tbl_name}.
@@ -3477,8 +3462,8 @@ normally 64 bits long). It depends on the function which precision one
gets. The general rule is that bit functions are done with @code{BIGINT}
precision, @code{IF}, and @code{ELT()} with @code{BIGINT} or @code{DOUBLE}
precision and the rest with @code{DOUBLE} precision. One should try to
-avoid using bigger unsigned long long values than 63 bits
-(9223372036854775807) for anything else than bit fields!
+avoid using unsigned long long values if they resolve to be bigger than
+63 bits (9223372036854775807) for anything else than bit fields!
MySQL Server 4.0 has better @code{BIGINT} handling than 3.23.
@item
@@ -3491,7 +3476,7 @@ that in MySQL Server, @code{VARCHAR} columns are treated the same way.
You can only have up to 255 @code{ENUM} and @code{SET} columns in one table.
@item
-@code{safe_mysqld} re-directs all messages from @code{mysqld} to the
+@code{safe_mysqld} redirects all messages from @code{mysqld} to the
@code{mysqld} log. One problem with this is that if you execute
@code{mysqladmin refresh} to close and reopen the log,
@code{stdout} and @code{stderr} are still redirected to the old log.
@@ -3513,10 +3498,10 @@ This will update @code{KEY} with @code{2} instead of with @code{1}.
@item
You can't use temporary tables more than once in the same query.
-For example, the following doesn't work.
+For example, the following doesn't work:
@example
-select * from temporary_table, temporary_table as t2;
+mysql> SELECT * FROM temporary_table, temporary_table AS t2;
@end example
@item
@@ -3527,9 +3512,9 @@ select * from temporary_table, temporary_table as t2;
The optimiser may handle @code{DISTINCT} differently if you are using
'hidden' columns in a join or not. In a join, hidden columns are
counted as part of the result (even if they are not shown) while in
-normal queries hidden columns doesn't participate in the @code{DISTINCT}
+normal queries hidden columns don't participate in the @code{DISTINCT}
comparison. We will probably change this in the future to never compare
-the hidden columns when executing @code{DISTINCT}
+the hidden columns when executing @code{DISTINCT}.
An example of this is:
@@ -3549,17 +3534,17 @@ SELECT DISTINCT band_downloads.mp3id
@end example
In the second case you may in MySQL Server 3.23.x get two identical rows
-in the result set (because the hidden 'id' column may differ).
+in the result set (because the hidden @code{id} column may differ).
-Note that the this only happens for queries where you don't have the
-ORDER BY columns in the result, something that is you are not allowed
+Note that this happens only for queries where you don't have the
+ORDER BY columns in the result, something that you are not allowed
to do in ANSI SQL.
@item
Because MySQL Server allows you to work with table types that don't
support transactions, and thus can't @code{rollback} data, some things
behave a little differently in MySQL Server than in other SQL servers.
-This is just to ensure that MySQL Server never need to do a rollback
+This is just to ensure that MySQL Server never needs to do a rollback
for a SQL command. This may be a little awkward at times as column
values must be checked in the application, but this will actually give
you a nice speed increase as it allows MySQL Server to do some
@@ -3582,20 +3567,20 @@ numerical column, MySQL Server will store 0 into it.
If you try to store @code{NULL} into a column that doesn't take
@code{NULL} values, MySQL Server will store 0 or @code{''} (empty
string) in it instead. (This behavior can, however, be changed with the
--DDONT_USE_DEFAULT_FIELDS compile option).
+-DDONT_USE_DEFAULT_FIELDS compile option.)
@item
MySQL allows you to store some wrong date values into
-@code{DATE} and @code{DATETIME} columns. (Like 2000-02-31 or 2000-02-00).
+@code{DATE} and @code{DATETIME} columns (like 2000-02-31 or 2000-02-00).
If the date is totally wrong, MySQL Server will store the special
0000-00-00 date value in the column.
@item
If you set an @code{ENUM} column to an unsupported value, it will be set to
-the error value 'empty string', with numeric value 0.
+the error value @code{empty string}, with numeric value 0.
@item
-If you set an @code{SET} column to an unsupported value, the value will
+If you set a @code{SET} column to an unsupported value, the value will
be ignored.
@end itemize
@@ -3609,20 +3594,20 @@ Creation of a table of type @code{MERGE} doesn't check if the underlying
tables are of compatible types.
@item
-MySQL Server can't yet handle @code{NaN}, @code{-Inf} and @code{Inf}
+MySQL Server can't yet handle @code{NaN}, @code{-Inf}, and @code{Inf}
values in double. Using these will cause problems when trying to export
and import data. We should as an intermediate solution change @code{NaN} to
@code{NULL} (if possible) and @code{-Inf} and @code{Inf} to the
-Minimum respective maximum possible @code{double} value.
+minimum respective maximum possible @code{double} value.
@item
@code{LIMIT} on negative numbers are treated as big positive numbers.
@item
-If you use @code{ALTER TABLE} to first add an @code{UNIQUE} index to a
+If you use @code{ALTER TABLE} to first add a @code{UNIQUE} index to a
table used in a @code{MERGE} table and then use @code{ALTER TABLE} to
add a normal index on the @code{MERGE} table, the key order will be
-different for the tables if there was an old not-unique key in the
+different for the tables if there was an old key that was not unique in the
table. This is because @code{ALTER TABLE} puts @code{UNIQUE} keys before
normal keys to be able to detect duplicate keys as early as possible.
@end itemize
@@ -3642,10 +3627,10 @@ In the following case you can get a core dump:
Delayed insert handler has pending inserts to a table.
@item
-@code{LOCK table} with @code{WRITE}
+@code{LOCK table} with @code{WRITE}.
@item
-@code{FLUSH TABLES}
+@code{FLUSH TABLES}.
@end itemize
@item
@@ -3663,7 +3648,7 @@ A workaround is to use:
mysql> UPDATE tbl_name SET KEY=KEY+1 WHERE KEY+0 > 100;
@end example
-This will work because MySQL Server will not use index on expressions in
+This will work because MySQL Server will not use an index on expressions in
the @code{WHERE} clause.
@item
@@ -3686,7 +3671,7 @@ For platform-specific bugs, see the sections about compiling and porting.
* TODO MySQL 4.1:: Things That Should be in 4.1
* TODO future:: Things That Must be Done in the Near Future
* TODO sometime:: Things That Have to be Done Sometime
-* TODO unplanned:: Things we don't Have any Plans to do
+* TODO unplanned:: Things We Have No Plans to do
@end menu
This appendix lists the features that we plan to implement in MySQL Server.
@@ -3697,13 +3682,13 @@ tell us what you want to have done more quickly. @xref{Licensing and Support}.
The plan is that we in the future will support the full ANSI SQL99
standard, but with a lot of useful extensions. The challenge is to do
-this without sacrifying the speed or compromise the code.
+this without sacrifying the speed or compromising the code.
@node TODO MySQL 4.0, TODO MySQL 4.1, TODO, TODO
@subsection Things That Should be in 4.0
-We are now in the final stages one the development of the MySQL Server
+We are now in the final stages of the development of the MySQL Server
4.0. server. The target is to quickly implement the rest of the
following features and then shift development to MySQL Server
4.1. @xref{MySQL 4.0 In A Nutshell}.
@@ -3712,7 +3697,7 @@ The news section for 4.0 includes a list of the features we have already
implemented in the 4.0 tree. @xref{News-4.0.x}.
This section lists features not yet implemented in the current version
-of MySQL Server 4.0, which will however be implemented in later versions
+of MySQL Server 4.0, which will, however, be implemented in later versions
of MySQL 4.0. This being very volatile information, please consider this
list valid only if you are reading it from the MySQL web site
(@uref{http://www.mysql.com/}).
@@ -3721,20 +3706,20 @@ list valid only if you are reading it from the MySQL web site
@item
Allow users to change startup options without taking down the server.
@item
-Better command line argument handling.
+Better command-line argument handling.
@item
New key cache, which will give better performance when using many threads.
@item
-New table definition file format (@file{.frm} files) This will enable us
+New table definition file format (@file{.frm} files). This will enable us
to not run out of bits when adding more table options. One will still
be able to use the old @file{.frm} file format with 4.0. All newly created
tables will, however, use the new format.
The new file format will enable us to add new column types, more options
-for keys and possible to store and retrieve @code{FOREIGN KEY} definitions.
+for keys, and possibly to store and retrieve @code{FOREIGN KEY} definitions.
@item
@code{SHOW COLUMNS FROM table_name} (used by @code{mysql} client to allow
-expansions of column names) should not open the table, but only the
+expansions of column names) should not open the table, only the
definition file. This will require less memory and be much faster.
@item
@code{SET SQL_DEFAULT_TABLE_TYPE=[MyISAM | INNODB | BDB | HEAP]}.
@@ -3744,7 +3729,7 @@ definition file. This will require less memory and be much faster.
@node TODO MySQL 4.1, TODO future, TODO MySQL 4.0, TODO
@subsection Things That Should be in 4.1
-The following features is the ones we plan that should be in MySQL 4.1.
+The following features are planned for inclusion into MySQL 4.1.
Note that because we have many developers that are working on different
projects, there will also be many additional features. There is also a
small chance that some of these features will be added to MySQL 4.0.
@@ -3757,7 +3742,7 @@ Subqueries.
@item
Foreign keys, including cascading delete.
@item
-Fail safe replication.
+Fail-safe replication.
@item
Replication should work with @code{RAND()} and user variables @code{@@var}.
@item
@@ -3765,7 +3750,7 @@ Online backup with very low performance penalty. The online backup will
make it easy to add a new replication slave without taking down the
master.
@item
-Derived tables.
+Derived tables:
@example
SELECT a.col1, b.col2
FROM (SELECT MAX(col1) AS col1 FROM root_table) a,
@@ -3782,19 +3767,19 @@ the @file{.MYD} file.
@item
When using @code{SET CHARACTER SET} we should translate the whole query
at once and not only strings. This will enable users to use the translated
-characters in database, table and column names.
+characters in database, table, and column names.
@item
Add @code{record_in_range()} method to @code{MERGE} tables to be
-able to choose the right index when there is many to choose from. We should
+able to choose the right index when there are many to choose from. We should
also extend the info interface to get the key distribution for each index,
-if @code{analyze} is run on all sub tables.
+if @code{analyze} is run on all subtables.
@item
@code{RENAME TABLE} on a table used in an active @code{MERGE} table may
corrupt the table.
@item
-A faster, smaller embedded MySQL library. (Compatible with the old one)
+A faster, smaller embedded MySQL library. (Compatible with the old one.)
@item
-Stable openssl support. (MySQL 4.0 supports rudimentary, not 100 % tested
+Stable openssl support. (MySQL 4.0 supports rudimentary, not 100% tested,
support for openssl).
@item
Add support for sorting on @code{UNICODE}.
@@ -3804,7 +3789,7 @@ Character set casts and syntax for handling multiple character sets.
Help for all commands from the client.
@item
New faster client/server protocol which will support prepared statements,
-bound parameters and bound result columns, binary transfer of data,
+bound parameters, and bound result columns, binary transfer of data,
warnings...
@item
Add database and real table name (in case of alias) to the MYSQL_FIELD
@@ -3825,14 +3810,14 @@ we do with the @code{RENAME} command.
Drop the old database.
@end itemize
@item
-Add true @code{VARCHAR} support (There is already support for this in
+Add true @code{VARCHAR} support (there is already support for this in
@code{MyISAM}).
@item
Optimise @code{BIT} type to take 1 bit (now @code{BIT} takes 1 char).
@item
New internal file interface change. This will make all file handling much
-more general and make it easier to add extensions like RAID nicely.
-(The current implementation is a hack).
+more general and make it easier to add extensions like RAID.
+(the current implementation is a hack.)
@item
Better in-memory (@code{HEAP}) tables:
@itemize @bullet
@@ -3851,7 +3836,7 @@ Faster row handling (less copying)
@itemize @bullet
@item
-Atomic multi-table updates, eg @code{update items,month set
+Atomic multi-table updates@-e.g., @code{update items,month set
items.price=month.price where items.id=month.id;};
@item
Don't allow more than a defined number of threads to run MyISAM recover
@@ -3867,7 +3852,7 @@ Multiple result sets.
Make it possible to specify @code{long_query_time} with a granularity
in microseconds.
@item
-Add a configurable prompt to the @code{mysql} command line client, with
+Add a configurable prompt to the @code{mysql} command-line client, with
options like database in use, time and date...
@item
Link the @code{myisampack} code into the server.
@@ -3885,11 +3870,11 @@ If you perform an @code{ALTER TABLE} on a table that is symlinked to another
disk, create temporary tables on this disk.
@item
Implement a @code{DATE/DATETIME} type that handles time zone information
-properly, so that dealing with dates in different time zones is easier.
+properly so that dealing with dates in different time zones is easier.
@item
-FreeBSD and MIT-pthreads; Do sleeping threads take CPU?
+FreeBSD and MIT-pthreads; do sleeping threads take CPU time?
@item
-Check if locked threads take any CPU.
+Check if locked threads take any CPU time.
@item
Fix configure so that one can compile all libraries (like @code{MyISAM})
without threads.
@@ -3902,9 +3887,9 @@ Allow join on key parts (optimisation issue).
@code{INSERT SQL_CONCURRENT} and @code{mysqld --concurrent-insert} to do
a concurrent insert at the end of the file if the file is read-locked.
@item
-Server side cursors.
+Server-side cursors.
@item
-Check if @code{lockd} works with modern Linux kernels; If not, we have
+Check if @code{lockd} works with modern Linux kernels; if not, we have
to fix @code{lockd}! To test this, start @code{mysqld} with
@code{--enable-locking} and run the different fork* test suits. They shouldn't
give any errors if @code{lockd} works.
@@ -3912,11 +3897,11 @@ give any errors if @code{lockd} works.
Allow SQL variables in @code{LIMIT}, like in @code{LIMIT @@a,@@b}.
@item
Allow update of variables in @code{UPDATE} statements. For example:
-@code{UPDATE TABLE foo SET @@a=a+b,a=@@a, b=@@a+c}
+@code{UPDATE TABLE foo SET @@a=a+b,a=@@a, b=@@a+c}.
@item
Change when user variables are updated so that one can use them with
@code{GROUP BY}, as in the following example:
-@code{SELECT id, @@a:=count(*), sum(sum_col)/@@a FROM table_name GROUP BY id}.
+@code{SELECT id, @@a:=COUNT(*), SUM(sum_col)/@@a FROM table_name GROUP BY id}.
@item
Don't add automatic @code{DEFAULT} values to columns. Give an error when using
an @code{INSERT} that doesn't contain a column that doesn't have a
@@ -3938,74 +3923,74 @@ entries matching that primary key are updated from the remainder of the
columns. However, columns @strong{missing} from the incoming data feed are not
touched.
@item
-For tables tables with primary keys that are missing some part of the key
+For tables with primary keys that are missing some part of the key
in the incoming data stream, or that have no primary key, the feed is
-treated as a @code{LOAD DATA INFILE ... REPLACE INTO} is now.
+treated as a @code{LOAD DATA INFILE ... REPLACE INTO} now.
@end itemize
@item
Make @code{LOAD DATA INFILE} understand syntax like:
@example
LOAD DATA INFILE 'file_name.txt' INTO TABLE tbl_name
TEXT_FIELDS (text_field1, text_field2, text_field3)
- SET table_field1=concatenate(text_field1, text_field2),
+ SET table_field1=CONCAT(text_field1, text_field2),
table_field3=23
IGNORE text_field3
@end example
This can be used to skip over extra columns in the text file,
-or update columns based on expressions of the read data...
+or update columns based on expressions of the read data.
@item
-@code{LOAD DATA INFILE 'file_name' INTO TABLE 'table_name' ERRORS TO err_table_name}
+@code{LOAD DATA INFILE 'file_name' INTO TABLE 'table_name' ERRORS TO err_table_name}.
This would cause any errors and warnings to be logged into the
@code{err_table_name} table. That table would have a structure like:
@example
-line_number - line number in data file
+line_number - line number in datafile
error_message - the error/warning message
and maybe
-data_line - the line from the data file
+data_line - the line from the datafile
@end example
@item
Automatic output from @code{mysql} to Netscape.
@item
-@code{LOCK DATABASES}. (with various options)
+@code{LOCK DATABASES} (with various options.)
@item
@code{DECIMAL} and @code{NUMERIC} types can't read exponential numbers;
@code{Field_decimal::store(const char *from,uint len)} must be recoded
to fix this.
@item
Functions:
-ADD_TO_SET(value,set) and REMOVE_FROM_SET(value,set)
+ADD_TO_SET(value,set) and REMOVE_FROM_SET(value,set).
@item
Add use of @code{t1 JOIN t2 ON ...} and @code{t1 JOIN t2 USING ...}
Currently, you can only use this syntax with @code{LEFT JOIN}.
@item
Many more variables for @code{show status}. Records reads and
-updated. Selects on 1 table and selects with joins. Mean number of
+updates. Selects on 1 table and selects with joins. Mean number of
tables in select. Number of @code{ORDER BY} and @code{GROUP BY} queries.
@item
If you abort @code{mysql} in the middle of a query, you should open
another connection and kill the old running query.
Alternatively, an attempt should be made to detect this in the server.
@item
-Add a handler interface for table information so you can use it as a system
+Add a handler interface for table information so that you can use it as a system
table. This would be a bit slow if you requested information about all tables,
but very flexible. @code{SHOW INFO FROM tbl_name} for basic table information
should be implemented.
@item
@code{NATURAL JOIN}.
@item
-Allow @code{select a from crash_me left join crash_me2 using (a)}; In this
+Allow @code{SELECT a FROM crash_me LEFT JOIN crash_me2 USING (a)}; in this
case @code{a} is assumed to come from the @code{crash_me} table.
@item
-Fix that @code{ON} and @code{USING} works with the @code{JOIN}
+Fix so that @code{ON} and @code{USING} works with the @code{JOIN}
join type.
@item
-Oracle like @code{CONNECT BY PRIOR ...} to search hierarchy structures.
+Oracle-like @code{CONNECT BY PRIOR ...} to search hierarchy structures.
@item
-@code{mysqladmin copy database new-database}; Requires @code{COPY}
-command to be added to @code{mysqld}
+@code{mysqladmin copy database new-database}; requires @code{COPY}
+command to be added to @code{mysqld}.
@item
-Processlist should show number of queries/thread.
+Processlist should show number of queries/threads.
@item
@code{SHOW HOSTS} for printing information about the hostname cache.
@item
@@ -4018,45 +4003,45 @@ Add all missing ANSI92 and ODBC 3.0 types.
@item
Change table names from empty strings to @code{NULL} for calculated columns.
@item
-Don't use 'Item_copy_string' on numerical values to avoid
+Don't use @code{Item_copy_string} on numerical values to avoid
number->string->number conversion in case of:
@code{SELECT COUNT(*)*(id+0) FROM table_name GROUP BY id}
@item
Make it possible to use the new GNU regexp library instead of the current
-one (The GNU library should be much faster than the old one).
+one (the GNU library should be much faster than the old one).
@item
-Change that @code{ALTER TABLE} doesn't abort clients that executes
-@code{INSERT DELAYED}.
+Change so that @code{ALTER TABLE} doesn't abort clients
+that execute @code{INSERT DELAYED}.
@item
-Fix that when columns referenced in an @code{UPDATE} clause contains the old
-values before the update started.
+Fix so that when columns are referenced in an @code{UPDATE} clause,
+they contain the old values from before the update started.
@item
Add simulation of @code{pread()}/@code{pwrite()} on Windows to enable
concurrent inserts.
@item
-A logfile analyser that could parsed out information about which tables
+A logfile analyser that could parse out information about which tables
are hit most often, how often multi-table joins are executed, etc. It
should help users identify areas or table design that could be optimised
to execute much more efficient queries.
@item
-Add @code{SUM(DISTINCT)}
+Add @code{SUM(DISTINCT)}.
@item
-Add @code{ANY()},@code{EVERY()} and @code{SOME()} group functions. In
-ANSI SQL these only works on boolean columns, but we can extend these to
+Add @code{ANY()}, @code{EVERY()}, and @code{SOME()} group functions. In
+ANSI SQL these work only on boolean columns, but we can extend these to
work on any columns/expressions by applying: value == 0 -> FALSE and
value <> 0 -> TRUE.
@item
-Fix that the type for @code{MAX(column)} is the same as the column type.
+Fix that the type for @code{MAX(column)} is the same as the column type:
@example
-create table t1 (a DATE);
-insert into t1 values (now());
-create table t2 select MAX(a) from t1;
-show columns from t2;
+mysql> CREATE TABLE t1 (a DATE);
+mysql> INSERT INTO t1 VALUES (NOW());
+mysql> CREATE TABLE t2 SELECT MAX(a) FROM t1;
+mysql> SHOW COLUMNS FROM t2;
@end example
@item
Come up with a nice syntax for a statement that will @code{UPDATE} the row
-if it exists and @code{INSERT} a new row if the row didn't exist.
-(Like @code{REPLACE} works with @code{INSERT} / @code{DELETE})
+if it exists and @code{INSERT} a new row if the row didn't exist
+(like @code{REPLACE} works with @code{INSERT} / @code{DELETE}).
@end itemize
@@ -4065,15 +4050,15 @@ if it exists and @code{INSERT} a new row if the row didn't exist.
@itemize @bullet
@item
-Implement function: @code{get_changed_tables(timeout,table1,table2,...)}
+Implement function: @code{get_changed_tables(timeout,table1,table2,...)}.
@item
Change reading through tables to use memmap when possible. Now only
compressed tables use memmap.
@item
-Add a new privilege @strong{'Show_priv'} for @code{SHOW} commands.
+Add a new privilege @code{Show_priv} for @code{SHOW} commands.
@item
Make the automatic timestamp code nicer. Add timestamps to the update
-log with @code{SET TIMESTAMP=#;}
+log with @code{SET TIMESTAMP=#;}.
@item
Use read/write mutex in some places to get more speed.
@item
@@ -4082,7 +4067,7 @@ language first.
@item
Simple views (first on one table, later on any expression).
@item
-Automatically close some tables if a table, temporary table or temporary files
+Automatically close some tables if a table, temporary table, or temporary files
gets error 23 (not enough open files).
@item
When one finds a field=#, change all occurrences of field to #. Now this
@@ -4101,10 +4086,10 @@ better error messages (5 days).
Change the parser to use only one rule per different number of arguments
in function.
@item
-Use of full calculation names in the order part. (For ACCESS97)
+Use of full calculation names in the order part (for ACCESS97).
@item
-@code{MINUS}, @code{INTERSECT} and @code{FULL OUTER JOIN}.
-(Currently @code{UNION} (in 4.0) and @code{LEFT OUTER JOIN} are supported)
+@code{MINUS}, @code{INTERSECT}, and @code{FULL OUTER JOIN}.
+(Currently @code{UNION} [in 4.0] and @code{LEFT OUTER JOIN} are supported.)
@item
@code{SQL_OPTION MAX_SELECT_TIME=#} to put a time limit on a query.
@item
@@ -4139,7 +4124,7 @@ Use @code{NULL} instead.
@item
Add full support for @code{JOIN} with parentheses.
@item
-As an alternative for one thread / connection manage a pool of threads
+As an alternative for one thread/connection manage a pool of threads
to handle the queries.
@item
Allow one to get more than one lock with @code{GET_LOCK}. When doing this,
@@ -4150,11 +4135,11 @@ Time is given according to amount of work, not real time.
@node TODO unplanned, , TODO sometime, TODO
-@subsection Things we don't Have any Plans to do
+@subsection Things We Have No Plans to do
@itemize @bullet
@item
-Nothing; We aim towards full ANSI 92 / ANSI 99 compliancy.
+Nothing; we aim toward full ANSI 92/ANSI 99 compliancy.
@end itemize
@@ -4167,12 +4152,12 @@ Nothing; We aim towards full ANSI 92 / ANSI 99 compliancy.
Our users have successfully run their own benchmarks against a number
of @code{Open Source} and traditional database servers.
We are aware of tests against @code{Oracle} server, @code{DB/2} server,
-@code{Microsoft SQL Server} and other commercial products.
+@code{Microsoft SQL Server}, and other commercial products.
Due to legal reasons we are restricted from publishing some of those
benchmarks in our reference manual.
This section includes a comparison with @code{mSQL} for historical
-reasons and with @code{PostgreSQL} as it is also an Open Source
+reasons and with @code{PostgreSQL} as it is also an @code{Open Source}
database. If you have benchmark results that we can publish, please
contact us at @email{benchmarks@@mysql.com}.
@@ -4232,7 +4217,7 @@ Retrieving large results (MySQL Server has a better, faster, and safer
protocol).
@item
-Tables with variable-length strings, because MySQL Server has more efficient
+Tables with variable-length strings because MySQL Server has more efficient
handling and can have indexes on @code{VARCHAR} columns.
@item
@@ -4261,7 +4246,7 @@ next can be served, while all the others wait again, etc.
Joins.
@code{mSQL} can become pathologically slow if you change the order of
tables in a @code{SELECT}. In the benchmark suite, a time more than
-15000 times slower than MySQL Server was seen. This is due to @code{mSQL}'s
+15,000 times slower than MySQL Server was seen. This is due to @code{mSQL}'s
lack of a join optimiser to order tables in the optimal order.
However, if you put the tables in exactly the right order in
@code{mSQL}2 and the @code{WHERE} is simple and uses index columns,
@@ -4303,7 +4288,7 @@ mysql> UPDATE SET x=x*10+y WHERE x<20;
MySQL Server has column aliasing.
@item Qualifying column names.
-In MySQ ServerL, if a column name is unique among the tables used in a
+In MySQL Server, if a column name is unique among the tables used in a
query, you do not have to use the full qualifier.
@item @code{SELECT} with functions.
@@ -4314,10 +4299,10 @@ MySQL Server has many functions (too many to list here; see @ref{Functions}).
@item Disk Space Efficiency
That is, how small can you make your tables?
-MySQ ServerL has very precise types, so you can create tables that take
+MySQL Server has very precise types, so you can create tables that take
very little space. An example of a useful MySQL datatype is the
-@code{MEDIUMINT} that is 3 bytes long. If you have 100,000,000
-records, saving even one byte per record is very important.
+@code{MEDIUMINT} that is 3 bytes long. If you have 100 million
+records, saving even 1 byte per record is very important.
@code{mSQL2} has a more limited set of column types, so it is
more difficult to get small tables.
@@ -4344,28 +4329,28 @@ MySQL Server currently has a lot of different JDBC drivers:
@itemize @bullet
@item
-The mm driver: A type 4 JDBC driver by Mark Matthews
+The mm driver: a type 4 JDBC driver by Mark Matthews
@email{mmatthew@@ecn.purdue.edu}. This is released under the LGPL.
@item
-The Resin driver. This is a commercial JDBC driver released under open
+The Resin driver: this is a commercial JDBC driver released under open
source. @uref{http://www.caucho.com/projects/jdbc-mysql/index.xtp}
@item
-The gwe driver: A Java interface by GWE technologies (not supported anymore).
+The gwe driver: a Java interface by GWE technologies (not supported anymore).
@item
-The jms driver: An improved gwe driver by Xiaokun Kelvin ZHU
+The jms driver: an improved gwe driver by Xiaokun Kelvin ZHU
@email{X.Zhu@@brad.ac.uk} (not supported anymore).
@item
-The twz driver: A type 4 JDBC driver by Terrence W. Zellers
+The twz driver: a type 4 JDBC driver by Terrence W. Zellers
@email{zellert@@voicenet.com}. This is commercial but is free for private
and educational use (not supported anymore).
@end itemize
The recommended driver is the mm driver. The Resin driver may also be
-good (at least the benchmarks looks good), but we haven't received that
+good (at least the benchmarks look good), but we haven't received that
much information about this yet.
We know that @code{mSQL} has a JDBC driver, but we have too little
@@ -4385,7 +4370,7 @@ most rapidly.
Both @code{mSQL} and MySQL Server have many interesting third-party
tools. Because it is very easy to port upward (from @code{mSQL} to
MySQL Server), almost all the interesting applications that are available for
-@code{mSQL} are also available for MySQ ServerL.
+@code{mSQL} are also available for MySQL Server.
MySQL Server comes with a simple @code{msql2mysql} program that fixes
differences in spelling between @code{mSQL} and MySQL Server for the
@@ -4466,7 +4451,7 @@ There are enough differences that it is impossible
(or at least not easy) to support both.
The most significant ways in which the MySQL protocol differs
-from the @code{mSQL} protocol are listed below:
+from the @code{mSQL} protocol are listed here:
@itemize @bullet
@item
@@ -4522,7 +4507,7 @@ MySQL Server also supports
the following additional type attributes:
@itemize @bullet
@item
-@code{UNSIGNED} option for integer and floating point columns.
+@code{UNSIGNED} option for integer and floating-point columns.
@item
@code{ZEROFILL} option for integer columns.
@item
@@ -4533,8 +4518,8 @@ the following additional type attributes:
@code{DEFAULT} value for all columns.
@end itemize
@item mSQL2
-@code{mSQL} column types correspond to the MySQL types shown below:
-@multitable @columnfractions .15 .65
+@code{mSQL} column types correspond to the MySQL types shown in the following table:
+@multitable @columnfractions .15 .70
@item @code{mSQL} @strong{type} @tab @strong{Corresponding MySQL type}
@item @code{CHAR(len)} @tab @code{CHAR(len)}
@item @code{TEXT(len)} @tab @code{TEXT(len)}. @code{len} is the maximal length.
@@ -4634,7 +4619,7 @@ sorting in ASCII order.
@item MySQL Server
@code{LIKE} is a case-insensitive or case-sensitive operator, depending on
the columns involved. If possible, MySQL uses indexes if the
-@code{LIKE} argument doesn't start with a wild-card character.
+@code{LIKE} argument doesn't start with a wildcard character.
@item mSQL
Use @code{CLIKE}.
@end table
@@ -4657,7 +4642,7 @@ Retains trailing space.
@item MySQL Server
MySQL correctly prioritises everything (@code{AND} is evaluated
before @code{OR}). To get @code{mSQL} behavior in MySQL Server, use
-parentheses (as shown in an example below).
+parentheses (as shown in an example later in this section).
@item mSQL
Evaluates everything from left to right. This means that some logical
calculations with more than three arguments cannot be expressed in any
@@ -4694,18 +4679,18 @@ users.
When reading the following, please note that both products are continually
evolving. We at MySQL AB and the PostgreSQL developers are both working
-on making our respective database as good as possible, so we are both a
+on making our respective databases as good as possible, so we are both a
serious alternative to any commercial database.
The following comparison is made by us at MySQL AB. We have tried to be
-as accurate and fair as possible, but because while we know MySQL Server thorougly
+as accurate and fair as possible, but although we know MySQL Server thoroughly,
we don't have a full knowledge of all PostgreSQL features, so we may have
-got some things wrong. We will however correct these when they come to our
+got some things wrong. We will, however, correct these when they come to our
attention.
We would first like to note that PostgreSQL and MySQL Server are both widely used
products, but with different design goals, even if we are both striving
-towards ANSI SQL compliancy. This means that for some applications MySQL Server
+toward ANSI SQL compliancy. This means that for some applications MySQL Server
is more suited, while for others PostgreSQL is more suited. When choosing
which database to use, you should first check if the database's feature set
satisfies your application. If you need raw speed, MySQL Server is probably your
@@ -4736,7 +4721,7 @@ MySQL server.
We at MySQL AB believe in frequent releases to be able to push out new
features quickly to our users. Because of this we do a new small release
about every three weeks, and a major branch every year. All releases are
-throughly tested with our testing tools on a lot of different platforms.
+thoroughly tested with our testing tools on a lot of different platforms.
PostgreSQL is based on a kernel with lots of contributors. In this setup
it makes sense to prioritise adding a lot of new features, instead of
@@ -4744,18 +4729,18 @@ implementing them optimally, because one can always optimise things
later if there arises a need for this.
Another big difference between MySQL Server and PostgreSQL is that
-nearly all of the code in the MySQL server are coded by developers that
+nearly all of the code in the MySQL server is coded by developers that
are employed by MySQL AB and are still working on the server code. The
-exceptions are the transaction engines, and the regexp library.
+exceptions are the transaction engines and the regexp library.
-This is in sharp contrast to the PostgreSQL code where the majority of
-the code is coded by a big group of people with different backgrounds.
+This is in sharp contrast to the PostgreSQL code, the majority of
+which is coded by a big group of people with different backgrounds.
It was only recently that the PostgreSQL developers announced that their
current developer group had finally had time to take a look at all
the code in the current PostgreSQL release.
-Both of the above development methods have their own merits and drawbacks.
-We here at MySQL AB think of course that our model is better because our
+Both of the aforementioned development methods have their own merits and drawbacks.
+We here at MySQL AB think, of course, that our model is better because our
model gives better code consistency, more optimal and reusable code, and
in our opinion, fewer bugs. Because we are the authors of the MySQL server
code, we are better able to coordinate new features and releases.
@@ -4769,10 +4754,10 @@ code, we are better able to coordinate new features and releases.
On the crash-me page
(@uref{http://www.mysql.com/information/crash-me.php})
you can find a list of those database constructs and limits that
-one can detect automatically with a program. Note however that a lot of
-the numerical limits may be changed with startup options for respective
-database. The above web page is however extremely useful when you want to
-ensure that your applications works with many different databases or
+one can detect automatically with a program. Note, however, that a lot of
+the numerical limits may be changed with startup options for their respective
+databases. This web page is, however, extremely useful when you want to
+ensure that your applications work with many different databases or
when you want to convert your application from one database to another.
MySQL Server offers the following advantages over PostgreSQL:
@@ -4784,11 +4769,11 @@ MySQL Server offers the following advantages over PostgreSQL:
mostly-read-only sites many times.
@item
-MySQL has a much larger user base than PostgreSQL, therefore the code is
-more tested and has historically proven more stable than PostgreSQL.
-MySQL Server is more used in production environments than PostgreSQL,
-mostly thanks to that MySQL AB, formerly TCX DataKonsult AB, has
-provided top quality commercial support for MySQL Server from the day it
+MySQL has a much larger user base than PostgreSQL. Therefore, the code is
+tested more and has historically proven more stable than PostgreSQL.
+MySQL Server is used more in production environments than PostgreSQL,
+mostly thanks to the fact that MySQL AB, formerly TCX DataKonsult AB, has
+provided top-quality commercial support for MySQL Server from the day it
was released, whereas until recently PostgreSQL was unsupported.
@item
@@ -4803,7 +4788,7 @@ MySQL has more APIs to other languages and is supported by more
existing programs than PostgreSQL. @xref{Contrib}.
@item
-MySQL Server works on 24/7 heavy duty systems. In most circumstances
+MySQL Server works on 24/7 heavy-duty systems. In most circumstances
you never have to run any cleanups on MySQL Server. PostgreSQL doesn't
yet support 24/7 systems because you have to run @code{VACUUM}
once in a while to reclaim space from @code{UPDATE} and @code{DELETE}
@@ -4812,8 +4797,8 @@ good performance with PostgreSQL. @code{VACUUM} is also needed after
adding a lot of new rows to a table. On a busy system with lots of changes,
@code{VACUUM} must be run very frequently, in the worst cases even
many times a day. During the @code{VACUUM} run, which may take hours
-if the database is big, the database is from a production standpoint,
-practically dead. Please note: In PostgreSQL version 7.2, basic vacuuming
+if the database is big, the database is, from a production standpoint,
+practically dead. Please note: in PostgreSQL version 7.2, basic vacuuming
no longer locks tables, thus allowing normal user access during the vacuum.
A new @code{VACUUM FULL} command does old-style vacuum by locking the table
and shrinking the on-disk copy of the table.
@@ -4834,14 +4819,14 @@ as a benchmark suite. The test system is actively updated with code to
test each new feature and almost all reproduceable bugs that have come to
our attention. We test MySQL Server with these on a lot of platforms before
every release. These tests are more sophisticated than anything we have
-seen from PostgreSQL, and they ensures that the MySQL Server is kept to a high
+seen from PostgreSQL, and they ensure that the MySQL Server is kept to a high
standard.
@item
There are far more books in print about MySQL Server than about PostgreSQL.
O'Reilly, SAMS, Que, and New Riders are all major publishers with books
-about MySQL. All MySQL features are also documented in the MySQL on-line
-manual, because when a new feature is implemented, the MySQL developers
+about MySQL. All MySQL features are also documented in the MySQL online
+manual because when a new feature is implemented, the MySQL developers
are required to document it before it's included in the source.
@item
@@ -4852,12 +4837,12 @@ MySQL Server has a much more sophisticated @code{ALTER TABLE}.
@item
MySQL Server has support for tables without transactions for applications that
-need all speed they can get. The tables may be memory based, @code{HEAP}
+need all the speed they can get. The tables may be memory-based, @code{HEAP}
tables or disk based @code{MyISAM}. @xref{Table types}.
@item
MySQL Server has support for two different table handlers that support
-transactions, @code{InnoDB} and @code{BerkeleyDB}. Because every
+transactions, @code{InnoDB}, and @code{BerkeleyDB}. Because every
transaction engine performs differently under different conditions, this
gives the application writer more options to find an optimal solution for
his or her setup, if need be per individual table. @xref{Table types}.
@@ -4865,7 +4850,7 @@ his or her setup, if need be per individual table. @xref{Table types}.
@item
@code{MERGE} tables gives you a unique way to instantly make a view over
a set of identical tables and use these as one. This is perfect for
-systems where you have log files that you order for example by month.
+systems where you have log files that you order, for example, by month.
@xref{MERGE}.
@item
@@ -4878,14 +4863,14 @@ reads. This is very useful when you are archiving things.
MySQL Server has internal support for full-text search. @xref{Fulltext Search}.
@item
-You can access many databases from the same connection (depending of course
+You can access many databases from the same connection (depending, of course,
on your privileges).
@item
-MySQL Server is coded from the start to be multi-threaded while
+MySQL Server is coded from the start to be multi-threaded, while
PostgreSQL uses processes. Context switching and access to common
storage areas is much faster between threads than between separate
-processes, this gives MySQL Server a big speed advantage in multi-user
+processes. This gives MySQL Server a big speed advantage in multi-user
applications and also makes it easier for MySQL Server to take full
advantage of symmetric multiprocessor (SMP) systems.
@@ -4894,7 +4879,7 @@ MySQL Server has a much more sophisticated privilege system than
PostgreSQL. While PostgreSQL only supports @code{INSERT},
@code{SELECT}, and @code{UPDATE/DELETE} grants per user on a database or
a table, MySQL Server allows you to define a full set of different
-privileges on database, table and column level. MySQL Server also
+privileges on the database, table, and column level. MySQL Server also
allows you to specify the privilege on host and user combinations.
@xref{GRANT}.
@@ -4909,14 +4894,14 @@ low-level table types to be called from the SQL engine, and each table
type can be optimised for different performance characteristics.
@item
-All MySQL table types (except @strong{InnoDB}) are implemented as files
-(one table per file), which makes it really easy to backup, move, delete
+All MySQL table types (except @code{InnoDB}) are implemented as files
+(one table per file), which makes it really easy to back up, move, delete,
and even symlink databases and tables, even when the server is down.
@item
-Tools to repair and optimise @strong{MyISAM} tables (the most common
+Tools to repair and optimise @code{MyISAM} tables (the most common
MySQL table type). A repair tool is only needed when a physical corruption
-of a data file happens, usually from a hardware failure. It allows a
+of a datafile happens, usually from a hardware failure. It allows a
majority of the data to be recovered.
@item
@@ -4941,20 +4926,20 @@ optimal binary that works in all cases.
@item
Table locking, as used by the non-transactional @code{MyISAM} tables, is
-in many cases faster than page locks, row locks or versioning. The
-drawback however is that if one doesn't take into account how table
+in many cases faster than page locks, row locks, or versioning. The
+drawback, however, is that if one doesn't take into account how table
locks work, a single long-running query can block a table for updates
for a long time. This can usually be avoided when designing the
application. If not, one can always switch the trouble table to use one
of the transactional table types. @xref{Table locking}.
@item
-With UDF (user defined functions) one can extend MySQL Server with both normal
+With UDF (user-defined functions) one can extend MySQL Server with both normal
SQL functions and aggregates, but this is not yet as easy or as flexible
as in PostgreSQL. @xref{Adding functions}.
@item
-Updates that run over multiple tables is harder to do in MySQL Server.
+Updates that run over multiple tables are harder to do in MySQL Server.
This will, however, be fixed in MySQL Server 4.0.2 with multi-table
@code{UPDATE} and in MySQL Server 4.1 with subselects. In MySQL Server
4.0 one can use multi-table deletes to delete from many tables at the
@@ -4963,6 +4948,29 @@ same time. @xref{DELETE}.
PostgreSQL currently offers the following advantages over MySQL Server:
+Note that because we know the MySQL road map, we have included in the
+following table the version when MySQL Server should support this feature.
+Unfortunately we couldn't do this for previous comparisons, because we
+don't know the PostgreSQL roadmap.
+
+@multitable @columnfractions .30 .30
+@item @strong{Feature} @tab @strong{MySQL version}
+@item Subselects @tab 4.1
+@item Foreign keys @tab 4.1
+@item Views @tab 5.0
+@item Stored procedures @tab 5.0
+@item Triggers @tab 5.0
+@item Unions @tab 4.0
+@item Full join @tab 4.1
+@item Constraints @tab 4.1 or 5.0
+@item Cursors @tab 4.1 or 5.0
+@item R-trees @tab 4.1 (for MyISAM tables)
+@item Inherited tables @tab Not planned
+@item Extensible type system @tab Not planned
+@end multitable
+
+Other reasons someone may consider using PostgreSQL:
+
@itemize @bullet
@item
Standard usage in PostgreSQL is closer to ANSI SQL in some cases.
@@ -4971,6 +4979,10 @@ Standard usage in PostgreSQL is closer to ANSI SQL in some cases.
One can speed up PostgreSQL by coding things as stored procedures.
@item
+For geographical data, R-trees make PostgreSQL better than MySQL Server.
+(note: MySQL version 4.1 will have R-trees for MyISAM tables).
+
+@item
The PostgreSQL optimiser can do some optimisation that the current MySQL
optimiser can't do. Most notable is doing joins when you don't have the
proper keys in place and doing a join where you are using different keys
@@ -5005,7 +5017,7 @@ in this section.
@cindex PostgreSQL vs. MySQL, benchmarks
-The only open source benchmark that we know of that can be used to
+The only @code{Open Source} benchmark that we know of that can be used to
benchmark MySQL Server and PostgreSQL (and other databases) is our own. It can
be found at @uref{http://www.mysql.com/information/benchmarks.html}.
@@ -5013,7 +5025,7 @@ We have many times asked the PostgreSQL developers and some PostgreSQL
users to help us extend this benchmark to make it the definitive benchmark
for databases, but unfortunately we haven't gotten any feedback for this.
-We the MySQL developers have, because of this, spent a lot of hours to get
+We, the MySQL developers, have, because of this, spent a lot of hours to get
maximum performance from PostgreSQL for the benchmarks, but because we
don't know PostgreSQL intimately, we are sure that there are things that
we have missed. We have on the benchmark page documented exactly how we
@@ -5037,85 +5049,85 @@ When running with PostgreSQL 7.1.1 we could, however, not run with
@code{--fast} because during the @code{INSERT} test, the postmaster (the
PostgreSQL deamon) died and the database was so corrupted that it was
impossible to restart postmaster. After this happened twice, we decided
-to postpone the @code{--fast} test until next PostgreSQL release. The
-details about the machine we run the benchmark can be found on the
+to postpone the @code{--fast} test until the next PostgreSQL release. The
+details about the machine we run the benchmark on can be found on the
benchmark page.
Before going to the other benchmarks we know of, we would like to give
-some background on benchmarks:
+some background on benchmarks.
It's very easy to write a test that shows @strong{any} database to be the best
database in the world, by just restricting the test to something the
database is very good at and not testing anything that the database is
-not good at. If one, after doing this, summarises the result with as
+not good at. If one, after doing this, summarises the result as
a single figure, things are even easier.
This would be like us measuring the speed of MySQL Server compared to PostgreSQL
by looking at the summary time of the MySQL benchmarks on our web page.
Based on this MySQL Server would be more than 40 times faster than PostgreSQL,
-something that is of course not true. We could make things even worse
+something that is, of course, not true. We could make things even worse
by just taking the test where PostgreSQL performs worst and claim that
MySQL Server is more than 2000 times faster than PostgreSQL.
The case is that MySQL does a lot of optimisations that PostgreSQL
-doesn't do. This is of course also true the other way around. An SQL
-optimiser is a very complex thing, and a company could spend years on
+doesn't do. This is, of course, also true the other way around. An SQL
+optimiser is a very complex thing, and a company could spend years
just making the optimiser faster and faster.
When looking at the benchmark results you should look for things that
you do in your application and just use these results to decide which
database would be best suited for your application. The benchmark
-results also shows things a particular database is not good at and should
+results also show things a particular database is not good at and should
give you a notion about things to avoid and what you may have to do in
other ways.
-We know of two benchmark tests that claims that PostgreSQL performs better
+We know of two benchmark tests that claim that PostgreSQL performs better
than MySQL Server. These both where multi-user tests, a test that we here at
MySQL AB haven't had time to write and include in the benchmark suite,
-mainly because it's a big task to do this in a manner that is fair against
+mainly because it's a big task to do this in a manner that is fair to
all databases.
One is the benchmark paid for by Great Bridge, the company that for 16 months
attempted to build a business based on PostgreSQL but now has ceased
-operations. This is the probably worst benchmark we have ever seen anyone
+operations. This is probably the worst benchmark we have ever seen anyone
conduct. This was not only tuned to only test what PostgreSQL is absolutely
-best at, it was also totally unfair against every other database involved in
+best at, but it was also totally unfair to every other database involved in
the test.
@strong{Note}: We know that even some of the main PostgreSQL
developers did not like the way Great Bridge conducted the benchmark, so we
don't blame the PostgreSQL team for the way the benchmark was done.
-This benchmark has been condemned in a lot of postings and newsgroups so
-we will here just shortly repeat some things that were wrong with it.
+This benchmark has been condemned in a lot of postings and newsgroups, so
+here we will just briefly repeat some things that were wrong with it.
@itemize @bullet
@item
-The tests were run with an expensive commercial tool, that makes it
-impossible for an open source company like us to verify the benchmarks,
+The tests were run with an expensive commercial tool that makes it
+impossible for an @code{Open Source} company like us to verify the benchmarks,
or even check how the benchmarks were really done. The tool is not even
a true benchmark tool, but an application/setup testing tool. To refer
-this as a ``standard'' benchmark tool is to stretch the truth a long way.
+to this as a ``standard'' benchmark tool is to stretch the truth a long way.
@item
Great Bridge admitted that they had optimised the PostgreSQL database
(with @code{VACUUM} before the test) and tuned the startup for the tests,
-something they hadn't done for any of the other databases involved. To
+something they hadn't done for any of the other databases involved. They
say ``This process optimises indexes and frees up disk space a bit. The
optimised indexes boost performance by some margin.'' Our benchmarks
clearly indicate that the difference in running a lot of selects on a
database with and without @code{VACUUM} can easily differ by a factor
-of ten.
+of 10.
@item
The test results were also strange. The AS3AP test documentation
mentions that the test does ``selections, simple joins, projections,
-aggregates, one-tuple updates, and bulk updates''.
+aggregates, one-tuple updates, and bulk updates.''
PostgreSQL is good at doing @code{SELECT}s and @code{JOIN}s (especially
-after a @code{VACUUM}, but doesn't perform as well on @code{INSERT}s or
+after a @code{VACUUM}), but doesn't perform as well on @code{INSERT}s or
@code{UPDATE}s. The benchmarks seem to indicate that only @code{SELECT}s
-were done (or very few updates). This could easily explain they good results
+were done (or very few updates). This could easily explain the good results
for PostgreSQL in this test. The bad results for MySQL will be obvious a
bit down in this document.
@@ -5130,12 +5142,12 @@ database itself.
When running the database against Oracle and MS-SQL (Great Bridge has
indirectly indicated the databases they used in the test), they
didn't use the native protocol but instead ODBC. Anyone that has ever
-used Oracle knows that all real application uses the native interface
+used Oracle knows that all real applications use the native interface
instead of ODBC. Doing a test through ODBC and claiming that the results
had anything to do with using the database in a real-world situation can't
be regarded as fair. They should have done two tests with and without ODBC
-to provide the right facts (after having got experts to tune all involved
-databases of course).
+to provide the right facts (after having gotten experts to tune all involved
+databases, of course).
@item
They refer to the TPC-C tests, but they don't mention anywhere that the
@@ -5164,7 +5176,7 @@ Using an old MySQL version when there was a recommended newer one available
@item
Not starting MySQL Server with the right options for heavy multi-user use (the
-default installation of MySQL Server is tuned for minimal resource use).
+default installation of MySQL Server is tuned for minimal resource use)
@end itemize
Great Bridge did run a new test, with our optimised ODBC driver and with
@@ -5174,15 +5186,15 @@ statically linked with a fixed glibc library.
According to what we know, Great Bridge did nothing to ensure that the
other databases were set up correctly to run well in their test
-environment. We are sure however that they didn't contact Oracle or
-Microsoft to ask for their advice in this matter ;)
+environment. We are sure, however, that they didn't contact Oracle or
+Microsoft to ask for their advice in this matter. ;)
@item
The benchmark was paid for by Great Bridge, and they decided to publish
only partial, chosen results (instead of publishing it all).
@end itemize
-Tim Perdue, a long time PostgreSQL fan and a reluctant MySQL user
+Tim Perdue, a long-time PostgreSQL fan and a reluctant MySQL user,
published a comparison on PHPbuilder
(@uref{http://www.phpbuilder.com/columns/tim20001112.php3}).
@@ -5200,8 +5212,8 @@ how to fix this and Tim should be aware of this problem.
The other possible problem could have been an old glibc library and
that Tim didn't use a MySQL binary from our site, which is linked with
-a corrected glibc library, but had compiled a version of his own with.
-In any of the above cases, the symptom would have been exactly what Tim
+a corrected glibc library, but had compiled a version of his own.
+In any of these cases, the symptom would have been exactly what Tim
had measured.
We asked Tim if we could get access to his data so that we could repeat
@@ -5209,40 +5221,42 @@ the benchmark and if he could check the MySQL version on the machine to
find out what was wrong and he promised to come back to us about this.
He has not done that yet.
-Because of this we can't put any trust in this benchmark either :(
+Because of this we can't put any trust in this benchmark either. :(
-Over time things also changes and the above benchmarks are not that
+Over time things also change and the preceding benchmarks are not that
relevant anymore. MySQL Server now has a couple of different table handlers
with different speed/concurrency tradeoffs. @xref{Table types}. It
would be interesting to see how the above tests would run with the
-different transactional table types in MySQL Server. PostgreSQL has of course
-also got new features since the test was made. As the above test are
+different transactional table types in MySQL Server. PostgreSQL
+has, of course,
+also got new features since the test was made. As these tests are
not publicly available there is no way for us to know how the
-database would preform in the same tests today.
+database would perform in the same tests today.
Conclusion:
The only benchmarks that exist today that anyone can download and run
-against MySQL Server and PostgreSQL is the MySQL benchmarks.
+against MySQL Server and PostgreSQL are the MySQL benchmarks.
We here at MySQL AB
-believe that open source databases should be tested with open source tools!
+believe that @code{Open Source} databases should be tested with @code{Open Source} tools!
This is the only way to ensure that no one does tests that nobody can
-reproduce and use this to claim that a database is better than another.
+reproduce and use this to claim that one database is better than another.
Without knowing all the facts it's impossible to answer the claims of the
tester.
The thing we find strange is that every test we have seen about
PostgreSQL, that is impossible to reproduce, claims that PostgreSQL is
better in most cases while our tests, which anyone can reproduce,
-clearly shows otherwise. With this we don't want to say that PostgreSQL
+clearly show otherwise. With this we don't want to say that PostgreSQL
isn't good at many things (it is!) or that it isn't faster than MySQL Server
under certain conditions. We would just like to see a fair test where
-they are very good so that we could get some friendly competition going!
+PostgreSQL performs very well, so that we could get some friendly
+competition going!
-For more information about our benchmarks suite, see @ref{MySQL Benchmarks}.
+For more information about our benchmark suite, see @ref{MySQL Benchmarks}.
-We are working on an even better benchmark suite, including multi user
+We are working on an even better benchmark suite, including multi-user
tests, and a better documentation of what the individual tests really
do and how to add more tests to the suite.
@@ -5271,8 +5285,8 @@ For a list of sites from which you can obtain MySQL, see
@item
To see which platforms are supported, see @ref{Which OS}. Please note that
-not all supported system are equally good for running MySQL on them.
-On some it is much more robust and efficient than others - see @ref{Which OS}
+not all supported systems are equally good for running MySQL on them.
+On some it is much more robust and efficient than others@-see @ref{Which OS}
for details.
@item
@@ -5285,7 +5299,7 @@ use the binary distribution.
@item
Installation instructions for binary and source distributions are described
-in @ref{Installing binary} and @ref{Installing source}. Each set of
+in @ref{Installing binary}, and @ref{Installing source}. Each set of
instructions includes a section on system-specific problems you may run
into.
@@ -5318,7 +5332,7 @@ file. The MySQL RPMs are currently being built on a RedHat Version
and use @code{glibc}.
If you have problems with an RPM file, for example, if you receive the error
-``@code{Sorry, the host 'xxxx' could not be looked up}'', see
+``@code{Sorry, the host 'xxxx' could not be looked up}''@-see
@ref{Binary notes-Linux}.
The RPM files you may want to use are:
@@ -5345,7 +5359,7 @@ MySQL clients, such as the Perl modules.
@item @code{MySQL-VERSION.src.rpm}
-This contains the source code for all of the above packages. It can also
+This contains the source code for all of the previous packages. It can also
be used to try to build RPMs for other architectures (for example, Alpha
or SPARC).
@end itemize
@@ -5389,7 +5403,7 @@ The MySQL server for Windows is available in two distribution types:
@enumerate
@item
The binary distribution contains a setup program which installs
-everything you need so you can start the server immediately.
+everything you need so that you can start the server immediately.
@item
The source distribution contains all the code and support files
for building the executables using the VC++ 6.0 compiler.
@@ -5401,12 +5415,12 @@ Generally speaking, you should use the binary distribution.
You will need the following:
@itemize @bullet
@item
-A 32 bits Windows Operating System such as 9x, Me, NT, 2000 or XP.
+A 32-bit Windows Operating System such as 9x, Me, NT, 2000, or XP.
The NT family (NT, Windows 2000 and XP) permits running the MySQL server
as a service. @xref{NT start}.
If you want to use tables bigger than 4G, you should install MySQL
-on NTFS or newer file system. Don't forget to use @code{MAX_ROWS} and
+on an NTFS or newer filesystem. Don't forget to use @code{MAX_ROWS} and
@code{AVG_ROW_LENGTH} when you create the table. @xref{CREATE TABLE}.
@item
TCP/IP protocol support.
@@ -5415,12 +5429,12 @@ A copy of the MySQL binary or distribution for Windows, which
can be downloaded from @uref{http://www.mysql.com/downloads/}.
Note: The distribution files are supplied with a zipped format
-and we recommended the use of an adequate FTP client with resume
+and we recommend the use of an adequate FTP client with resume
feature to avoid corruption of files during the download process.
@item
-A @code{ZIP} program to unpacked the distribution file.
+A @code{ZIP} program to unpack the distribution file.
@item
-Enough space on the hard drive to unpack, install and to create the
+Enough space on the hard drive to unpack, install, and create the
databases in accorandance with your requirements.
@item
If you plan to connect to the MySQL server via @code{ODBC}, you
@@ -5458,7 +5472,7 @@ C:\mysql\bin> mysqladmin -u root shutdown
@item
On NT/2000/XP machines, if you want to change the server executable
-(e.g. -max or -nt), it is also necessary to remove the service:
+(e.g., -max or -nt), it is also necessary to remove the service:
@example
C:\mysql\bin> mysqld-max-nt --remove
@@ -5487,7 +5501,7 @@ Here is a list of the different MySQL servers you can use:
@item @strong{Binary} @tab @strong{Description}
@item @code{mysqld} @tab
Compiled with full debugging and automatic memory allocation
-checking, symbolic links, InnoDB and BDB tables.
+checking, symbolic links, InnoDB, and BDB tables.
@item @code{mysqld-opt} @tab
Optimised binary with no support for transactional tables.
@item @code{mysqld-nt} @tab
@@ -5504,14 +5518,14 @@ Like @code{mysqld-max}, but compiled with support for named pipes.
Starting from 3.23.50, named pipes are only enabled if one starts mysqld with
@code{--enable-named-pipe}.
-All of the above binaries are optimised for the Pentium Pro
+All of the preceding binaries are optimised for the Pentium Pro
processor but should work on any Intel processor >= i386.
You will need to use an option file to specify your MySQL configuration
under the following circumstances:
@itemize @bullet
@item
-The installation or data directories are different than the default
+The installation or data directories are different from the default
locations (@file{c:\mysql} and @file{c:\mysql\data}).
@item
You want to use one of these servers:
@@ -5529,17 +5543,17 @@ option file @code{my.ini}. In this case you don't have to worry
about the following section.
There are two option files with the same function: @file{my.cnf} and
-@file{my.ini} file. However, to avoid confusion, it's best if you use only
+@file{my.ini}. However, to avoid confusion, it's best if you use only
of one them. Both files are plain text. The @file{my.cnf} file, if used,
-should be created in the root directory of drive C. The @file{my.ini}
+should be created in the root directory of the C drive. The @file{my.ini}
file, if used, should be created in the Windows system directory. (This
directory is typically something like @file{C:\WINDOWS} or @file{C:\WINNT}.
You can determine its exact location from the value of the @code{windir}
environment variable.) MySQL looks first for the @code{my.ini} file,
-then for the @code{my.cnf} file.
+then for the @file{my.cnf} file.
If your PC uses a boot loader where the C drive isn't the boot drive,
-then your only option is to use the @file{my.ini} file. Also note that
+your only option is to use the @file{my.ini} file. Also note that
if you use the @code{WinMySQLAdmin} tool, it uses only the @file{my.ini}
file. The @file{\mysql\bin} directory contains a help file with
instructions for using this tool.
@@ -5561,13 +5575,13 @@ Note that Windows pathnames should be specified in option files using
forward slashes rather than backslashes. If you do use backslashes, you
must double them.
-If you would like to use a data directory different than the default of
+If you would like to use a data directory different from the default of
@file{c:\mysql\data}, you must copy the entire contents of the
@file{c:\mysql\data} directory to the new location.
If you want to use the @code{InnoDB} transactional tables, you
need to manually create two new directories to hold the InnoDB
-data and log files, e.g. @file{c:\ibdata} and @file{c:\iblogs}.
+data and log files@-e.g., @file{c:\ibdata} and @file{c:\iblogs}.
You will also need to add some extra lines to the option
file. @xref{InnoDB start}.
@@ -5595,7 +5609,7 @@ C:\mysql\bin> mysqld-max --standalone
You should see the following messages as the server starts up:
@example
-InnoDB: The first specified data file c:\ibdata\ibdata1 did not exist:
+InnoDB: The first specified datafile c:\ibdata\ibdata1 did not exist:
InnoDB: a new database to be created!
InnoDB: Setting file c:\ibdata\ibdata1 size to 209715200
InnoDB: Database physically writes the file full: wait...
@@ -5655,10 +5669,10 @@ Our main download mirror is located at:
If you are interested in becoming a MySQL mirror site, you may
anonymously rsync with: @code{rsync://sunsite.dk/ftp/mirrors/mysql/}. Please
send e-mail to @email{webmaster@@mysql.com} notifying us of your mirror to be
-added to the list below.
+added to the following list.
If you have problems downloading from our main site, try using one of the
-mirrors listed below.
+following mirrors.
Please report bad or out-of-date mirrors to @email{webmaster@@mysql.com}.
@@ -5715,7 +5729,7 @@ Mac OS X Server. @xref{Mac OS X}.
@item
NetBSD 1.3/1.4 Intel and NetBSD 1.3 Alpha (Requires GNU make). @xref{NetBSD}.
@item
-OpenBSD > 2.5 with native therads. OpenBSD < 2.5 with the included
+OpenBSD > 2.5 with native threads. OpenBSD < 2.5 with the included
MIT-pthreads package. @xref{OpenBSD}.
@item
OS/2 Warp 3, FixPack 29 and OS/2 Warp 4, FixPack 4. @xref{OS/2}.
@@ -5738,7 +5752,7 @@ Windows 9x, Me, NT, 2000 and XP. @xref{Windows}.
Note that not all platforms are suited equally well for running
MySQL. How well a certain platform is suited for a high-load
-mission critical MySQL server is determined by the following
+mission-critical MySQL server is determined by the following
factors:
@itemize @bullet
@@ -5758,15 +5772,15 @@ CPU than the original process.
The ability of the kernel and/or the thread library to run many threads which
acquire/release a mutex over a short critical region frequently without
excessive context switches. In other words, if the implementation of
-@code{pthread_mutex_lock()} is too anxious to yield CPU, this will hurt
+@code{pthread_mutex_lock()} is too anxious to yield CPU time, this will hurt
MySQL tremendously. If this issue is not taken care of, adding extra CPUs
will actually make MySQL slower.
@item
-General file system stability/performance.
+General filesystem stability/performance.
@item
-Ability of the file system to deal with large files at all and deal with them
+Ability of the filesystem to deal with large files at all and deal with them
efficiently, if your tables are big.
@item
@@ -5781,11 +5795,11 @@ The amount of testing of similar configurations we have done internally.
@item
The number of users that have successfully run MySQL on that
platform in similar configurations. If this number is high, the chances of
-hitting some platform-specific surprise are much smaller.
+hitting some platform-specific surprises are much smaller.
@end itemize
-Based on the above criteria, the best platforms for running
-MySQL at this point are x86 with SuSE Linux 7.1, 2.4 kernel and
+Based on the preceding criteria, the best platforms for running
+MySQL at this point are x86 with SuSE Linux 7.1, 2.4 kernel, and
ReiserFS (or any similar Linux distribution) and SPARC with Solaris 2.7
or 2.8. FreeBSD comes third, but we really hope it will join the top
club once the thread library is improved. We also hope that at some
@@ -5799,15 +5813,15 @@ development, and need more detailed instructions on what MySQL
needs to run better, send an e-mail to
@email{internals@@lists.mysql.com}.
-Please note that the comparison above is not to say that one OS is better or
+Please note that the preceding comparison is not to say that one OS is better or
worse than the other in general. We are talking about choosing a particular OS
-for a dedicated purpose - running MySQL, and compare platforms in that
+for a dedicated purpose@-running MySQL, and compare platforms in that
regard only. With this in mind, the result of this comparison
would be different if we included more issues into it. And in some cases,
the reason one OS is better than the other could simply be that we have put
forth more effort into testing on and optimising for that particular platform.
-We are just stating our observations to help you make a
-decision on which platform to use MySQL on in your setup.
+We are just stating our observations to help you decide on which
+platform to use MySQL on in your setup.
@node Which version, Installation layouts, Which OS, General Installation Issues
@@ -5826,7 +5840,7 @@ release or the last stable release:
@item
Normally, if you are beginning to use MySQL for the first time or trying
to port it to some system for which there is no binary distribution, we
-recommend going with the stable release (currently Version 3.23. Note
+recommend going with the stable release (currently version 3.23). Note
that all MySQL releases are checked with the MySQL benchmarks and an
extensive test suite before each release (even the development
releases).
@@ -5855,8 +5869,8 @@ to get even more flexibility).
@item
To be able to satisfy different user requirements, we are providing two
-different binary versions; One compiled with the non-transactional table
-handlers, (a small, fast binary), and one configured with the most
+different binary versions: one compiled with the non-transactional table
+handlers (a small, fast binary), and one configured with the most
important extended options like transaction-safe tables. Both versions
are compiled from the same source distribution. All native @code{MySQL}
clients can connect to both MySQL versions.
@@ -5884,12 +5898,12 @@ common extra options that you may want to use:
@item
The default binary distribution is normally compiled with support
-for all characters sets and should work on a variety of processors from
+for all character sets and should work on a variety of processors from
the same processor family.
If you want a faster MySQL server you may want to recompile it
with support for only the character sets you need, use a better compiler
-(like @code{pgcc}) or use compiler options that are better optimised for your
+(like @code{pgcc}), or use compiler options that are better optimised for your
processor.
@item
@@ -5920,7 +5934,7 @@ releases have the same file format.
The second number (@code{21}) is the release level. Normally there are two to
choose from. One is the release/stable branch (currently @code{23}) and the
other is the development branch (currently @code{4.0}). Normally both are
-stable, but the development version may have quirks, missing documentation on
+stable, but the development version may have quirks, may be missing documentation on
new features, or may fail to compile on some systems.
@item
@@ -6007,7 +6021,7 @@ A binary distribution is installed by unpacking it at the installation
location you choose (typically @file{/usr/local/mysql}) and creates the
following directories in that location:
-@multitable @columnfractions .15 .40
+@multitable @columnfractions .15 .45
@item @strong{Directory} @tab @strong{Contents of directory}
@item @file{bin} @tab Client programs and the @code{mysqld} server
@item @file{data} @tab Log files, databases
@@ -6022,7 +6036,7 @@ A source distribution is installed after you configure and compile it. By
default, the installation step installs files under @file{/usr/local}, in the
following subdirectories:
-@multitable @columnfractions .15 .40
+@multitable @columnfractions .15 .45
@item @strong{Directory} @tab @strong{Contents of directory}
@item @file{bin} @tab Client programs and scripts
@item @file{include/mysql} @tab Include (header) files
@@ -6086,7 +6100,7 @@ versions, the second number in the version string is incremented. When the
file format changes, the first number is increased.
@item
-Stable tested releases are meant to appear about 1-2 times a year, but
+Stable-tested releases are meant to appear about 1-2 times a year, but
if small bugs are found, a release with only bug fixes will be released.
@item
@@ -6113,14 +6127,14 @@ release as soon as possible. We would like other companies to do this,
too.
@end itemize
-The current stable release is Version 3.23; We have already moved active
+The current stable release is Version 3.23; we have already moved active
development to Version 4.0. Bugs will still be fixed in the stable version.
We don't believe in a complete freeze, as this also leaves out bug fixes
and things that ``must be done.'' ``Somewhat frozen'' means that we may
add small things that ``almost surely will not affect anything that's
already working.''
-MySQL uses a little different naming scheme that most other products.
+MySQL uses a slightly different naming scheme from most other products.
In general it's relatively safe to use any version that has been out for
a couple of weeks without being replaced with a new version.
@xref{Which version}.
@@ -6173,10 +6187,13 @@ and are configured with the following compilers and options:
@item BSDI BSD/OS 2.1 i386 with @code{gcc} 2.7.2
@code{CC=gcc CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex}
+
+@item FreeBSD 4.4-stable i386 with @code{gcc} 2.95.3
+@code{CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-O3 -fno-omit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql "--with-comment=Official MySQL binary" --with-extra-charsets=complex "--with-server-suffix=" --enable-thread-safe-client --enable-local-infile --enable-assembler --with-named-z-libs=not-used --disable-shared}
@end table
-Anyone who has more optimal options for any of the configurations listed
-above can always mail them to the developer's mailing list at
+Anyone who has more optimal options for any of the preceding
+configurations listed can always mail them to the developer's mailing list at
@email{internals@@lists.mysql.com}.
RPM distributions prior to MySQL Version 3.22 are user-contributed.
@@ -6184,7 +6201,7 @@ Beginning with Version 3.22, the RPMs are generated by us at
MySQL AB.
If you want to compile a debug version of MySQL, you should add
-@code{--with-debug} or @code{--with-debug=full} to the above configure lines
+@code{--with-debug} or @code{--with-debug=full} to the preceding configure lines
and remove any @code{-fomit-frame-pointer} options.
For the Windows distribution, please see @ref{Windows installation}.
@@ -6253,15 +6270,15 @@ you install the @code{DBI} and @code{Msql-Mysql-modules} Perl modules.
A more detailed description follows.
-To install a binary distribution, follow the steps below, then proceed
+To install a binary distribution, follow these steps, then proceed
to @ref{Post-installation}, for post-installation setup and testing:
@enumerate
@item
Pick the directory under which you want to unpack the distribution, and move
-into it. In the example below, we unpack the distribution under
+into it. In the following example, we unpack the distribution under
@file{/usr/local} and create a directory @file{/usr/local/mysql} into which
-MySQL is installed. (The following instructions therefore assume
+MySQL is installed. (The following instructions, therefore, assume
you have permission to create files in @file{/usr/local}. If that directory
is protected, you will need to perform the installation as @code{root}.)
@@ -6402,8 +6419,7 @@ You can start the MySQL server with the following command:
shell> bin/safe_mysqld --user=mysql &
@end example
-@xref{safe_mysqld, , @code{safe_mysqld}}.
-
+Now proceed to @ref{safe_mysqld, , @code{safe_mysqld}}, and
@xref{Post-installation}.
@@ -6416,7 +6432,7 @@ shell> bin/safe_mysqld --user=mysql &
Before you proceed with the source installation, check first to see if our
binary is available for your platform and if it will work for you. We
-put in a lot of effort into making sure that our binaries are built with the
+put a lot of effort into making sure that our binaries are built with the
best possible options.
You need the following tools to build and install MySQL from source:
@@ -6437,8 +6453,8 @@ using @code{gcc}. @code{gcc} 2.7.x has a bug that makes it impossible
to compile some perfectly legal C++ files, such as
@file{sql/sql_base.cc}. If you only have @code{gcc} 2.7.x, you must
upgrade your @code{gcc} to be able to compile MySQL. @code{gcc}
-2.8.1 is also known to have problems on some platforms so it should be
-avoided if there exists a new compiler for the platform..
+2.8.1 is also known to have problems on some platforms, so it should be
+avoided if a new compiler exists for the platform.
@code{gcc} >= 2.95.2 is recommended when compiling MySQL
Version 3.23.x.
@@ -6449,7 +6465,7 @@ sometimes required. If you have problems, we recommend trying GNU
@code{make} 3.75 or newer.
@end itemize
-If you are using a recent version of @strong{gcc}, recent enough to understand
+If you are using a recent version of @code{gcc}, recent enough to understand the
@code{-fno-exceptions} option, it is @strong{very important} that you use
it. Otherwise, you may compile a binary that crashes randomly. We also
recommend that you use @code{-felide-constructors} and @code{-fno-rtti} along
@@ -6510,12 +6526,12 @@ shell> /usr/local/mysql/bin/mysqld_safe --user=mysql &
if you are running MySQL 4.x.
@end example
-If you want have support for InnoDB tables, you should edit the
+If you want to have support for InnoDB tables, you should edit the
@code{/etc/my.cnf} file and remove the @code{#} character before the
-parameters that starts with @code{innodb_...}. @xref{Option
-files}. @xref{InnoDB start}.
+parameter that starts with @code{innodb_...}.
+@xref{Option files}, and @ref{InnoDB start}.
-If you start from a source RPM, then do the following:
+If you start from a source RPM, do the following:
@example
shell> rpm --rebuild MySQL-VERSION.src.rpm
@@ -6528,7 +6544,7 @@ you install the @code{DBI} and @code{Msql-Mysql-modules} Perl modules.
A more detailed description follows.
-To install a source distribution, follow the steps below, then proceed
+To install a source distribution, follow these steps, then proceed
to @ref{Post-installation}, for post-installation initialisation and testing:
@enumerate
@@ -6558,7 +6574,7 @@ shell> groupadd mysql
shell> useradd -g mysql mysql
@end example
-These commands add the @code{mysql} group, and the @code{mysql} user. The
+These commands add the @code{mysql} group and the @code{mysql} user. The
syntax for @code{useradd} and @code{groupadd} may differ slightly on different
versions of Unix. They may also be called @code{adduser} and @code{addgroup}.
You may wish to call the user and group something else instead of @code{mysql}.
@@ -6579,7 +6595,7 @@ shell> cd mysql-VERSION
@end example
Note that currently you must configure and build MySQL from
-this top-level directory. You can not build it in a different
+this top-level directory. You cannot build it in a different
directory.
@item
@@ -6660,12 +6676,12 @@ distribution:
shell> /usr/local/mysql/bin/safe_mysqld --user=mysql &
@end example
-If that command fails immediately with @code{mysqld daemon ended} then you can
+If that command fails immediately with @code{mysqld daemon ended}, you can
find some information in the file @file{mysql-data-directory/'hostname'.err}.
The likely reason is that you already have another @code{mysqld} server
running. @xref{Multiple servers}.
-@xref{Post-installation}.
+Now proceed to @ref{Post-installation}.
@node Applying patches, configure options, Quick install, Installing source
@@ -6689,7 +6705,8 @@ shell> make clean
@end example
Patches from the FTP site are distributed as plain text files or as files
-compressed with @code{gzip}. Apply a plain patch as shown above for
+compressed with @code{gzip}. Apply a plain patch as shown
+previously for
mailing list patches. To apply a compressed patch, change into the
top-level directory of your MySQL source tree and run these
commands:
@@ -6722,7 +6739,7 @@ the version that is currently executing.
The @code{configure} script gives you a great deal of control over how
you configure your MySQL distribution. Typically you do this
-using options on the @code{configure} command line. You can also affect
+using options on the @code{configure} command-line. You can also affect
@code{configure} using certain environment variables. @xref{Environment
variables}. For a list of options supported by @code{configure}, run
this command:
@@ -6731,7 +6748,7 @@ this command:
shell> ./configure --help
@end example
-Some of the more commonly-used @code{configure} options are described below:
+Some of the more commonly-used @code{configure} options are described here:
@itemize @bullet
@item
@@ -6753,7 +6770,7 @@ warnings about @file{mysql.cc}. (If @code{make} stops, try @code{make -k}
to tell it to continue with the rest of the build even if errors occur.)
@item
-If you want to get a embedded MySQL library (@code{libmysqld.a}) you should
+If you want to get an embedded MySQL library (@code{libmysqld.a}) you should
use the @code{--with-embedded-server} option.
@item
@@ -6822,14 +6839,16 @@ shell> CC=gcc CXX=gcc ./configure
@end example
When you use @code{gcc} as your C++ compiler, it will not attempt to link in
-@code{libg++} or @code{libstdc++}.
+@code{libg++} or @code{libstdc++}. This may be a good idea to do even if you
+have the above libraries installed, as some versions of these libraries have
+caused strange problems for MySQL users in the past.
-Here is some common environment variables to set depending on
+Here are some common environment variables to set depending on
the compiler you are using:
@tindex CXXFLAGS environment variable
@tindex environment variable, CXXFLAGS
-@multitable @columnfractions .20 .80
+@multitable @columnfractions .19 .81
@item @strong{Compiler} @tab @strong{Recommended options}
@item gcc 2.7.2.1 @tab
CC=gcc CXX=gcc CXXFLAGS="-O3 -felide-constructors"
@@ -6845,7 +6864,7 @@ CXXFLAGS="-O3 -mpentiumpro -mstack-align-double -felide-constructors \
@end multitable
In most cases you can get a reasonably optimal MySQL binary by
-using the options from the above and adding the following options to the
+using the options from the preceding table and adding the following options to the
configure line:
@example
@@ -6853,7 +6872,7 @@ configure line:
--with-mysqld-ldflags=-all-static
@end example
-The full configure line would in other words be something like the
+The full configure line would, in other words, be something like the
following for all recent gcc versions:
@example
@@ -6913,17 +6932,18 @@ you should take a look at the @code{SET OPTION CHARACTER SET} command.
@xref{SET OPTION, , @code{SET OPTION}}.
@cindex @code{myisamchk}
-@strong{Warning:} If you change character sets after having created any
+@strong{Warning}: If you change character sets after having created any
tables, you will have to run @code{myisamchk -r -q} on every table. Your
indexes may be sorted incorrectly otherwise. (This can happen if you
install MySQL, create some tables, then reconfigure
MySQL to use a different character set and reinstall it.)
With the option @code{--with-extra-charset=LIST} you can define
-which additional character sets should be incompiled in the server.
+which additional character sets should be compiled into the server.
-Here @code{LIST} is either a list of character set separated with space,
-@code{complex} to include all characters that can't be dynamically loaded
+Here @code{LIST} is either a list of character
+sets separated with spaces,
+@code{complex} to include all characters that can't be dynamically loaded,
or @code{all} to include all character sets into the binaries.
@item
@@ -6957,7 +6977,7 @@ system-specific section of this manual.
@cindex BitKeeper tree
@cindex cvs tree
-@strong{Caution:} You should read this section only if you are interested
+@strong{Caution}: You should read this section only if you are interested
in helping us test our new code. If you just want to get MySQL up
and running on your system, you should use a standard release distribution
(either a source or binary distribution will do).
@@ -6966,15 +6986,15 @@ To obtain our most recent development source tree, use these instructions:
@enumerate
@item
-Download @strong{BitKeeper} from
+Download @code{BitKeeper} from
@uref{http://www.bitmover.com/cgi-bin/download.cgi}. You will need
-@strong{Bitkeeper} 2.0 or newer to access our repository.
+@code{Bitkeeper} 2.0 or newer to access our repository.
@item
Follow the instructions to install it.
@item
-After @strong{BitKeeper} is installed, first go to the directory you
+After @code{BitKeeper} is installed, first go to the directory you
want to work from, and then use this command if you want to clone
the MySQL 3.23 branch:
@@ -6988,7 +7008,7 @@ To clone the 4.0 branch, use this command instead:
shell> bk clone bk://work.mysql.com:7001 mysql-4.0
@end example
-In the above examples the source tree will be set up in the @file{mysql/}
+In the preceding examples the source tree will be set up in the @file{mysql/}
or @file{mysql-4.0/} subdirectory of your current directory.
The initial download of the source tree may take a while, depending on the
@@ -7014,14 +7034,14 @@ shell> make
A collection of our standard configure scripts is located in the
@file{BUILD/} subdirectory. If you are lazy, you can use
@file{BUILD/compile-pentium-debug}. To compile on a different architecture,
-modify the script removing flags that are Pentium-specific.
+modify the script by removing flags that are Pentium-specific.
@item
When the build is done, run @code{make install}. Be careful with this
on a production machine; the command may overwrite your live release
installation. If you have another installation of MySQL, we
recommand that you run @code{./configure} with different values for the
-@code{prefix}, @code{tcp-port}, and @code{unix-socket-path} options than
+@code{prefix}, @code{with-tcp-port}, and @code{unix-socket-path} options than
those used for your production server.
@item
@@ -7036,7 +7056,7 @@ crash trying to process our configuration files, please report that also.
However, if you execute @code{aclocal} and get a @code{command not found}
error or a similar problem, do not report it. Instead, make sure all
the necessary tools are installed and that your @code{PATH} variable is
-set correctly so your shell can find them.
+set correctly so that your shell can find them.
@item
After the initial @code{bk clone} operation to get the source tree, you
@@ -7053,7 +7073,7 @@ to the source. If you do not have the time to code your idea, just send
a description.
@item
-@strong{BitKeeper} has a nice help utility that you can access via
+@code{BitKeeper} has a nice help utility that you can access via
@code{bk helptool}.
@end enumerate
@@ -7071,8 +7091,8 @@ a description.
All MySQL programs compile cleanly for us with no warnings on
Solaris using @code{gcc}. On other systems, warnings may occur due to
differences in system include files. See @ref{MIT-pthreads} for warnings
-that may occur when using MIT-pthreads. For other problems, check the list
-below.
+that may occur when using MIT-pthreads. For other problems, check
+the following list.
The solution to many problems involves reconfiguring. If you do need to
reconfigure, take note of the following:
@@ -7093,7 +7113,7 @@ when you reconfigure.
@item
Each time you run @code{configure}, you must run @code{make} again
to recompile. However, you may want to remove old object files from previous
-builds first, because they were compiled using different configuration options.
+builds first because they were compiled using different configuration options.
@end itemize
To prevent old configuration information or object files from being used,
@@ -7106,7 +7126,7 @@ shell> make clean
Alternatively, you can run @code{make distclean}.
-The list below describes some of the problems compiling MySQL
+The following list describes some of the problems when compiling MySQL
that have been found to occur most often:
@itemize @bullet
@@ -7118,7 +7138,7 @@ that have been found to occur most often:
@cindex virtual memory, problems while compiling
@cindex configure option, --with-low-memory
If you get errors when compiling @file{sql_yacc.cc}, such as the ones shown
-below, you have probably run out of memory or swap space:
+here, you have probably run out of memory or swap space:
@example
Internal compiler error: program cc1plus got fatal signal 11
@@ -7176,7 +7196,11 @@ This works because @code{gcc} compiles C++ sources as well as @code{g++}
does, but does not link in @code{libg++} or @code{libstdc++} by default.
Another way to fix these problems, of course, is to install @code{g++},
-@code{libg++} and @code{libstdc++}.
+@code{libg++}, and @code{libstdc++}. We would however like to recommend
+you to not use @code{libg++} or @code{libstdc++} with MySQL as this will
+only increase the binary size of mysqld without giving you any benefits.
+Some versions of these libraries have also caused strange problems for
+MySQL users in the past.
@item
If your compile fails with errors, such as any of the following,
@@ -7237,7 +7261,7 @@ client/libmysql.c:273: parse error before `__attribute__'
@code{egcs} 1.0.3a instead.
@item
-If you get errors such as those shown below when compiling @code{mysqld},
+If you get errors such as those shown here when compiling @code{mysqld},
@code{configure} didn't correctly detect the type of the last argument to
@code{accept()}, @code{getsockname()}, or @code{getpeername()}:
@@ -7258,12 +7282,12 @@ To fix this, edit the @file{config.h} file (which is generated by
Change @code{XXX} to @code{size_t} or @code{int}, depending on your
operating system. (Note that you will have to do this each time you run
-@code{configure}, because @code{configure} regenerates @file{config.h}.)
+@code{configure} because @code{configure} regenerates @file{config.h}.)
@item
The @file{sql_yacc.cc} file is generated from @file{sql_yacc.yy}. Normally
the build process doesn't need to create @file{sql_yacc.cc}, because
-MySQL comes with an already-generated copy. However, if you do need
+MySQL comes with an already generated copy. However, if you do need
to re-create it, you might encounter this error:
@example
@@ -7289,7 +7313,7 @@ link your clients with the new client library. @xref{Debugging client}.
This section describes some of the issues involved in using MIT-pthreads.
-Note that on Linux you should NOT use MIT-pthreads but install LinuxThreads!
+Note that on Linux you should @strong{not} use MIT-pthreads but install LinuxThreads!
@xref{Linux}.
If your system does not provide native thread support, you will need to
@@ -7307,13 +7331,13 @@ shell> ./configure --with-mit-threads
@end example
Building in a non-source directory is not supported when using
-MIT-pthreads, because we want to minimise our changes to this code.
+MIT-pthreads because we want to minimise our changes to this code.
@item
-The checks that determine whether or not to use MIT-pthreads occur only
+The checks that determine whether to use MIT-pthreads occur only
during the part of the configuration process that deals with the server
code. If you have configured the distribution using @code{--without-server}
-to build only the client code, clients will not know whether or not
+to build only the client code, clients will not know whether
MIT-pthreads is being used and will use Unix socket connections by default.
Because Unix sockets do not work under MIT-pthreads, this means you will need
to use @code{-h} or @code{--host} when you run client programs.
@@ -7393,9 +7417,9 @@ Building MySQL
@enumerate
@item
-Create a work directory (e.g.: workdir).
+Create a work directory (e.g., workdir).
@item
-Unpack the source distribution in the above directory.
+Unpack the source distribution in the aforementioned directory.
@item
Start the VC++ 6.0 compiler.
@item
@@ -7409,7 +7433,7 @@ select the @code{Set Active Configuration} menu.
Click over the screen selecting @code{mysqld - Win32 Debug}
and click OK.
@item
-Press @code{F7} to begin the build of the debug server, libs and
+Press @code{F7} to begin the build of the debug server, libs, and
some client applications.
@item
When the compilation finishes, copy the libs and the executables
@@ -7417,7 +7441,7 @@ to a separate directory.
@item
Compile the release versions that you want, in the same way.
@item
-Create the directory for the MySQL stuff: e.g. @file{c:\mysql}
+Create the directory for the MySQL stuff: e.g., @file{c:\mysql}
@item
From the workdir directory copy for the c:\mysql directory the
following directories:
@@ -7482,7 +7506,7 @@ shell> ./bin/safe_mysqld --user=mysql &
This creates the @code{mysql} database which will hold all database
privileges, the @code{test} database which you can use to test
-MySQL and also privilege entries for the user that run
+MySQL, and also privilege entries for the user that run
@code{mysql_install_db} and a @code{root} user (without any passwords).
This also starts the @code{mysqld} server.
@@ -7497,7 +7521,7 @@ distribution. For a binary distribution, this is your installation directory
distribution, this is the main directory of your MySQL source tree.
@cindex testing, the server
-In the commands shown below in this section and in the following
+In the commands shown in this section and in the following
subsections, @code{BINDIR} is the path to the location in which programs
like @code{mysqladmin} and @code{safe_mysqld} are installed. For a
binary distribution, this is the @file{bin} directory within the
@@ -7509,7 +7533,7 @@ installed. For a binary distribution, this is the same as
@code{BINDIR}. For a source distribution, @code{EXECDIR} is probably
@file{/usr/local/libexec}.
-Testing is described in detail below:
+Testing is described in detail:
@cindex testing, installation
@enumerate
@@ -7534,7 +7558,7 @@ you are unsure of what to do, you can always run @code{mysql_install_db}.)
@code{mysql} database. A description of the initial privileges is given in
@ref{Default privileges}. Briefly, these privileges allow the MySQL
@code{root} user to do anything, and allow anybody to create or use databases
-with a name of @code{'test'} or starting with @code{'test_'}.
+with a name of @code{test} or starting with @code{test_}.
If you don't set up the grant tables, the following error will appear in the
log file when you start the server:
@@ -7544,13 +7568,13 @@ log file when you start the server:
mysqld: Can't find file: 'host.frm'
@end example
-The above may also happen with a binary MySQL distribution if you
+This may also happen with a binary MySQL distribution if you
don't start MySQL by executing exactly @code{./bin/safe_mysqld}!
@xref{safe_mysqld, , @code{safe_mysqld}}.
You might need to run @code{mysql_install_db} as @code{root}. However,
if you prefer, you can run the MySQL server as an unprivileged
-(non-@code{root}) user, provided that user can read and write files in
+(non-@code{root}) user, provided that the user can read and write files in
the database directory. Instructions for running MySQL as an
unprivileged user are given in @ref{Changing MySQL user, , Changing
MySQL user}.
@@ -7606,15 +7630,14 @@ shell> BINDIR/mysqladmin variables
@end example
The output from @code{mysqladmin version} varies slightly depending on your
-platform and version of MySQL, but should be similar to that shown
-below:
+platform and version of MySQL, but should be similar to that shown here:
@example
shell> BINDIR/mysqladmin version
mysqladmin Ver 8.14 Distrib 3.23.32, for linux on i586
Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
-and you are welcome to modify and redistribute it under the GPL license
+and you are welcome to modify and redistribute it under the GPL license.
Server version 3.23.32-debug
Protocol version 10
@@ -7658,7 +7681,7 @@ see @ref{Starting server}.
@item
Run some simple tests to verify that the server is working.
-The output should be similar to what is shown below:
+The output should be similar to what is shown here:
@example
shell> BINDIR/mysqlshow
@@ -7681,7 +7704,7 @@ Database: mysql
| user |
+--------------+
-shell> BINDIR/mysql -e "select host,db,user from db" mysql
+shell> BINDIR/mysql -e "SELECT host,db,user FROM db" mysql
+------+--------+------+
| host | db | user |
+------+--------+------+
@@ -7773,7 +7796,7 @@ example, for testing, or perhaps you simply want to run two installations at
the same time). Generally the problem that occurs when you try to run the
second server is that it tries to use the same socket and port as the old one.
In this case you will get the error message: @code{Can't start server: Bind on
-TCP/IP port: Address already in use} or @code{Can't start server : Bind on
+TCP/IP port: Address already in use} or @code{Can't start server: Bind on
unix socket...}. @xref{Installing many servers}.
@item You don't have write access to @file{/tmp}
@@ -7798,7 +7821,7 @@ shell> MYSQL_UNIX_PORT=/some_tmp_dir/mysqld.sock
shell> export TMPDIR MYSQL_UNIX_PORT
@end example
-@xref{Problems with mysql.sock}.
+See @ref{Problems with mysql.sock}.
@file{some_tmp_dir} should be the path to some directory for which you
have write permission. @xref{Environment variables}.
@@ -7864,7 +7887,7 @@ For Windows NT/2000/XP, please see @ref{NT start}.
By invoking @code{mysqld} directly.
@end itemize
-When the @code{mysqld} daemon starts up, it changes directory to the
+When the @code{mysqld} daemon starts up, it changes the directory to the
data directory. This is where it expects to write log files and the pid
(process ID) file, and where it expects to find databases.
@@ -7880,7 +7903,7 @@ defaults by specifying the correct pathnames as command-line arguments to
Normally you should need to tell @code{mysqld} only the base directory under
which MySQL is installed. You can do this with the @code{--basedir}
option. You can also use @code{--help} to check the effect of changing path
-options (note that @code{--help} @emph{must} be the final option of the
+options (note that @code{--help} @strong{must} be the final option of the
@code{mysqld} command). For example:
@example
@@ -7894,7 +7917,7 @@ Whichever method you use to start the server, if it fails to start up
correctly, check the log file to see if you can find out why. Log files
are located in the data directory (typically
@file{/usr/local/mysql/data} for a binary distribution,
-@file{/usr/local/var} for a source distribution,
+@file{/usr/local/var} for a source distribution, and
@file{\mysql\data\mysql.err} on Windows). Look in the data directory for
files with names of the form @file{host_name.err} and
@file{host_name.log} where @code{host_name} is the name of your server
@@ -7905,7 +7928,7 @@ shell> tail host_name.err
shell> tail host_name.log
@end example
-If you find something like the following in the log file:
+Look for something like the following in the log file:
@example
000729 14:50:10 bdb: Recovery function for LSN 1 27595 failed
000729 14:50:10 bdb: warning: ./test/t1.db: No such file or directory
@@ -7916,7 +7939,7 @@ This means that you didn't start @code{mysqld} with @code{--bdb-no-recover}
and Berkeley DB found something wrong with its log files when it
tried to recover your databases. To be able to continue, you should
move away the old Berkeley DB log file from the database directory to
-some other place, where you can later examine these. The log files are
+some other place, where you can later examine it. The log files are
named @file{log.0000000001}, where the number will increase over time.
If you are running @code{mysqld} with BDB table support and @code{mysqld} core
@@ -8008,7 +8031,7 @@ shell> mysql.server stop
under the MySQL installation directory or in the @file{support-files}
directory of the MySQL source tree.
-Before @code{mysql.server} starts the server, it changes directory to
+Before @code{mysql.server} starts the server, it changes the directory to
the MySQL installation directory, then invokes @code{safe_mysqld}.
You might need to edit @code{mysql.server} if you have a binary distribution
that you've installed in a non-standard location. Modify it to @code{cd}
@@ -8021,7 +8044,7 @@ You can take down the server manually by executing @code{mysqladmin shutdown}.
You might want to add these start and stop commands to the appropriate places
in your @file{/etc/rc*} files when you start using MySQL for
-production applications. Note that if you modify @code{mysql.server}, then
+production applications. Note that if you modify @code{mysql.server}, and then
upgrade MySQL sometime, your modified version will be overwritten,
so you should make a copy of your edited version that you can reinstall.
@@ -8069,15 +8092,15 @@ read from option files:
@cindex upgrading
@cindex downgrading
-You can always move the MySQL form and data files between
+You can always move the MySQL form and datafiles between
different versions on the same architecture as long as you have the same
base version of MySQL. The current base version is
3. If you change the character set when running MySQL (which may
also change the sort order), you must run @code{myisamchk -r -q} on all
-tables. Otherwise your indexes may not be ordered correctly.
+tables. Otherwise, your indexes may not be ordered correctly.
If you are afraid of new versions, you can always rename your old
-@code{mysqld} to something like @code{mysqld}-'old-version-number'. If
+@code{mysqld} to something like @code{mysqld-old-version-number}. If
your new @code{mysqld} then does something unexpected, you can simply shut it
down and restart with your old @code{mysqld}!
@@ -8094,7 +8117,7 @@ If you get some problems that the new @code{mysqld} server doesn't want to
start or that you can't connect without a password, check that you don't
have some old @file{my.cnf} file from your old installation! You can
check this with: @code{program-name --print-defaults}. If this outputs
-anything other than the program name, you have an active @code{my.cnf}
+anything other than the program name, you have an active @file{my.cnf}
file that will affect things!
It is a good idea to rebuild and reinstall the @code{Msql-Mysql-modules}
@@ -8115,7 +8138,7 @@ dumping core after you upgrade MySQL.
@node Upgrading-from-3.23, Upgrading-from-3.22, Upgrade, Upgrade
@subsection Upgrading From Version 3.23 to Version 4.0
-You can use your old data files without any modification with Version 4.0.
+You can use your old datafiles without any modification with Version 4.0.
If you want to move your data from a MySQL 4.0 server to an older server,
you have to use @code{mysqldump}.
@@ -8127,11 +8150,11 @@ version 4.0;
@itemize @bullet
@item
@code{DOUBLE} and @code{FLOAT} columns are now honoring the
-@code{UNSIGNED} flag on storage (before @code{UNSIGNED} was ignored for
+@code{UNSIGNED} flag on storage (before, @code{UNSIGNED} was ignored for
these columns).
@item
-Use @code{ORDER BY column DESC} now always sorts @code{NULL} values
-first; In 3.23 this was not always consistent.
+@code{ORDER BY column DESC} now always sorts @code{NULL} values
+first; in 3.23 this was not always consistent.
@item
@code{SHOW INDEX} has 2 columns more (@code{Null} and @code{Index_type})
than it had in 3.23.
@@ -8139,11 +8162,11 @@ than it had in 3.23.
@code{SIGNED} is a reserved word.
@item
The result of all bitwise operators @code{|}, @code{&}, @code{<<},
-@code{>>} and @code{~} is now unsigned. This may cause problems if you
+@code{>>}, and @code{~} is now unsigned. This may cause problems if you
are using them in a context where you want a signed result.
@xref{Cast Functions}.
@item
-@strong{NOTE:} When you use subtraction between integer values where
+@strong{Note}: when you use subtraction between integer values where
one is of type @code{UNSIGNED}, the result will be unsigned! In other
words, before upgrading to MySQL 4.0, you should check your application
for cases where you are subtracting a value from an unsigned entity and
@@ -8156,11 +8179,11 @@ To use @code{MATCH ... AGAINST (... IN BOOLEAN MODE)} with your tables,
you need to rebuild them with @code{ALTER TABLE table_name TYPE=MyISAM},
@strong{even} if they are of @code{MyISAM} type.
@item
-@code{LOCATE()} and @code{INSTR()} are case sensitive if one of the
+@code{LOCATE()} and @code{INSTR()} are case-sensitive if one of the
arguments is a binary string.
@item
@code{STRCMP()} now uses the current character set when doing comparisons,
-which means that the default comparison behavior now is case insensitive.
+which means that the default comparison behavior now is case-insensitive.
@item
@code{HEX(string)} now returns the characters in string converted to
hexadecimal. If you want to convert a number to hexadecimal, you should
@@ -8172,18 +8195,18 @@ don't specify @code{IGNORE}.
@item
@file{safe_mysqld} is renamed to @file{mysqld_safe}.
@item
-The old C API functions @code{mysql_drop_db}, @code{mysql_create_db} and
+The old C API functions @code{mysql_drop_db}, @code{mysql_create_db}, and
@code{mysql_connect} are not supported anymore, unless you compile
MySQL with @code{CFLAGS=-DUSE_OLD_FUNCTIONS}. Instead of doing this,
it is preferable to change the client to use the new 4.0 API.
@item
-In the @code{MYSQL_FIELD} structure, @code{length} and @code{max_length} has
+In the @code{MYSQL_FIELD} structure, @code{length} and @code{max_length} have
changed from @code{unsigned int} to @code{unsigned long}. This should not
-cause any other problems than some warnings if you use these to
-@code{printf()} type function.
+cause any problems, except that they may generate warning messages when
+used as arguments in the @code{printf()} class of functions.
@item
You should use @code{TRUNCATE TABLE} when you want to delete all rows
-from a table and you don't care of how many rows where deleted.
+from a table and you don't care how many rows were deleted.
(Because @code{TRUNCATE TABLE} is faster than @code{DELETE FROM table_name}).
@item
You will get an error if you have an active @code{LOCK TABLES} or
@@ -8191,21 +8214,20 @@ transaction when trying to execute @code{TRUNCATE TABLE} or @code{DROP
DATABASE}.
@item
You should use integers to store values in BIGINT columns (instead of using
-strings as you did in MySQL 3.23). Using strings will still work, but using
+strings, as you did in MySQL 3.23). Using strings will still work, but using
integers is more efficient.
@item
Format of @code{SHOW OPEN TABLE} has changed.
@item
-Multithreaded clients should use @code{mysql_thread_init()} and
+Multi-threaded clients should use @code{mysql_thread_init()} and
@code{mysql_thread_end()}. @xref{Threaded clients}.
@item
If you want to recompile the Perl DBD::mysql module, you must get
-Msql-Mysql-modules version 1.2218 or newer, because the older DBD modules
+Msql-Mysql-modules version 1.2218 or newer because the older DBD modules
used the deprecated @code{drop_db()} call.
@item
@code{RAND(seed)} returns a different random number series in 4.0 than in
-3.23; This was done to get @code{RAND(seed)} and @code{RAND(seed+1)} more
-different.
+3.23; this was done to further differentiate @code{RAND(seed)} and @code{RAND(seed+1)}.
@end itemize
@node Upgrading-from-3.22, Upgrading-from-3.21, Upgrading-from-3.23, Upgrade
@@ -8225,21 +8247,21 @@ or the Perl script @code{mysql_convert_table_format}.
Version 3.22 and 3.21 clients will work without any problems with a Version
3.23 server.
-The following lists tell what you have to watch out for when upgrading to
+The following list tells what you have to watch out for when upgrading to
Version 3.23:
@itemize @bullet
@item
-All tables that uses the @code{tis620} character set must be fixed
+All tables that use the @code{tis620} character set must be fixed
with @code{myisamchk -r} or @code{REPAIR TABLE}.
@item
If you do a @code{DROP DATABASE} on a symbolic linked database, both the
-link and the original database is deleted. (This didn't happen in 3.22
-because configure didn't detect the @code{readlink} system call).
+link and the original database are deleted. (This didn't happen in 3.22
+because configure didn't detect the @code{readlink} system call.)
@item
-@code{OPTIMIZE TABLE} now only works for @strong{MyISAM} tables.
+@code{OPTIMIZE TABLE} now only works for @code{MyISAM} tables.
For other table types, you can use @code{ALTER TABLE} to optimise the table.
During @code{OPTIMIZE TABLE} the table is now locked from other threads.
@@ -8247,12 +8269,12 @@ During @code{OPTIMIZE TABLE} the table is now locked from other threads.
The MySQL client @code{mysql} is now by default started with the
option @code{--no-named-commands (-g)}. This option can be disabled with
@code{--enable-named-commands (-G)}. This may cause incompatibility problems in
-some cases, for example in SQL scripts that use named commands without a
+some cases@-for example, in SQL scripts that use named commands without a
semicolon! Long format commands still work from the first line.
@item
-Date functions that work on part of dates (like @code{MONTH()}) will now
-return 0 for @code{0000-00-00} dates. (MySQL 3.22 returned @code{NULL}).
+Date functions that work on parts of dates (like @code{MONTH()}) will now
+return 0 for @code{0000-00-00} dates. (MySQL 3.22 returned @code{NULL}.)
@item
If you are using the @code{german} character sort order, you must repair
@@ -8266,13 +8288,13 @@ and not only the first argument.
@item
@code{AUTO_INCREMENT} will not work with negative numbers. The reason
for this is that negative numbers caused problems when wrapping from -1 to 0.
-@code{AUTO_INCREMENT} is now for MyISAM tables handled at a lower level and
+@code{AUTO_INCREMENT} for MyISAM tables is no handled at a lower level and
is much faster than before. For MyISAM tables old numbers are also not reused
anymore, even if you delete some rows from the table.
@item
@code{CASE}, @code{DELAYED}, @code{ELSE}, @code{END}, @code{FULLTEXT},
-@code{INNER}, @code{RIGHT}, @code{THEN} and @code{WHEN} are now reserved words.
+@code{INNER}, @code{RIGHT}, @code{THEN}, and @code{WHEN} are now reserved words.
@item
@code{FLOAT(X)} is now a true floating-point type and not a value with a
@@ -8285,15 +8307,15 @@ includes a place for the sign or the decimal point.
@item
A @code{TIME} string must now be of one of the following formats:
@code{[[[DAYS] [H]H:]MM:]SS[.fraction]} or
-@code{[[[[[H]H]H]H]MM]SS[.fraction]}
+@code{[[[[[H]H]H]H]MM]SS[.fraction]}.
@item
@code{LIKE} now compares strings using the same character comparison rules
-as @code{'='}. If you require the old behavior, you can compile
+as @code{=}. If you require the old behavior, you can compile
MySQL with the @code{CXXFLAGS=-DLIKE_CMP_TOUPPER} flag.
@item
-@code{REGEXP} is now case insensitive for normal (not binary) strings.
+@code{REGEXP} is now case-insensitive for normal (not binary) strings.
@item
When you check/repair tables you should use @code{CHECK TABLE}
@@ -8307,8 +8329,8 @@ MySQL Version 3.22 and Version 3.23, you should not use the
@item
Check all your calls to @code{DATE_FORMAT()} to make sure there is a
-@samp{%} before each format character. (Later MySQL Version 3.22
-did allow this syntax.)
+@samp{%} before each format character.
+(MySQL Version 3.22 and later already allowed this syntax.)
@item
@code{mysql_fetch_fields_direct} is now a function (it was a macro) and
@@ -8317,8 +8339,8 @@ it returns a pointer to a @code{MYSQL_FIELD} instead of a
@item
@code{mysql_num_fields()} can no longer be used on a @code{MYSQL*} object (it's
-now a function that takes @code{MYSQL_RES*} as an argument. You should now
-use @code{mysql_field_count()} instead.
+now a function that takes @code{MYSQL_RES*} as an argument, so you should
+use @code{mysql_field_count()} instead).
@item
In MySQL Version 3.22, the output of @code{SELECT DISTINCT ...} was
@@ -8326,8 +8348,8 @@ almost always sorted. In Version 3.23, you must use @code{GROUP BY} or
@code{ORDER BY} to obtain sorted output.
@item
-@code{SUM()} now returns @code{NULL}, instead of 0, if there is no matching
-rows. This is according to ANSI SQL.
+@code{SUM()} now returns @code{NULL}, instead of 0, if
+there are no matching rows. This is according to ANSI SQL.
@item
An @code{AND} or @code{OR} with @code{NULL} values will now return
@@ -8344,7 +8366,7 @@ than the length argument.
@cindex compatibility, between MySQL versions
@cindex upgrading, 3.21 to 3.22
-Nothing that affects compatibility has changed between Version 3.21 and 3.22.
+Nothing that affects compatibility has changed between versions 3.21 and 3.22.
The only pitfall is that new tables that are created with @code{DATE} type
columns will use the new way to store the date. You can't access these new
fields from an old version of @code{mysqld}.
@@ -8391,7 +8413,7 @@ If you are @strong{not} using the @code{--old-protocol} option to
@itemize @bullet
@item
All client code must be recompiled. If you are using ODBC, you must get
-the new @strong{MyODBC} 2.x driver.
+the new @code{MyODBC} 2.x driver.
@item
The script @code{scripts/add_long_password} must be run to convert the
@code{Password} field in the @code{mysql.user} table to @code{CHAR(16)}.
@@ -8424,7 +8446,7 @@ The new Perl @code{DBI}/@code{DBD} interface also supports the old
@code{mysqlperl} interface. The only change you have to make if you use
@code{mysqlperl} is to change the arguments to the @code{connect()} function.
The new arguments are: @code{host}, @code{database}, @code{user},
-@code{password} (the @code{user} and @code{password} arguments have changed
+and @code{password} (the @code{user} and @code{password} arguments have changed
places).
@xref{Perl DBI Class, , Perl @code{DBI} Class}.
@@ -8449,7 +8471,7 @@ There are some new reserved words. The most notable are @code{DATE},
If you are using MySQL Version 3.23, you can copy the @file{.frm},
@file{.MYI}, and @file{.MYD} files between different architectures that
support the same floating-point format. (MySQL takes care of any
-byte swapping issues.)
+byte-swapping issues.)
The MySQL @code{ISAM} data and index files (@file{.ISD} and
@file{*.ISM}, respectively) are architecture-dependent and in some cases
@@ -8507,7 +8529,7 @@ shell> gunzip < db_name.contents.gz | mysql db_name
You can also use @code{mysqldump} and @code{mysqlimport} to accomplish
the database transfer.
For big tables, this is much faster than simply using @code{mysqldump}.
-In the commands shown below, @code{DUMPDIR} represents the full pathname
+In the following commands, @code{DUMPDIR} represents the full pathname
of the directory you use to store the output from @code{mysqldump}.
First, create the directory for the output files and dump the database:
@@ -8527,7 +8549,7 @@ shell> cat DUMPDIR/*.sql | mysql db_name # create tables in database
shell> mysqlimport db_name DUMPDIR/*.txt # load data into tables
@end example
-Also, don't forget to copy the @code{mysql} database, because that's where the
+Also, don't forget to copy the @code{mysql} database because that's where the
grant tables (@code{user}, @code{db}, @code{host}) are stored. You may have
to run commands as the MySQL @code{root} user on the new machine
until you have the @code{mysql} database in place.
@@ -8549,7 +8571,7 @@ information.
* Other Unix Notes:: Other Unix Notes
* OS/2:: OS/2 Notes
* BeOS:: BeOS Notes
-* Novell Netware:: Novell Netware Notes
+* Novell Netware:: Novell NetWare Notes
@end menu
@@ -8566,13 +8588,13 @@ information.
* Linux-IA64:: Linux IA64 Notes
@end menu
-The notes below regarding @strong{glibc} apply only to the situation
+The following notes regarding @code{glibc} apply only to the situation
when you build MySQL
yourself. If you are running Linux on an x86 machine, in most cases it is
much better for you to just use our binary. We link our binaries against
-the best patched version of @strong{glibc} we can come up with and with the
+the best patched version of @code{glibc} we can come up with and with the
best compiler options, in an attempt to make it suitable for a high-load
-server. So if you read the text below, and are in doubt about
+server. So if you read the following text, and are in doubt about
what you should do, try our binary first to see if it meets your needs, and
worry about your own build only after you have discovered that our binary is
not good enough. In that case, we would appreciate a note about it, so we
@@ -8585,14 +8607,14 @@ Linux version that doesn't have @code{glibc2}, you must install
LinuxThreads before trying to compile MySQL. You can get
LinuxThreads at @uref{http://www.mysql.com/Downloads/Linux/}.
-@strong{Note:} We have seen some strange problems with Linux 2.2.14 and
-MySQL on SMP systems; If you have a SMP system, we recommend
-you to upgrade to Linux 2.4 as soon as possible! Your system will be
+@strong{Note}: we have seen some strange problems with Linux 2.2.14 and
+MySQL on SMP systems. If you have a SMP system, we recommend
+you upgrade to Linux 2.4 as soon as possible! Your system will be
faster and more stable by doing this!
Note that @code{glibc} versions before and including Version 2.1.1 have
a fatal bug in @code{pthread_mutex_timedwait} handling, which is used
-when you do @code{INSERT DELAYED}. We recommend you to not use
+when you do @code{INSERT DELAYED}. We recommend that you not use
@code{INSERT DELAYED} before upgrading glibc.
If you plan to have 1000+ concurrent connections, you will need to make
@@ -8604,11 +8626,11 @@ relative to the root of @code{glibc} Note that MySQL will not be
stable with around 600-1000 connections if @code{STACK_SIZE} is the default
of 2 MB.
-If you have a problem with that MySQL can't open enough files,
+If MySQL can't open enough files,
or connections, it may be that you haven't configured Linux to handle
enough files.
-In Linux 2.2 and forwards, you can check the number of allocated
+In Linux 2.2 and onward, you can check the number of allocated
file handlers by doing:
@example
@@ -8617,7 +8639,7 @@ cat /proc/sys/fs/dquot-max
cat /proc/sys/fs/super-max
@end example
-If you have more than 16M of memory, you should add something like the
+If you have more than 16 MB of memory, you should add something like the
following in your boot script (@file{/etc/rc/boot.local} on SuSE):
@example
@@ -8626,8 +8648,8 @@ echo 8192 > /proc/sys/fs/dquot-max
echo 1024 > /proc/sys/fs/super-max
@end example
-You can also run the above from the command line as root, but in this case
-your old limits will be used next time your computer reboots.
+You can also run the preceding commands from the command-line as root, but in this case
+your old limits will be used the next time your computer reboots.
You should also add /etc/my.cnf:
@@ -8636,12 +8658,12 @@ You should also add /etc/my.cnf:
open-files-limit=8192
@end example
-The above should allow MySQL to create up to 8192 connections + files.
+This should allow MySQL to create up to 8192 connections + files.
The @code{STACK_SIZE} constant in LinuxThreads controls the spacing of thread
stacks in the address space. It needs to be large enough so that there will
be plenty of room for the stack of each individual thread, but small enough
-to keep the stack of some thread from running into the global @code{mysqld}
+to keep the stack of some threads from running into the global @code{mysqld}
data. Unfortunately, the Linux implementation of @code{mmap()}, as we have
experimentally discovered, will successfully unmap an already mapped region
if you ask it to map out an address already in use, zeroing out the data
@@ -8657,7 +8679,7 @@ If you build MySQL yourself and do not want to mess with patching
LinuxThreads, you should set @code{max_connections} to a value no higher
than 500. It should be even less if you have a large key buffer, large
heap tables, or some other things that make @code{mysqld} allocate a lot
-of memory or if you are running a 2.2 kernel with a 2GB patch. If you are
+of memory, or if you are running a 2.2 kernel with a 2GB patch. If you are
using our binary or RPM version 3.23.25 or later, you can safely set
@code{max_connections} at 1500, assuming no large key buffer or heap tables
with lots of data. The more you reduce @code{STACK_SIZE} in LinuxThreads
@@ -8668,14 +8690,14 @@ If you use a lot of concurrent connections, you may suffer from a "feature"
in the 2.2 kernel that penalises a process for forking or cloning a child
in an attempt to prevent a fork bomb attack. This will cause MySQL
not to scale well as you increase the number of concurrent clients. On
-single CPU systems, we have seen this manifested in a very slow thread
+single-CPU systems, we have seen this manifested in a very slow thread
creation, which means it may take a long time to connect to MySQL
(as long as 1 minute), and it may take just as long to shut it down. On
-multiple CPU systems, we have observed a gradual drop in query speed as
+multiple-CPU systems, we have observed a gradual drop in query speed as
the number of clients increases. In the process of trying to find a
solution, we have received a kernel patch from one of our users, who
-claimed it made a lot of difference for his site. The patch is available here
-(@uref{http://www.mysql.com/Downloads/Patches/linux-fork.patch}). We have
+claimed it made a lot of difference for his site. The patch is available at
+@uref{http://www.mysql.com/Downloads/Patches/linux-fork.patch}. We have
now done rather extensive testing of this patch on both development and
production systems. It has significantly
improved @code{MySQL} performance without causing any problems and we now
@@ -8686,12 +8708,12 @@ the current performance of your system, rather than patching your 2.2 kernel,
it might be easier to just upgrade to 2.4, which will also give you a nice
SMP boost in addition to fixing this fairness bug.
-We have tested MySQL on the 2.4 kernel on a 2 CPU machine and
-found MySQL scales MUCH better - there was virtually no slowdown
-on query throughput all the way up
-to 1000 clients, and MySQL scaling factor ( computed as the ratio of
+We have tested MySQL on the 2.4 kernel on a 2-CPU machine and
+found MySQL scales @strong{much} better@-there was virtually no slowdown
+on queries throughput all the way up
+to 1000 clients, and the MySQL scaling factor (computed as the ratio of
maximum throughput to the throughput with one client) was 180%.
-We have observed similar results on a 4-CPU system - virtually no
+We have observed similar results on a 4-CPU system@-virtually no
slowdown as the number of
clients was increased up to 1000, and 300% scaling factor. So for a high-load
SMP server we would definitely recommend the 2.4 kernel at this point. We
@@ -8710,19 +8732,19 @@ include them in the manual.
There is another issue that greatly hurts MySQL performance,
especially on SMP systems. The implementation of mutex in
-LinuxThreads in @strong{glibc-2.1} is very bad for programs with many
+LinuxThreads in @code{glibc-2.1} is very bad for programs with many
threads that only
hold the mutex for a short time. On an SMP system, ironic as it is, if
-you link MySQL against unmodified @strong{LinuxThreads},
+you link MySQL against unmodified @code{LinuxThreads},
removing processors from the machine improves MySQL performance
-in many cases. We have made a patch available for @strong{glibc 2.1.3}
+in many cases. We have made a patch available for @code{glibc 2.1.3}
to correct this behavior
(@uref{http://www.mysql.com/Downloads/Linux/linuxthreads-2.1-patch}).
-With @strong{glibc-2.2.2}
+With @code{glibc-2.2.2}
MySQL version 3.23.36 will use the adaptive mutex, which is much
-better than even the patched one in @strong{glibc-2.1.3}. Be warned, however,
-that under some conditions, the current mutex code in @strong{glibc-2.2.2}
+better than even the patched one in @code{glibc-2.1.3}. Be warned, however,
+that under some conditions, the current mutex code in @code{glibc-2.2.2}
overspins, which hurts MySQL performance. The chance of this
condition can be reduced by renicing @code{mysqld} process to the highest
priority. We have also been able to correct the overspin behavior with
@@ -8831,8 +8853,8 @@ CC=fcc CFLAGS="-O -K fast -K lib -K omitfp -Kpreex -D_GNU_SOURCE \
MySQL needs at least Linux Version 2.0.
-@strong{WARNING}:
-We have have reports from some MySQL users that they have got serious
+@strong{Warning}:
+We have reports from some MySQL users that they have got serious
stability problems with MySQL with Linux kernel 2.2.14. If you are
using this kernel you should upgrade to 2.2.19 (or newer) or to a 2.4
kernel. If you have a multi-cpu box, then you should seriously consider
@@ -8874,7 +8896,7 @@ You can solve this problem in one of the following ways:
Get a MySQL source distribution (an RPM or the @code{tar.gz}
distribution) and install this instead.
@item
-Execute @code{mysql_install_db --force}; This will not execute the
+Execute @code{mysql_install_db --force}; this will not execute the
@code{resolveip} test in @code{mysql_install_db}. The downside is that
you can't use host names in the grant tables; you must use IP numbers
instead (except for @code{localhost}). If you are using an old MySQL
@@ -8916,11 +8938,11 @@ kernel will fix this problem in the future.
MySQL requires @code{libc} Version 5.4.12 or newer. It's known to
work with @code{libc} 5.4.46. @code{glibc} Version 2.0.6 and later should
also work. There have been some problems with the @code{glibc} RPMs from
-RedHat, so if you have problems, check whether or not there are any updates!
+RedHat, so if you have problems, check whether there are any updates!
The @code{glibc} 2.0.7-19 and 2.0.7-29 RPMs are known to work.
If you are using gcc 3.0 and above to compile MySQL, you must install
-the @code{libstdc++v3} library before compiling MySQL; If you don't do
+the @code{libstdc++v3} library before compiling MySQL; if you don't do
this you will get an error about a missing @code{__cxa_pure_virtual}
symbol during linking!
@@ -8935,7 +8957,7 @@ See the Installation chapter in the Reference Manual.
Just do what the error message says and add an extra underscore to the
@code{_P} macro that has only one underscore, then try again.
-You may get some warnings when compiling; those shown below can be ignored:
+You may get some warnings when compiling; those shown here can be ignored:
@example
mysqld.cc -o objs-thread/mysqld.o
@@ -8978,9 +9000,6 @@ You can avoid using @file{libg++.a} by running @code{configure} like this:
shell> CXX=gcc ./configure
@end example
-If you are running gcc 3.0 and above, you can't use the above trick with
-setting to CXX=gcc.
-
@node Linux-SPARC, Linux-Alpha, Linux-x86, Linux
@subsubsection Linux SPARC Notes
@@ -9017,7 +9036,7 @@ You can find the above compilers at
@uref{http://www.support.compaq.com/alpha-tools/}). By using these compilers,
instead of gcc, we get about 9-14 % better performance with MySQL.
-Note that the configure line optimised the binary for the current CPU; This
+Note that the configure line optimised the binary for the current CPU; this
means you can only use our binary if you have an Alpha EV6 processor. We also
compile statically to avoid library problems.
@@ -9070,7 +9089,7 @@ work). You must also use the @code{egcs} C++ compiler
@node Linux-IA64, , Linux-MIPS, Linux
@subsubsection Linux IA64 Notes
-To get MySQL to compile on Linux Ia64, we use the following compile line:
+To get MySQL to compile on Linux IA64, we use the following compile line:
Using @code{gcc-2.96}:
@example
@@ -9080,7 +9099,7 @@ CXXFLAGS="-O3 -fno-omit-frame-pointer -felide-constructors \
"--with-comment=Official MySQL binary" --with-extra-charsets=complex
@end example
-On Ia64 the MySQL client binaries are using shared libraries. This means
+On IA64 the MySQL client binaries are using shared libraries. This means
that if you install our binary distribution in some other place than
@file{/usr/local/mysql} you need to either modify @file{/etc/ld.so.conf}
or add the path to the directory where you have @file{libmysqlclient.so}
@@ -9152,7 +9171,7 @@ allow named pipe connections. You should use either
If @code{mysqld} doesn't start, please check the
@file{\mysql\data\mysql.err} file to see if the server wrote any
message there to indicate the cause of the problem. You can also
-try to start the server with @code{mysqld --standalone}; In this
+try to start the server with @code{mysqld --standalone}; in this
case, you may get some useful information on the screen that may
help solve the problem.
@@ -9300,11 +9319,11 @@ You can force a MySQL client to use named pipes by specifying the
@code{--socket} option to specify the name of the pipe.
Note that starting from 3.23.50, named pipes are only enabled if mysqld is
-started with with @code{--enable-named-pipe}. This is because some users
+started with @code{--enable-named-pipe}. This is because some users
have experienced problems shutting down the MySQL server when one uses
named pipes.
-You can test whether or not MySQL is working by executing the
+You can test whether MySQL is working by executing the
following commands:
@example
@@ -9360,8 +9379,9 @@ C:\> mysqladmin --user=root --password=your_password shutdown
If you are using the old shareware version of MySQL Version
3.21 under Windows, the above command will fail with an error:
-@code{parse error near 'SET OPTION password'}. The fix is in to upgrade
-to the current MySQL version, which is freely available.
+@code{parse error near 'SET OPTION password'}. The solution for
+this is to download and upgrade to the latest MySQL version,
+which is now freely available.
With the current MySQL versions you can easily add new users
and change privileges with @code{GRANT} and @code{REVOKE} commands.
@@ -9384,7 +9404,7 @@ MySQL server with SSH (by David Carlson @email{dcarlson@@mplcomm.com}):
Install an SSH client on your Windows machine. As a user, the best non-free
one I've found is from @code{SecureCRT} from @uref{http://www.vandyke.com/}.
Another option is @code{f-secure} from @uref{http://www.f-secure.com/}. You
-can also find some free ones on @strong{Google} at
+can also find some free ones on @code{Google} at
@uref{http://directory.google.com/Top/Computers/Security/Products_and_Tools/Cryptography/SSH/Clients/Windows/}.
@item
@@ -9409,7 +9429,7 @@ On your Windows machine, start some ODBC application (such as Access).
@item
Create a new file in Windows and link to MySQL using the ODBC
driver the same way you normally do, except type in @code{localhost}
-for the MySQL host server --- not @code{yourmysqlservername}.
+for the MySQL host server@-not @code{yourmysqlservername}.
@end itemize
You should now have an ODBC connection to MySQL, encrypted using SSH.
@@ -9443,7 +9463,7 @@ text @code{D:\data\foo\}. After that, all tables created in the database
Note that because of the speed penalty you get when opening every table,
we have not enabled this by default even if you have compiled
MySQL with support for this. To enable symlinks you should put
-in your @code{my.cnf} or @code{my.ini} file the following entry:
+in your @file{my.cnf} or @file{my.ini} file the following entry:
@example
[mysqld]
@@ -9539,8 +9559,8 @@ You can't kill MySQL from the task manager or with the shutdown
utility in Windows 95. You must take it down with @code{mysqladmin shutdown}.
@item Case-insensitive names
-Filenames are case insensitive on Windows, so database and table names
-are also case insensitive in MySQL for Windows. The only
+Filenames are case-insensitive on Windows, so database and table names
+are also case-insensitive in MySQL for Windows. The only
restriction is that database and table names must be specified using the same
case throughout a given statement. @xref{Name case sensitivity}.
@@ -9634,7 +9654,7 @@ Add some nice start and shutdown icons to the MySQL installation.
@item
When registering @code{mysqld} as a service with @code{--install} (on NT)
-it would be nice if you could also add default options on the command line.
+it would be nice if you could also add default options on the command-line.
For the moment, the workaround is to list the parameters in the
@file{C:\my.cnf} file instead.
@@ -9643,7 +9663,7 @@ It would be real nice to be able to kill @code{mysqld} from the task manager.
For the moment, you must use @code{mysqladmin shutdown}.
@item
-Port @code{readline} to Windows for use in the @code{mysql} command line tool.
+Port @code{readline} to Windows for use in the @code{mysql} command-line tool.
@item
GUI versions of the standard MySQL clients (@code{mysql},
@@ -9760,7 +9780,7 @@ If you turn on @code{__STDC__} with the @code{-Xc} option, the Sun compiler
can't compile with the Solaris @file{pthread.h} header file. This is a Sun
bug (broken compiler or broken include file).
-If @code{mysqld} issues the error message shown below when you run it, you have
+If @code{mysqld} issues the error message shown here when you run it, you have
tried to compile MySQL with the Sun compiler without enabling the
multi-thread option (@code{-mt}):
@@ -10031,11 +10051,11 @@ Versions 3 and up. It is possible to run with native threads on some late
The MySQL @file{Makefile}s require GNU make (@code{gmake}) to work. If
you want to compile MySQL you need to install GNU @code{make} first.
-Be sure to have your name resolver setup correct. Otherwise you may
+Be sure to have your name resolver setup correct. Otherwise, you may
experience resolver delays or failures when connecting to @code{mysqld}.
Make sure that the @code{localhost} entry in the @file{/etc/hosts} file is
-correct (otherwise you will have problems connecting to the database). The
+correct (otherwise, you will have problems connecting to the database). The
@file{/etc/hosts} file should start with a line:
@example
@@ -10092,7 +10112,7 @@ that are marked @code{-RELEASE}.
@node NetBSD, OpenBSD, FreeBSD, BSD Notes
@subsubsection NetBSD notes
-To compile on NetBSD you need GNU @code{make}. Otherwise the compile will
+To compile on NetBSD you need GNU @code{make}. Otherwise, the compile will
crash when @code{make} tries to run @code{lint} on C++ files.
@@ -10251,7 +10271,7 @@ CC=gcc CFLAGS="-O2 -fomit-frame-pointer" CXX=gcc CXXFLAGS="-O2 \
@end example
You might want to also add aliases to your shell's resource file to
-access @code{mysql} and @code{mysqladmin} from the command line:
+access @code{mysql} and @code{mysqladmin} from the command-line:
@example
alias mysql '/usr/local/mysql/bin/mysql'
@@ -10310,7 +10330,7 @@ HP 9000/7xx or 8xx running HP-UX 10.x where x < 2
HP 9000/7xx or 8xx running HP-UX 9.x
@end itemize
-To install the distribution, use one of the commands below, where
+To install the distribution, use one of the commands here, where
@code{/path/to/depot} is the full pathname of the depot file:
@itemize @bullet
@@ -10394,7 +10414,7 @@ PHKL_22840 Streams cumulative
PHNE_22397 ARPA cumulative
@end example
-This will solve a problem that one gets @code{EWOULDBLOCK} from @code{recv()}
+This will solve the problem of getting @code{EWOULDBLOCK} from @code{recv()}
and @code{EBADF} from @code{accept()} in threaded applications.
If you are using @code{gcc} 2.95.1 on an unpatched HP-UX 11.x system,
@@ -10532,7 +10552,7 @@ the IBM C compiler).
If you are using @code{gcc} or @code{egcs} to compile MySQL, you
@strong{must} use the @code{-fno-exceptions} flag, as the exception
-handling in @code{gcc}/@code{egcs} is not thread safe! (This is tested with
+handling in @code{gcc}/@code{egcs} is not thread-safe! (This is tested with
@code{egcs} 1.1.) There are also some known problems with IBM's assembler,
which may cause it to generate bad code when used with gcc.
@@ -10554,19 +10574,19 @@ option generates faster code, we recommend that you should always use this
option with @code{egcs / gcc}.
If you get a problem with assembler code try changing the -mcpu=xxx to
-match your cpu. Typically power2, power, or powerpc may need to be used,
+match your CPU. Typically power2, power, or powerpc may need to be used,
alternatively you might need to use 604 or 604e. I'm not positive but I
would think using "power" would likely be safe most of the time, even on
a power2 machine.
-If you don't know what your cpu is then do a "uname -m", this will give
+If you don't know what your CPU is then do a "uname -m", this will give
you back a string that looks like "000514676700", with a format of
xxyyyyyymmss where xx and ss are always 0's, yyyyyy is a unique system
id and mm is the id of the CPU Planar. A chart of these values can be
found at
-@uref{http://www.rs6000.ibm.com/doc_link/en_US/a_doc_lib/cmds/aixcmds5/uname.htm}.
+@uref{http://publib.boulder.ibm.com/doc_link/en_US/a_doc_lib/cmds/aixcmds5/uname.htm}.
This will give you a machine type and a machine model you can use to
-determine what type of cpu you have.
+determine what type of CPU you have.
If you have problems with signals (MySQL dies unexpectedly
under high load) you may have found an OS bug with threads and
@@ -10660,7 +10680,7 @@ accept(int,sockadddr *, int *)'
You can safely ignore these warnings. They occur because @code{configure}
can detect only errors, not warnings.
-If you start the server directly from the command line, you may have problems
+If you start the server directly from the command-line, you may have problems
with it dying when you log out. (When you log out, your outstanding processes
receive a @code{SIGHUP} signal.) If so, try starting the server like this:
@@ -11009,8 +11029,8 @@ In FSU Pthreads, the following system calls are pthreads-aware: @code{read()},
@item
The CSSA-2001-SCO.35.2 (the patch is listed in custom as
-erg711905-dscr_remap security patch (ver 2.0.0) breaks FSU threads and
-makes mysqld instable. You have to remove this one if you want to run
+erg711905-dscr_remap security patch (version 2.0.0) breaks FSU threads and
+makes mysqld unstable. You have to remove this one if you want to run
mysqld on an OpenServer 5.0.6 machine.
@end itemize
@@ -11071,7 +11091,6 @@ It's probably a good idea to install the above patches before trying to
compile/use MySQL.
@node OS/2, BeOS, Other Unix Notes, Operating System Specific Notes
-
@subsection OS/2 Notes
MySQL uses quite a few open files. Because of this, you should add
@@ -11109,11 +11128,11 @@ gcc -Zdll -Zmt -Zcrtdll=pthrdrtl -I../include -I../regex -I.. \
mv example.dll example.udf
@end example
-@strong{Note:} Due to limitations in OS/2, UDF module name stems must not
+@strong{Note}: Due to limitations in OS/2, UDF module name stems must not
exceed 8 characters. Modules are stored in the @file{/mysql2/udf}
directory; the @code{safe-mysqld.cmd} script will put this directory in
the @code{BEGINLIBPATH} environment variable. When using UDF modules,
-specified extensions are ignored --- it is assumed to be @file{.udf}.
+specified extensions are ignored@-it is assumed to be @file{.udf}.
For example, in Unix, the shared module might be named @file{example.so}
and you would load a function from it like this:
@@ -11145,10 +11164,10 @@ in a while.
@node Novell Netware, , BeOS, Operating System Specific Notes
-@subsection Novell Netware Notes
+@subsection Novell NetWare Notes
-We are really interested in getting MySQL to work on Netware, but
-unfortunately we don't have any person who knows Netware or has time to do
+We are really interested in getting MySQL to work on NetWare, but
+unfortunately we don't have any person who knows NetWare or has time to do
a port.
We are interested in finding someone to do a port, and we will help them
@@ -11192,7 +11211,7 @@ The Perl distributions are provided as compressed @code{tar} archives and
have names like @file{MODULE-VERSION.tar.gz}, where @code{MODULE} is the
module name and @code{VERSION} is the version number. You should get the
@code{Data-Dumper}, @code{DBI}, and @code{Msql-Mysql-modules} distributions
-and install them in that order. The installation procedure is shown below.
+and install them in that order. The installation procedure is shown here.
The example shown is for the @code{Data-Dumper} module, but the procedure is
the same for all three distributions:
@@ -11294,7 +11313,7 @@ ftp://ftp.de.uu.net/pub/CPAN/authors/id/JWIED/DBD-mysql-1.2212.x86.ppd
The above should work at least with ActiveState Perl Version 5.6.
If you can't get the above to work, you should instead install the
-@strong{MyODBC} driver and connect to MySQL server through
+@code{MyODBC} driver and connect to MySQL server through
ODBC:
@example
@@ -11497,7 +11516,7 @@ shell> mysql --help
This chapter assumes that @code{mysql} is installed on your machine and that
a MySQL server is available to which you can connect. If this is
-not true, contact your MySQL administrator. (If @emph{you} are the
+not true, contact your MySQL administrator. (If @strong{you} are the
administrator, you will need to consult other sections of this manual.)
This chapter describes the entire process of setting up and using a
@@ -11590,13 +11609,13 @@ principles of entering commands, using several queries you can try out to
familiarise yourself with how @code{mysql} works.
Here's a simple command that asks the server to tell you its version number
-and the current date. Type it in as shown below following the @code{mysql>}
+and the current date. Type it in as shown here following the @code{mysql>}
prompt and press Enter:
@example
mysql> SELECT VERSION(), CURRENT_DATE;
+--------------+--------------+
-| version() | CURRENT_DATE |
+| VERSION() | CURRENT_DATE |
+--------------+--------------+
| 3.22.20a-log | 1999-03-19 |
+--------------+--------------+
@@ -11662,7 +11681,7 @@ Just end each one with a semicolon:
@example
mysql> SELECT VERSION(); SELECT NOW();
+--------------+
-| version() |
+| VERSION() |
+--------------+
| 3.22.20a-log |
+--------------+
@@ -11795,7 +11814,7 @@ is ready for a new command.
It's important to know what the @code{'>} and @code{">} prompts signify,
because if you mistakenly enter an unterminated string, any further lines you
-type will appear to be ignored by @code{mysql} --- including a line
+type will appear to be ignored by @code{mysql}@-including a line
containing @code{QUIT}! This can be quite confusing, especially if you
don't know that you need to supply the terminating quote before you can
cancel the current command.
@@ -11908,7 +11927,7 @@ yourself:
mysql> CREATE DATABASE menagerie;
@end example
-Under Unix, database names are case sensitive (unlike SQL keywords), so you
+Under Unix, database names are case-sensitive (unlike SQL keywords), so you
must always refer to your database as @code{menagerie}, not as
@code{Menagerie}, @code{MENAGERIE}, or some other variant. This is also true
for table names. (Under Windows, this restriction does not apply, although
@@ -11926,7 +11945,7 @@ Database changed
Your database needs to be created only once, but you must select it for use
each time you begin a @code{mysql} session. You can do this by issuing a
@code{USE} statement as shown above. Alternatively, you can select the
-database on the command line when you invoke @code{mysql}. Just specify its
+database on the command-line when you invoke @code{mysql}. Just specify its
name after any connection parameters that you might need to provide. For
example:
@@ -11936,10 +11955,10 @@ Enter password: ********
@end example
Note that @code{menagerie} is not your password on the command just shown.
-If you want to supply your password on the command line after the @code{-p}
+If you want to supply your password on the command-line after the @code{-p}
option, you must do so with no intervening space (for example, as
@code{-pmypassword}, not as @code{-p mypassword}). However, putting your
-password on the command line is not recommended, because doing so exposes it
+password on the command-line is not recommended, because doing so exposes it
to snooping by other users logged in on your machine.
@@ -12059,9 +12078,9 @@ the columns in your table or what types they are.
After creating your table, you need to populate it. The @code{LOAD DATA} and
@code{INSERT} statements are useful for this.
-Suppose your pet records can be described as shown below.
+Suppose your pet records can be described as shown here.
(Observe that MySQL expects dates in @code{YYYY-MM-DD} format;
-this may be different than what you are used to.)
+this may be different from what you are used to.)
@multitable @columnfractions .10 .10 .10 .05 .15 .15
@item @strong{name} @tab @strong{owner} @tab @strong{species} @tab @strong{sex} @tab @strong{birth} @tab @strong{death}
@@ -12185,7 +12204,7 @@ mysql> SELECT * FROM pet;
This form of @code{SELECT} is useful if you want to review your entire table,
for instance, after you've just loaded it with your initial dataset. As it
-happens, the output just shown reveals an error in your data file: Bowser
+happens, the output just shown reveals an error in your datafile: Bowser
appears to have been born after he died! Consulting your original pedigree
papers, you find that the correct birth year is 1989, not 1998.
@@ -12241,7 +12260,7 @@ mysql> SELECT * FROM pet WHERE name = "Bowser";
The output confirms that the year is correctly recorded now as 1989, not 1998.
-String comparisons are normally case insensitive, so you can specify the
+String comparisons are normally case-insensitive, so you can specify the
name as @code{"bowser"}, @code{"BOWSER"}, etc. The query result will be
the same.
@@ -12415,6 +12434,12 @@ mysql> SELECT name, birth FROM pet ORDER BY birth;
+----------+------------+
@end example
+On character type columns, sorting@-like all other comparison
+operations@-is normally performed in a case-insensitive fashion.
+This means that the order will be undefined for columns that are identical
+except for their case. You can force a case-sensitive sort by using the
+BINARY cast: @code{ORDER BY BINARY(field)}.
+
To sort in reverse order, add the @code{DESC} (descending) keyword to the
name of the column you are sorting by:
@@ -12559,7 +12584,7 @@ mysql> SELECT name, birth, CURRENT_DATE,
@end example
A similar query can be used to determine age at death for animals that have
-died. You determine which animals these are by checking whether or not the
+died. You determine which animals these are by checking whether the
@code{death} value is @code{NULL}. Then, for those with non-@code{NULL}
values, compute the difference between the @code{death} and @code{birth}
values:
@@ -12711,8 +12736,8 @@ by Unix utilities such as @code{vi}, @code{grep}, and @code{sed}.
SQL pattern matching allows you to use @samp{_} to match any single
character and @samp{%} to match an arbitrary number of characters (including
-zero characters). In MySQL, SQL patterns are case insensitive by
-default. Some examples are shown below. Note that you do not use @code{=}
+zero characters). In MySQL, SQL patterns are case-insensitive by
+default. Some examples are shown here. Note that you do not use @code{=}
or @code{<>} when you use SQL patterns; use the @code{LIKE} or @code{NOT
LIKE} comparison operators instead.
@@ -12790,12 +12815,6 @@ example, @samp{x*} matches any number of @samp{x} characters,
number of anything.
@item
-Regular expressions are case sensitive, but you can use a character class to
-match both lettercases if you wish. For example, @samp{[aA]} matches
-lowercase or uppercase @samp{a} and @samp{[a-zA-Z]} matches any letter in
-either case.
-
-@item
The pattern matches if it occurs anywhere in the value being tested.
(SQL patterns match only if they match the entire value.)
@@ -12806,7 +12825,7 @@ pattern.
@end itemize
To demonstrate how extended regular expressions work, the @code{LIKE} queries
-shown above are rewritten below to use @code{REGEXP}.
+shown previously are rewritten here to use @code{REGEXP}.
To find names beginning with @samp{b}, use @samp{^} to match the beginning of
the name:
@@ -12821,7 +12840,7 @@ mysql> SELECT * FROM pet WHERE name REGEXP "^b";
+--------+--------+---------+------+------------+------------+
@end example
-Prior to MySQL Version 3.23.4, @code{REGEXP} is case sensitive,
+Prior to MySQL Version 3.23.4, @code{REGEXP} is case-sensitive,
and the previous query will return no rows. To match either lowercase or
uppercase @samp{b}, use this query instead:
@@ -12830,7 +12849,7 @@ mysql> SELECT * FROM pet WHERE name REGEXP "^[bB]";
@end example
From MySQL 3.23.4 on, to force a @code{REGEXP} comparison to
-be case sensitive, use the @code{BINARY} keyword to make one of the
+be case-sensitive, use the @code{BINARY} keyword to make one of the
strings a binary string. This query will match only lowercase @samp{b}
at the beginning of a name:
@@ -12865,7 +12884,7 @@ mysql> SELECT * FROM pet WHERE name REGEXP "w";
@end example
Because a regular expression pattern matches if it occurs anywhere in the
-value, it is not necessary in the previous query to put a wild card on either
+value, it is not necessary in the previous query to put a wildcard on either
side of the pattern to get it to match the entire value like it would be if
you used a SQL pattern.
@@ -13073,7 +13092,7 @@ mysql> CREATE TABLE event (name VARCHAR(20), date DATE,
As with the @code{pet} table, it's easiest to load the initial records
by creating a tab-delimited text file containing the information:
-@multitable @columnfractions .10 .15 .10 .30
+@multitable @columnfractions .10 .15 .10 .35
@item @strong{name} @tab @strong{date} @tab @strong{type} @tab @strong{remark}
@item Fluffy @tab 1995-05-15 @tab litter @tab 4 kittens, 3 female, 1 male
@item Buffy @tab 1993-06-23 @tab litter @tab 5 puppies, 2 female, 3 male
@@ -13220,8 +13239,8 @@ mysql> DESCRIBE pet;
@end example
@code{Field} indicates the column name, @code{Type} is the data type for
-the column, @code{NULL} indicates whether or not the column can contain
-@code{NULL} values, @code{Key} indicates whether or not the column is
+the column, @code{NULL} indicates whether the column can contain
+@code{NULL} values, @code{Key} indicates whether the column is
indexed, and @code{Default} specifies the column's default value.
If you have indexes on a table,
@@ -13242,7 +13261,7 @@ article (item number) for certain traders (dealers). Supposing that each
trader has a single fixed price per article, then (@code{article},
@code{dealer}) is a primary key for the records.
-Start the command line tool @code{mysql} and select a database:
+Start the command-line tool @code{mysql} and select a database:
@example
mysql your-database-name
@@ -13290,7 +13309,7 @@ mysql> SELECT * FROM shop;
* example-user-variables:: Using user variables
* example-Foreign keys:: Using foreign keys
* Searching on two keys:: Searching on Two Keys
-* Calculating days:: Calculating visits per day
+* Calculating days:: Calculating Visits Per Day
* example-AUTO_INCREMENT:: Using AUTO_INCREMENT
@end menu
@@ -13457,9 +13476,8 @@ For example, to find the articles with the highest and lowest price you
can do:
@example
-select @@min_price:=min(price),@@max_price:=max(price) from shop;
-select * from shop where price=@@min_price or price=@@max_price;
-
+mysql> SELECT @@min_price:=MIN(price),@@max_price:=MAX(price) FROM shop;
+mysql> SELECT * FROM shop WHERE price=@@min_price OR price=@@max_price;
+---------+--------+-------+
| article | dealer | price |
+---------+--------+-------+
@@ -13595,7 +13613,7 @@ The above way to solve this query is in effect a @code{UNION} of two queries.
@xref{UNION}.
@node Calculating days, example-AUTO_INCREMENT, Searching on two keys, Examples
-@subsection Calculating visits per day
+@subsection Calculating Visits Per Day
@findex BIT_OR
@findex BIT_COUNT
@@ -13628,7 +13646,7 @@ year/month combination, with automatic removal of duplicate entries.
@node example-AUTO_INCREMENT, , Calculating days, Examples
-@subsection Using AUTO_INCREMENT
+@subsection Using @code{AUTO_INCREMENT}
@cindex AUTO_INCREMENT
The @code{AUTO_INCREMENT} attribute can be used to generate an unique
@@ -13681,8 +13699,8 @@ Which returns:
+--------+----+---------+
@end example
-Note that in this case, the auto_increment value will be reused if you
-delete the row with the biggest auto_increment value in any group.
+Note that in this case, the @code{AUTO_INCREMENT} value will be reused if you
+delete the row with the biggest @code{AUTO_INCREMENT} value in any group.
You can get the used @code{AUTO_INCREMENT} key with the
@code{LAST_INSERT_ID()} SQL function or the @code{mysql_insert_id()} API
@@ -13713,7 +13731,7 @@ characters in the file that causes problems, you can do:
dos> mysql -e "source batch-file"
@end example
-If you need to specify connection parameters on the command line, the
+If you need to specify connection parameters on the command-line, the
command might look like this:
@example
@@ -13725,7 +13743,7 @@ When you use @code{mysql} this way, you are creating a script file, then
executing the script.
If you want the script to continue even if you have errors, you should
-use the @code{--force} command line option.
+use the @code{--force} command-line option.
Why use a script? Here are a few reasons:
@@ -13800,11 +13818,11 @@ If you want to get the interactive output format in batch mode, use
@code{mysql -t}. To echo to the output the commands that are executed, use
@code{mysql -vvv}.
-You can also use scripts in the @code{mysql} command line prompt by
+You can also use scripts in the @code{mysql} command-line prompt by
using the @code{source} command:
@example
-mysql> source filename
+mysql> source filename;
@end example
@node Twin, Apache, Batch mode, Tutorial
@@ -13831,7 +13849,7 @@ environmental risk factors.
More information about Twin studies can be found at:
@uref{http://www.imm.ki.se/TWIN/TWINUKW.HTM}
-The latter part of the project is administered with a Web interface
+The latter part of the project is administered with a web interface
written using Perl and MySQL.
Each night all data from the interviews are moved into a MySQL
@@ -13850,96 +13868,96 @@ The following query is used to determine who goes into the second part of the
project:
@example
-select
- concat(p1.id, p1.tvab) + 0 as tvid,
- concat(p1.christian_name, " ", p1.surname) as Name,
- p1.postal_code as Code,
- p1.city as City,
- pg.abrev as Area,
- if(td.participation = "Aborted", "A", " ") as A,
- p1.dead as dead1,
- l.event as event1,
- td.suspect as tsuspect1,
- id.suspect as isuspect1,
- td.severe as tsevere1,
- id.severe as isevere1,
- p2.dead as dead2,
- l2.event as event2,
- h2.nurse as nurse2,
- h2.doctor as doctor2,
- td2.suspect as tsuspect2,
- id2.suspect as isuspect2,
- td2.severe as tsevere2,
- id2.severe as isevere2,
+SELECT
+ CONCAT(p1.id, p1.tvab) + 0 AS tvid,
+ CONCAT(p1.christian_name, " ", p1.surname) AS Name,
+ p1.postal_code AS Code,
+ p1.city AS City,
+ pg.abrev AS Area,
+ IF(td.participation = "Aborted", "A", " ") AS A,
+ p1.dead AS dead1,
+ l.event AS event1,
+ td.suspect AS tsuspect1,
+ id.suspect AS isuspect1,
+ td.severe AS tsevere1,
+ id.severe AS isevere1,
+ p2.dead AS dead2,
+ l2.event AS event2,
+ h2.nurse AS nurse2,
+ h2.doctor AS doctor2,
+ td2.suspect AS tsuspect2,
+ id2.suspect AS isuspect2,
+ td2.severe AS tsevere2,
+ id2.severe AS isevere2,
l.finish_date
-from
- twin_project as tp
+FROM
+ twin_project AS tp
/* For Twin 1 */
- left join twin_data as td on tp.id = td.id
- and tp.tvab = td.tvab
- left join informant_data as id on tp.id = id.id
- and tp.tvab = id.tvab
- left join harmony as h on tp.id = h.id
- and tp.tvab = h.tvab
- left join lentus as l on tp.id = l.id
- and tp.tvab = l.tvab
+ LEFT JOIN twin_data AS td ON tp.id = td.id
+ AND tp.tvab = td.tvab
+ LEFT JOIN informant_data AS id ON tp.id = id.id
+ AND tp.tvab = id.tvab
+ LEFT JOIN harmony AS h ON tp.id = h.id
+ AND tp.tvab = h.tvab
+ LEFT JOIN lentus AS l ON tp.id = l.id
+ AND tp.tvab = l.tvab
/* For Twin 2 */
- left join twin_data as td2 on p2.id = td2.id
- and p2.tvab = td2.tvab
- left join informant_data as id2 on p2.id = id2.id
- and p2.tvab = id2.tvab
- left join harmony as h2 on p2.id = h2.id
- and p2.tvab = h2.tvab
- left join lentus as l2 on p2.id = l2.id
- and p2.tvab = l2.tvab,
- person_data as p1,
- person_data as p2,
- postal_groups as pg
-where
+ LEFT JOIN twin_data AS td2 ON p2.id = td2.id
+ AND p2.tvab = td2.tvab
+ LEFT JOIN informant_data AS id2 ON p2.id = id2.id
+ AND p2.tvab = id2.tvab
+ LEFT JOIN harmony AS h2 ON p2.id = h2.id
+ AND p2.tvab = h2.tvab
+ LEFT JOIN lentus AS l2 ON p2.id = l2.id
+ AND p2.tvab = l2.tvab,
+ person_data AS p1,
+ person_data AS p2,
+ postal_groups AS pg
+WHERE
/* p1 gets main twin and p2 gets his/her twin. */
/* ptvab is a field inverted from tvab */
- p1.id = tp.id and p1.tvab = tp.tvab and
- p2.id = p1.id and p2.ptvab = p1.tvab and
+ p1.id = tp.id AND p1.tvab = tp.tvab AND
+ p2.id = p1.id AND p2.ptvab = p1.tvab AND
/* Just the sceening survey */
- tp.survey_no = 5 and
+ tp.survey_no = 5 AND
/* Skip if partner died before 65 but allow emigration (dead=9) */
- (p2.dead = 0 or p2.dead = 9 or
- (p2.dead = 1 and
- (p2.death_date = 0 or
- (((to_days(p2.death_date) - to_days(p2.birthday)) / 365)
+ (p2.dead = 0 OR p2.dead = 9 OR
+ (p2.dead = 1 AND
+ (p2.death_date = 0 OR
+ (((TO_DAYS(p2.death_date) - TO_DAYS(p2.birthday)) / 365)
>= 65))))
- and
+ AND
(
/* Twin is suspect */
- (td.future_contact = 'Yes' and td.suspect = 2) or
+ (td.future_contact = 'Yes' AND td.suspect = 2) OR
/* Twin is suspect - Informant is Blessed */
- (td.future_contact = 'Yes' and td.suspect = 1
- and id.suspect = 1) or
+ (td.future_contact = 'Yes' AND td.suspect = 1
+ AND id.suspect = 1) OR
/* No twin - Informant is Blessed */
- (ISNULL(td.suspect) and id.suspect = 1
- and id.future_contact = 'Yes') or
+ (ISNULL(td.suspect) AND id.suspect = 1
+ AND id.future_contact = 'Yes') OR
/* Twin broken off - Informant is Blessed */
(td.participation = 'Aborted'
- and id.suspect = 1 and id.future_contact = 'Yes') or
+ AND id.suspect = 1 AND id.future_contact = 'Yes') OR
/* Twin broken off - No inform - Have partner */
- (td.participation = 'Aborted' and ISNULL(id.suspect)
- and p2.dead = 0))
- and
+ (td.participation = 'Aborted' AND ISNULL(id.suspect)
+ AND p2.dead = 0))
+ AND
l.event = 'Finished'
/* Get at area code */
- and substring(p1.postal_code, 1, 2) = pg.code
+ AND SUBSTRING(p1.postal_code, 1, 2) = pg.code
/* Not already distributed */
- and (h.nurse is NULL or h.nurse=00 or h.doctor=00)
+ AND (h.nurse IS NULL OR h.nurse=00 OR h.doctor=00)
/* Has not refused or been aborted */
- and not (h.status = 'Refused' or h.status = 'Aborted'
- or h.status = 'Died' or h.status = 'Other')
-order by
+ AND NOT (h.status = 'Refused' OR h.status = 'Aborted'
+ OR h.status = 'Died' OR h.status = 'Other')
+ORDER BY
tvid;
@end example
Some explanations:
@table @asis
-@item @code{concat(p1.id, p1.tvab) + 0 as tvid}
+@item @code{CONCAT(p1.id, p1.tvab) + 0 AS tvid}
We want to sort on the concatenated @code{id} and @code{tvab} in
numerical order. Adding @code{0} to the result causes MySQL to
treat the result as a number.
@@ -13982,29 +14000,29 @@ The current number of records in the tables used above:
@subsection Show a Table on Twin Pair Status
Each interview ends with a status code called @code{event}. The query
-shown below is used to display a table over all twin pairs combined by
+shown here is used to display a table over all twin pairs combined by
event. This indicates in how many pairs both twins are finished, in how many
pairs one twin is finished and the other refused, and so on.
@example
-select
+SELECT
t1.event,
t2.event,
- count(*)
-from
- lentus as t1,
- lentus as t2,
- twin_project as tp
-where
+ COUNT(*)
+FROM
+ lentus AS t1,
+ lentus AS t2,
+ twin_project AS tp
+WHERE
/* We are looking at one pair at a time */
t1.id = tp.id
- and t1.tvab=tp.tvab
- and t1.id = t2.id
+ AND t1.tvab=tp.tvab
+ AND t1.id = t2.id
/* Just the sceening survey */
- and tp.survey_no = 5
+ AND tp.survey_no = 5
/* This makes each pair only appear once */
- and t1.tvab='1' and t2.tvab='2'
-group by
+ AND t1.tvab='1' AND t2.tvab='2'
+GROUP BY
t1.event, t2.event;
@end example
@@ -14062,15 +14080,15 @@ FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '\\'
@menu
-* Command-line options:: mysqld Command-line Options
-* Option files:: my.cnf Option Files
+* Command-line options:: @code{mysqld} Command-line Options
+* Option files:: @file{my.cnf} Option Files
* Installing many servers:: Installing Many Servers on the Same Machine
* Multiple servers:: Running Multiple MySQL Servers on the Same Machine
@end menu
@node Command-line options, Option files, Configuring MySQL, Configuring MySQL
-@subsection mysqld Command-line Options
+@subsection @code{mysqld} Command-line Options
@findex command-line options
@cindex options, command-line
@@ -14117,8 +14135,9 @@ though.
@item --core-file
Write a core file if @code{mysqld} dies. For some systems you must also
-specify @code{--core-file-size} to @code{safe_mysqld}. @xref{safe_mysqld, ,
-@code{safe_mysqld}}. Note that on some system like Solaris, you will
+specify @code{--core-file-size} to @code{safe_mysqld}.
+@xref{safe_mysqld, ,@code{safe_mysqld}}.
+Note that on some systems, like Solaris, you will
not get a core file if you are also using the @code{--user} option.
@item -h, --datadir=path
@@ -14144,8 +14163,8 @@ Read the default keys used by @code{DES_ENCRYPT()} and @code{DES_DECRYPT()}
from this file.
@item --enable-locking
-Enable system locking. Note that if you use this option on a system
-which a not fully working lockd() (as on Linux) you will easily get
+Enable system locking. Note that if you use this option on a system on
+which @code{lockd} does not fully work (as on Linux), you will easily get
mysqld to deadlock.
@item --enable-named-pipe
@@ -14153,7 +14172,7 @@ Enable support for named pipes (only on NT/Win2000/XP).
@item -T, --exit-info
This is a bit mask of different flags one can use for debugging the
-mysqld server; One should not use this option if one doesn't know
+mysqld server; one should not use this option if one doesn't know
exactly what it does!
@item --flush
@@ -14205,11 +14224,12 @@ system supports the @code{mlockall()} system call (like Solaris). This
may help if you have a problem where the operating system is causing
@code{mysqld} to swap on disk.
-@item --myisam-recover [=option[,option...]]] where option is any combination
+@item --myisam-recover [=option[,option...]]]
+Option is any combination
of @code{DEFAULT}, @code{BACKUP}, @code{FORCE} or @code{QUICK}. You can
-also set this explicitely to @code{""} if you want to disable this
+also set this explicitly to @code{""} if you want to disable this
option. If this option is used, @code{mysqld} will on open check if the
-table is marked as crashed or if if the table wasn't closed properly.
+table is marked as crashed or if the table wasn't closed properly.
(The last option only works if you are running with
@code{--skip-locking}.) If this is the case @code{mysqld} will run
check on the table. If the table was corrupted, @code{mysqld} will
@@ -14222,7 +14242,7 @@ The following options affects how the repair works.
@item DEFAULT @tab The same as not giving any option to
@code{--myisam-recover}.
@item BACKUP @tab If the data table was changed during recover, save a
- backup of the @file{table_name.MYD} data file as
+ backup of the @file{table_name.MYD} datafile as
@file{table_name-datetime.BAK}.
@item FORCE @tab Run recover even if we will loose more than one row
from the .MYD file.
@@ -14234,7 +14254,7 @@ Before a table is automatically repaired, MySQL will add a note
about this in the error log. If you want to be able to recover from most
things without user intervention, you should use the options
@code{BACKUP,FORCE}. This will force a repair of a table even if some rows
-would be deleted, but it will keep the old data file as a backup so that
+would be deleted, but it will keep the old datafile as a backup so that
you can later examine what happened.
@item --pid-file=path
@@ -14264,7 +14284,7 @@ Don't show databases for which the user doesn't have any privileges.
@item --safe-user-create
If this is enabled, a user can't create new users with the GRANT
-command, if the user doesn't have @code{INSERT} privilege to the
+command, if the user doesn't have @strong{insert} privilege to the
@code{mysql.user} table or any column in this table.
@item --skip-concurrent-insert
@@ -14278,7 +14298,7 @@ Ignore the @code{delay_key_write} option for all tables.
@item --skip-grant-tables
This option causes the server not to use the privilege system at all. This
-gives everyone @emph{full access} to all databases! (You can tell a running
+gives everyone @strong{full access} to all databases! (You can tell a running
server to start using the grant tables again by executing @code{mysqladmin
flush-privileges} or @code{mysqladmin reload}.)
@@ -14321,7 +14341,8 @@ privilege.
@item --skip-stack-trace
Don't write stack traces. This option is useful when you are running
-@code{mysqld} under a debugger. @xref{Debugging server}.
+@code{mysqld} under a debugger. On some system you also have to use
+this option to get a core file. @xref{Debugging server}.
@item --skip-thread-priority
Disable using thread priorities for faster response time.
@@ -14339,7 +14360,15 @@ Option can be any combination of: @code{REAL_AS_FLOAT},
By specifying all of the above options is same as using --ansi.
With this option one can turn on only needed SQL modes. @xref{ANSI mode}.
-@item transaction-isolation= @{ READ-UNCOMMITTED | READ-COMMITTED | REPEATABLE-READ | SERIALIZABLE @}
+@item --temp-pool
+Using this option will cause most temporary files created to use a small
+set of names, rather than a unique name for each new file. This is to
+work around a problem in the Linux kernel dealing with creating a bunch
+of new files with different names. With the old behavior, Linux seems to
+'leak' memory, as it's being allocated to the directory entry cache
+instead of the disk cache.
+
+@item --transaction-isolation= @{ READ-UNCOMMITTED | READ-COMMITTED | REPEATABLE-READ | SERIALIZABLE @}
Sets the default transaction isolation level. @xref{SET TRANSACTION}.
@item -t, --tmpdir=path
@@ -14348,7 +14377,7 @@ directory resides on a partition too small to hold temporary tables.
@item -u, --user= [user_name | userid]
Run @code{mysqld} daemon as user @code{user_name} or @code{userid} (numeric).
-This option is @emph{mandatory} when starting @code{mysqld} as root.
+This option is @strong{mandatory} when starting @code{mysqld} as root.
@item -V, --version
Output version information and exit.
@@ -14360,7 +14389,7 @@ Print out warnings like @code{Aborted connection...} to the @file{.err} file.
@node Option files, Installing many servers, Command-line options, Configuring MySQL
-@subsection my.cnf Option Files
+@subsection @file{my.cnf} Option Files
@cindex default options
@cindex option files
@@ -14373,7 +14402,7 @@ server and for clients from option files.
MySQL reads default options from the following files on Unix:
@tindex .my.cnf file
-@multitable @columnfractions .35 .45
+@multitable @columnfractions .35 .50
@item @strong{Filename} @tab @strong{Purpose}
@item @code{/etc/my.cnf} @tab Global options
@item @code{DATADIR/my.cnf} @tab Server-specific options
@@ -14391,7 +14420,7 @@ before it processes any command-line arguments.)
MySQL reads default options from the following files on Windows:
-@multitable @columnfractions .35 .45
+@multitable @columnfractions .35 .50
@item @strong{Filename} @tab @strong{Purpose}
@item @code{windows-system-directory\my.ini} @tab Global options
@item @code{C:\my.cnf} @tab Global options
@@ -14405,9 +14434,9 @@ Note that on Windows, you should specify all paths with @code{/} instead of
MySQL tries to read option files in the order listed above. If
multiple option files exist, an option specified in a file read later takes
precedence over the same option specified in a file read earlier. Options
-specified on the command line take precedence over options specified in any
+specified on the command-line take precedence over options specified in any
option file. Some options can be specified using environment variables.
-Options specified on the command line or in option files take precedence over
+Options specified on the command-line or in option files take precedence over
environment variable values. @xref{Environment variables}.
The following programs support option files: @code{mysql},
@@ -14415,7 +14444,7 @@ The following programs support option files: @code{mysql},
@code{mysqldump}, @code{mysqlimport}, @code{mysqlshow}, @code{mysqlcheck},
@code{myisamchk}, and @code{myisampack}.
-Any long option that may be given on the command line when running a MySQL
+Any long option that may be given on the command-line when running a MySQL
program can be given in an option file as well (without the leading double
dash). Run the program with @code{--help} to get a list of available options.
@@ -14432,13 +14461,13 @@ apply to the named group until the end of the option file or another group
line is given.
@item option
-This is equivalent to @code{--option} on the command line.
+This is equivalent to @code{--option} on the command-line.
@item option=value
-This is equivalent to @code{--option=value} on the command line.
+This is equivalent to @code{--option=value} on the command-line.
@item set-variable = variable=value
-This is equivalent to @code{--set-variable variable=value} on the command line.
+This is equivalent to @code{--set-variable variable=value} on the command-line.
This syntax must be used to set a @code{mysqld} variable.
@end table
@@ -14506,7 +14535,7 @@ following options:
@item --defaults-extra-file=full-path-to-default-file @tab Read this configuration file after the global configuration file but before the user configuration file.
@end multitable
-Note that the above options must be first on the command line to work!
+Note that the above options must be first on the command-line to work!
@code{--print-defaults} may however be used directly after the
@code{--defaults-xxx-file} commands.
@@ -14570,8 +14599,7 @@ will automatically be directed to the new running server!
If you need to do this more permanently, you should create an option
file for each server. @xref{Option files}. In your startup script that
-is executed at boot time (mysql.server?) you should specify for both
-servers:
+is executed at boot time you should specify for both servers:
@code{safe_mysqld --default-file=path-to-option-file}
@@ -14637,9 +14665,9 @@ shell> ./configure --with-tcp-port=port_number \
--prefix=/usr/local/mysql-3.22.9
@end example
-Here @code{port_number} and @code{file_name} should be different than the
+Here @code{port_number} and @code{file_name} should be different from the
default port number and socket file pathname, and the @code{--prefix} value
-should specify an installation directory different than the one under which
+should specify an installation directory different from the one under which
the existing MySQL installation is located.
You can check the socket used by any currently executing MySQL server
@@ -14658,7 +14686,7 @@ MySQL, including the socket name.
You don't have to recompile a new MySQL server just to start with
a different port and socket. You can change the port and socket to be used
-by specifying them at run time as options to @code{safe_mysqld}:
+by specifying them at runtime as options to @code{safe_mysqld}:
@example
shell> /path/to/safe_mysqld --socket=file_name --port=port_number
@@ -14674,7 +14702,7 @@ files to @code{safe_mysqld} with @code{--log}, @code{--log-update}, or
@code{--log-slow-queries}. Otherwise, both servers may be trying to
write to the same log file.
-@strong{Warning}: Normally you should never have two servers that update
+@strong{Warning}: normally you should never have two servers that update
data in the same database! If your OS doesn't support fault-free system
locking, this may lead to unpleasant surprises!
@@ -14856,7 +14884,7 @@ connection is refused, everything is OK; the port is blocked.
@item
Do not trust any data entered by your users. They can try to trick your
-code by entering special or escaped character sequences in Web forms,
+code by entering special or escaped character sequences in web forms,
URLs, or whatever application you have built. Be sure that your
application remains secure if a user enters something like ``@code{; DROP
DATABASE mysql;}''. This is an extreme example, but large security leaks
@@ -14876,10 +14904,10 @@ strips all non-numeric symbols from it.
Checklist:
@itemize @minus
@item
-All Web applications:
+All web applications:
@itemize @bullet
@item
-Try to enter @samp{'} and @samp{"} in all your Web forms. If you get any kind
+Try to enter @samp{'} and @samp{"} in all your web forms. If you get any kind
of MySQL error, investigate the problem right away.
@item
Try to modify any dynamic URLs by adding @code{%22} (@samp{"}), @code{%23}
@@ -14938,7 +14966,7 @@ SSH port-forwarding can be used to create an encrypted (and compressed)
tunnel for the communication.
@item
Learn to use the @code{tcpdump} and @code{strings} utilities. For most cases,
-you can check whether or not MySQL data streams are unencrypted
+you can check whether MySQL data streams are unencrypted
by issuing a command like the following:
@example
@@ -14971,7 +14999,7 @@ All other information is transferred as text that can be read by anyone
who is able to watch the connection. If you are concerned about this,
you can use the compressed protocol (in MySQL Version 3.22 and above)
to make things much harder. To make things even more secure you should use
-@code{ssh}. You can find an Open Source @code{ssh} client at
+@code{ssh}. You can find an @code{Open Source} @code{ssh} client at
@uref{http://www.openssh.org/}, and a commercial @code{ssh} client at
@uref{http://www.ssh.com/}. With this, you can get an encrypted TCP/IP
connection between a MySQL server and a MySQL client.
@@ -15001,7 +15029,7 @@ mysql> FLUSH PRIVILEGES;
@item
Don't run the MySQL daemon as the Unix @code{root} user. This is
-very dangerous, because any user with @code{FILE} privileges will be able
+very dangerous, because any user with the @strong{file} privilege will be able
to create files as @code{root} (for example, @code{~root/.bashrc}). To
prevent this, @code{mysqld} will refuse to run as @code{root} unless it
is specified directly using a @code{--user=root} option.
@@ -15049,12 +15077,12 @@ in and check things even if all normal connections are in use.
@item
Don't give the @strong{file} privilege to all users. Any user that has this
-privilege can write a file anywhere in the file system with the privileges of
+privilege can write a file anywhere in the filesystem with the privileges of
the @code{mysqld} daemon! To make this a bit safer, all files generated with
@code{SELECT ... INTO OUTFILE} are readable to everyone, and you cannot
overwrite existing files.
-@tindex /etc/passwd
+@tindex @file{/etc/passwd}
The @strong{file} privilege may also be used to read any file accessible
to the Unix user that the server runs as. This could be abused, for example,
by using @code{LOAD DATA} to load @file{/etc/passwd} into a table, which
@@ -15064,7 +15092,7 @@ can then be read with @code{SELECT}.
If you don't trust your DNS, you should use IP numbers instead of
hostnames in the grant tables. In any case, you should be very careful
about creating grant table entries using hostname values that contain
-wild cards!
+wildcards!
@item
If you want to restrict the number of connections for a single user, you
@@ -15090,13 +15118,13 @@ some kind of privilege.
@item --safe-user-create
If this is enabled, an user can't create new users with the @code{GRANT}
-command, if the user doesn't have @code{INSERT} privilege to the
+command, if the user doesn't have the @strong{insert} privilege for the
@code{mysql.user} table. If you want to give a user access to just create
new users with those privileges that the user has right to grant, you should
give the user the following privilege:
@example
-GRANT INSERT(user) on mysql.user to 'user'@@'hostname';
+mysql> GRANT INSERT(user) ON mysql.user TO 'user'@@'hostname';
@end example
This will ensure that the user can't change any privilege columns directly,
@@ -15104,7 +15132,7 @@ but has to use the @code{GRANT} command to give privileges to other users.
@item --skip-grant-tables
This option causes the server not to use the privilege system at all. This
-gives everyone @emph{full access} to all databases! (You can tell a running
+gives everyone @strong{full access} to all databases! (You can tell a running
server to start using the grant tables again by executing @code{mysqladmin
flush-privileges} or @code{mysqladmin reload}.)
@@ -15149,7 +15177,7 @@ If you don't configure MySQL with @code{--enable-local-infile}, then
calls @code{mysql_options(... MYSQL_OPT_LOCAL_INFILE, 0)} in the client.
@xref{mysql_options, , @code{mysql_options()}}.
-For the @code{mysql} command line client, @code{LOAD DATA LOCAL} can be
+For the @code{mysql} command-line client, @code{LOAD DATA LOCAL} can be
enabled by specifying the option @code{--local-infile[=1]}, or disabled
with @code{--local-infile=0}.
@@ -15160,7 +15188,7 @@ before.
One can disable all @code{LOAD DATA LOCAL} commands in the MySQL server
by starting @code{mysqld} with @code{--local-infile=0}.
-In the case that @code{LOAD DATA INFILE} is disabled in the server or
+In the case that @code{LOAD DATA LOCAL INFILE} is disabled in the server or
the client, you will get the error message (1148):
@example
@@ -15209,11 +15237,11 @@ MySQL access control involves two stages:
@itemize @bullet
@item
-Stage 1: The server checks whether or not you are even allowed to connect.
+Stage 1: The server checks whether you are even allowed to connect.
@item
Stage 2: Assuming you can connect, the server checks each request you issue
-to see whether or not you have sufficient privileges to perform it. For
+to see whether you have sufficient privileges to perform it. For
example, if you try to select rows from a table in a database or drop a table
from the database, the server makes sure you have the @strong{select}
privilege for the table or the @strong{drop} privilege for the database.
@@ -15221,7 +15249,7 @@ privilege for the table or the @strong{drop} privilege for the database.
The server uses the @code{user}, @code{db}, and @code{host} tables in the
@code{mysql} database at both stages of access control. The fields in these
-grant tables are shown below:
+grant tables are shown here:
@multitable @columnfractions .20 .20 .20 .20
@item @strong{Table name} @tab @code{user} @tab @code{db} @tab @code{host}
@@ -15249,7 +15277,7 @@ grant tables are shown below:
For the second stage of access control (request verification), the server
may, if the request involves tables, additionally consult the
@code{tables_priv} and @code{columns_priv} tables. The fields in these
-tables are shown below:
+tables are shown here:
@multitable @columnfractions .20 .20 .20
@item @strong{Table name} @tab @code{tables_priv} @tab @code{columns_priv}
@@ -15283,9 +15311,9 @@ to which each entry applies.
@cindex case sensitivity, in access checking
For access-checking purposes, comparisons of @code{Host} values are
-case insensitive. @code{User}, @code{Password}, @code{Db}, and
-@code{Table_name} values are case sensitive.
-@code{Column_name} values are case insensitive in MySQL Version
+case-insensitive. @code{User}, @code{Password}, @code{Db}, and
+@code{Table_name} values are case-sensitive.
+@code{Column_name} values are case-insensitive in MySQL Version
3.22.12 or later.
Privilege fields indicate the privileges granted by a table entry, that is,
@@ -15293,10 +15321,10 @@ what operations can be performed. The server combines the information in the
various grant tables to form a complete description of a user's privileges.
The rules used to do this are described in @ref{Request access}.
-Scope fields are strings, declared as shown below; the default value for
+Scope fields are strings, declared as shown here; the default value for
each is the empty string:
-@multitable @columnfractions .15 .15 .6
+@multitable @columnfractions .20 .15 .65
@item @strong{Field name} @tab @strong{Type} @tab @strong{Notes}
@item @code{Host} @tab @code{CHAR(60)} @tab
@item @code{User} @tab @code{CHAR(16)} @tab
@@ -15308,13 +15336,13 @@ each is the empty string:
@end multitable
In the @code{user}, @code{db} and @code{host} tables,
-all privilege fields are declared as @code{ENUM('N','Y')} --- each can have a
+all privilege fields are declared as @code{ENUM('N','Y')}@-each can have a
value of @code{'N'} or @code{'Y'}, and the default value is @code{'N'}.
In the @code{tables_priv} and @code{columns_priv} tables, the privilege
fields are declared as @code{SET} fields:
-@multitable @columnfractions .15 .15 .50
+@multitable @columnfractions .15 .15 .55
@item @strong{Table name}
@tab @strong{Field name}
@tab @strong{Possible set elements}
@@ -15367,7 +15395,7 @@ etc.) are specified only in the @code{user} table. This is because
administrative operations are operations on the server itself and are not
database-specific, so there is no reason to list such privileges in the
other grant tables. In fact, only the @code{user} table need
-be consulted to determine whether or not you can perform an administrative
+be consulted to determine whether you can perform an administrative
operation.
The @strong{file} privilege is specified only in the @code{user} table, too.
@@ -15405,11 +15433,11 @@ MySQL server reads the contents of these tables when it starts up
and under the circumstances indicated in @ref{Privilege changes}.
The names used in this manual to refer to the privileges provided by
-MySQL are shown below, along with the table column name associated
+MySQL are shown here, along with the table column name associated
with each privilege in the grant tables and the context in which the
privilege applies:
-@multitable @columnfractions .15 .20 .30
+@multitable @columnfractions .15 .20 .35
@item @strong{Privilege} @tab @strong{Column} @tab @strong{Context}
@item @strong{select} @tab @code{Select_priv} @tab tables
@item @strong{insert} @tab @code{Insert_priv} @tab tables
@@ -15462,7 +15490,7 @@ OUTFILE} statements. Any user to whom this privilege is granted can read or
write any file that the MySQL server can read or write.
The remaining privileges are used for administrative operations, which are
-performed using the @code{mysqladmin} program. The table below shows which
+performed using the @code{mysqladmin} program. The table here shows which
@code{mysqladmin} commands each administrative privilege allows you to
execute:
@@ -15566,12 +15594,12 @@ Alternate forms of the @code{-h}, @code{-u}, and @code{-p} options are
@code{--password=your_pass}. Note that there is @emph{no space} between
@code{-p} or @code{--password=} and the password following it.
-@strong{Note:} Specifying a password on the command line is not secure!
+@strong{Note}: Specifying a password on the command-line is not secure!
Any user on your system may then find out your password by typing a command
like: @code{ps auxww}. @xref{Option files}.
@code{mysql} uses default values for connection parameters that are missing
-from the command line:
+from the command-line:
@itemize @bullet
@item
@@ -15596,7 +15624,7 @@ shell> mysql
Other MySQL clients behave similarly.
On Unix systems, you can specify different default values to be used when you
-make a connection, so that you need not enter them on the command line each
+make a connection, so that you need not enter them on the command-line each
time you invoke a client program. This can be done in a couple of ways:
@itemize @bullet
@@ -15639,7 +15667,7 @@ Windows only). The password can be specified using @code{MYSQL_PWD}
@cindex testing, connection to the server
When you attempt to connect to a MySQL server, the server accepts or
-rejects the connection based on your identity and whether or not you can
+rejects the connection based on your identity and whether you can
verify your identity by supplying the correct password. If not, the server
denies access to you completely. Otherwise, the server accepts the
connection, then enters Stage 2 and waits for requests.
@@ -15668,7 +15696,7 @@ to indicate the local host.
@item
@cindex wildcards, in @code{mysql.user} table
-You can use the wild-card characters @samp{%} and @samp{_} in the @code{Host}
+You can use the wildcard characters @samp{%} and @samp{_} in the @code{Host}
field.
@item
@@ -15686,7 +15714,8 @@ IP numbers, you can specify a netmask indicating how many address bits to
use for the network number. For example:
@example
-GRANT ALL PRIVILEGES on db.* to david@@'192.58.197.0/255.255.255.0';
+mysql> GRANT ALL PRIVILEGES ON db.*
+ -> TO david@@'192.58.197.0/255.255.255.0';
@end example
This will allow everyone to connect from an IP where the following is true:
@@ -15700,7 +15729,7 @@ In the above example all IP:s in the interval 192.58.197.0 -
@item
@cindex anonymous user
-Wild-card characters are not allowed in the @code{User} field, but you can
+Wildcard characters are not allowed in the @code{User} field, but you can
specify a blank value, which matches any name. If the @code{user} table
entry that matches an incoming connection has a blank user name, the user is
considered to be the anonymous user (the user with no name), rather than the
@@ -15725,7 +15754,7 @@ point of view the encrypted password is the REAL password, so you should
not give anyone access to it! In particular, don't give normal users
read access to the tables in the @code{mysql} database!
-The examples below show how various combinations of @code{Host} and
+The examples here show how various combinations of @code{Host} and
@code{User} values in @code{user} table entries apply to incoming
connections:
@@ -15742,14 +15771,14 @@ connections:
@item @code{'144.155.166.0/255.255.255.0'} @tab @code{'fred'} @tab Same as previous example
@end multitable
-Because you can use IP wild-card values in the @code{Host} field (for example,
+Because you can use IP wildcard values in the @code{Host} field (for example,
@code{'144.155.166.%'} to match every host on a subnet), there is the
possibility that someone might try to exploit this capability by naming a
host @code{144.155.166.somewhere.com}. To foil such attempts, MySQL
disallows matching on hostnames that start with digits and a dot. Thus, if
you have a host named something like @code{1.2.foo.com}, its name will never
match the @code{Host} column of the grant tables. Only an IP number can
-match an IP wild-card value.
+match an IP wildcard value.
An incoming connection may be matched by more than one entry in the
@code{user} table. For example, a connection from @code{thomas.loc.gov} by
@@ -15863,14 +15892,14 @@ in the @code{user} table set to @code{'N'} and grant privileges on a
database-specific basis only, using the @code{db} and @code{host} tables.
@cindex anonymous user
-@cindex wild cards, in @code{mysql.db} table
-@cindex wild cards, in @code{mysql.host} table
+@cindex wildcards, in @code{mysql.db} table
+@cindex wildcards, in @code{mysql.host} table
The @code{db} and @code{host} tables grant database-specific privileges.
Values in the scope fields may be specified as follows:
@itemize @bullet
@item
-The wild-card characters @samp{%} and @samp{_} can be used in the @code{Host}
+The wildcard characters @samp{%} and @samp{_} can be used in the @code{Host}
and @code{Db} fields of either table.
@item
@@ -15902,15 +15931,15 @@ values first and least-specific values last, and when the server looks for
matching entries, it uses the first match that it finds.
-@cindex wild cards, in @code{mysql.tables_priv} table
-@cindex wild cards, in @code{mysql.columns_priv} table
+@cindex wildcards, in @code{mysql.tables_priv} table
+@cindex wildcards, in @code{mysql.columns_priv} table
The @code{tables_priv} and @code{columns_priv} tables grant table- and
column-specific privileges. Values in the scope fields may be specified as
follows:
@itemize @bullet
@item
-The wild-card characters @samp{%} and @samp{_}
+The wildcard characters @samp{%} and @samp{_}
can be used in the @code{Host} field of either table.
@item
@@ -15918,15 +15947,15 @@ A @code{'%'} or blank @code{Host} value in either table means ``any host.''
@item
The @code{Db}, @code{Table_name} and @code{Column_name} fields cannot contain
-wild cards or be blank in either table.
+wildcards or be blank in either table.
@end itemize
The @code{tables_priv} and @code{columns_priv} tables are sorted on
the @code{Host}, @code{Db}, and @code{User} fields. This is similar to
@code{db} table sorting, although the sorting is simpler because
-only the @code{Host} field may contain wild cards.
+only the @code{Host} field may contain wildcards.
-The request verification process is described below. (If you are familiar
+The request verification process is described here. (If you are familiar
with the access-checking source code, you will notice that the description
here differs slightly from the algorithm used in the code. The description
is equivalent to what the code actually does; it differs only to make the
@@ -15967,7 +15996,7 @@ access to the database. In this case, a further lookup is done in the
@code{host} table to find a match on the @code{Host} and @code{Db} fields.
If no @code{host} table entry matches, access is denied. If there is a
match, the user's database-specific privileges are computed as the
-intersection (@emph{not} the union!) of the privileges in the @code{db} and
+intersection (@strong{not} the union!) of the privileges in the @code{db} and
@code{host} table entries, that is, the privileges that are @code{'Y'} in both
entries. (This way you can grant general privileges in the @code{db} table
entry and then selectively restrict them on a host-by-host basis using the
@@ -16012,7 +16041,7 @@ The @code{host} table can be used to maintain a list of secure servers.
At TcX, the @code{host} table contains a list of all machines on the local
network. These are granted all privileges.
-You can also use the @code{host} table to indicate hosts that are @emph{not}
+You can also use the @code{host} table to indicate hosts that are @strong{not}
secure. Suppose you have a machine @code{public.your.domain} that is located
in a public area that you do not consider secure. You can allow access to
all hosts on your network except that machine by using @code{host} table
@@ -16042,7 +16071,7 @@ actually set up the way you think they are.
@subsection Causes of @code{Access denied} Errors
If you encounter @code{Access denied} errors when you try to connect to the
-MySQL server, the list below indicates some courses of
+MySQL server, the following list indicates some courses of
action you can take to correct the problem:
@itemize @bullet
@@ -16243,9 +16272,9 @@ name (or vice-versa). For example, if you have an entry with host
your hostname is @code{'tcx.subnet.se'}, the entry will not work. Try adding
an entry to the @code{user} table that contains the IP number of your host as
the @code{Host} column value. (Alternatively, you could add an entry to the
-@code{user} table with a @code{Host} value that contains a wild card---for
+@code{user} table with a @code{Host} value that contains a wildcard---for
example, @code{'tcx.%'}. However, use of hostnames ending with @samp{%} is
-@emph{insecure} and is @emph{not} recommended!)
+@strong{insecure} and is @strong{not} recommended!)
@item
If @code{mysql -u user_name test} works but @code{mysql -u user_name
@@ -16261,7 +16290,7 @@ in the @code{user} table or the @code{db} table.
@item
If you can't figure out why you get @code{Access denied}, remove from the
@code{user} table all entries that have @code{Host} values containing
-wild cards (entries that contain @samp{%} or @samp{_}). A very common error
+wildcards (entries that contain @samp{%} or @samp{_}). A very common error
is to insert a new entry with @code{Host}=@code{'%'} and
@code{User}=@code{'some user'}, thinking that this will allow you to specify
@code{localhost} to connect from the same machine. The reason that this
@@ -16298,7 +16327,7 @@ probably doesn't have the @strong{file} privilege enabled.
Remember that client programs will use connection parameters specified
in configuration files or environment variables. @xref{Environment
variables}. If a client seems to be sending the wrong default
-connection parameters when you don't specify them on the command line,
+connection parameters when you don't specify them on the command-line,
check your environment and the @file{.my.cnf} file in your home
directory. You might also check the system-wide MySQL
configuration files, though it is far less likely that client connection
@@ -16312,7 +16341,7 @@ If you make changes to the grant tables directly (using an @code{INSERT} or
@code{UPDATE} statement) and your changes seem to be ignored, remember
that you must issue a @code{FLUSH PRIVILEGES} statement or execute a
@code{mysqladmin flush-privileges} command to cause the server to re-read
-the privilege tables. Otherwise your changes have no effect until the
+the privilege tables. Otherwise, your changes have no effect until the
next time the server is restarted. Remember that after you set the
@code{root} password with an @code{UPDATE} command, you won't need to
specify it until after you flush the privileges, because the server
@@ -16331,10 +16360,10 @@ prompt you for the password.)
@item
For testing, start the @code{mysqld} daemon with the
@code{--skip-grant-tables} option. Then you can change the MySQL
-grant tables and use the @code{mysqlaccess} script to check whether or not
+grant tables and use the @code{mysqlaccess} script to check whether
your modifications have the desired effect. When you are satisfied with your
changes, execute @code{mysqladmin flush-privileges} to tell the @code{mysqld}
-server to start using the new grant tables. @strong{Note:} Reloading the
+server to start using the new grant tables. @strong{Note}: reloading the
grant tables overrides the @code{--skip-grant-tables} option. This allows
you to tell the server to begin using the grant tables again without bringing
it down and restarting it.
@@ -16367,6 +16396,7 @@ to restart @code{mysqld} with @code{--skip-grant-tables} to run
* Privilege changes:: When Privilege Changes Take Effect
* Default privileges:: Setting Up the Initial MySQL Privileges
* Adding users:: Adding New Users to MySQL
+* User resources:: Limiting user resources
* Passwords:: Setting Up Passwords
* Password security:: Keeping Your Password Secure
* Secure connections:: Using Secure Connections
@@ -16395,7 +16425,9 @@ GRANT priv_type [(column_list)] [, priv_type [(column_list)] ...]
[CIPHER cipher [AND]]
[ISSUER issuer [AND]]
[SUBJECT subject]]
- [WITH [GRANT OPTION | MAX_QUERIES_PER_HOUR=#]]
+ [WITH [GRANT OPTION | MAX_QUERIES_PER_HOUR=# |
+ MAX_UPDATES_PER_HOUR=# |
+ MAX_CONNECTIONS_PER_HOUR=#]]
REVOKE priv_type [(column_list)] [, priv_type [(column_list)] ...]
ON @{tbl_name | * | *.* | db_name.*@}
@@ -16449,7 +16481,7 @@ To revoke the @strong{grant} privilege from a user, use a @code{priv_type}
value of @code{GRANT OPTION}:
@example
-REVOKE GRANT OPTION ON ... FROM ...;
+mysql> REVOKE GRANT OPTION ON ... FROM ...;
@end example
The only @code{priv_type} values you can specify for a table are @code{SELECT},
@@ -16463,17 +16495,17 @@ you use a @code{column_list} clause) are @code{SELECT}, @code{INSERT}, and
You can set global privileges by using @code{ON *.*} syntax. You can set
database privileges by using @code{ON db_name.*} syntax. If you specify
@code{ON *} and you have a current database, you will set the privileges for
-that database. (@strong{Warning:} If you specify @code{ON *} and you
-@emph{don't} have a current database, you will affect the global privileges!)
+that database. (@strong{Warning}: if you specify @code{ON *} and you
+@strong{don't} have a current database, you will affect the global privileges!)
In order to accommodate granting rights to users from arbitrary hosts,
MySQL supports specifying the @code{user_name} value in the form
@code{user@@host}. If you want to specify a @code{user} string
containing special characters (such as @samp{-}), or a @code{host} string
-containing special characters or wild-card characters (such as @samp{%}), you
+containing special characters or wildcard characters (such as @samp{%}), you
can quote the user or host name (for example, @code{'test-user'@@'test-hostname'}).
-You can specify wild cards in the hostname. For example,
+You can specify wildcards in the hostname. For example,
@code{user@@"%.loc.gov"} applies to @code{user} for any host in the
@code{loc.gov} domain, and @code{user@@"144.155.166.%"} applies to @code{user}
for any host in the @code{144.155.166} class C subnet.
@@ -16485,7 +16517,7 @@ defined by inserting entries with @code{User=''} into the
@code{mysql.user} table or creating an user with an empty name with the
@code{GRANT} command.
-@strong{Note:} If you allow anonymous users to connect to the MySQL
+@strong{Note}: if you allow anonymous users to connect to the MySQL
server, you should also grant privileges to all local users as
@code{user@@localhost} because otherwise the anonymous user entry for
the local host in the @code{mysql.user} table will be used when the user
@@ -16539,7 +16571,7 @@ If you don't want to send the password in clear text you can use the
function @code{PASSWORD()} or the C API function
@code{make_scrambled_password(char *to, const char *password)}.
-@strong{Warning:} If you create a new user but do not specify an
+@strong{Warning}: if you create a new user but do not specify an
@code{IDENTIFIED BY} clause, the user has no password. This is insecure.
Passwords can also be set with the @code{SET PASSWORD} command.
@@ -16558,11 +16590,11 @@ to other users any privileges the user has at the specified privilege level.
You should be careful to whom you give the @strong{grant} privilege, as two
users with different privileges may be able to join privileges!
-@code{MAX_QUERIES_PER_HOUR=#} limits the number of queries the user can
-do during one hour. If @code{#} is 0, then this means that there is no
-limit of the number of queries. This works by MySQL resetting a user
-specific query counter to 0, after it has gone more than one hour
-since the counter started incrementing.
+@code{MAX_QUERIES_PER_HOUR=#}, @code{MAX_UPDATES_PER_HOUR=#} and
+@code{MAX_CONNECTIONS_PER_HOUR=#} limit the number of
+queries/updates and logins the user can do during one hour.
+If @code{#} is 0 (default), then this means that there is no limitations
+for the user. @xref{User resources}.
You cannot grant another user a privilege you don't have yourself;
the @strong{grant} privilege allows you to give away only those privileges
@@ -16619,11 +16651,11 @@ MySQL the granted privileges are not automatically revoked, but
you have to revoke these yourself if needed.
@item
-If you in MySQL have the @code{INSERT} grant on only part of the
+In MySQL, if you have the @strong{insert} privilege on only some of the
columns in a table, you can execute @code{INSERT} statements on the
-table; The columns for which you don't have the @code{INSERT} privilege
-will set to their default values. ANSI SQL requires you to have the
-@code{INSERT} privilege on all columns.
+table; the columns for which you don't have the @strong{insert} privilege
+will be set to their default values. ANSI SQL requires you to have the
+@strong{insert} privilege on all columns.
@item
When you drop a table in ANSI SQL, all privileges for the table are revoked.
@@ -16677,7 +16709,7 @@ the MySQL server!
MySQL users and their privileges are normally created with the
@code{GRANT} command. @xref{GRANT}.
-When you login to a MySQL server with a command line client you
+When you login to a MySQL server with a command-line client you
should specify the password with @code{--password=your-password}.
@xref{Connecting}.
@@ -16724,7 +16756,7 @@ Modifications to the grant tables that you perform using @code{GRANT},
If you modify the grant tables manually (using @code{INSERT}, @code{UPDATE},
etc.), you should execute a @code{FLUSH PRIVILEGES} statement or run
@code{mysqladmin flush-privileges} or @code{mysqladmin reload} to tell the
-server to reload the grant tables. Otherwise your changes will have @emph{no
+server to reload the grant tables. Otherwise, your changes will have @emph{no
effect} until you restart the server. If you change the grant tables manually
but forget to reload the privileges, you will be wondering why your changes
don't seem to make any difference!
@@ -16740,10 +16772,11 @@ request.
@item
Database privilege changes take effect at the next @code{USE db_name}
command.
-@end itemize
-Global privilege changes and password changes take effect the next time the
-client connects.
+@item
+Global privilege changes and password changes take effect the next time
+the client connects.
+@end itemize
@node Default privileges, Adding users, Privilege changes, User Account Management
@@ -16769,7 +16802,7 @@ of privileges:
The MySQL @code{root} user is created as a superuser who can do
anything. Connections must be made from the local host.
-@strong{Note:}
+@strong{Note}:
The initial @code{root} password is empty, so anyone can connect as @code{root}
@emph{without a password} and be granted all privileges.
@@ -16785,7 +16818,7 @@ Other privileges are denied. For example, normal users can't use
@code{mysqladmin shutdown} or @code{mysqladmin processlist}.
@end itemize
-@strong{Note:} The default privileges are different for Windows.
+@strong{Note}: the default privileges are different for Windows.
@xref{Windows running}.
Because your installation is initially wide open, one of the first things you
@@ -16834,7 +16867,7 @@ See the @code{scripts/mysql_install_db} script to see how it sets up
the default privileges. You can use this as a basis to see how to
add other users.
-If you want the initial privileges to be different than those just described
+If you want the initial privileges to be different from those just described
above, you can modify @code{mysql_install_db} before you run it.
@cindex grant tables, re-creating
@@ -16846,13 +16879,13 @@ the database directory, which is listed when you run @code{mysqld
--help}.) Then run the @code{mysql_install_db} script, possibly after
editing it first to have the privileges you want.
-@strong{Note:} For MySQL versions older than Version 3.22.10,
+@strong{Note}: for MySQL versions older than Version 3.22.10,
you should not delete the @file{.frm} files. If you accidentally do this,
you should copy them back from your MySQL distribution before
running @code{mysql_install_db}.
-@node Adding users, Passwords, Default privileges, User Account Management
+@node Adding users, User resources, Default privileges, User Account Management
@subsection Adding New Users to MySQL
@findex GRANT statement
@@ -16870,15 +16903,14 @@ more concise and less error-prone. @xref{GRANT}.
There are also a lot of contributed programs like @code{phpmyadmin}
that can be used to create and administrate users. @xref{Portals}.
-The examples below show how to use the @code{mysql} client to set up new
+The following examples show how to use the @code{mysql} client to set up new
users. These examples assume that privileges are set up according to the
defaults described in the previous section. This means that to make changes,
you must be on the same machine where @code{mysqld} is running, you must
connect as the MySQL @code{root} user, and the @code{root} user must
have the @strong{insert} privilege for the @code{mysql} database and the
@strong{reload} administrative privilege. Also, if you have changed the
-@code{root} user password, you must specify it for the @code{mysql} commands
-below.
+@code{root} user password, you must specify it for the @code{mysql} commands here.
You can add new users by issuing @code{GRANT} statements:
@@ -16915,7 +16947,7 @@ This allows the user to execute the @code{mysqladmin reload},
@item dummy
A user who can connect without a password, but only from the local host. The
-global privileges are all set to @code{'N'} --- the @code{USAGE} privilege
+global privileges are all set to @code{'N'}@-the @strong{usage} privilege
type allows you to create a user with no privileges. It is assumed that you
will grant database-specific privileges later.
@end table
@@ -17045,8 +17077,67 @@ You can also use @code{xmysqladmin}, @code{mysql_webadmin}, and even
You can find these utilities in the Contrib directory of the
MySQL web site (@uref{http://www.mysql.com/Downloads/Contrib/}).
+@node User resources, Passwords, Adding users, User Account Management
+@subsection Limiting user resources
+
+Starting from MySQL 4.0.2 one can limit certain resources per user.
+
+So far, the only available method of limiting usage of MySQL
+server resources has been setting the @code{max_user_connections}
+startup variable to a non-zero value. But this method is strictly
+global and does not allow for management of individual users, which
+could be of particular interest to Internet Service Providers.
+
+Therefore, management of three resources is introduced on the
+individual user level:
+
+@itemize @bullet
+@item Number of all queries per hour:
+All commands that could be run by a user.
+@item Number of all updates per hour:
+Any command that changes any table or database.
+@item Number of connections made per hour:
+New connections opened per hour.
+@end itemize
+
+A user in the aforementioned context is a single entry in the
+@code{user} table, which is uniquely identified by its @code{user}
+and @code{host} columns.
+
+All users are by default not limited in using the above resources,
+unless the limits are granted to them. These limits can be granted
+@strong{only} via global @code{GRANT (*.*)}, using this syntax:
+
+@example
+GRANT ... WITH MAX_QUERIES_PER_HOUR = N1
+ MAX_UPDATES_PER_HOUR = N2
+ MAX_CONNECTIONS_PER_HOUR = N3;
+@end example
+
+One can specify any combination of the above resources.
+N1, N2 and N3 are integers and stands for count / hour.
+
+If user reaches any of the above limits withing one hour, his
+connection will be terminated or refused and the appropriate error
+message shall be issued.
+
+Current usage values for a particular user can be flushed (set to zero)
+by issuing a @code{GRANT} statement with any of the above clauses,
+including a @code{GRANT} statement with the current values.
-@node Passwords, Password security, Adding users, User Account Management
+Also, current values for all users will be flushed if privileges are
+reloaded (in the server or using @code{mysqladmin reload})
+or if the @code{FLUSH USER_RESOURCES} command is issued.
+
+The feature is enabled as soon as a single user is granted with any
+of the limiting @code{GRANT} clauses.
+
+As a prerequisite for enabling this feature, the @code{user} table in
+the @code{mysql} database must contain the additional columns, as
+defined in the table creation scripts @code{mysql_install_db} and
+@code{mysql_install_db.sh} in @file{scripts} subdirectory.
+
+@node Passwords, Password security, User resources, User Account Management
@subsection Setting Up Passwords
@findex PASSWORD()
@@ -17120,7 +17211,7 @@ or
shell> mysqladmin -u jeffrey password biscuit
@end example
-@strong{NOTE:} @code{PASSWORD()} does not perform password encryption in the
+@strong{Note}: @code{PASSWORD()} does not perform password encryption in the
same way that Unix passwords are encrypted. You should not assume that if
your Unix password and your MySQL password are the same, that
@code{PASSWORD()} will result in the same encrypted value as is stored in the
@@ -17132,7 +17223,7 @@ Unix password file. @xref{User names}.
It is inadvisable to specify your password in a way that exposes it to
discovery by other users. The methods you can use to specify your password
-when you run client programs are listed below, along with an assessment of
+when you run client programs are listed here, along with an assessment of
the risks of each method:
@itemize @bullet
@@ -17147,7 +17238,7 @@ with your other applications).
Use a @code{-pyour_pass} or @code{--password=your_pass} option on the command
line. This is convenient but insecure, because your password becomes visible
to system status programs (such as @code{ps}) that may be invoked by other
-users to display command lines. (MySQL clients typically overwrite
+users to display command-lines. (MySQL clients typically overwrite
the command-line argument with zeroes during their initialisation sequence,
but there is still a brief interval during which the value is visible.)
@@ -17166,7 +17257,7 @@ Enter password: ********
The @samp{*} characters represent your password.
It is more secure to enter your password this way than to specify it on the
-command line because it is not visible to other users. However, this method
+command-line because it is not visible to other users. However, this method
of entering a password is suitable only for programs that you run
interactively. If you want to invoke a client from a script that runs
non-interactively, there is no opportunity to enter the password from the
@@ -17212,7 +17303,7 @@ file.
@menu
* Secure basics:: Basics
* Secure requirements:: Requirements
-* Secure GRANT:: GRANT OPTIONS
+* Secure GRANT:: @code{GRANT} Options
@end menu
@node Secure basics, Secure requirements, Secure connections, Secure connections
@@ -17286,7 +17377,7 @@ examining if @code{SHOW VARIABLES LIKE 'have_openssl'} returns @code{YES}.
@node Secure GRANT, , Secure requirements, Secure connections
-@subsubsection GRANT options
+@subsubsection @code{GRANT} Options
@cindex SSL related options
@findex REQUIRE GRANT option
@@ -17309,8 +17400,8 @@ encrypted connections. Note that this option can be omitted
if there are any ACL records which allow non-SSL connections.
@example
-GRANT ALL PRIVILEGES ON test.* TO root@@localhost
-IDENTIFIED BY "goodsecret" REQUIRE SSL
+mysql> GRANT ALL PRIVILEGES ON test.* TO root@@localhost
+ -> IDENTIFIED BY "goodsecret" REQUIRE SSL;
@end example
@item
@@ -17320,8 +17411,8 @@ The only restriction is that it should be possible to verify its
signature with one of the CA certificates.
@example
-GRANT ALL PRIVILEGES ON test.* TO root@@localhost
-IDENTIFIED BY "goodsecret" REQUIRE X509
+mysql> GRANT ALL PRIVILEGES ON test.* TO root@@localhost
+ -> IDENTIFIED BY "goodsecret" REQUIRE X509;
@end example
@item
@@ -17331,10 +17422,10 @@ Using X509 certificates always implies encryption, so the option "SSL"
is not neccessary anymore.
@example
-GRANT ALL PRIVILEGES ON test.* TO root@@localhost
-IDENTIFIED BY "goodsecret"
-REQUIRE ISSUER "C=FI, ST=Some-State, L=Helsinki,
-O=MySQL Finland AB, CN=Tonu Samuel/Email=tonu@@mysql.com"
+mysql> GRANT ALL PRIVILEGES ON test.* TO root@@localhost
+ -> IDENTIFIED BY "goodsecret"
+ -> REQUIRE ISSUER "C=FI, ST=Some-State, L=Helsinki,
+ "> O=MySQL Finland AB, CN=Tonu Samuel/Email=tonu@@mysql.com";
@end example
@item
@@ -17344,10 +17435,11 @@ certificate but having different "subject" then the connection is
still not allowed.
@example
-GRANT ALL PRIVILEGES ON test.* TO root@@localhost
-IDENTIFIED BY "goodsecret"
-REQUIRE SUBJECT "C=EE, ST=Some-State, L=Tallinn,
-O=MySQL demo client certificate, CN=Tonu Samuel/Email=tonu@@mysql.com"
+mysql> GRANT ALL PRIVILEGES ON test.* TO root@@localhost
+ -> IDENTIFIED BY "goodsecret"
+ -> REQUIRE SUBJECT "C=EE, ST=Some-State, L=Tallinn,
+ "> O=MySQL demo client certificate,
+ "> CN=Tonu Samuel/Email=tonu@@mysql.com";
@end example
@item
@@ -17357,24 +17449,25 @@ with short encryption keys are used. Using this option, we can ask for
some exact cipher method to allow a connection.
@example
-GRANT ALL PRIVILEGES ON test.* TO root@@localhost
-IDENTIFIED BY "goodsecret"
-REQUIRE CIPHER "EDH-RSA-DES-CBC3-SHA"
+mysql> GRANT ALL PRIVILEGES ON test.* TO root@@localhost
+ -> IDENTIFIED BY "goodsecret"
+ -> REQUIRE CIPHER "EDH-RSA-DES-CBC3-SHA";
@end example
Also it is allowed to combine these options with each other like this:
@example
-GRANT ALL PRIVILEGES ON test.* TO root@@localhost
-IDENTIFIED BY "goodsecret"
-REQUIRE SUBJECT "C=EE, ST=Some-State, L=Tallinn,
-O=MySQL demo client certificate, CN=Tonu Samuel/Email=tonu@@mysql.com"
-AND ISSUER "C=FI, ST=Some-State, L=Helsinki,
-O=MySQL Finland AB, CN=Tonu Samuel/Email=tonu@@mysql.com"
-AND CIPHER "EDH-RSA-DES-CBC3-SHA"
+mysql> GRANT ALL PRIVILEGES ON test.* TO root@@localhost
+ -> IDENTIFIED BY "goodsecret"
+ -> REQUIRE SUBJECT "C=EE, ST=Some-State, L=Tallinn,
+ "> O=MySQL demo client certificate,
+ "> CN=Tonu Samuel/Email=tonu@@mysql.com"
+ -> AND ISSUER "C=FI, ST=Some-State, L=Helsinki,
+ "> O=MySQL Finland AB, CN=Tonu Samuel/Email=tonu@@mysql.com"
+ -> AND CIPHER "EDH-RSA-DES-CBC3-SHA";
@end example
-But it is not allowed to use any of options twice. Only different
+But it is not allowed to use any option twice. Only different
options can be mixed.
@end itemize
@@ -17481,23 +17574,23 @@ If you get performance problems in making backups on your system, you can
solve this by setting up replication and do the backups on the slave
instead of on the master. @xref{Replication Intro}.
-If you are using a Veritas file system, you can do:
+If you are using a Veritas filesystem, you can do:
@enumerate
@item
-Execute in a client (perl ?) @code{FLUSH TABLES WITH READ LOCK}
+From a client (or Perl), execute: @code{FLUSH TABLES WITH READ LOCK}.
@item
-Fork a shell or execute in another client @code{mount vxfs snapshot}.
+From another shell, execute: @code{mount vxfs snapshot}.
@item
-Execute in the first client @code{UNLOCK TABLES}
+From the first client, execute: @code{UNLOCK TABLES}.
@item
-Copy files from snapshot
+Copy files from snapshot.
@item
-Unmount snapshot
+Unmount snapshot.
@end enumerate
@@ -17512,9 +17605,9 @@ Unmount snapshot
BACKUP TABLE tbl_name[,tbl_name...] TO '/path/to/backup/directory'
@end example
-Make a copy of all the table files to the backup directory that are the
-minimum needed to restore it. Currenlty only works for @code{MyISAM}
-tables. For @code{MyISAM} table, copies @file{.frm} (definition) and
+Copies to the backup directory the minimum number of table files needed
+to restore the table. Currently only works for @code{MyISAM} tables.
+For @code{MyISAM} tables, copies @file{.frm} (definition) and
@file{.MYD} (data) files. The index file can be rebuilt from those two.
Before using this command, please see @ref{Backup}.
@@ -17612,7 +17705,7 @@ The different check types stand for the following:
@item @code{EXTENDED} @tab Do a full key lookup for all keys for each row. This ensures that the table is 100 % consistent, but will take a long time!
@end multitable
-For dynamic sized @code{MyISAM} tables a started check will always
+For dynamically sized @code{MyISAM} tables a started check will always
do a @code{MEDIUM} check. For static size rows we skip the row scan
for @code{QUICK} and @code{FAST} as the rows are very seldom corrupted.
@@ -17622,21 +17715,22 @@ You can combine check options as in:
CHECK TABLE test_table FAST QUICK;
@end example
-Which only would do a quick check on the table if it wasn't closed properly.
+Which would simply do a quick check on the table to see whether it was
+closed properly.
-@strong{Note:} that in some case @code{CHECK TABLE} will change the
+@strong{Note}: that in some case @code{CHECK TABLE} will change the
table! This happens if the table is marked as 'corrupted' or 'not
closed properly' but @code{CHECK TABLE} didn't find any problems in the
table. In this case @code{CHECK TABLE} will mark the table as okay.
If a table is corrupted, then it's most likely that the problem is in
the indexes and not in the data part. All of the above check types
-checks the indexes throughly and should thus find most errors.
+checks the indexes thoroughly and should thus find most errors.
If you just want to check a table that you assume is okay, you should use
no check options or the @code{QUICK} option. The latter should be used
when you are in a hurry and can take the very small risk that
-@code{QUICK} didn't find an error in the data file. (In most cases
+@code{QUICK} didn't find an error in the datafile. (In most cases
MySQL should find, under normal usage, any error in the data
file. If this happens then the table will be marked as 'corrupted',
in which case the table can't be used until it's repaired.)
@@ -17659,14 +17753,14 @@ Some things reported by check table, can't be corrected automatically:
@code{Found row where the auto_increment column has the value 0}.
This means that you have in the table a row where the
-@code{auto_increment} index column contains the value 0.
-(It's possible to create a row where the auto_increment column is 0 by
-explicitely setting the column to 0 with an @code{UPDATE} statement)
+@code{AUTO_INCREMENT} index column contains the value 0.
+(It's possible to create a row where the @code{AUTO_INCREMENT} column is 0 by
+explicitly setting the column to 0 with an @code{UPDATE} statement)
This isn't an error in itself, but could cause trouble if you decide to
dump the table and restore it or do an @code{ALTER TABLE} on the
-table. In this case the auto_increment column will change value,
-according to the rules of auto_increment columns, which could cause
+table. In this case the @code{AUTO_INCREMENT} column will change value,
+according to the rules of @code{AUTO_INCREMENT} columns, which could cause
problems like a duplicate key error.
To get rid of the warning, just execute an @code{UPDATE} statement
@@ -17713,7 +17807,7 @@ If @code{QUICK} is given then MySQL will try to do a
@code{REPAIR} of only the index tree.
If you use @code{EXTENDED} then MySQL will create the index row
-by row instead of creating one index at a time with sorting; This may be
+by row instead of creating one index at a time with sorting; this may be
better than sorting on fixed-length keys if you have long @code{char()}
keys that compress very good.
@@ -17751,7 +17845,7 @@ flushing tables.
@xref{OPTIMIZE TABLE, , @code{OPTIMIZE TABLE}}.
Even that the repair in @code{myisamchk} is quite secure, it's always a
-good idea to make a backup BEFORE doing a repair (or anything that could
+good idea to make a backup @emph{before} doing a repair (or anything that could
make a lot of changes to a table)
@menu
@@ -17778,20 +17872,20 @@ shell> myisamchk [options] tbl_name
@end example
The @code{options} specify what you want @code{myisamchk} to do. They are
-described below. (You can also get a list of options by invoking
+described here. (You can also get a list of options by invoking
@code{myisamchk --help}.) With no options, @code{myisamchk} simply checks your
table. To get more information or to tell @code{myisamchk} to take corrective
-action, specify options as described below and in the following sections.
+action, specify options as described here and in the following sections.
@code{tbl_name} is the database table you want to check/repair. If you run
@code{myisamchk} somewhere other than in the database directory, you must
specify the path to the file, because @code{myisamchk} has no idea where your
-database is located. Actually, @code{myisamchk} doesn't care whether or not
+database is located. Actually, @code{myisamchk} doesn't care whether
the files you are working on are located in a database directory; you can
copy the files that correspond to a database table into another location and
perform recovery operations on them there.
-You can name several tables on the @code{myisamchk} command line if you
+You can name several tables on the @code{myisamchk} command-line if you
wish. You can also specify a name as an index file
name (with the @file{.MYI} suffix), which allows you to specify all
tables in a directory by using the pattern @file{*.MYI}.
@@ -17809,7 +17903,7 @@ by specifying the path to the directory:
shell> myisamchk /path/to/database_dir/*.MYI
@end example
-You can even check all tables in all databases by specifying a wild card
+You can even check all tables in all databases by specifying a wildcard
with the path to the MySQL data directory:
@example
@@ -17978,9 +18072,9 @@ The following options are used if you start @code{myisamchk} with
@table @code
@item -D # or --data-file-length=#
-Max length of data file (when re-creating data file when it's 'full').
+Max length of datafile (when re-creating datafile when it's 'full').
@item -e or --extend-check
-Try to recover every possible row from the data file.
+Try to recover every possible row from the datafile.
Normally this will also find a lot of garbage rows. Don't use this option
if you are not totally desperate.
@item -f or --force
@@ -18001,13 +18095,13 @@ Can fix almost anything except unique keys that aren't unique
If you want to recover a table, this is the option to try first. Only if
myisamchk reports that the table can't be recovered by @code{-r}, you
should then try @code{-o}. (Note that in the unlikely case that @code{-r}
-fails, the data file is still intact.)
+fails, the datafile is still intact.)
If you have lots of memory, you should increase the size of
@code{sort_buffer_size}!
@item -o or --safe-recover
Uses an old recovery method (reads through all rows in order and updates
-all index trees based on the found rows); this is a magnitude slower
-than @code{-r}, but can handle a couple of very unlikely cases that
+all index trees based on the found rows); this is an order of magnitude
+slower than @code{-r}, but can handle a couple of very unlikely cases that
@code{-r} cannot handle. This recovery method also uses much less disk
space than @code{-r}. Normally one should always first repair with
@code{-r}, and only if this fails use @code{-o}.
@@ -18022,11 +18116,11 @@ temporary files should be very big.
Directory where character sets are stored.
@item --set-character-set=name
Change the character set used by the index
-@item .t or --tmpdir=path
+@item -t or --tmpdir=path
Path for storing temporary files. If this is not set, @code{myisamchk} will
use the environment variable @code{TMPDIR} for this.
@item -q or --quick
-Faster repair by not modifying the data file. One can give a second
+Faster repair by not modifying the datafile. One can give a second
@code{-q} to force @code{myisamchk} to modify the original datafile in case
of duplicate keys
@item -u or --unpack
@@ -18049,8 +18143,8 @@ MySQL.
@item -d or --description
Prints some information about table.
@item -A or --set-auto-increment[=value]
-Force auto_increment to start at this or higher value. If no value is
-given, then sets the next auto_increment value to the highest used value
+Force @code{AUTO_INCREMENT} to start at this or higher value. If no value is
+given, then sets the next @code{AUTO_INCREMENT} value to the highest used value
for the auto key + 1.
@item -S or --sort-index
Sort the index tree blocks in high-low order.
@@ -18086,7 +18180,7 @@ shell> myisamchk -O sort=16M -O key=16M -O read=1M -O write=1M ...
Using @code{-O sort=16M} should probably be enough for most cases.
Be aware that @code{myisamchk} uses temporary files in @code{TMPDIR}. If
-@code{TMPDIR} points to a memory file system, you may easily get out of
+@code{TMPDIR} points to a memory filesystem, you may easily get out of
memory errors. If this happens, set @code{TMPDIR} to point at some directory
with more space and restart @code{myisamchk}.
@@ -18161,12 +18255,12 @@ directory:
@multitable @columnfractions .20 .30
@item @strong{File} @tab @strong{Purpose}
@item @file{tbl_name.frm} @tab Table definition (form) file
-@item @file{tbl_name.MYD} @tab Data file
+@item @file{tbl_name.MYD} @tab Datafile
@item @file{tbl_name.MYI} @tab Index file
@end multitable
Each of these three file types is subject to corruption in various ways, but
-problems occur most often in data files and index files.
+problems occur most often in datafiles and index files.
@code{myisamchk} works by creating a copy of the @file{.MYD} (data) file
row by row. It ends the repair stage by removing the old @file{.MYD}
@@ -18196,7 +18290,7 @@ To check a MyISAM table, use the following commands:
@table @code
@item myisamchk tbl_name
This finds 99.99% of all errors. What it can't find is corruption that
-involves @strong{only} the data file (which is very unusual). If you want
+involves @strong{only} the datafile (which is very unusual). If you want
to check a table, you should normally run @code{myisamchk} without options or
with either the @code{-s} or @code{--silent} option.
@@ -18279,7 +18373,7 @@ ALTER TABLE table MAX_ROWS=xxx AVG_ROW_LENGTH=yyy;
In the other cases, you must repair your tables. @code{myisamchk}
can usually detect and fix most things that go wrong.
-The repair process involves up to four stages, described below. Before you
+The repair process involves up to four stages, described here. Before you
begin, you should @code{cd} to the database directory and check the
permissions of the table files. Make sure they are readable by the Unix user
that @code{mysqld} runs as (and to you, because you need to access the files
@@ -18296,7 +18390,7 @@ The manual section about table maintenance includes the options to
The following section is for the cases where the above command fails or
if you want to use the extended features that @code{isamchk}/@code{myisamchk} provides.
-If you are going to repair a table from the command line, you must first
+If you are going to repair a table from the command-line, you must first
take down the @code{mysqld} server. Note that when you do
@code{mysqladmin shutdown} on a remote server, the @code{mysqld} server
will still be alive for a while after @code{mysqladmin} returns, until
@@ -18327,18 +18421,18 @@ memory) to all @code{isamchk/myisamchk} commands.
First, try @code{myisamchk -r -q tbl_name} (@code{-r -q} means ``quick
recovery mode''). This will attempt to repair the index file without
-touching the data file. If the data file contains everything that it
+touching the datafile. If the datafile contains everything that it
should and the delete links point at the correct locations within the
-data file, this should work, and the table is fixed. Start repairing the
+datafile, this should work, and the table is fixed. Start repairing the
next table. Otherwise, use the following procedure:
@enumerate
@item
-Make a backup of the data file before continuing.
+Make a backup of the datafile before continuing.
@item
Use @code{myisamchk -r tbl_name} (@code{-r} means ``recovery mode''). This will
-remove incorrect records and deleted records from the data file and
+remove incorrect records and deleted records from the datafile and
reconstruct the index file.
@item
@@ -18360,7 +18454,7 @@ follows:
@enumerate
@item
-Move the data file to some safe place.
+Move the datafile to some safe place.
@item
Use the table description file to create new (empty) data and index files:
@@ -18376,7 +18470,7 @@ If your SQL version doesn't have @code{TRUNCATE TABLE}, use @code{DELETE FROM
table_name} instead.
@item
-Copy the old data file back onto the newly created data file.
+Copy the old datafile back onto the newly created datafile.
(Don't just move the old file back onto the new file; you want to retain
a copy in case something goes wrong.)
@end enumerate
@@ -18402,10 +18496,10 @@ should start with @code{myisamchk -r}.
@item
If you don't have a backup but know exactly how the table was created, create
-a copy of the table in another database. Remove the new data file, then move
+a copy of the table in another database. Remove the new datafile, then move
the description and index files from the other database to your crashed
database. This gives you new description and index files, but leaves
-the data file alone. Go back to Stage 2 and attempt to reconstruct
+the datafile alone. Go back to Stage 2 and attempt to reconstruct
the index file.
@end enumerate
@@ -18424,8 +18518,8 @@ shell> myisamchk -r tbl_name
@end example
You can optimise a table in the same way using the SQL @code{OPTIMIZE TABLE}
-statement. @code{OPTIMIZE TABLE} does a repair of the table, a key
-analyses and also sorts the index tree to give faster key lookups.
+statement. @code{OPTIMIZE TABLE} does a repair of the table and a key
+analysis, and also sorts the index tree to give faster key lookups.
There is also no possibility of unwanted interaction between a utility
and the server, because the server does all the work when you use
@code{OPTIMIZE TABLE}. @xref{OPTIMIZE TABLE}.
@@ -18434,9 +18528,9 @@ and the server, because the server does all the work when you use
the performance of a table:
@itemize
-@item -S, --sort-index
-@item -R index_num, --sort-records=index_num
-@item -a, --analyze
+@item @code{-S}, @code{--sort-index}
+@item @code{-R index_num}, @code{--sort-records=index_num}
+@item @code{-a}, @code{--analyze}
@end itemize
For a full description of the option. @xref{myisamchk syntax}.
@@ -18516,7 +18610,7 @@ myisamchk -r --silent --sort-index -O sort_buffer_size=16M */*.MYI
@cindex tables, information
To get a description of a table or statistics about it, use the commands shown
-below. We explain some of the information in more detail later:
+here. We explain some of the information in more detail later:
@itemize @bullet
@item myisamchk -d tbl_name
@@ -18682,7 +18776,7 @@ preceding examples:
@end example
Explanations for the types of information @code{myisamchk} produces are
-given below. The ``keyfile'' is the index file. ``Record'' and ``row''
+given here. The ``keyfile'' is the index file. ``Record'' and ``row''
are synonymous:
@itemize @bullet
@@ -18693,10 +18787,10 @@ Name of the ISAM (index) file.
Version of ISAM format. Currently always 2.
@item Creation time
-When the data file was created.
+When the datafile was created.
@item Recover time
-When the index/data file was last reconstructed.
+When the index/datafile was last reconstructed.
@item Data records
How many records are in the table.
@@ -18706,7 +18800,7 @@ How many deleted blocks still have reserved space.
You can optimise your table to minimise this space.
@xref{Optimisation}.
-@item Datafile: Parts
+@item Data file: Parts
For dynamic record format, this indicates how many data blocks there are. For
an optimised table without fragmented records, this is the same as @code{Data
records}.
@@ -18716,8 +18810,8 @@ How many bytes of non-reclaimed deleted data there are.
You can optimise your table to minimise this space.
@xref{Optimisation}.
-@item Datafile pointer
-The size of the data file pointer, in bytes. It is usually 2, 3, 4, or 5
+@item Data file pointer
+The size of the datafile pointer, in bytes. It is usually 2, 3, 4, or 5
bytes. Most tables manage with 2 bytes, but this cannot be controlled
from MySQL yet. For fixed tables, this is a record address. For
dynamic tables, this is a byte address.
@@ -18728,7 +18822,7 @@ bytes. Most tables manage with 2 bytes, but this is calculated
automatically by MySQL. It is always a block address.
@item Max datafile length
-How long the table's data file (@file{.MYD} file) can become, in bytes.
+How long the table's datafile (@file{.MYD} file) can become, in bytes.
@item Max keyfile length
How long the table's key file (@file{.MYI} file) can become, in bytes.
@@ -18759,7 +18853,7 @@ length of the indexed column, because you can index a prefix of a string
column.
@item Index
-@code{unique} or @code{multip.} (multiple). Indicates whether or not one value
+@code{unique} or @code{multip.} (multiple). Indicates whether one value
can exist multiple times in this index.
@item Type
@@ -18812,15 +18906,15 @@ MySQL strips spaces from the end of strings. The @code{Packed}
value indicates the percentage of savings achieved by doing this.
@item Recordspace used
-What percentage of the data file is used.
+What percentage of the datafile is used.
@item Empty space
-What percentage of the data file is unused.
+What percentage of the datafile is unused.
@item Blocks/Record
Average number of blocks per record (that is, how many links a fragmented
-record is composed of). This is always 1 for fixed-format tables. This value
-should stay as close to 1.0 as possible. If it gets too big, you can
+record is composed of). This is always 1.0 for fixed-format tables. This
+value should stay as close to 1.0 as possible. If it gets too big, you can
reorganise the table with @code{myisamchk}.
@xref{Optimisation}.
@@ -18832,10 +18926,10 @@ of records.
How many blocks (links) are deleted.
@item Recorddata
-How many bytes in the data file are used.
+How many bytes in the datafile are used.
@item Deleted data
-How many bytes in the data file are deleted (unused).
+How many bytes in the datafile are deleted (unused).
@item Lost space
If a record is updated to a shorter length, some space is lost. This is
@@ -18884,13 +18978,14 @@ table or if you have made many changes to a table with variable-length rows
(tables that have @code{VARCHAR}, @code{BLOB}, or @code{TEXT} columns).
Deleted records are maintained in a linked list and subsequent @code{INSERT}
operations reuse old record positions. You can use @code{OPTIMIZE TABLE} to
-reclaim the unused space and to defragment the data file.
+reclaim the unused space and to defragment the datafile.
-For the moment @code{OPTIMIZE TABLE} only works on @strong{MyISAM} and
+For the moment, @code{OPTIMIZE TABLE} only works on @code{MyISAM} and
@code{BDB} tables. For @code{BDB} tables, @code{OPTIMIZE TABLE} is
-currently mapped to @code{ANALYZE TABLE}. @xref{ANALYZE TABLE}.
+currently mapped to @code{ANALYZE TABLE}.
+@xref{ANALYZE TABLE, , @code{ANALYZE TABLE}}.
-You can get optimise table to work on other table types by starting
+You can get @code{OPTIMIZE TABLE} to work on other table types by starting
@code{mysqld} with @code{--skip-new} or @code{--safe-mode}, but in this
case @code{OPTIMIZE TABLE} is just mapped to @code{ALTER TABLE}.
@@ -18905,7 +19000,7 @@ If the statistics are not up to date (and the repair couldn't be done
by sorting the index), update them.
@end itemize
-@code{OPTIMIZE TABLE} for @code{MyISAM} tables is equvialent of running
+@code{OPTIMIZE TABLE} for a @code{MyISAM} table is equivalent to running
@code{myisamchk --quick --check-only-changed --sort-index --analyze}
on the table.
@@ -18923,7 +19018,7 @@ ANALYZE TABLE tbl_name[,tbl_name...]
@end example
Analyse and store the key distribution for the table. During the
-analyse the table is locked with a read lock. This works on
+analysis, the table is locked with a read lock. This works on
@code{MyISAM} and @code{BDB} tables.
This is equivalent to running @code{myisamchk -a} on the table.
@@ -18959,12 +19054,12 @@ the table will not be analysed again.
@cindex caches, clearing
@example
-FLUSH flush_option [,flush_option]
+FLUSH flush_option [,flush_option] ...
@end example
You should use the @code{FLUSH} command if you want to clear some of the
internal caches MySQL uses. To execute @code{FLUSH}, you must have
-the @strong{RELOAD} privilege.
+the @strong{reload} privilege.
@code{flush_option} can be any of the following:
@@ -18981,7 +19076,8 @@ Flushing the host tables allows the host to attempt to connect
again. @xref{Blocked host}. You can start @code{mysqld} with
@code{-O max_connection_errors=999999999} to avoid this error message.
-@item @code{DES_KEY_FILE} @tab Reloads the des keys from the file specified with @code{--des-key-file}.
+@item @code{DES_KEY_FILE} @tab Reloads the DES keys from the file that was
+specified with the @code{--des-key-file} option at server startup time.
@item @code{LOGS} @tab Closes and reopens all log files.
If you have specified the update log file or a binary log file without
@@ -18994,15 +19090,19 @@ signal to the @code{mysqld} server.
@item @code{PRIVILEGES} @tab Reloads the privileges from the grant tables in
the @code{mysql} database.
-@item @code{QUERY CACHE} @tab Defragment the query cache to better utilise its memory. This command will not remove any queries from the cache.
+@item @code{QUERY CACHE} @tab Defragment the query cache to better utilise its
+memory. This command will not remove any queries from the cache, unlike
+@code{RESET QUERY CACHE}.
@item @code{TABLES} @tab Closes all open tables and force all tables in use to be closed. This also flushes the query cache.
-@item @code{[TABLE | TABLES] table_name [,table_name...]} @tab Flushes only the given tables.
+@item @code{[TABLE | TABLES] tbl_name [,tbl_name...]} @tab Flushes only the given tables.
-@item @code{TABLES WITH READ LOCK} @tab Closes all open tables and locks all tables for all databases with a read until one executes @code{UNLOCK TABLES}. This is very convenient way to get backups if you have a file system, like Veritas,that can take snapshots in time.
+@item @code{TABLES WITH READ LOCK} @tab Closes all open tables and locks all tables for all databases with a read until one executes @code{UNLOCK TABLES}. This is very convenient way to get backups if you have a filesystem, like Veritas,that can take snapshots in time.
@item @code{STATUS} @tab Resets most status variables to zero. This is something one should only use when debugging a query.
+
+@item @code{USER_RESOURCES} @tab Resets all user resources to zero. This will enable blocked users to login again. @xref{User resources}.
@end multitable
You can also access each of the commands shown above with the @code{mysqladmin}
@@ -19010,32 +19110,31 @@ utility, using the @code{flush-hosts}, @code{flush-logs}, @code{reload},
or @code{flush-tables} commands.
Take also a look at the @code{RESET} command used with replication.
-@xref{RESET}.
+@xref{RESET, , @code{RESET}}.
@node RESET, KILL, FLUSH, Database Administration
@subsection @code{RESET} Syntax
@example
-FLUSH flush_option [,flush_option]
+RESET reset_option [,reset_option] ...
@end example
The @code{RESET} command is used to clear things. It also acts as an stronger
-version of the @code{FLUSH} command. @xref{FLUSH}.
+version of the @code{FLUSH} command. @xref{FLUSH, , @code{FLUSH}}.
+
+To execute @code{RESET}, you must have the @strong{reload} privilege.
@multitable @columnfractions .25 .75
@item @strong{Option} @tab @strong{Description}
-@item @code{MASTER}
-@tab Deletes all binary logs listed in the index file, resetting the binlog
+@item @code{MASTER} @tab Deletes all binary logs listed in the index file, resetting the binlog
index file to be empty. In pre-3.23.26 versions, @code{FLUSH MASTER} (Master)
-@item @code{SLAVE}
-@tab Makes the slave forget its replication position in the master
+@item @code{SLAVE} @tab Makes the slave forget its replication position in the master
logs. In pre 3.23.26 versions the command was called
@code{FLUSH SLAVE}(Slave)
-@item @code{QUERY CACHE}
-@tab Removes all query results from the query cache.
+@item @code{QUERY CACHE} @tab Removes all query results from the query cache.
@end multitable
@node KILL, SHOW, RESET, Database Administration
@@ -19134,7 +19233,7 @@ or SHOW SLAVE STATUS
@code{SHOW} provides information about databases, tables, columns, or
status information about the server. If the @code{LIKE wild} part is
used, the @code{wild} string can be a string that uses the SQL @samp{%}
-and @samp{_} wild-card characters.
+and @samp{_} wildcard characters.
@menu
* SHOW DATABASE INFO:: Retrieving information about Database, Tables, Columns, and Indexes
@@ -19167,7 +19266,7 @@ host. You can also get this list using the @code{mysqlshow} command.
@code{SHOW TABLES} lists the tables in a given database. You can also
get this list using the @code{mysqlshow db_name} command.
-@strong{Note:} If a user doesn't have any privileges for a table, the table
+@strong{Note}: if a user doesn't have any privileges for a table, the table
will not show up in the output from @code{SHOW TABLES} or @code{mysqlshow
db_name}.
@@ -19177,7 +19276,7 @@ how many times the table is @code{cached} and @code{in_use}.
@code{SHOW COLUMNS} lists the columns in a given table. If you specify
the @code{FULL} option, you will also get the privileges you have for
-each column. If the column types are different than you expect them to
+each column. If the column types are different from what you expect them to
be based on a @code{CREATE TABLE} statement, note that MySQL
sometimes changes column types. @xref{Silent column changes}.
@@ -19239,20 +19338,20 @@ STATUS}, but provides a lot of information about each table. You can
also get this list using the @code{mysqlshow --status db_name} command.
The following columns are returned:
-@multitable @columnfractions .20 .65
+@multitable @columnfractions .20 .70
@item @strong{Column} @tab @strong{Meaning}
@item @code{Name} @tab Name of the table.
@item @code{Type} @tab Type of table. @xref{Table types}.
@item @code{Row_format} @tab The row storage format (Fixed, Dynamic, or Compressed).
@item @code{Rows} @tab Number of rows.
@item @code{Avg_row_length} @tab Average row length.
-@item @code{Data_length} @tab Length of the data file.
-@item @code{Max_data_length} @tab Max length of the data file.
+@item @code{Data_length} @tab Length of the datafile.
+@item @code{Max_data_length} @tab Max length of the datafile.
@item @code{Index_length} @tab Length of the index file.
@item @code{Data_free} @tab Number of allocated but not used bytes.
@item @code{Auto_increment} @tab Next autoincrement value.
@item @code{Create_time} @tab When the table was created.
-@item @code{Update_time} @tab When the data file was last updated.
+@item @code{Update_time} @tab When the datafile was last updated.
@item @code{Check_time} @tab When the table was last checked.
@item @code{Create_options} @tab Extra options used with @code{CREATE TABLE}.
@item @code{Comment} @tab The comment used when creating the table (or some information why MySQL couldn't access the table information).
@@ -19268,7 +19367,7 @@ in the table comment.
@cindex @code{mysqladmin}
@code{SHOW STATUS} provides server status information
(like @code{mysqladmin extended-status}). The output resembles that shown
-below, though the format and numbers probably differ:
+here, though the format and numbers probably differ:
@example
+--------------------------+------------+
@@ -19340,15 +19439,16 @@ The status variables listed above have the following meaning:
@item @code{Aborted_connects} @tab Number of tries to connect to the MySQL server that failed. @xref{Communication errors}.
@item @code{Bytes_received} @tab Number of bytes received from all clients.
@item @code{Bytes_sent} @tab Number of bytes sent to all clients.
-@item @code{Com_xxxx} @tab Number of times the xxx commands has been executed.
+@item @code{Com_xxx} @tab Number of times each xxx command has been executed.
@item @code{Connections} @tab Number of connection attempts to the MySQL server.
@item @code{Created_tmp_disk_tables} @tab Number of implicit temporary tables on disk created while executing statements.
@item @code{Created_tmp_tables} @tab Number of implicit temporary tables in memory created while executing statements.
-@item @code{Created_tmp_files} @tab How many temporary files @code{mysqld} have created.
+@item @code{Created_tmp_files} @tab How many temporary files @code{mysqld} has created.
@item @code{Delayed_insert_threads} @tab Number of delayed insert handler threads in use.
@item @code{Delayed_writes} @tab Number of rows written with @code{INSERT DELAYED}.
@item @code{Delayed_errors} @tab Number of rows written with @code{INSERT DELAYED} for which some error occurred (probably @code{duplicate key}).
@item @code{Flush_commands} @tab Number of executed @code{FLUSH} commands.
+@item @code{Handler_commit} @tab Number of internal @code{COMMIT} commands.
@item @code{Handler_delete} @tab Number of times a row was deleted from a table.
@item @code{Handler_read_first} @tab Number of times the first entry was read from an index.
If this is high, it suggests that the server is doing a lot of full index scans, for example,
@@ -19358,12 +19458,14 @@ is high, it is a good indication that your queries and tables are properly index
@item @code{Handler_read_next} @tab Number of requests to read next row in key order. This
will be incremented if you are querying an index column with a range constraint. This also
will be incremented if you are doing an index scan.
+@item @code{Handler_read_prev} @tab Number of requests to read previous row in key order. This is mainly used to optimize @code{ORDER BY ... DESC}.
@item @code{Handler_read_rnd} @tab Number of requests to read a row based on a fixed position.
This will be high if you are doing a lot of queries that require sorting of the result.
@item @code{Handler_read_rnd_next} @tab Number of requests to read the next row in the datafile.
This will be high if you are doing a lot of table scans. Generally this suggests that your tables
are not properly indexed or that your queries are not written to take advantage of the indexes you
have.
+@item @code{Handler_rollback} @tab Number of internal @code{ROLLBACK} commands.
@item @code{Handler_update} @tab Number of requests to update a row in a table.
@item @code{Handler_write} @tab Number of requests to insert a row in a table.
@item @code{Key_blocks_used} @tab The number of used blocks in the key cache.
@@ -19378,20 +19480,23 @@ have.
@item @code{Open_files} @tab Number of files that are open.
@item @code{Open_streams} @tab Number of streams that are open (used mainly for logging).
@item @code{Opened_tables} @tab Number of tables that have been opened.
-@item @code{Select_full_join} @tab Number of joins without keys (Should be 0).
+@item @code{Rpl_status} @tab Status of failsafe replication. (Not yet in use).
+@item @code{Select_full_join} @tab Number of joins without keys (If this is 0, you should carefully check the index of your tables).
@item @code{Select_full_range_join} @tab Number of joins where we used a range search on reference table.
@item @code{Select_range} @tab Number of joins where we used ranges on the first table. (It's normally not critical even if this is big.)
-@item @code{Select_scan} @tab Number of joins where we scanned the first table.
-@item @code{Select_range_check} @tab Number of joins without keys where we check for key usage after each row (Should be 0).
+@item @code{Select_scan} @tab Number of joins where we did a full scann of the first table.
+@item @code{Select_range_check} @tab Number of joins without keys where we check for key usage after each row (If this is 0, you should carefully check the index of your tables).
@item @code{Questions} @tab Number of queries sent to the server.
@item @code{Slave_open_temp_tables} @tab Number of temporary tables currently
open by the slave thread
-@item @code{Slow_launch_threads} @tab Number of threads that have taken more than @code{slow_launch_time} to connect.
+@item @code{Slave_running} @tab Is @code{ON} if this is a slave that is connected to a master.
+@item @code{Slow_launch_threads} @tab Number of threads that have taken more than @code{slow_launch_time} to create.
@item @code{Slow_queries} @tab Number of queries that have taken more than @code{long_query_time}. @xref{Slow query log}.
-@item @code{Sort_merge_passes} @tab Number of merges the sort has to do. If this value is large you should consider increasing @code{sort_buffer}.
+@item @code{Sort_merge_passes} @tab Number of merges passes the sort algoritm have had to do. If this value is large you should consider increasing @code{sort_buffer}.
@item @code{Sort_range} @tab Number of sorts that where done with ranges.
@item @code{Sort_rows} @tab Number of sorted rows.
@item @code{Sort_scan} @tab Number of sorts that where done by scanning the table.
+@item @code{ssl_xxx} @tab Variables used by SSL; Not yet implemented.
@item @code{Table_locks_immediate} @tab Number of times a table lock was
acquired immediately. Available after 3.23.33.
@item @code{Table_locks_waited} @tab Number of times a table lock could not
@@ -19412,9 +19517,9 @@ Some comments about the above:
If @code{Opened_tables} is big, then your @code{table_cache}
variable is probably too small.
@item
-If @code{key_reads} is big, then your @code{key_cache} is probably too
-small. The cache hit rate can be calculated with
-@code{key_reads}/@code{key_read_requests}.
+If @code{Key_reads} is big, then your @code{key_buffer_size} variable is
+probably too small. The cache hit rate can be calculated with
+@code{Key_reads}/@code{Key_read_requests}.
@item
If @code{Handler_read_rnd} is big, then you probably have a lot of
queries that require MySQL to scan whole tables or you have
@@ -19425,7 +19530,7 @@ If @code{Threads_created} is big, you may want to increase the
with @code{Threads_created}/@code{Connections}.
@item
If @code{Created_tmp_disk_tables} is big, you may want to increase the
-@code{tmp_table_size} variable to get the temporary tables memory based
+@code{tmp_table_size} variable to get the temporary tables memory-based
instead of disk based.
@end itemize
@@ -19443,7 +19548,7 @@ variables} command. If the default values are unsuitable, you can set most
of these variables using command-line options when @code{mysqld} starts up.
@xref{Command-line options}.
-The output resembles that shown below, though the format and numbers may
+The output resembles that shown here, though the format and numbers may
differ somewhat:
@example
@@ -19536,12 +19641,16 @@ differ somewhat:
+------------------------------+---------------------------+
@end example
-Each option is described below. Values for buffer sizes, lengths, and stack
+Each option is described here. Values for buffer sizes, lengths, and stack
sizes are given in bytes. You can specify values with a suffix of @samp{K}
or @samp{M} to indicate kilobytes or megabytes. For example, @code{16M}
indicates 16 megabytes. The case of suffix letters does not matter;
@code{16M} and @code{16m} are equivalent:
+@c FIX 2002-04-29 arjen / paul
+@c FIX Below should be a @multitable just like SHOW STATUS.
+@c FIX Has to wait till after O'Reilly printed edition is out the door.
+
@cindex variables, values
@itemize
@item @code{ansi_mode}.
@@ -19626,7 +19735,7 @@ The value of the @code{--datadir} option.
@item @code{delay_key_write}
If enabled (is on by default), MySQL will honor the
-@code{delay_key_write} option @code{CREATE TABLE}. This means that the
+@code{DELAY_KEY_WRITE} option for @code{CREATE TABLE}. This means that the
key buffer for tables with this option will not get flushed on every
index update, but only when a table is closed. This will speed up
writes on keys a lot, but you should add automatic checking of all tables
@@ -19662,13 +19771,13 @@ very little resources.
@item @code{ft_min_word_len}
The minimum length of the word to be included in a @code{FULLTEXT} index.
-@strong{Note: @code{FULLTEXT} index have to be rebuilt after changing
-this variable.}
+@strong{Note: @code{FULLTEXT} indexes must be rebuilt after changing
+this variable.} (This option is new for MySQL 4.0.)
@item @code{ft_max_word_len}
The maximum length of the word to be included in a @code{FULLTEXT} index.
-@strong{Note: @code{FULLTEXT} index have to be rebuilt after changing
-this variable.}
+@strong{Note: @code{FULLTEXT} indexes must be rebuilt after changing
+this variable.} (This option is new for MySQL 4.0.)
@item @code{ft_max_word_len_sort}
The maximum length of the word in a @code{FULLTEXT} index
@@ -19677,11 +19786,10 @@ to be used in fast index recreation method in @code{REPAIR},
slow way. The rule of the thumb is as follows: with
@code{ft_max_word_len_sort} increasing, @strong{MySQL} will create bigger
temporary files (thus slowing the process down, due to disk I/O), and will put
-fewer keys in one sort block (againg, decreasing the efficiency). When
+fewer keys in one sort block (again, decreasing the efficiency). When
@code{ft_max_word_len_sort} is too small, instead, @strong{MySQL} will insert a
-lot of words into index the slow way - but short words will be inserted very
-fast. It applies only to index recreation during @code{REPAIR},
-@code{CREATE INDEX}, or @code{ALTER TABLE}.
+lot of words into index the slow way, but short words will be inserted very
+quickly.
@item @code{ft_boolean_syntax}
List of operators supported by @code{MATCH ... AGAINST(... IN BOOLEAN MODE)}.
@@ -19727,10 +19835,10 @@ Index blocks are buffered and are shared by all threads.
Increase this to get better index handling (for all reads and multiple
writes) to as much as you can afford; 64M on a 256M machine that mainly
runs MySQL is quite common. If you, however, make this too big
-(more than 50% of your total memory?) your system may start to page and
-become extremely slow. Remember that because MySQL does not cache
-data read, that you will have to leave some room for the OS filesystem
-cache.
+(for instance more than 50% of your total memory) your system may start
+to page and become extremely slow. Remember that because MySQL does not
+cache data reads, you will have to leave some room for the OS
+filesystem cache.
You can check the performance of the key buffer by doing @code{show
status} and examine the variables @code{Key_read_requests},
@@ -19739,7 +19847,7 @@ status} and examine the variables @code{Key_read_requests},
The @code{Key_write/Key_write_requests} is usually near 1 if you are
using mostly updates/deletes but may be much smaller if you tend to
do updates that affect many at the same time or if you are
-using @code{delay_key_write}. @xref{SHOW}.
+using @code{delay_key_write}. @xref{SHOW, , @code{SHOW}}.
To get even more speed when writing many rows at the same time, use
@code{LOCK TABLES}. @xref{LOCK TABLES, , @code{LOCK TABLES}}.
@@ -19840,7 +19948,7 @@ MySQL uses special tree-like cache to make bulk inserts (that is,
@code{LOAD DATA INFILE}) faster. This variable limits
the size of the cache tree in bytes per thread. Setting it to 0
will disable this optimization.
-@strong{Note:} This cache is only used when adding data to non-empty table.
+@strong{Note}: this cache is only used when adding data to non-empty table.
Default value is 8 MB.
@item @code{myisam_recover_options}
@@ -19852,18 +19960,18 @@ The buffer that is allocated when sorting the index when doing a
@code{ALTER TABLE}.
@item @code{myisam_max_extra_sort_file_size}.
-If the creating of the temporary file for fast index creation would be
-this much bigger than using the key cache, then prefer the key cache
-method. This is mainly used to force long character keys in large
+If the temporary file used for fast index creation would be bigger than
+using the key cache by the amount specified here, then prefer the key
+cache method. This is mainly used to force long character keys in large
tables to use the slower key cache method to create the index.
-@strong{NOTE} that this parameter is given in megabytes!
+@strong{Note} that this parameter is given in megabytes!
@item @code{myisam_max_sort_file_size}
The maximum size of the temporary file MySQL is allowed to use
while recreating the index (during @code{REPAIR}, @code{ALTER TABLE}
-or @code{LOAD DATA INFILE}. If the file size would be bigger than this,
+or @code{LOAD DATA INFILE}. If the file-size would be bigger than this,
the index will be created through the key cache (which is slower).
-@strong{NOTE} that this parameter is given in megabytes!
+@strong{Note} that this parameter is given in megabytes!
@item @code{net_buffer_length}
The communication buffer is reset to this size between queries. This
@@ -19875,7 +19983,7 @@ is automatically enlarged, up to @code{max_allowed_packet} bytes.)
@item @code{net_read_timeout}
Number of seconds to wait for more data from a connection before aborting
the read. Note that when we don't expect data from a connection, the timeout
-is defined by @code{write_timeout}. See also @code{slave_read_timeout}.
+is defined by @code{write_timeout}. See also @code{slave_net_timeout}.
@item @code{net_retry_count}
If a read on a communication port is interrupted, retry this many times
@@ -19926,18 +20034,18 @@ If this is 0, the query cache is disabled (default).
@item @code{query_cache_startup_type}
This may be set (only numeric) to
-@multitable @columnfractions .10 .15 .70
+@multitable @columnfractions .09 .14 .72
@item @strong{Value} @tab @strong{Alias} @tab @strong{Comment}
@item 0 @tab OFF @tab Don't cache or retrieve results.
@item 1 @tab ON @tab Cache all results except @code{SELECT SQL_NO_CACHE ...} queries.
@item 2 @tab DEMAND @tab Cache only @code{SELECT SQL_CACHE ...} queries.
@end multitable
-@item @code{safe_show_databases}
+@item @code{safe_show_database}
Don't show databases for which the user doesn't have any database or
table privileges. This can improve security if you're concerned about
people being able to see what databases other users have. See also
-@code{skip_show_databases}.
+@code{skip_show_database}.
@item @code{server_id}
The value of the @code{--server-id} option.
@@ -19948,13 +20056,13 @@ Is OFF if @code{mysqld} uses external locking.
@item @code{skip_networking}
Is ON if we only allow local (socket) connections.
-@item @code{skip_show_databases}
+@item @code{skip_show_database}
This prevents people from doing @code{SHOW DATABASES} if they don't have
-the @code{Process_priv} privilege. This can improve security if you're
+the @strong{process} privilege. This can improve security if you're
concerned about people being able to see what databases other users
-have. See also @code{safe_show_databases}.
+have. See also @code{safe_show_database}.
-@item @code{slave_read_timeout}
+@item @code{slave_net_timeout}
Number of seconds to wait for more data from a master/slave connection
before aborting the read.
@@ -19975,15 +20083,15 @@ operations.
The number of open tables for all threads. Increasing this value
increases the number of file descriptors that @code{mysqld} requires.
You can check if you need to increase the table cache by checking the
-@code{Opened_tables} variable. @xref{SHOW}. If this variable is big and
-you don't do @code{FLUSH TABLES} a lot (which just forces all tables to
-be closed and reopenend), then you should increase the value of this
+@code{Opened_tables} variable. @xref{SHOW, , @code{SHOW}}. If this variable
+is big and you don't do @code{FLUSH TABLES} a lot (which just forces all
+tables to be closed and reopenend), then you should increase the value of this
variable.
For more information about the table cache, see @ref{Table cache}.
@item @code{table_type}
-The default table type
+The default table type.
@item @code{thread_cache_size}
How many threads we should keep in a cache for reuse. When a
@@ -20067,15 +20175,15 @@ the first 100 characters of each query will be shown.
This command is very useful if you get the 'too many connections' error
message and want to find out what's going on. MySQL reserves
-one extra connection for a client with the @code{Process_priv} privilege
+one extra connection for a client with the @strong{process} privilege
to ensure that you should always be able to login and check the system
(assuming you are not giving this privilege to all your users).
-Some frequently states in @code{mysqladmin processlist}
+Some states commonly seen in @code{mysqladmin processlist}
@itemize @bullet
@item @code{Checking table}
-The thread doing an [automatic ?] checking of the table.
+The thread is performing [automatic] checking of the table.
@item @code{Closing tables}
Means that the thread is flushing the changed table data to disk and
closing the used tables. This should be a fast operation. If not, then
@@ -20085,7 +20193,7 @@ in very heavy use.
Slave connecting to master.
@item @code{Copying to tmp table on disk}
The temporary result set was larger than @code{tmp_table_size} and the
-thread is now changing the in memory based temporary table to a disk
+thread is now changing the in memory-based temporary table to a disk
based one to save memory.
@item @code{Creating tmp table}
The thread is creating a temporary table to hold a part of the result for
@@ -20168,7 +20276,7 @@ Most states are very quick operations. If threads last in any of these
states for many seconds, there may be a problem around that needs to be
investigated.
-There are some other states that are not mentioned above, but most of
+There are some other states that are not mentioned previously, but most of
these are only useful to find bugs in @code{mysqld}.
@node SHOW GRANTS, SHOW CREATE TABLE, SHOW PROCESSLIST, SHOW
@@ -20195,7 +20303,7 @@ mysql> SHOW GRANTS FOR root@@localhost;
Shows a @code{CREATE TABLE} statement that will create the given table:
@example
-mysql> show create table t\G
+mysql> SHOW CREATE TABLE t\G
*************************** 1. row ***************************
Table: t
Create Table: CREATE TABLE t (
@@ -20218,7 +20326,7 @@ Create Table: CREATE TABLE t (
* Character sets:: The Character Set Used for Data and Sorting
* Languages:: Non-English Error Messages
* Adding character set:: Adding a New Character Set
-* Character arrays:: The character definition arrays
+* Character arrays:: The Character Definition Arrays
* String collating:: String Collating Support
* Multi-byte characters:: Multi-byte Character Support
* Problems with character sets:: Problems With Character Sets
@@ -20255,7 +20363,7 @@ character set configuration files listed in
If you change the character set when running MySQL (which may
also change the sort order), you must run @code{myisamchk -r -q} on all
-tables. Otherwise your indexes may not be ordered correctly.
+tables. Otherwise, your indexes may not be ordered correctly.
When a client connects to a MySQL server, the server sends the
default character set in use to the client. The client will switch to
@@ -20267,7 +20375,7 @@ old @code{mysql_escape_string()} function, except that it takes the @code{MYSQL}
connection handle as the first parameter.
If the client is compiled with different paths than where the server is
-installed and the user who configured MySQL didn't included all
+installed and the user who configured MySQL didn't include all
character sets in the MySQL binary, one must specify for
the client where it can find the additional character sets it will need
if the server runs with a different character set than the client.
@@ -20279,8 +20387,8 @@ One can specify this by putting in a MySQL option file:
character-sets-dir=/usr/local/mysql/share/mysql/charsets
@end example
-where the path points to where the dynamic MySQL character sets
-are stored.
+where the path points to the directory in which the dynamic MySQL character
+sets are stored.
One can force the client to use specific character set by specifying:
@@ -20457,7 +20565,7 @@ The @code{configure} program uses this comment to include
the character set into the MySQL library automatically.
The strxfrm_multiply and mbmaxlen lines will be explained in
-the following sections. Only include them if you the string
+the following sections. Only include these if you need the string
collating functions or the multi-byte character set functions,
respectively.
@@ -20488,7 +20596,7 @@ distribution, mail a patch to @email{internals@@lists.mysql.com}.
@node Character arrays, String collating, Adding character set, Localisation
-@subsection The character definition arrays
+@subsection The Character Definition Arrays
@code{to_lower[]} and @code{to_upper[]} are simple arrays that hold the
lowercase and uppercase characters corresponding to each member of the
@@ -20501,7 +20609,7 @@ to_upper['a'] should contain 'A'
@code{sort_order[]} is a map indicating how characters should be ordered for
comparison and sorting purposes. For many character sets, this is the same as
-@code{to_upper[]} (which means sorting will be case insensitive).
+@code{to_upper[]} (which means sorting will be case-insensitive).
MySQL will sort characters based on the value of
@code{sort_order[character]}. For more complicated sorting rules, see
the discussion of string collating below. @xref{String collating}.
@@ -20615,10 +20723,10 @@ table with @code{myisamchk -dvv table_name}.
@menu
* Server-Side Overview:: Overview of the Server-Side Scripts and Utilities
-* safe_mysqld:: safe_mysqld, the wrapper around mysqld
-* mysqld_multi:: mysqld_multi, program for managing multiple MySQL servers
-* myisampack:: myisampack, The MySQL Compressed Read-only Table Generator
-* mysqld-max:: mysqld-max, An extended mysqld server
+* safe_mysqld:: @code{safe_mysqld}, The Wrapper Around @code{mysqld}
+* mysqld_multi:: @code{mysqld_multi}, Program for Managing Multiple MySQL Servers
+* myisampack:: @code{myisampack}, The MySQL Compressed Read-only Table Generator
+* mysqld-max:: @code{mysqld-max}, An Extended @code{mysqld} Server
@end menu
@@ -20639,7 +20747,7 @@ All MySQL clients that communicate with the server using the
@tindex environment variable, @code{MYSQL_PWD}
@tindex @code{MYSQL_DEBUG} environment variable
@tindex environment variable, @code{MYSQL_DEBUG}
-@multitable @columnfractions .25 .55
+@multitable @columnfractions .25 .60
@item @strong{Name} @tab @strong{Description}
@item @code{MYSQL_UNIX_PORT} @tab The default socket; used for connections to @code{localhost}
@item @code{MYSQL_TCP_PORT} @tab The default TCP/IP port
@@ -20656,7 +20764,7 @@ Use of @code{MYSQL_PWD} is insecure.
@tindex @code{HOME} environment variable
@tindex environment variable, @code{HOME}
@cindex history file
-@cindex command line history
+@cindex command-line history
@tindex .mysql_history file
The @file{mysql} client uses the file named in the @code{MYSQL_HISTFILE}
environment variable to save the command-line history. The default value for
@@ -20671,7 +20779,7 @@ to get a full description of the program's different options. For example, try
You can override default options for all standard client programs with an
option file. @ref{Option files}.
-The list below briefly describes the MySQL programs:
+The following list briefly describes the MySQL programs:
@table @code
@@ -20750,7 +20858,7 @@ shell> replace a b b a -- file1 file2 ...
@node safe_mysqld, mysqld_multi, Server-Side Overview, Server-Side Scripts
-@subsection safe_mysqld, the wrapper around mysqld
+@subsection @code{safe_mysqld}, The Wrapper Around @code{mysqld}
@cindex tools, safe_mysqld
@cindex scripts
@@ -20765,17 +20873,17 @@ If you don't use @code{--mysqld=#} or @code{--mysqld-version=#}
@code{safe_mysqld} will use an executable named @code{mysqld-max} if it
exists. If not, @code{safe_mysqld} will start @code{mysqld}.
This makes it very easy to test to use @code{mysqld-max} instead of
-@code{mysqld}; Just copy @code{mysqld-max} to where you have
+@code{mysqld}; just copy @code{mysqld-max} to where you have
@code{mysqld} and it will be used.
Normally one should never edit the @code{safe_mysqld} script, but
instead put the options to @code{safe_mysqld} in the
-@code{[safe_mysqld]} section in the @code{my.cnf}
+@code{[safe_mysqld]} section in the @file{my.cnf}
file. @code{safe_mysqld} will read all options from the @code{[mysqld]},
@code{[server]} and @code{[safe_mysqld]} sections from the option files.
@xref{Option files}.
-Note that all options on the command line to @code{safe_mysqld} are passed
+Note that all options on the command-line to @code{safe_mysqld} are passed
to @code{mysqld}. If you wants to use any options in @code{safe_mysqld} that
@code{mysqld} doesn't support, you must specify these in the option file.
@@ -20784,7 +20892,7 @@ Most of the options to @code{safe_mysqld} are the same as the options to
@code{safe_mysqld} supports the following options:
-@itemize
+@table @code
@item --basedir=path
@item --core-file-size=#
Size of the core file @code{mysqld} should be able to create. Passed to @code{ulimit -c}.
@@ -20811,7 +20919,7 @@ Number of files @code{mysqld} should be able to open. Passed to @code{ulimit -n}
@item --timezone=#
Set the timezone (the @code{TZ}) variable to the value of this parameter.
@item --user=#
-@end itemize
+@end table
The @code{safe_mysqld} script is written so that it normally is able to start
a server that was installed from either a source or a binary version of
@@ -20856,7 +20964,7 @@ edited version that you can reinstall.
@node mysqld_multi, myisampack, safe_mysqld, Server-Side Scripts
-@subsection mysqld_multi, program for managing multiple MySQL servers
+@subsection @code{mysqld_multi}, Program for Managing Multiple MySQL Servers
@cindex tools, mysqld_multi
@cindex scripts
@@ -20869,12 +20977,12 @@ processes running in different Unix sockets and TCP/IP ports.
The program will search for group(s) named [mysqld#] from my.cnf (or the
given --config-file=...), where # can be any positive number starting
from 1. These groups should be the same as the usual @code{[mysqld]}
-group (e.g. options to mysqld, see MySQL manual for detailed
-information about this group), but with those port, socket etc. options
+group (e.g., options to @code{mysqld}, see the MySQL manual for detailed
+information about this group), but with those port, socket, etc. options
that are wanted for each separate @code{mysqld} processes. The number in
the group name has another function; it can be used for starting,
stopping, or reporting some specific @code{mysqld} servers with this
-program. See the usage and options below for more information.
+program. See the usage and options here for more information.
@example
Usage: mysqld_multi [OPTIONS] @{start|stop|report@} [GNR,GNR,GNR...]
@@ -20883,7 +20991,7 @@ or mysqld_multi [OPTIONS] @{start|stop|report@} [GNR-GNR,GNR,GNR-GNR,...]
The GNR above means the group number. You can start, stop or report
any GNR, or several of them at the same time. (See --example) The GNRs
-list can be comma separated, or a dash combined, of which the latter
+list can be comma separated or combined with a dash, of which the latter
means that all the GNRs between GNR1-GNR2 will be affected. Without
GNR argument all the found groups will be either started, stopped, or
reported. Note that you must not have any white spaces in the GNR
@@ -20891,7 +20999,7 @@ list. Anything after a white space is ignored.
@code{mysqld_multi} supports the following options:
-@itemize
+@table @code
@cindex config-file option
@item --config-file=...
Alternative config file. Note: This will not affect this program's own
@@ -20936,7 +21044,7 @@ MySQL user for @code{mysqladmin}.
@cindex version option
@item --version
Print the version number and exit.
-@end itemize
+@end table
Some notes about @code{mysqld_multi}:
@@ -20959,7 +21067,7 @@ You will have to do the above for each @code{mysqld} running in each
data directory, that you have (just change the socket, -S=...).
@item
@code{pid-file} is very important, if you are using @code{safe_mysqld}
-to start @code{mysqld} (e.g. --mysqld=safe_mysqld) Every @code{mysqld}
+to start @code{mysqld} (e.g., @code{--mysqld=safe_mysqld}) Every @code{mysqld}
should have its own @code{pid-file}. The advantage using
@code{safe_mysqld} instead of @code{mysqld} directly here is, that
@code{safe_mysqld} 'guards' every @code{mysqld} process and will restart
@@ -20980,7 +21088,7 @@ release) if test -d /data/mysql -a -f ./share/mysql/english/errmsg.sys
@end example
The above test should be successful, or you may encounter problems.
@item
-Beware of the dangers starting multiple @code{mysqlds} in the same data
+Beware of the dangers starting multiple @code{mysqld}s in the same data
directory. Use separate data directories, unless you @strong{know} what
you are doing!
@item
@@ -21063,7 +21171,7 @@ user = jani
@node myisampack, mysqld-max, mysqld_multi, Server-Side Scripts
-@subsection myisampack, The MySQL Compressed Read-only Table Generator
+@subsection @code{myisampack}, The MySQL Compressed Read-only Table Generator
@cindex compressed tables
@cindex tables, compressed
@@ -21081,22 +21189,22 @@ The information needed to decompress columns is read into memory when the
table is opened. This results in much better performance when accessing
individual records, because you only have to uncompress exactly one record, not
a much larger disk block as when using Stacker on MS-DOS.
-Usually, @code{myisampack} packs the data file 40%-70%.
+Usually, @code{myisampack} packs the datafile 40%-70%.
MySQL uses memory mapping (@code{mmap()}) on compressed tables and
falls back to normal read/write file usage if @code{mmap()} doesn't work.
-There are currently two limitations with @code{myisampack}:
+Please note the following:
@itemize @bullet
@item
-After packing, the table is read-only.
+After packing, the table is read-only. This is generally intended
+(such as when accessing packed tables on a CD). Also allowing writes
+to a packed table is on our TODO list but with low priority.
@item
-@code{myisampack} can also pack @code{BLOB} or @code{TEXT} columns. The
-older @code{pack_isam} could not do this.
+@code{myisampack} can also pack @code{BLOB} or @code{TEXT} columns.
+The older @code{pack_isam} (for @code{ISAM} tables) can not do this.
@end itemize
-Fixing these limitations is on our TODO list but with low priority.
-
@code{myisampack} is invoked like this:
@example
@@ -21109,7 +21217,7 @@ file. It is permissible to omit the @file{.MYI} extension.
@code{myisampack} supports the following options:
-@itemize @bullet
+@table @code
@item -b, --backup
Make a backup of the table as @code{tbl_name.OLD}.
@@ -21129,7 +21237,7 @@ it finds that @file{tbl_name.TMD} exists. With @code{--force},
Display a help message and exit.
@item -j big_tbl_name, --join=big_tbl_name
-Join all tables named on the command line into a single table
+Join all tables named on the command-line into a single table
@code{big_tbl_name}. All tables that are to be combined
@strong{must} be identical (same column names and types, same indexes, etc.).
@@ -21163,10 +21271,10 @@ Wait and retry if table is in use. If the @code{mysqld} server was
invoked with the @code{--skip-locking} option, it is not a good idea to
invoke @code{myisampack} if the table might be updated during the
packing process.
-@end itemize
+@end table
@cindex examples, compressed tables
-The sequence of commands shown below illustrates a typical table compression
+The sequence of commands shown here illustrates a typical table compression
session:
@example
@@ -21345,7 +21453,7 @@ Field Start Length Type Huff tree Bits
57 831 4 no zeros, zerofill(1) 2 9
@end example
-The information printed by @code{myisampack} is described below:
+The information printed by @code{myisampack} is described here:
@table @code
@item normal
@@ -21447,7 +21555,7 @@ If you want to unpack a packed table, you can do this with the
@node mysqld-max, , myisampack, Server-Side Scripts
-@subsection mysqld-max, An extended mysqld server
+@subsection @code{mysqld-max}, An Extended @code{mysqld} Server
@cindex @code{mysqld-max}
@@ -21476,7 +21584,7 @@ You can check which table types are supported by doing the following
query:
@example
-mysql> show variables like "have_%";
+mysql> SHOW VARIABLES LIKE "have_%";
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
@@ -21520,12 +21628,12 @@ The following table shows which table types our standard @strong{MySQL-Max}
binaries includes:
@multitable @columnfractions .15 .10 .10
-@item @strong{System} @tab @strong{BDB} @tab @strong{InnoDB}
+@item @strong{System} @tab @code{BDB} @tab @code{InnoDB}
@item AIX 4.3 @tab N @tab Y
@item HP-UX 11.0 @tab N @tab Y
@item Linux-Alpha @tab N @tab Y
@item Linux-Intel @tab Y @tab Y
-@item Linux-Ia64 @tab N @tab Y
+@item Linux-IA64 @tab N @tab Y
@item Solaris-Intel @tab N @tab Y
@item Solaris-SPARC @tab Y @tab Y
@item Caldera (SCO) OSR5 @tab Y @tab Y
@@ -21540,13 +21648,13 @@ binaries includes:
@menu
* Client-Side Overview:: Overview of the Client-Side Scripts and Utilities
* mysql:: The Command-line Tool
-* mysqladmin:: mysqladmin, Administrating a MySQL Server
+* mysqladmin:: @code{mysqladmin}, Administrating a MySQL Server
* Using mysqlcheck:: Using @code{mysqlcheck} for Table Maintenance and Crash Recovery
-* mysqldump:: mysqldump, Dumping Table Structure and Data
-* mysqlhotcopy:: mysqlhotcopy, Copying MySQL Databases and Tables
-* mysqlimport:: mysqlimport, Importing Data from Text Files
+* mysqldump:: @code{mysqldump}, Dumping Table Structure and Data
+* mysqlhotcopy:: @code{mysqlhotcopy}, Copying MySQL Databases and Tables
+* mysqlimport:: @code{mysqlimport}, Importing Data from Text Files
* mysqlshow:: Showing Databases, Tables, and Columns
-* perror:: perror, Explaining Error Codes
+* perror:: @code{perror}, Explaining Error Codes
* Batch Commands:: How to Run SQL Commands from a Text File
@end menu
@@ -21568,7 +21676,7 @@ All MySQL clients that communicate with the server using the
@tindex environment variable, @code{MYSQL_PWD}
@tindex @code{MYSQL_DEBUG} environment variable
@tindex environment variable, @code{MYSQL_DEBUG}
-@multitable @columnfractions .25 .55
+@multitable @columnfractions .25 .60
@item @strong{Name} @tab @strong{Description}
@item @code{MYSQL_UNIX_PORT} @tab The default socket; used for connections to @code{localhost}
@item @code{MYSQL_TCP_PORT} @tab The default TCP/IP port
@@ -21585,7 +21693,7 @@ Use of @code{MYSQL_PWD} is insecure.
@tindex @code{HOME} environment variable
@tindex environment variable, @code{HOME}
@cindex history file
-@cindex command line history
+@cindex command-line history
@tindex .mysql_history file
The @file{mysql} client uses the file named in the @code{MYSQL_HISTFILE}
environment variable to save the command-line history. The default value for
@@ -21600,7 +21708,7 @@ to get a full description of the program's different options. For example, try
You can override default options for all standard client programs with an
option file. @ref{Option files}.
-The list below briefly describes the MySQL programs:
+The following list briefly describes the MySQL programs:
@table @code
@@ -21679,10 +21787,10 @@ shell> replace a b b a -- file1 file2 ...
@node mysql, mysqladmin, Client-Side Overview, Client-Side Scripts
-@subsection The Command-line Tool
+@subsection @code{mysql}, The Command-line Tool
-@cindex command line tool
-@cindex tools, command line
+@cindex command-line tool
+@cindex tools, command-line
@cindex scripts
@cindex @code{mysql}
@@ -21706,9 +21814,9 @@ Using @code{mysql} is very easy. Just start it as follows:
@code{mysql database} or @code{mysql --user=user_name --password=your_password database}. Type a SQL statement, end it with @samp{;}, @samp{\g}, or @samp{\G}
and press Enter.
-@cindex @code{mysql} command line options
-@cindex command line options, @code{mysql}
-@cindex options, command line, @code{mysql}
+@cindex @code{mysql} command-line options
+@cindex command-line options, @code{mysql}
+@cindex options, command-line, @code{mysql}
@cindex startup parameters, @code{mysql}
@code{mysql} supports the following options:
@@ -21722,6 +21830,14 @@ Display this help and exit.
No automatic rehashing. One has to use 'rehash' to get table and field
completion. This gives a quicker start of mysql.
+@cindex @code{prompt}, @code{mysql} option
+@item --prompt=...
+Set the mysql prompt to specified format.
+
+@cindex @code{no-beep}, @code{mysql} option
+@item -b, --no-beep
+Turn off beep-on-error.
+
@cindex @code{batch}, @code{mysql} option
@item -B, --batch
Print results with a tab as separator, each row on a new line. Doesn't use
@@ -21741,7 +21857,7 @@ Debug log. Default is 'd:t:o,/tmp/mysql.trace'.
@cindex @code{database}, @code{mysql} option
@item -D, --database=...
-Database to use. This is mainly useful in the @code{my.cnf} file.
+Database to use. This is mainly useful in the @file{my.cnf} file.
@cindex @code{default-character-set}, @code{mysql} option
@item --default-character-set=...
@@ -21824,7 +21940,7 @@ also. This option does not work in batch mode. Pager works only in Unix.
@cindex @code{password}, @code{mysql} option
@item -p[password], --password[=...]
Password to use when connecting to server. If a password is not given on
-the command line, you will be prompted for it. Note that if you use the
+the command-line, you will be prompted for it. Note that if you use the
short form @code{-p} you can't have a space between the option and the
password.
@@ -21870,7 +21986,7 @@ User for login if not current user.
@item -U, --safe-updates[=#], --i-am-a-dummy[=#]
Only allow @code{UPDATE} and @code{DELETE} that uses keys. See below for
more information about this option. You can reset this option if you have
-it in your @code{my.cnf} file by using @code{--safe-updates=0}.
+it in your @file{my.cnf} file by using @code{--safe-updates=0}.
@cindex @code{verbose}, @code{mysql} option
@item -v, --verbose
@@ -21903,7 +22019,7 @@ You can also set the following variables with @code{-O} or
@item max_join_size @tab 1000000 @tab Automatic limit for rows in a join when using --i-am-a-dummy.
@end multitable
-If you type 'help' on the command line, @code{mysql} will print out the
+If you type 'help' on the command-line, @code{mysql} will print out the
commands that it supports:
@cindex commands, list of
@@ -21926,6 +22042,7 @@ notee (\t) Don't write into outfile.
pager (\P) Set PAGER [to_pager].
Print the query results via PAGER.
print (\p) Print current command.
+prompt (\R) Change your mysql prompt.
quit (\q) Quit mysql.
rehash (\#) Rebuild completion hash.
source (\.) Execute a SQL script file.
@@ -21937,9 +22054,9 @@ use (\u) Use another database.
Takes database name as argument.
@end example
-From the above, pager only works in Unix.
+The @code{pager} command works only in Unix.
-@cindex status command
+@cindex @code{status} command
The @code{status} command gives you some information about the
connection and the server you are using. If you are running in the
@code{--safe-updates} mode, @code{status} will also print the values for
@@ -21959,7 +22076,7 @@ SET SQL_SAFE_UPDATES=1,SQL_SELECT_LIMIT=#select_limit#,
@end example
where @code{#select_limit#} and @code{#max_join_size#} are variables that
-can be set from the @code{mysql} command line. @xref{SET OPTION, @code{SET}}.
+can be set from the @code{mysql} command-line. @xref{SET OPTION, @code{SET}}.
The effect of the above is:
@@ -21986,7 +22103,7 @@ includes new lines, is often much easier to be read with vertical
output.
@example
-mysql> select * from mails where length(txt) < 300 limit 300,1\G
+mysql> SELECT * FROM mails WHERE LENGTH(txt) < 300 lIMIT 300,1\G
*************************** 1. row ***************************
msg_nro: 3068
date: 2000-03-01 23:29:50
@@ -21998,7 +22115,7 @@ mail_from: Monty
txt: >>>>> "Thimble" == Thimble Smith writes:
Thimble> Hi. I think this is a good idea. Is anyone familiar with UTF-8
-Thimble> or Unicode? Otherwise I'll put this on my TODO list and see what
+Thimble> or Unicode? Otherwise, I'll put this on my TODO list and see what
Thimble> happens.
Yes, please do that.
@@ -22013,14 +22130,14 @@ Monty
@itemize @bullet
@item
For logging, you can use the @code{tee} option. The @code{tee} can be
-started with option @code{--tee=...}, or from the command line
+started with option @code{--tee=...}, or from the command-line
interactively with command @code{tee}. All the data displayed on the
screen will also be appended into a given file. This can be very useful
for debugging purposes also. The @code{tee} can be disabled from the
-command line with command @code{notee}. Executing @code{tee} again
+command-line with command @code{notee}. Executing @code{tee} again
starts logging again. Without a parameter the previous file will be
used. Note that @code{tee} will flush the results into the file after
-each command, just before the command line appears again waiting for the
+each command, just before the command-line appears again waiting for the
next command.
@item
@@ -22028,7 +22145,7 @@ Browsing, or searching the results in the interactive mode in Unix less,
more, or any other similar program, is now possible with option
@code{--pager[=...]}. Without argument, @code{mysql} client will look
for environment variable PAGER and set @code{pager} to that.
-@code{pager} can be started from the interactive command line with
+@code{pager} can be started from the interactive command-line with
command @code{pager} and disabled with command @code{nopager}. The
command takes an argument optionally and the @code{pager} will be set to
that. Command @code{pager} can be called without an argument, but this
@@ -22083,9 +22200,89 @@ more handy to switch on and off, when you want to log something into a
file, but want to be able to turn the feature off sometimes.
@end itemize
+@cindex @code{prompt} command
+You can change the prompt in the @code{mysql} command-line client.
+
+You can use the following prompt options:
+@c FIX these columnfractions have NOT been measured!
+@multitable @columnfractions .10 .50
+@item @strong{Option} @tab @strong{Description}
+@item \v @tab mysqld version
+@item \d @tab database in use
+@item \h @tab host connected to
+@item \p @tab port connected on
+@item \u @tab username
+@item \U @tab full username@@host
+@item \\ @tab @samp{\}
+@item \n @tab new line break
+@item \t @tab tab
+@item \ @tab space
+@item \_ @tab space
+@item \R @tab military hour time (0-23)
+@item \r @tab standard hour time (1-12)
+@item \m @tab minutes
+@item \y @tab two digit year
+@item \Y @tab four digit year
+@item \D @tab full date format
+@item \s @tab seconds
+@item \w @tab day of the week in three letter format (Mon, Tue, ...)
+@item \P @tab am/pm
+@item \o @tab month in number format
+@item \O @tab month in three letter format (Jan, Feb, ...)
+@item \c @tab counter that counts up for each command you do
+@end multitable
+
+@samp{\} followed by any other letter just becomes that letter.
+
+You may set the prompt in the following places:
+
+@table @strong
+@item Environment Variable
+You may set the @code{MYSQL_PS1} environment variable to a prompt string. For
+example:
+
+@example
+shell> export MYSQL_PS1="(\u@@\h) [\d]> "
+@end example
+
+@item @file{my.cnf}
+@item @file{.my.cnf}
+You may set the @code{prompt} option in any MySQL configuration file, in the
+@code{mysql} group. For example:
+
+@example
+[mysql]
+prompt=(\u@@\h) [\d]>\_
+@end example
+
+@item Command Line
+You may set the @code{--prompt} option on the command line to @code{mysql}.
+For example:
+
+@example
+shell> mysql --prompt="(\u@@\h) [\d]> "
+
+(user@@host) [database]>
+@end example
+
+@item Interactively
+You may also use the @code{prompt} (or @code{\R}) command to change your
+prompt interactively. For example:
+
+@example
+mysql> prompt (\u@@\h) [\d]>\_
+PROMPT set to '(\u@@\h) [\d]>\_'
+(user@@host) [database]>
+(user@@host) [database]> prompt
+Returning to default PROMPT of mysql>
+mysql>
+@end example
+
+@end table
+
@node mysqladmin, Using mysqlcheck, mysql, Client-Side Scripts
-@subsection mysqladmin, Administrating a MySQL Server
+@subsection @code{mysqladmin}, Administrating a MySQL Server
@cindex administration, server
@cindex server administration
@@ -22280,7 +22477,7 @@ Use compression in server/client protocol.
@item -?, --help
Display this help message and exit.
@item -B, --databases
-To check several databases. Note the difference in usage; In this case
+To check several databases. Note the difference in usage; in this case
no tables are given. All name arguments are regarded as database names.
@item --default-character-set=...
Set the default character set
@@ -22332,7 +22529,7 @@ Output version information and exit.
@node mysqldump, mysqlhotcopy, Using mysqlcheck, Client-Side Scripts
-@subsection mysqldump, Dumping Table Structure and Data
+@subsection @code{mysqldump}, Dumping Table Structure and Data
@cindex dumping, databases
@cindex databases, dumping
@@ -22425,7 +22622,8 @@ tables.
@item -K, --disable-keys
@code{/*!40000 ALTER TABLE tb_name DISABLE KEYS */;} and
@code{/*!40000 ALTER TABLE tb_name ENABLE KEYS */;}
-will be put in the output.
+will be put in the output. This will make loading the data into a MySQL
+4.0 server faster as the indexes are created after all data are inserted.
@item -n, --no-create-db
@code{CREATE DATABASE /*!32312 IF NOT EXISTS*/ db_name;} will not be put in the
output. The above line will be added otherwise, if --databases or
@@ -22450,6 +22648,8 @@ used.)
@item -q, --quick
Don't buffer query, dump directly to stdout. Uses @code{mysql_use_result()}
to do this.
+@item -Q, --quote-names
+Quote table and column names within @samp{`} characters.
@item -r, --result-file=...
Direct output to a given file. This option should be used in MSDOS,
because it prevents new line '\n' from being converted to '\n\r' (new
@@ -22462,7 +22662,7 @@ Overrides option --databases (-B).
@item -T, --tab=path-to-some-directory
Creates a @code{table_name.sql} file, that contains the SQL CREATE commands,
and a @code{table_name.txt} file, that contains the data, for each give table.
-@strong{NOTE}: This only works if @code{mysqldump} is run on the same
+@strong{Note}: This only works if @code{mysqldump} is run on the same
machine as the @code{mysqld} daemon. The format of the @file{.txt} file
is made according to the @code{--fields-xxx} and @code{--lines--xxx} options.
@item -u user_name, --user=user_name
@@ -22533,14 +22733,14 @@ mysqldump --all-databases > all_databases.sql
@node mysqlhotcopy, mysqlimport, mysqldump, Client-Side Scripts
-@subsection mysqlhotcopy, Copying MySQL Databases and Tables
+@subsection @code{mysqlhotcopy}, Copying MySQL Databases and Tables
@cindex dumping, databases
@cindex databases, dumping
@cindex tables, dumping
@cindex backing up, databases
-@code{mysqlhotcopy} is a perl script that uses @code{LOCK TABLES},
+@code{mysqlhotcopy} is a Perl script that uses @code{LOCK TABLES},
@code{FLUSH TABLES} and @code{cp} or @code{scp} to quickly make a backup
of a database. It's the fastest way to make a backup of the database,
of single tables but it can only be run on the same machine where the
@@ -22601,13 +22801,13 @@ documentation for @code{mysqlhotcopy}.
from the option files.
To be able to execute @code{mysqlhotcopy} you need write access to the
-backup directory, @code{SELECT} privilege to the tables you are about to
-copy and the MySQL @code{Reload} privilege (to be able to
+backup directory, the @strong{select} privilege for the tables you are about to
+copy and the MySQL @strong{reload} privilege (to be able to
execute @code{FLUSH TABLES}).
@node mysqlimport, mysqlshow, mysqlhotcopy, Client-Side Scripts
-@subsection mysqlimport, Importing Data from Text Files
+@subsection @code{mysqlimport}, Importing Data from Text Files
@cindex importing, data
@cindex data, importing
@@ -22626,7 +22826,7 @@ directly to the same options to @code{LOAD DATA INFILE}.
shell> mysqlimport [options] database textfile1 [textfile2 ...]
@end example
-For each text file named on the command line,
+For each text file named on the command-line,
@code{mysqlimport} strips any extension from the filename and uses the result
to determine which table to import the file's contents into. For example,
files named @file{patient.txt}, @file{patient.text}, and @file{patient} would
@@ -22784,12 +22984,12 @@ are shown.
Note that in newer MySQL versions, you only see those
database/tables/columns for which you have some privileges.
-If the last argument contains a shell or SQL wild-card (@code{*}, @code{?},
-@code{%} or @code{_}) then only what's matched by the wild card is shown.
+If the last argument contains a shell or SQL wildcard (@code{*}, @code{?},
+@code{%} or @code{_}) then only what's matched by the wildcard is shown.
This may cause some confusion when you try to display the columns for a
table with a @code{_} as in this case @code{mysqlshow} only shows you
the table names that match the pattern. This is easily fixed by
-adding an extra @code{%} last on the command line (as a separate
+adding an extra @code{%} last on the command-line (as a separate
argument).
@@ -22830,8 +23030,6 @@ Note that the error messages are mostly system dependent!
@node Batch Commands, , perror, Client-Side Scripts
@subsection How to Run SQL Commands from a Text File
-@c FIX add the 'source' command
-
The @code{mysql} client typically is used interactively, like this:
@example
@@ -22841,7 +23039,7 @@ shell> mysql database
However, it's also possible to put your SQL commands in a file and tell
@code{mysql} to read its input from that file. To do so, create a text
file @file{text_file} that contains the commands you wish to execute.
-Then invoke @code{mysql} as shown below:
+Then invoke @code{mysql} as shown here:
@example
shell> mysql database < text_file
@@ -22855,7 +23053,14 @@ line:
shell> mysql < text_file
@end example
-@xref{Client-Side Scripts}.
+If you are already running @code{mysql}, you can execute a SQL
+script file using the @code{source} command:
+
+@example
+mysql> source filename;
+@end example
+
+For more information about batch mode, @ref{Batch mode}.
@node Log Files, Replication, Client-Side Scripts, MySQL Database Administration
@@ -22929,7 +23134,7 @@ remove the @code{-l} option from @code{mysql.server} or change it to
@code{--log-bin}.
The entries in this log are written as @code{mysqld} receives the questions.
-This may be different than the order in which the statements are executed.
+This may be different from the order in which the statements are executed.
This is in contrast to the update log and the binary log which are written
after the query is executed, but before any locks are released.
@@ -22940,7 +23145,7 @@ after the query is executed, but before any locks are released.
@cindex update log
@cindex files, update log
-@strong{Note}: The update log is replaced by the binary
+@strong{Note}: the update log is replaced by the binary
log. @xref{Binary log}. With this you can do anything that you can do
with the update log.
@@ -22954,7 +23159,7 @@ extension, @code{mysqld} will create log file names like so:
time you execute @code{mysqladmin refresh}, execute @code{mysqladmin
flush-logs}, execute the @code{FLUSH LOGS} statement, or restart the server.
-@strong{Note:} For the above scheme to work, you must not create
+@strong{Note}: for the above scheme to work, you must not create
your own files with the same filename as the update log + some extensions
that may be regarded as a number, in the directory used by the update log!
@@ -23030,7 +23235,7 @@ command. @xref{RESET}.
You can use the following options to @code{mysqld} to affect what is logged
to the binary log:
-@multitable @columnfractions .35 .65
+@multitable @columnfractions .38 .62
@item @strong{Option} @tab @strong{Description}
@item @code{binlog-do-db=database_name} @tab
@@ -23105,7 +23310,7 @@ more than @code{long_query_time} to execute. The time to get the initial
table locks are not counted as execution time.
The slow query log is logged after the query is executed and after all
-locks has been released. This may be different than the order in which
+locks has been released. This may be different from the order in which
the statements are executed.
If no file name is given, it defaults to the name of the host machine
@@ -23189,7 +23394,7 @@ and then take a backup and remove @file{mysql.old}.
* Replication Implementation:: Replication Implementation Overview
* Replication HOWTO:: How To Set Up Replication
* Replication Features:: Replication Features and Known Problems
-* Replication Options:: Replication Options in my.cnf
+* Replication Options:: Replication Options in @file{my.cnf}
* Replication SQL:: SQL Commands Related to Replication
* Replication FAQ:: Replication FAQ
* Replication Problems:: Troubleshooting Replication
@@ -23198,7 +23403,7 @@ and then take a backup and remove @file{mysql.old}.
This section describes the various replication features in MySQL.
It serves as a reference to the options available with replication.
You will be introduced to replication and learn how to implement it.
-Towards the end, there are some frequently asked questions and descriptions
+Toward the end, there are some frequently asked questions and descriptions
of problems and how to solve them.
We suggest that you visit our website at @uref{http://www.mysql.com/}
@@ -23271,7 +23476,7 @@ Due to the above limitation, we recommend that at this point you use
small, or if a prolonged read lock on the master is acceptable. While the
actual speed of @code{LOAD DATA FROM MASTER} may vary from system to system,
a good rule for a rough estimate of how long it is going to take is 1 second
-per 1 MB of the data file. You will get close to the estimate if both master
+per 1 MB of the datafile. You will get close to the estimate if both master
and slave are equivalent to 700 MHz Pentium, are connected through
100 MBit/s network, and your index file is about half the size of your data
file. Of course, your mileage will vary from system to system, the above rule
@@ -23293,24 +23498,24 @@ The next section explains the master/slave setup process in more detail.
@node Replication HOWTO, Replication Features, Replication Implementation, Replication
@subsection How To Set Up Replication
-Below is a quick description of how to set up complete replication on
+Here is a quick description of how to set up complete replication on
your current MySQL server. It assumes you want to replicate all
your databases and have not configured replication before. You will need
to shutdown your master server briefly to complete the steps outlined
-below.
+here.
-While the above method is the most straightforward way to set up a slave,
+While this method is the most straightforward way to set up a slave,
it is not the only one. For example, if you already have a snapshot
of the master, and
-the master already has server id set and binary logging enabled, one can
+the master already has server id set and binary logging enabled, you can
set up a slave without shutting the master down or even blocking the updates.
For more details, please see @ref{Replication FAQ}.
If you want to become a real MySQL replication guru, we suggest that you
-begin with studing, pondering, and trying all commands
+begin by studying, pondering, and trying all commands
mentioned in @ref{Replication SQL}. You should also familiarize yourself
-with replication startup options in @code{my.cnf} in
-@xref{Replication Options}.
+with replication startup options in @file{my.cnf} in
+@ref{Replication Options}.
@enumerate
@item
@@ -23332,7 +23537,7 @@ For example, to create a user named @code{repl} which can access your
master from any host, you might use this command:
@example
-GRANT FILE ON *.* TO repl@@"%" IDENTIFIED BY '<password>';
+mysql> GRANT FILE ON *.* TO repl@@"%" IDENTIFIED BY '<password>';
@end example
@item
@@ -23357,7 +23562,7 @@ Windows users can use @code{WinZIP} or similar software to create an
archive of the data directory.
@item
-In @code{my.cnf} on the master add @code{log-bin} and
+In @file{my.cnf} on the master add @code{log-bin} and
@code{server-id=unique number} to the @code{[mysqld]} section and
restart it. It is very important that the id of the slave is different from
the id of the master. Think of @code{server-id} as something similar
@@ -23374,7 +23579,7 @@ server-id=1
Restart MySQL on the master.
@item
-Add the following to @code{my.cnf} on the slave(s):
+Add the following to @file{my.cnf} on the slave(s):
@example
master-host=<hostname of the master>
@@ -23416,16 +23621,16 @@ Warning: one should set server_id to a non-0 value if master_host is set.
The server will not act as a slave.
@end example
-If you have forgot to do this for the master, the slaves will not be
+If you have forgotten to do this for the master, the slaves will not be
able to connect to the master.
If a slave is not able to replicate for any reason, you will find error
messages in the error log on the slave.
Once a slave is replicating, you will find a file called
-@code{master.info} in the same directory as your error log. The
-@code{master.info} file is used by the slave to keep track of how much
-of the master's binary log is has processed. @strong{Do not} remove or
+@file{master.info} in the same directory as your error log. The
+@file{master.info} file is used by the slave to keep track of how much
+of the master's binary log it has processed. @strong{Do not} remove or
edit the file, unless you really know what you are doing. Even in that case,
it is preferred that you use @code{CHANGE MASTER TO} command.
@@ -23433,10 +23638,10 @@ it is preferred that you use @code{CHANGE MASTER TO} command.
@subsection Replication Features and Known Problems
@cindex options, replication
-@cindex @code{my.cnf} file
-@cindex files,@code{my.cnf}
+@cindex @file{my.cnf} file
+@cindex files,@file{my.cnf}
-Below is an explanation of what is supported and what is not:
+Here is an explanation of what is supported and what is not:
@itemize @bullet
@item
@@ -23464,15 +23669,15 @@ Update queries that use user variables are not replication-safe (yet).
@code{FLUSH} commands are not stored in the binary log and are because
of this not replicated to the slaves. This is not normally a problem as
@code{FLUSH} doesn't change anything. This does however mean that if you
-update the @code{MySQL} privilege tables directly without using
-@code{GRANT} statement and you replicate the @code{MySQL} privilege
+update the MySQL privilege tables directly without using the
+@code{GRANT} statement and you replicate the @code{mysql} privilege
database, you must do a @code{FLUSH PRIVILEGES} on your slaves to put
the new privileges into effect.
@item
Temporary tables starting in 3.23.29 are replicated properly with the
exception of the case when you shut down slave server ( not just slave thread),
-you have some temporary tables open, and the are used in subsequent updates.
-To deal with this problem, to shut down the slave, do @code{SLAVE STOP}, then
+you have some temporary tables open, and they are used in subsequent updates.
+To deal with this problem shutting down the slave, do @code{SLAVE STOP},
check @code{Slave_open_temp_tables} variable to see if it is 0, then issue
@code{mysqladmin shutdown}. If the number is not 0, restart the slave thread
with @code{SLAVE START} and see
@@ -23482,10 +23687,10 @@ In earlier versions temporary tables are not replicated properly - we
recommend that you either upgrade, or execute @code{SET SQL_LOG_BIN=0} on
your clients before all queries with temp tables.
@item
-MySQL only supports one master and many slaves. We will in 4.x
+MySQL only supports one master and many slaves. In 4.x, we will
add a voting algorithm to automatically change master if something goes
wrong with the current master. We will also introduce 'agent' processes
-to help doing load balancing by sending select queries to different
+to help do load balancing by sending select queries to different
slaves.
@item
Starting in Version 3.23.26, it is safe to connect servers in a circular
@@ -23513,7 +23718,7 @@ pre-3.23.26 slaves will not be able to read it.
If the query on the slave gets an error, the slave thread will
terminate, and a message will appear in the @file{.err} file. You should
then connect to the slave manually, fix the cause of the error (for
-example, non-existent table), and then run @code{SLAVE START} sql
+example, non-existent table), and then run the @code{SLAVE START} SQL
command (available starting in Version 3.23.16). In Version 3.23.15, you
will have to restart the server.
@item
@@ -23529,19 +23734,19 @@ if disk cache was not synced before the system died. Your system fault
tolerance will be greatly increased if you have a good UPS.
@item
If the master is listening on a non-standard port, you will also need to
-specify this with @code{master-port} parameter in @code{my.cnf} .
+specify this with @code{master-port} parameter in @file{my.cnf} .
@item
In Version 3.23.15, all of the tables and databases will be
replicated. Starting in Version 3.23.16, you can restrict replication to
a set of databases with @code{replicate-do-db} directives in
-@code{my.cnf} or just exclude a set of databases with
+@file{my.cnf} or just exclude a set of databases with
@code{replicate-ignore-db}. Note that up until Version 3.23.23, there was a bug
that did not properly deal with @code{LOAD DATA INFILE} if you did it in
a database that was excluded from replication.
@item
Starting in Version 3.23.16, @code{SET SQL_LOG_BIN = 0} will turn off
replication (binary) logging on the master, and @code{SET SQL_LOG_BIN =
-1} will turn in back on - you must have the process privilege to do
+1} will turn it back on -- you must have the @strong{process} privilege to do
this.
@item
Starting in Version 3.23.19, you can clean up stale replication leftovers when
@@ -23580,14 +23785,14 @@ While individual tables can be excluded from replication with
@code{replicate-wild-do-table}/@code{replicate-wild-ignore-table}, there
are currently some design deficiencies that in some rather rare cases
produce unexpected results. The replication protocol does not inform the
-slave explicitly which tables are going to be modified by the query - so
+slave explicitly which tables are going to be modified by the query -- so
the slave has to parse the query to know this. To avoid redundant
parsing for queries that will end up actually being executed, table
exclusion is currently implemented by sending the query to the standard
MySQL parser, which will short-circuit the query and report success if
it detects that the table should be ignored. In addition to several
inefficiencies, this approach is also more bug prone, and there are two
-known bugs as of Version 3.23.49 - because the parser automatically opens
+known bugs as of Version 3.23.49 -- because the parser automatically opens
the table when parsing some queries the ignored table has to exist on
the slave. The other bug is that if the ignored table gets partially
updated, the slave thread will not notice that the table actually should
@@ -23595,17 +23800,17 @@ have been ignored and will suspend the replication process. While the
above bugs are conceptually very simple to fix, we have not yet found a way
to do this without a sigficant code change that would compromize the stability
status of 3.23 branch. There exists a workaround for both if in the rare case
-it happens to affect your application - use @code{slave-skip-errors}.
+it happens to affect your application -- use @code{slave-skip-errors}.
@end itemize
@node Replication Options, Replication SQL, Replication Features, Replication
-@subsection Replication Options in my.cnf
+@subsection Replication Options in @file{my.cnf}
-If you are using replication, we recommend you to use MySQL Version
+If you are using replication, we recommend that you use MySQL Version
3.23.30 or later. Older versions work, but they do have some bugs and are
-missing some features. Some of the options below may not be available in
+missing some features. Some of the options mentioned here may not be available in
your version if it is not the most recent one. For all options specific to
the 4.0 branch, there is a note indicating so. Otherwise, if you discover
that the option you are interested in is not available in your 3.23 version,
@@ -23622,9 +23827,9 @@ This sets an unique replication id. You should pick a unique value in the
range between 1 to 2^32-1 for each master and slave.
Example: @code{server-id=3}
-The following table has the options you can use for the @strong{MASTER}:
+The following table describes the options you can use for the @code{MASTER}:
-@multitable @columnfractions .35 .65
+@multitable @columnfractions .38 .62
@item @strong{Option} @tab @strong{Description}
@item @code{log-bin=filename} @tab
@@ -23635,17 +23840,16 @@ not work right during replication if you do @code{FLUSH LOGS} . The
problem is fixed in Version 3.23.25. If you are using this kind of log
name, @code{FLUSH LOGS} will be ignored on binlog. To clear the log, run
@code{FLUSH MASTER}, and do not forget to run @code{FLUSH SLAVE} on all
-slaves. In Version 3.23.26 and in later versions you should use
+slaves. In Versions 3.23.26 and later, you should use
@code{RESET MASTER} and @code{RESET SLAVE}
@item @code{log-bin-index=filename} @tab
Because the user could issue the @code{FLUSH LOGS} command, we need to
know which log is currently active and which ones have been rotated out
and in what sequence. This information is stored in the binary log index file.
-The default is `hostname`.index. You can use this option if you want to
-be a rebel.
+The default is @file{`hostname`.index}. You should not need to change this.
-Example: @code{log-bin-index=db.index}.
+Example: @code{log-bin-index=db.index}
@item @code{sql-bin-update-same} @tab
If set, setting @code{SQL_LOG_BIN} to a value will automatically set
@@ -23653,91 +23857,90 @@ If set, setting @code{SQL_LOG_BIN} to a value will automatically set
@item @code{binlog-do-db=database_name} @tab
Tells the master that it should log updates to the binary log if the
-current database is 'database_name'. All others database are ignored.
-Note that if you use this you should ensure that you only do updates in
+current database is @code{database_name}. All other databases are ignored.
+Note that if you use this, you should ensure that you do updates only in
the current database.
-Example: @code{binlog-do-db=sales}.
+Example: @code{binlog-do-db=sales}
@item @code{binlog-ignore-db=database_name} @tab
Tells the master that updates where the current database is
-'database_name' should not be stored in the binary log. Note that if
-you use this you should ensure that you only do updates in the current
+@code{database_name} should not be stored in the binary log. Note that if
+you use this, you should ensure that you do updates only in the current
database.
Example: @code{binlog-ignore-db=accounting}
@end multitable
-The following table has the options you can use for the @strong{SLAVE}:
+The following table describes the options you can use for the @code{SLAVE}:
-@multitable @columnfractions .35 .65
+@multitable @columnfractions .38 .62
@item @strong{Option} @tab @strong{Description}
@item @code{master-host=host} @tab
Master hostname or IP address for replication. If not set, the slave
thread will not be started. Note that the setting of @code{master-host}
-will be ignored if there exists a valid @code{master.info} file. Probably a
+will be ignored if there exists a valid @file{master.info} file. Probably a
better name for this options would have been something like
@code{bootstrap-master-host}, but it is too late to change now.
-Example: @code{master-host=db-master.mycompany.com}.
+Example: @code{master-host=db-master.mycompany.com}
@item @code{master-user=username} @tab
The username the slave thread will use for authentication when connecting to
-the master. The user must have @code{FILE} privilege. If the master user
-is not set, user @code{test} is assumed. The value in @code{master.info} will
+the master. The user must have the @strong{file} privilege. If the master user
+is not set, user @code{test} is assumed. The value in @file{master.info} will
take precedence if it can be read.
-Example: @code{master-user=scott}.
+Example: @code{master-user=scott}
@item @code{master-password=password} @tab
The password the slave thread will authenticate with when connecting to
the master. If not set, an empty password is assumed.The value in
-@code{master.info} will take precedence if it can be read.
+@file{master.info} will take precedence if it can be read.
-Example: @code{master-password=tiger}.
+Example: @code{master-password=tiger}
@item @code{master-port=portnumber} @tab
The port the master is listening on. If not set, the compiled setting of
@code{MYSQL_PORT} is assumed. If you have not tinkered with
@code{configure} options, this should be 3306. The value in
-@code{master.info} will take precedence if it can be read.
+@file{master.info} will take precedence if it can be read.
-Example: @code{master-port=3306}.
+Example: @code{master-port=3306}
@item @code{master-connect-retry=seconds} @tab
The number of seconds the slave thread will sleep before retrying to
connect to the master in case the master goes down or the connection is
lost. Default is 60.
-Example: @code{master-connect-retry=60}.
+Example: @code{master-connect-retry=60}
@item @code{master-ssl} @tab
Available after 4.0.0. Turn SSL on for replication. Be warned that is
this is a relatively new feature.
-Example: @code{master-ssl}.
+Example: @code{master-ssl}
@item @code{master-ssl-key} @tab
Available after 4.0.0. Master SSL keyfile name. Only applies if you have
enabled @code{master-ssl}.
-Example: @code{master-ssl-key=SSL/master-key.pem}.
+Example: @code{master-ssl-key=SSL/master-key.pem}
@item @code{master-ssl-cert} @tab
Available after 4.0.0. Master SSL certificate file name. Only applies if
you have enabled @code{master-ssl}.
-Example: @code{master-ssl-key=SSL/master-cert.pem}.
+Example: @code{master-ssl-key=SSL/master-cert.pem}
@item @code{master-info-file=filename} @tab
The location of the file that remembers where we left off on the master
-during the replication process. The default is master.info in the data
-directory. Sasha: The only reason I see for ever changing the default
-is the desire to be rebelious.
+during the replication process. The default is @file{master.info} in the data
+directory. You should not need to change this.
-Example: @code{master-info-file=master.info}.
+Example: @code{master-info-file=master.info}
@item @code{report-host} @tab
Available after 4.0.0. Hostname or IP of the slave to be reported to to
@@ -23762,7 +23965,7 @@ To specify more than one table, use the directive multiple times, once
for each table. This will work for cross-database updates, in
contrast to @code{replicate-do-db}.
-Example: @code{replicate-do-table=some_db.some_table}.
+Example: @code{replicate-do-table=some_db.some_table}
@item @code{replicate-ignore-table=db_name.table_name} @tab
Tells the slave thread to not replicate to the specified table. To
@@ -23770,7 +23973,7 @@ specify more than one table to ignore, use the directive multiple times,
once for each table. This will work for cross-datbase updates,
in contrast to @code{replicate-ignore-db}.
-Example: @code{replicate-ignore-table=db_name.some_table}.
+Example: @code{replicate-ignore-table=db_name.some_table}
@item @code{replicate-wild-do-table=db_name.table_name} @tab
Tells the slave thread to restrict replication to the tables that match
@@ -23779,18 +23982,18 @@ directive multiple times, once for each table. This will work for
cross-database updates.
Example: @code{replicate-wild-do-table=foo%.bar%} will replicate only updates
-to tables in all databases that start with foo and whose table names
-start with bar.
+to tables in all databases that start with @code{foo} and whose table names
+start with @code{bar}.
@item @code{replicate-wild-ignore-table=db_name.table_name} @tab
Tells the slave thread to not replicate to the tables that match the
-given wild card pattern. To specify more than one table to ignore, use
+given wildcard pattern. To specify more than one table to ignore, use
the directive multiple times, once for each table. This will work for
cross-database updates.
Example: @code{replicate-wild-ignore-table=foo%.bar%} will not do updates
-to tables in databases that start with foo and whose table names start
-with bar.
+to tables in databases that start with @code{foo} and whose table names start
+with @code{bar}.
@item @code{replicate-ignore-db=database_name} @tab
Tells the slave thread to not replicate to the specified database. To
@@ -23798,9 +24001,9 @@ specify more than one database to ignore, use the directive multiple
times, once for each database. This option will not work if you use cross
database updates. If you need cross database updates to work, make sure
you have 3.23.28 or later, and use
-@code{replicate-wild-ignore-table=db_name.%}
+@code{replicate-wild-ignore-table=db_name.%}.
-Example: @code{replicate-ignore-db=some_db}.
+Example: @code{replicate-ignore-db=some_db}
@item @code{replicate-do-db=database_name} @tab
@@ -23810,9 +24013,9 @@ times, once for each database. Note that this will only work if you do
not use cross-database queries such as @code{UPDATE some_db.some_table
SET foo='bar'} while having selected a different or no database. If you
need cross database updates to work, make sure you have 3.23.28 or
-later, and use @code{replicate-wild-do-table=db_name.%}
+later, and use @code{replicate-wild-do-table=db_name.%}.
-Example: @code{replicate-do-db=some_db}.
+Example: @code{replicate-do-db=some_db}
@item @code{log-slave-updates} @tab
Tells the slave to log the updates from the slave thread to the binary
@@ -23820,32 +24023,33 @@ log. Off by default. You will need to turn it on if you plan to
daisy-chain the slaves.
@item @code{replicate-rewrite-db=from_name->to_name} @tab
-Updates to a database with a different name than the original
+Updates to a database with a different name than the original.
+
+Example: @code{replicate-rewrite-db=master_db_name->slave_db_name}
-Example: @code{replicate-rewrite-db=master_db_name->slave_db_name}.
+@item @code{slave-skip-errors= [err_code1,err_code2,... | all]} @tab
-@item @code{slave-skip-errors=err_code1,err_code2,...} @tab
Available only in 3.23.47 and later. Tells the slave thread to continue
replication when a query returns an error from the provided
list. Normally, replication will discontinue when an error is
-encountered giving the user a chance to resolve the inconsistency in the
+encountered, giving the user a chance to resolve the inconsistency in the
data manually. Do not use this option unless you fully understand why
you are getting the errors. If there are no bugs in your
replication setup and client programs, and no bugs in MySQL itself, you
-should never get an abort with error.Indiscriminate use of this option
+should never get an abort with error. Indiscriminate use of this option
will result in slaves being hopelessly out of sync with the master and
you having no idea how the problem happened.
For error codes, you should use the numbers provided by the error message in
your slave error log and in the output of @code{SHOW SLAVE STATUS}. Full list
of error messages can be found in the source distribution in
-@code{Docs/mysqld_error.txt}.
+@file{Docs/mysqld_error.txt}.
-You can ( but should not) also use a very non-recommended value of @code{all}
+You can (but should not) also use a very non-recommended value of @code{all}
which will ignore all error messages and keep barging along regardless.
Needless to say, if you use it, we make no promises regarding your data
integrity. Please do not complain if your data on the slave is not anywhere
-close to what it is on the master in this case - you have been warned.
+close to what it is on the master in this case -- you have been warned.
Example:
@@ -23855,7 +24059,7 @@ Example:
Tells the slave server not to start the slave on the startup. The user
can start it later with @code{SLAVE START}.
-@item @code{slave_read_timeout=#} @tab
+@item @code{slave_net_timeout=#} @tab
Number of seconds to wait for more data from the master before aborting
the read.
@end multitable
@@ -23868,10 +24072,10 @@ the read.
@cindex commands, replication
@cindex replication, commands
-Replication can be controlled through the SQL interface. Below is the
+Replication can be controlled through the SQL interface. Here is the
summary of commands:
-@multitable @columnfractions .40 .60
+@multitable @columnfractions .45 .55
@item @strong{Command} @tab @strong{Description}
@item @code{SLAVE START}
@@ -23881,11 +24085,11 @@ summary of commands:
@tab Stops the slave thread. (Slave)
@item @code{SET SQL_LOG_BIN=0}
- @tab Disables update logging if the user has process privilege.
+ @tab Disables update logging if the user has the @strong{process} privilege.
Ignored otherwise. (Master)
@item @code{SET SQL_LOG_BIN=1}
- @tab Re-enables update logging if the user has process privilege.
+ @tab Re-enables update logging if the user has the @strong{process} privilege.
Ignored otherwise. (Master)
@item @code{SET SQL_SLAVE_SKIP_COUNTER=n}
@@ -23895,7 +24099,8 @@ recovering from replication glitches.
@item @code{RESET MASTER}
@tab Deletes all binary logs listed in the index file, resetting the binlog
-index file to be empty. In pre-3.23.26 versions, @code{FLUSH MASTER} (Master)
+index file to be empty. In pre-3.23.26 versions, use @code{FLUSH MASTER}
+(Master)
@item @code{RESET SLAVE}
@tab Makes the slave forget its replication position in the master
@@ -23904,9 +24109,9 @@ logs. In pre 3.23.26 versions the command was called
@item @code{LOAD TABLE tblname FROM MASTER}
@tab Downloads a copy of the table from master to the slave. Implemented
- mainly for debugging of @code{LOAD DATA FROM MASTER}, but some "gourmet"
+ mainly for debugging of @code{LOAD DATA FROM MASTER}, but some ``gourmet''
users might find it useful for other things. Do not use it if you consider
- yourself the average "non-hacker" type user. (Slave)
+ yourself the average ``non-hacker'' type user. (Slave)
@item @code{LOAD DATA FROM MASTER} @tab
Available starting in 4.0.0. Takes a snapshot of the master and copies
@@ -23945,11 +24150,11 @@ old values of log and position are not applicable anymore, and will
automatically be reset to an empty string and 0, respectively (the start
values). Note that if you restart the slave, it will remember its last master.
If this is not desirable, you should delete the @file{master.info} file before
-restarting, and the slave will read its master from @code{my.cnf} or the
-command line.
+restarting, and the slave will read its master from @file{my.cnf} or the
+command-line.
This command is useful for setting up a slave when you have the snapshot of
-the master and have record the log and the offset on the master that the
+the master and have recorded the log and the offset on the master that the
snapshot corresponds to. You can run
@code{CHANGE MASTER TO MASTER_LOG_FILE='log_name_on_master',
MASTER_LOG_POS=log_offset_on_master} on the slave after restoring the
@@ -23990,8 +24195,8 @@ intuitive way to describe this operation.
@item @code{PURGE MASTER LOGS TO 'logname'}
@tab Available starting in Version 3.23.28. Deletes all the
replication logs that are listed in the log
-index as being prior to the specified log, and removed them from the
-log index, so that the given log now becomes first. Example:
+index as being prior to the specified log, and removes them from the
+log index, so that the given log now becomes the first. Example:
@example
PURGE MASTER LOGS TO 'mysql-bin.010'
@@ -24001,7 +24206,7 @@ This command will do nothing and fail with an error if you have an
active slave that is currently reading one of the logs you are trying to
delete. However, if you have a dormant slave, and happen to purge one of
the logs it wants to read, the slave will be unable to replicate once it
-comes up. The command is safe to run while slaves are replicating - you
+comes up. The command is safe to run while slaves are replicating -- you
do not need to stop them.
You must first check all the slaves with @code{SHOW SLAVE STATUS} to
@@ -24052,7 +24257,7 @@ later
@end itemize
Afterwards, follow the instructions for the case when you have a snapshot and
-have records the log name and offset. You can use the same snapshot to set up
+have recorded the log name and offset. You can use the same snapshot to set up
several slaves. As long as the binary logs of the master are left intact, you
can wait as long as several days or in some cases maybe a month to set up a
slave once you have the snapshot of the master. In theory the waiting gap can
@@ -24148,7 +24353,7 @@ restart the master, start slave threads, and then remove the old log files.
lock the master tables, let the slave catch up, then run @code{FLUSH
MASTER} on the master, and @code{FLUSH SLAVE} on the slave to reset the
logs, then restart new versions of the master and the slave. Note that
-the slave can stay down for some time - since the master is logging
+the slave can stay down for some time -- since the master is logging
all the updates, the slave will be able to catch up once it is up and
can connect.
@@ -24168,7 +24373,7 @@ for client A to make an update to co-master 1, and in the meantime,
before it propagates to co-master 2, client B could make an update to
co-master 2 that will make the update of client A work differently than
it did on co-master 1. Thus when the update of client A will make it
-to co-master 2, it will produce tables that will be different than
+to co-master 2, it will produce tables that will be different from
what you have on co-master 1, even after all the updates from co-master
2 have also propagated. So you should not co-chain two servers in a
two-way replication relationship, unless you are sure that you updates
@@ -24203,7 +24408,7 @@ performance-enhancing replication?
@strong{A}:
If the part of your code that is responsible for database access has
been properly abstracted/modularised, converting it to run with the
-replicated setup should be very smooth and easy - just change the
+replicated setup should be very smooth and easy -- just change the
implementation of your database access to read from some slave or the
master, and to always write to the master. If your code does not have
this level of abstraction,
@@ -24238,7 +24443,7 @@ written a lot of code already, you may want to automate the conversion
task by using Monty's @code{replace} utility, which comes with the
standard distribution of MySQL, or just write your own Perl script.
Hopefully, your code follows some recognisable pattern. If not, then
-you are probably better off re-writing it anyway, or at least going
+you are probably better off rewriting it anyway, or at least going
through and manually beating it into a pattern.
Note that, of course, you can use different names for the
@@ -24262,7 +24467,7 @@ of your site, you need to know your query patterns, and empirically
(by benchmarking) determine the relationship between the throughput
on reads (reads per second, or @code{max_reads}) and on writes
@code{max_writes}) on a typical master and a typical slave. The
-example below will show you a rather simplified calculation of what you
+example here will show you a rather simplified calculation of what you
can get with replication for our imagined system.
Let's say our system load consists of 10% writes and 90% reads, and we
@@ -24328,9 +24533,9 @@ the slaves of the master change in case of failure. Some suggestions:
@item
To tell a slave to change the master use the @code{CHANGE MASTER TO} command.
@item
-A good way to keep your applications informed where the master is by
-having a dynamic DNS entry for the master. With @strong{bind} you can
-use @code{nsupdate} to dynamically update your DNS.
+A good way to keep your applications informed as to the location of the
+master is by having a dynamic DNS entry for the master.
+With @code{bind} you can use @file{nsupdate} to dynamically update your DNS.
@item
You should run your slaves with the @code{log-bin} option and without
@code{log-slave-updates}. This way the slave will be ready to become a
@@ -24394,10 +24599,10 @@ query from the master.
@item
If you have decided you can skip the next query, do
@code{SET SQL_SLAVE_SKIP_COUNTER=1; SLAVE START;} to skip a query that
-does not use auto_increment, or last_insert_id or
+does not use @code{AUTO_INCREMENT} or @code{LAST_INSERT_ID()}, or
@code{SET SQL_SLAVE_SKIP_COUNTER=2; SLAVE START;} otherwise. The reason
-auto_increment/last_insert_id queries are different is that they take
-two events in the binary log of the master.
+queries that use @code{AUTO_INCREMENT} or @code{LAST_INSERT_ID()}
+are different is that they take two events in the binary log of the master.
@item
If you are sure the slave started out perfectly in sync with the master,
@@ -24412,7 +24617,7 @@ version.
If all else fails, read the error logs. If they are big,
@code{grep -i slave /path/to/your-log.err} on the slave. There is no
generic pattern to search for on the master, as the only errors it logs
-are general system errors - if it can, it will send the error to the slave
+are general system errors -- if it can, it will send the error to the slave
when things go wrong.
@end itemize
@@ -24425,14 +24630,14 @@ bug report. Ideally, we would like to have a test case in the format found in
case like that, you can expect a patch within a day or two in most cases,
although, of course, you mileage may vary depending on a number of factors.
-Second best option is a just program with easily configurable connection
-arguments for the master and the slave that will demonstrate the problem on our
-systems. You can write one in Perl or in C, depending on which language you
-know better.
+The second best option is to write a simple program with easily configurable
+connection arguments for the master and the slave that will demonstrate
+the problem on our systems. You can write one in Perl or in C, depending
+on which language you know better.
If you have one of the above ways to demonstrate the bug, use
@code{mysqlbug} to prepare a bug report and send it to
-@email{bugs@@lists.mysql.com}. If you have a phantom - a problem that
+@email{bugs@@lists.mysql.com}. If you have a phantom -- a problem that
does occur but you cannot duplicate "at will":
@itemize @bullet
@@ -24442,7 +24647,7 @@ slave outside of the slave thread, the data will be out of sync, and you can
have unique key violations on updates, in which case the slave thread will
stop and wait for you to clean up the tables manually to bring them in sync.
@item
-Run slave with @code{log-slave-updates} and @code{log-bin} - this will keep
+Run slave with @code{log-slave-updates} and @code{log-bin} -- this will keep
a log of all updates on the slave.
@item
Save all evidence before resetting the replication. If we have no or only
@@ -24653,7 +24858,7 @@ MySQL-specific keywords to a query. The code inside
servers.
If high performance is more important than exactness, as in some
-Web applications, it is possibile to create an application layer that
+web applications, it is possibile to create an application layer that
caches all results to give you even higher performance. By letting
old results 'expire' after a while, you can keep the cache reasonably
fresh. This provides a method to handle high load spikes, in which case
@@ -24689,8 +24894,8 @@ We solved this by storing all information per month in compressed
'transaction' tables. We have a set of simple macros (script) that
generates summary tables grouped by different criteria (product group,
customer id, store ...) from the transaction tables. The reports are
-Web pages that are dynamically generated by a small Perl script that
-parses a Web page, executes the SQL statements in it, and inserts the
+web pages that are dynamically generated by a small Perl script that
+parses a web page, executes the SQL statements in it, and inserts the
results. We would have used PHP or mod_perl instead but they were
not available at that time.
@@ -24777,7 +24982,7 @@ For example, (run on the same NT 4.0 machine):
In the above test MySQL was run with a 8M index cache.
-We have gather some more benchmark results at
+We have gathered some more benchmark results at
@uref{http://www.mysql.com/information/benchmarks.html}.
Note that Oracle is not included because they asked to be removed. All
@@ -24868,16 +25073,16 @@ system setup you have, the more overhead you get.
If you do not have any @code{GRANT} statements done, MySQL will
optimise the permission checking somewhat. So if you have a very high
-volume it may be worth the time to avoid grants. Otherwise more
+volume it may be worth the time to avoid grants. Otherwise, more
permission check results in a larger overhead.
If your problem is with some explicit MySQL function, you can
always time this in the MySQL client:
@example
-mysql> select benchmark(1000000,1+1);
+mysql> SELECT BENCHMARK(1000000,1+1);
+------------------------+
-| benchmark(1000000,1+1) |
+| BENCHMARK(1000000,1+1) |
+------------------------+
| 0 |
+------------------------+
@@ -24888,7 +25093,7 @@ The above shows that MySQL can execute 1,000,000 @code{+}
expressions in 0.32 seconds on a @code{PentiumII 400MHz}.
All MySQL functions should be very optimised, but there may be
-some exceptions, and the @code{benchmark(loop_count,expression)} is a
+some exceptions, and the @code{BENCHMARK(loop_count,expression)} is a
great tool to find out if this is a problem with your query.
@menu
@@ -25055,7 +25260,7 @@ If you want to get your queries as fast as possible, you should look out for
@code{Using filesort} and @code{Using temporary}.
@end table
-The different join types are listed below, ordered from best to worst type:
+The different join types are listed here, ordered from best to worst type:
@cindex system table
@cindex tables, system
@@ -25095,7 +25300,7 @@ The @code{ref} column will be NULL for this type.
@item index
This is the same as @code{ALL}, except that only the index tree is
scanned. This is usually faster than @code{ALL}, as the index file is usually
-smaller than the data file.
+smaller than the datafile.
@item ALL
A full table scan will be done for each combination of rows from the
@@ -25116,7 +25321,7 @@ variable.
The following example shows how a @code{JOIN} can be optimised progressively
using the information provided by @code{EXPLAIN}.
-Suppose you have the @code{SELECT} statement shown below, that you examine
+Suppose you have the @code{SELECT} statement shown here, that you examine
using @code{EXPLAIN}:
@example
@@ -25150,7 +25355,7 @@ The columns being compared have been declared as follows:
@end multitable
@item
-The tables have the indexes shown below:
+The tables have the indexes shown here:
@multitable @columnfractions .10 .30
@item @strong{Table} @tab @strong{Index}
@@ -25224,7 +25429,7 @@ mysql> ALTER TABLE tt MODIFY AssignedPC VARCHAR(15),
-> MODIFY ClientID VARCHAR(15);
@end example
-Now @code{EXPLAIN} produces the output shown below:
+Now @code{EXPLAIN} produces the output shown here:
@example
table type possible_keys key key_len ref rows Extra
@@ -25313,7 +25518,7 @@ the data grows. @xref{Server parameters}.
@cindex speed, of queries
In general, when you want to make a slow @code{SELECT ... WHERE} faster, the
-first thing to check is whether or not you can add an index. @xref{MySQL
+first thing to check is whether you can add an index. @xref{MySQL
indexes, , MySQL indexes}. All references between different tables
should usually be done with indexes. You can use the @code{EXPLAIN} command
to determine which indexes are used for a @code{SELECT}.
@@ -25356,7 +25561,7 @@ they are mostly used with @code{SELECT}, but the same optimisations apply for
Also note that this section is incomplete. MySQL does many
optimisations, and we have not had time to document them all.
-Some of the optimisations performed by MySQL are listed below:
+Some of the optimisations performed by MySQL are listed here:
@itemize @bullet
@item
@@ -25431,7 +25636,7 @@ Each table index is queried, and the best index that spans fewer than 30% of
the rows is used. If no such index can be found, a quick table scan is used.
@item
In some cases, MySQL can read rows from the index without even
-consulting the data file. If all columns used from the index are numeric,
+consulting the datafile. If all columns used from the index are numeric,
then only the index tree is used to resolve the query.
@item
Before each record is output, those that do not match the @code{HAVING} clause
@@ -25586,9 +25791,9 @@ SELECT * FROM t1 ORDER BY key_part1 DESC,key_part2 DESC
SELECT * FROM t1 WHERE key_part1=1 ORDER BY key_part1 DESC,key_part2 DESC
@end example
-Some cases where MySQL can NOT use indexes to resolve the @code{ORDER
+Some cases where MySQL can @strong{not} use indexes to resolve the @code{ORDER
BY}: (Note that MySQL will still use indexes to find the rows that
-matches the where clause):
+matches the @code{WHERE} clause):
@itemize @bullet
@item
@@ -25596,7 +25801,7 @@ You are doing an @code{ORDER BY} on different keys:
@code{SELECT * FROM t1 ORDER BY key1,key2}
@item
-You are doing an @code{ORDER BY} on not following key parts.
+You are doing an @code{ORDER BY} using non-consecutive key parts.
@code{SELECT * FROM t1 WHERE key2=constant ORDER BY key_part2}
@@ -25718,8 +25923,8 @@ will abort the query (If you are not using @code{SQL_CALC_FOUND_ROWS}).
@code{LIMIT 0} will always quickly return an empty set. This is useful
to check the query and to get the column types of the result columns.
@item
-The size of temporary tables uses the @code{LIMIT #} to calculate how much
-space is needed to resolve the query.
+When the server uses temporary tables to resolve the query, the
+@code{LIMIT #} is used to calculate how much space is required.
@end itemize
@@ -25812,7 +26017,7 @@ flush-tables}.
@end enumerate
Note that @code{LOAD DATA INFILE} also does the above optimization if
-you insert into an empty table; The main difference with the above
+you insert into an empty table; the main difference with the above
procedure is that you can let myisamchk allocate much more temporary
memory for the index creation that you may want MySQL to allocate for
every index recreation.
@@ -25936,7 +26141,7 @@ In some cases it may make sense to introduce a column that is 'hashed'
based on information from other columns. If this column is short and
reasonably unique it may be much faster than a big index on many
columns. In MySQL it's very easy to use this extra column:
-@code{SELECT * FROM table_name WHERE hash=MD5(concat(col1,col2))
+@code{SELECT * FROM table_name WHERE hash=MD5(CONCAT(col1,col2))
AND col_1='constant' AND col_2='constant'}
@item
For tables that change a lot you should try to avoid all @code{VARCHAR}
@@ -26023,15 +26228,15 @@ is integrated in @code{mysqld}.
Use @code{AUTO_INCREMENT} columns to make unique values.
@item
Use @code{OPTIMIZE TABLE} once in a while to avoid fragmentation when
-using dynamic table format. @xref{OPTIMIZE TABLE, , @code{OPTIMIZE TABLE}}.
+using a dynamic table format. @xref{OPTIMIZE TABLE, , @code{OPTIMIZE TABLE}}.
@item
Use @code{HEAP} tables to get more speed when possible. @xref{Table
types}.
@item
-When using a normal Web server setup, images should be stored as
+When using a normal web server setup, images should be stored as
files. That is, store only a file reference in the database. The main
-reason for this is that a normal Web server is much better at caching
+reason for this is that a normal web server is much better at caching
files than database contents. So it it's much easier to get a fast
system if you are using files.
@item
@@ -26140,7 +26345,7 @@ once in a while.
This can be done with the following code:
@example
mysql> LOCK TABLES real_table WRITE, insert_table WRITE;
-mysql> insert into real_table select * from insert_table;
+mysql> INSERT INTO real_table SELECT * FROM insert_table;
mysql> TRUNCATE TABLE insert_table;
mysql> UNLOCK TABLES;
@end example
@@ -26346,7 +26551,7 @@ Choosing the right table format may give you a big performance gain.
@xref{Table types}.
You can get better performance on a table and minimise storage space
-using the techniques listed below:
+using the techniques listed here:
@itemize @bullet
@item
@@ -26411,7 +26616,7 @@ fast. Without an index MySQL has to start with the first record
and then read through the whole table until it finds the relevant
rows. The bigger the table, the more this costs. If the table has an index
for the columns in question, MySQL can quickly get a position to
-seek to in the middle of the data file without having to look at all the
+seek to in the middle of the datafile without having to look at all the
data. If a table has 1000 rows, this is at least 100 times faster than
reading sequentially. Note that if you need to access almost all 1000
rows it is faster to read sequentially because we then avoid disk seeks.
@@ -26448,7 +26653,7 @@ parts are followed by @code{DESC}. @xref{ORDER BY optimisation}.
@item
In some cases a query can be optimised to retrieve values without
-consulting the data file. If all used columns for some table are numeric
+consulting the datafile. If all used columns for some table are numeric
and form a leftmost prefix for some key, the values may be retrieved
from the index tree for greater speed:
@@ -26480,7 +26685,7 @@ search capabilities on @code{(col1)}, @code{(col1,col2)}, and
MySQL can't use a partial index if the columns don't form a
leftmost prefix of the index. Suppose you have the @code{SELECT}
-statements shown below:
+statements shown here:
@example
mysql> SELECT * FROM tbl_name WHERE col1=val1;
@@ -26498,12 +26703,12 @@ leftmost prefixes of @code{(col1,col2,col3)}.
@cindex indexes, and @code{LIKE}
@cindex wildcards, and @code{LIKE}
MySQL also uses indexes for @code{LIKE} comparisons if the argument
-to @code{LIKE} is a constant string that doesn't start with a wild-card
+to @code{LIKE} is a constant string that doesn't start with a wildcard
character. For example, the following @code{SELECT} statements use indexes:
@example
-mysql> select * from tbl_name where key_col LIKE "Patrick%";
-mysql> select * from tbl_name where key_col LIKE "Pat%_ck%";
+mysql> SELECT * FROM tbl_name WHERE key_col LIKE "Patrick%";
+mysql> SELECT * FROM tbl_name WHERE key_col LIKE "Pat%_ck%";
@end example
In the first statement, only rows with @code{"Patrick" <= key_col <
@@ -26512,14 +26717,20 @@ In the first statement, only rows with @code{"Patrick" <= key_col <
The following @code{SELECT} statements will not use indexes:
@example
-mysql> select * from tbl_name where key_col LIKE "%Patrick%";
-mysql> select * from tbl_name where key_col LIKE other_col;
+mysql> SELECT * FROM tbl_name WHERE key_col LIKE "%Patrick%";
+mysql> SELECT * FROM tbl_name WHERE key_col LIKE other_col;
@end example
-In the first statement, the @code{LIKE} value begins with a wild-card
+In the first statement, the @code{LIKE} value begins with a wildcard
character. In the second statement, the @code{LIKE} value is not a
constant.
+MySQL 4.0 does another optimization on @code{LIKE}. If you use
+@code{... LIKE "%string%"} and @code{string} is longer than 3 characters,
+MySQL will use the @code{Turbo Boyer-Moore} algorithm to initialise the
+pattern for the string and then use this pattern to perform the search
+quicker.
+
@findex IS NULL, and indexes
@cindex indexes, and @code{IS NULL}
Searching using @code{column_name IS NULL} will use indexes if column_name
@@ -26528,7 +26739,7 @@ is an index.
MySQL normally uses the index that finds the least number of rows. An
index is used for columns that you compare with the following operators:
@code{=}, @code{>}, @code{>=}, @code{<}, @code{<=}, @code{BETWEEN}, and a
-@code{LIKE} with a non-wild-card prefix like @code{'something%'}.
+@code{LIKE} with a non-wildcard prefix like @code{'something%'}.
Any index that doesn't span all @code{AND} levels in the @code{WHERE} clause
is not used to optimise the query. In other words: To be able to use an
@@ -26592,7 +26803,7 @@ index a column prefix looks like this:
KEY index_name (col_name(length))
@end example
-The example below creates an index for the first 10 characters of the
+The example here creates an index for the first 10 characters of the
@code{name} column:
@example
@@ -26686,12 +26897,12 @@ Uptime: 426 Running threads: 1 Questions: 11082 Reloads: 1 Open tables: 12
This can be somewhat perplexing if you only have 6 tables.
-MySQL is multithreaded, so it may have many queries on the same table
+MySQL is multi-threaded, so it may have many queries on the same table
simultaneously. To minimise the problem with two threads having
different states on the same file, the table is opened independently by
each concurrent thread. This takes some memory but will normaly increase
performance. Wth ISAM and MyISAM tables this also requires one extra file
-descriptor for the data file. With these table types the index file
+descriptor for the datafile. With these table types the index file
descriptor is shared between all threads.
You can read more about this topic in the next section. @xref{Table cache}.
@@ -26782,13 +26993,13 @@ If you are opening a table with the @code{HANDLER table_name OPEN}
statement, a dedicated table object is allocated for the thread.
This table object is not shared by other threads an will not be closed
until the thread calls @code{HANDLER table_name CLOSE} or the thread dies.
-@xref{HANDLER}. When this happens, the table is put back in the table_cache
-(if it isn't full).
+@xref{HANDLER, , @code{HANDLER}}. When this happens, the table is put
+back in the table_cache (if it isn't full).
You can check if your table cache is too small by checking the mysqld
variable @code{Opened_tables}. If this is quite big, even if you
haven't done a lot of @code{FLUSH TABLES}, you should increase your table
-cache. @xref{SHOW STATUS}.
+cache. @xref{SHOW STATUS, , @code{SHOW STATUS}}.
@node Creating many tables, , Table cache, Optimising Database Structure
@@ -26831,13 +27042,13 @@ nice to have a feeling about how much one could gain by changing things
at this level.
The default OS to use is really important! To get the most use of
-multiple CPU machines one should use Solaris (because the threads works
+multiple-CPU machines one should use Solaris (because the threads works
really nice) or Linux (because the 2.2 kernel has really good SMP
-support). Also on 32-bit machines Linux has a 2G file size limit by
+support). Also on 32-bit machines Linux has a 2G file-size limit by
default. Hopefully this will be fixed soon when new filesystems are
released (XFS/Reiserfs). If you have a desperate need for files bigger
than 2G on Linux-intel 32 bit, you should get the LFS patch for the ext2
-file system.
+filesystem.
Because we have not run MySQL in production on that many platforms, we
advice you to test your intended platform before choosing it, if possible.
@@ -26992,7 +27203,7 @@ much bigger than your available memory you should increase the value of
is done.
When you have installed MySQL, the @file{support-files} directory will
-contain some different @code{my.cnf} example files, @file{my-huge.cnf},
+contain some different @file{my.cnf} example files, @file{my-huge.cnf},
@file{my-large.cnf}, @file{my-medium.cnf}, and @file{my-small.cnf}, you can
use as a base to optimise your system.
@@ -27011,7 +27222,7 @@ shell> mysqld -O key_buffer=32m --help
@end example
Make sure that the @code{--help} option is last; otherwise, the effect of any
-options listed after it on the command line will not be reflected in the
+options listed after it on the command-line will not be reflected in the
output.
@@ -27104,7 +27315,7 @@ Running with @code{--log-bin} makes @strong{[MySQL} 1 % slower.
@item
Compiling on Linux-x86 using gcc without frame pointers
@code{-fomit-frame-pointer} or @code{-fomit-frame-pointer -ffixed-ebp}
-@code{mysqld} 1-4% faster.
+makes @code{mysqld} 1-4% faster.
@end itemize
The MySQL-Linux distribution provided by MySQL AB used
@@ -27121,14 +27332,14 @@ Linux binary is linked statically to get it faster and more portable.
@cindex memory use
-The list below indicates some of the ways that the @code{mysqld} server
+The following list indicates some of the ways that the @code{mysqld} server
uses memory. Where applicable, the name of the server variable relevant
to the memory use is given:
@itemize @bullet
@item
The key buffer (variable @code{key_buffer_size}) is shared by all
-threads; Other buffers used by the server are allocated as
+threads; other buffers used by the server are allocated as
needed. @xref{Server parameters}.
@item
@@ -27191,7 +27402,7 @@ unexpectedly large strings (this is done with @code{malloc()} and
@code{free()}).
@item
-Each index file is opened once and the data file is opened once for each
+Each index file is opened once and the datafile is opened once for each
concurrently running thread. For each concurrent thread, a table structure,
column structures for each column, and a buffer of size @code{3 * n} is
allocated (where @code{n} is the maximum row length, not counting @code{BLOB}
@@ -27310,7 +27521,7 @@ mysql> UPDATE mysql.user SET password=PASSWORD("newpass")
@item SQL_AUTO_IS_NULL = 0 | 1
If set to @code{1} (default) then one can find the last inserted row
-for a table with an auto_increment row with the following construct:
+for a table with an @code{AUTO_INCREMENT} column with the following construct:
@code{WHERE auto_increment_column IS NULL}. This is used by some
ODBC programs like Access.
@@ -27439,7 +27650,7 @@ the disks.
@table @strong
@item Using symbolic links
-This means that you symlink the index and/or data file(s) from the
+This means that you symlink the index and/or datafile(s) from the
normal data directory to another disk (that may also be striped). This
makes both the seek and read times better (if the disks are not used for
other things). @xref{Symbolic links}.
@@ -27474,8 +27685,8 @@ and logs) on a RAID 0+1 or RAID N disk. RAID N can be a problem if you
have many writes because of the time to update the parity bits.
@item
-You may also set the parameters for the file system that the database
-uses. One easy change is to mount the file system with the noatime
+You may also set the parameters for the filesystem that the database
+uses. One easy change is to mount the filesystem with the noatime
option. That makes it skip the updating of the last access time in the
inode and by this will avoid some disk seeks.
@@ -27497,13 +27708,13 @@ filesystem corruption may result. Backup everything before experimenting!
@item
On many operating systems you can mount the disks with the 'async' flag to
-set the file system to be updated asynchronously. If your computer is
+set the filesystem to be updated asynchronously. If your computer is
reasonable stable, this should give you more performance without sacrificing
too much reliability. (This flag is on by default on Linux.)
@item
If you don't need to know when a file was last accessed (which is not
-really useful on a database server), you can mount your file systems
+really useful on a database server), you can mount your filesystems
with the noatime flag.
@end itemize
@@ -27609,7 +27820,7 @@ In the data directory you will always have the table definition file
and the data/index files.
@item
-You can symlink the index file and the data file to different directories
+You can symlink the index file and the datafile to different directories
independent of the other.
@item
@@ -27784,19 +27995,19 @@ work around the problem that ASCII(26) stands for END-OF-FILE on Windows.
@item \\
A backslash (@samp{\}) character.
-@findex % (wild card character)
-@findex Wild card character (%)
+@findex % (wildcard character)
+@findex Wildcard character (%)
@item \%
A @samp{%} character. This is used to search for literal instances of
@samp{%} in contexts where @samp{%} would otherwise be interpreted
-as a wild-card character. @xref{String comparison functions}.
+as a wildcard character. @xref{String comparison functions}.
-@findex _ (wild card character)
-@findex Wild card character (_)
+@findex _ (wildcard character)
+@findex Wildcard character (_)
@item \_
A @samp{_} character. This is used to search for literal instances of
@samp{_} in contexts where @samp{_} would otherwise be interpreted
-as a wild-card character. @xref{String comparison functions}.
+as a wildcard character. @xref{String comparison functions}.
@end table
Note that if you use @samp{\%} or @samp{\_} in some string contexts, these
@@ -27823,7 +28034,7 @@ and need not be doubled or escaped. In the same way, @samp{"} inside a
string quoted with @samp{'} needs no special treatment.
@end itemize
-The @code{SELECT} statements shown below demonstrate how quoting and
+The @code{SELECT} statements shown here demonstrate how quoting and
escaping work:
@example
@@ -27929,7 +28140,7 @@ mysql> SELECT x'FF'
-> 255
mysql> SELECT 0xa+0;
-> 10
-mysql> select 0x5061756c;
+mysql> SELECT 0x5061756c;
-> Paul
@end example
@@ -27976,7 +28187,7 @@ introduced quoting of identifiers (database, table, and column names)
with @samp{`}. @samp{"} will also work to quote identifiers if you run
in ANSI mode. @xref{ANSI mode}.
-@multitable @columnfractions .15 .15 .65
+@multitable @columnfractions .15 .15 .70
@item @strong{Identifier} @tab @strong{Max length} @tab @strong{Allowed characters}
@item Database @tab 64 @tab Any character that is allowed in a directory name except @samp{/} or @samp{.}.
@item Table @tab 64 @tab Any character that is allowed in a file name, except @samp{/} or @samp{.}.
@@ -27991,7 +28202,7 @@ Note that if the identifier is a restricted word or contains special characters
you must always quote it with @code{`} when you use it:
@example
-mysql> SELECT * from `select` where `select`.id > 100;
+mysql> SELECT * FROM `select` WHERE `select`.id > 100;
@end example
In previous versions of MySQL, the name rules are as follows:
@@ -28064,12 +28275,12 @@ programs prefix table names with a @samp{.} character.
In MySQL, databases and tables correspond to directories and files
within those directories. Consequently, the case sensitivity of the
underlying operating system determines the case sensitivity of database and
-table names. This means database and table names are case insensitive in
-Windows, and case sensitive in most varieties of Unix (Mac OS X being an
+table names. This means database and table names are case-insensitive in
+Windows, and case-sensitive in most varieties of Unix (Mac OS X being an
exception).
@xref{Extensions to ANSI}.
-@strong{NOTE:} Although database and table names are case insensitive for
+@strong{Note}: although database and table names are case-insensitive for
Windows, you should not refer to a given database or table using different
cases within the same query. The following query would not work because it
refers to a table both as @code{my_table} and as @code{MY_TABLE}:
@@ -28078,9 +28289,9 @@ refers to a table both as @code{my_table} and as @code{MY_TABLE}:
mysql> SELECT * FROM my_table WHERE MY_TABLE.col=1;
@end example
-Column names and column aliases are case insensitive in all cases.
+Column names and column aliases are case-insensitive in all cases.
-Aliases on tables are case sensitive. The following query would not work
+Aliases on tables are case-sensitive. The following query would not work
because it refers to the alias both as @code{a} and as @code{A}:
@example
@@ -28101,6 +28312,12 @@ table names to lower case on storage and lookup. Note that if you
change this option, you need to first convert your old table names to
lower case before starting @code{mysqld}.
+If you move @code{MyISAM} files from a Windows to a *nix disk, you may
+in some cases need to use the @file{mysql_fix_extensions} tool to fix-up
+the case of the file extensions in each specified database directory
+(lowercase @file{.frm}, uppercase @file{.MYI} and @file{.MYD}).
+@file{mysql_fix_extensions} can be found in the @file{script} subdirectory.
+
@node Variables, Comments, Name case sensitivity, Language Structure
@subsection User Variables
@@ -28134,7 +28351,7 @@ However, in this case the assignment operator is @code{:=} rather than
statements:
@example
-select @@t1:=(@@t2:=1)+@@t3:=4,@@t1,@@t2,@@t3;
+mysql> SELECT @@t1:=(@@t2:=1)+@@t3:=4,@@t1,@@t2,@@t3;
+----------------------+------+------+------+
| @@t1:=(@@t2:=1)+@@t3:=4 | @@t1 | @@t2 | @@t3 |
+----------------------+------+------+------+
@@ -28147,14 +28364,14 @@ this does not currently include contexts where a number is explicitly
required, such as in the @code{LIMIT} clause of a @code{SELECT} statement,
or the @code{IGNORE number LINES} clause of a @code{LOAD DATA} statement.
-@strong{NOTE:} In a @code{SELECT} statement, each expression is evaluated
+@strong{Note}: in a @code{SELECT} statement, each expression is evaluated
only when it's sent to the client. This means that in the @code{HAVING},
@code{GROUP BY}, or @code{ORDER BY} clause, you can't refer to an expression
that involves variables that are set in the @code{SELECT} part. For example,
the following statement will NOT work as expected:
@example
-SELECT (@@aa:=id) AS a, (@@aa+3) AS b FROM table_name HAVING b=5;
+mysql> SELECT (@@aa:=id) AS a, (@@aa+3) AS b FROM table_name HAVING b=5;
@end example
The reason is that @code{@@aa} will not contain the value of the current
@@ -28172,10 +28389,10 @@ to end of line} and @code{/* in-line or multiple-line */} comment
styles:
@example
-mysql> select 1+1; # This comment continues to the end of line
-mysql> select 1+1; -- This comment continues to the end of line
-mysql> select 1 /* this is an in-line comment */ + 1;
-mysql> select 1+
+mysql> SELECT 1+1; # This comment continues to the end of line
+mysql> SELECT 1+1; -- This comment continues to the end of line
+mysql> SELECT 1 /* this is an in-line comment */ + 1;
+mysql> SELECT 1+
/*
this is a
multiple-line comment
@@ -28233,104 +28450,199 @@ A few are reserved because MySQL needs them and is
@c START_OF_RESERVED_WORDS
-@multitable @columnfractions .25 .25 .25 .25
-@item @strong{Word} @tab @strong{Word} @tab @strong{Word} @tab @strong{Word}
-@c Reserved word list updated Fri Dec 7 10:49:17 2001 by arjen.
+@c Reserved word list updated Fri May 3 08:41:00 2002 by arjen.
@c To regenerate, use Support/update-reserved-words.pl.
-@item @code{ADD} @tab @code{ALL}
- @tab @code{ALTER} @tab @code{ANALYZE}
-@item @code{AND} @tab @code{AS}
- @tab @code{ASC} @tab @code{AUTO_INCREMENT}
-@item @code{BDB} @tab @code{BERKELEYDB}
- @tab @code{BETWEEN} @tab @code{BIGINT}
-@item @code{BINARY} @tab @code{BLOB}
- @tab @code{BOTH} @tab @code{BY}
-@item @code{CASCADE} @tab @code{CASE}
- @tab @code{CHANGE} @tab @code{CHAR}
-@item @code{CHARACTER} @tab @code{COLUMN}
- @tab @code{COLUMNS} @tab @code{CONSTRAINT}
-@item @code{CREATE} @tab @code{CROSS}
- @tab @code{CURRENT_DATE} @tab @code{CURRENT_TIME}
-@item @code{CURRENT_TIMESTAMP} @tab @code{DATABASE}
- @tab @code{DATABASES} @tab @code{DAY_HOUR}
-@item @code{DAY_MINUTE} @tab @code{DAY_SECOND}
- @tab @code{DEC} @tab @code{DECIMAL}
-@item @code{DEFAULT} @tab @code{DELAYED}
- @tab @code{DELETE} @tab @code{DESC}
-@item @code{DESCRIBE} @tab @code{DISTINCT}
- @tab @code{DISTINCTROW} @tab @code{DOUBLE}
-@item @code{DROP} @tab @code{ELSE}
- @tab @code{ENCLOSED} @tab @code{ESCAPED}
-@item @code{EXISTS} @tab @code{EXPLAIN}
- @tab @code{FIELDS} @tab @code{FLOAT}
-@item @code{FOR} @tab @code{FOREIGN}
- @tab @code{FROM} @tab @code{FULLTEXT}
-@item @code{FUNCTION} @tab @code{GRANT}
- @tab @code{GROUP} @tab @code{HAVING}
-@item @code{HIGH_PRIORITY} @tab @code{HOUR_MINUTE}
- @tab @code{HOUR_SECOND} @tab @code{IF}
-@item @code{IGNORE} @tab @code{IN}
- @tab @code{INDEX} @tab @code{INFILE}
-@item @code{INNER} @tab @code{INNODB}
- @tab @code{INSERT} @tab @code{INSERT_ID}
-@item @code{INT} @tab @code{INTEGER}
- @tab @code{INTERVAL} @tab @code{INTO}
-@item @code{IS} @tab @code{JOIN}
- @tab @code{KEY} @tab @code{KEYS}
-@item @code{KILL} @tab @code{LAST_INSERT_ID}
- @tab @code{LEADING} @tab @code{LEFT}
-@item @code{LIKE} @tab @code{LIMIT}
- @tab @code{LINES} @tab @code{LOAD}
-@item @code{LOCK} @tab @code{LONG}
- @tab @code{LONGBLOB} @tab @code{LONGTEXT}
-@item @code{LOW_PRIORITY} @tab @code{MASTER_LOG_SEQ}
- @tab @code{MASTER_SERVER_ID} @tab @code{MATCH}
-@item @code{MEDIUMBLOB} @tab @code{MEDIUMINT}
- @tab @code{MEDIUMTEXT} @tab @code{MIDDLEINT}
-@item @code{MINUTE_SECOND} @tab @code{MRG_MYISAM}
- @tab @code{NATURAL} @tab @code{NOT}
-@item @code{NULL} @tab @code{NUMERIC}
- @tab @code{ON} @tab @code{OPTIMIZE}
-@item @code{OPTION} @tab @code{OPTIONALLY}
- @tab @code{OR} @tab @code{ORDER}
-@item @code{OUTER} @tab @code{OUTFILE}
- @tab @code{PARTIAL} @tab @code{PRECISION}
-@item @code{PRIMARY} @tab @code{PRIVILEGES}
- @tab @code{PROCEDURE} @tab @code{PURGE}
-@item @code{READ} @tab @code{REAL}
- @tab @code{REFERENCES} @tab @code{REGEXP}
-@item @code{RENAME} @tab @code{REPLACE}
- @tab @code{REQUIRE} @tab @code{RESTRICT}
-@item @code{RETURNS} @tab @code{REVOKE}
- @tab @code{RIGHT} @tab @code{RLIKE}
-@item @code{SELECT} @tab @code{SET}
- @tab @code{SHOW} @tab @code{SMALLINT}
-@item @code{SONAME} @tab @code{SQL_AUTO_IS_NULL}
- @tab @code{SQL_BIG_RESULT} @tab @code{SQL_BIG_SELECTS}
-@item @code{SQL_BIG_TABLES} @tab @code{SQL_BUFFER_RESULT}
- @tab @code{SQL_CALC_FOUND_ROWS} @tab @code{SQL_LOG_BIN}
-@item @code{SQL_LOG_OFF} @tab @code{SQL_LOG_UPDATE}
- @tab @code{SQL_LOW_PRIORITY_UPDATES} @tab @code{SQL_MAX_JOIN_SIZE}
-@item @code{SQL_QUOTE_SHOW_CREATE} @tab @code{SQL_SAFE_UPDATES}
- @tab @code{SQL_SELECT_LIMIT} @tab @code{SQL_SLAVE_SKIP_COUNTER}
-@item @code{SQL_SMALL_RESULT} @tab @code{SQL_WARNINGS}
- @tab @code{SSL} @tab @code{STARTING}
-@item @code{STRAIGHT_JOIN} @tab @code{STRIPED}
- @tab @code{TABLE} @tab @code{TABLES}
-@item @code{TERMINATED} @tab @code{THEN}
- @tab @code{TINYBLOB} @tab @code{TINYINT}
-@item @code{TINYTEXT} @tab @code{TO}
- @tab @code{TRAILING} @tab @code{UNION}
-@item @code{UNIQUE} @tab @code{UNLOCK}
- @tab @code{UNSIGNED} @tab @code{UPDATE}
-@item @code{USAGE} @tab @code{USE}
- @tab @code{USING} @tab @code{VALUES}
-@item @code{VARBINARY} @tab @code{VARCHAR}
- @tab @code{VARYING} @tab @code{WHEN}
-@item @code{WHERE} @tab @code{WITH}
- @tab @code{WRITE} @tab @code{YEAR_MONTH}
+@multitable @columnfractions .33 .33 .34
+@item @strong{Word}
+ @tab @strong{Word}
+ @tab @strong{Word}
+@item @code{ADD}
+ @tab @code{ALL}
+ @tab @code{ALTER}
+@item @code{ANALYZE}
+ @tab @code{AND}
+ @tab @code{AS}
+@item @code{ASC}
+ @tab @code{AUTO_INCREMENT}
+ @tab @code{BDB}
+@item @code{BERKELEYDB}
+ @tab @code{BETWEEN}
+ @tab @code{BIGINT}
+@item @code{BINARY}
+ @tab @code{BLOB}
+ @tab @code{BOTH}
+@item @code{BY}
+ @tab @code{CASCADE}
+ @tab @code{CASE}
+@item @code{CHANGE}
+ @tab @code{CHAR}
+ @tab @code{CHARACTER}
+@item @code{COLUMN}
+ @tab @code{COLUMNS}
+ @tab @code{CONSTRAINT}
+@item @code{CREATE}
+ @tab @code{CROSS}
+ @tab @code{CURRENT_DATE}
+@item @code{CURRENT_TIME}
+ @tab @code{CURRENT_TIMESTAMP}
+ @tab @code{DATABASE}
+@item @code{DATABASES}
+ @tab @code{DAY_HOUR}
+ @tab @code{DAY_MINUTE}
+@item @code{DAY_SECOND}
+ @tab @code{DEC}
+ @tab @code{DECIMAL}
+@item @code{DEFAULT}
+ @tab @code{DELAYED}
+ @tab @code{DELETE}
+@item @code{DESC}
+ @tab @code{DESCRIBE}
+ @tab @code{DISTINCT}
+@item @code{DISTINCTROW}
+ @tab @code{DOUBLE}
+ @tab @code{DROP}
+@item @code{ELSE}
+ @tab @code{ENCLOSED}
+ @tab @code{ESCAPED}
+@item @code{EXISTS}
+ @tab @code{EXPLAIN}
+ @tab @code{FIELDS}
+@item @code{FLOAT}
+ @tab @code{FOR}
+ @tab @code{FOREIGN}
+@item @code{FROM}
+ @tab @code{FULLTEXT}
+ @tab @code{FUNCTION}
+@item @code{GRANT}
+ @tab @code{GROUP}
+ @tab @code{HAVING}
+@item @code{HIGH_PRIORITY}
+ @tab @code{HOUR_MINUTE}
+ @tab @code{HOUR_SECOND}
+@item @code{IF}
+ @tab @code{IGNORE}
+ @tab @code{IN}
+@item @code{INDEX}
+ @tab @code{INFILE}
+ @tab @code{INNER}
+@item @code{INNODB}
+ @tab @code{INSERT}
+ @tab @code{INSERT_ID}
+@item @code{INT}
+ @tab @code{INTEGER}
+ @tab @code{INTERVAL}
+@item @code{INTO}
+ @tab @code{IS}
+ @tab @code{JOIN}
+@item @code{KEY}
+ @tab @code{KEYS}
+ @tab @code{KILL}
+@item @code{LAST_INSERT_ID}
+ @tab @code{LEADING}
+ @tab @code{LEFT}
+@item @code{LIKE}
+ @tab @code{LIMIT}
+ @tab @code{LINES}
+@item @code{LOAD}
+ @tab @code{LOCK}
+ @tab @code{LONG}
+@item @code{LONGBLOB}
+ @tab @code{LONGTEXT}
+ @tab @code{LOW_PRIORITY}
+@item @code{MASTER_SERVER_ID}
+ @tab @code{MATCH}
+ @tab @code{MEDIUMBLOB}
+@item @code{MEDIUMINT}
+ @tab @code{MEDIUMTEXT}
+ @tab @code{MIDDLEINT}
+@item @code{MINUTE_SECOND}
+ @tab @code{MRG_MYISAM}
+ @tab @code{NATURAL}
+@item @code{NOT}
+ @tab @code{NULL}
+ @tab @code{NUMERIC}
+@item @code{ON}
+ @tab @code{OPTIMIZE}
+ @tab @code{OPTION}
+@item @code{OPTIONALLY}
+ @tab @code{OR}
+ @tab @code{ORDER}
+@item @code{OUTER}
+ @tab @code{OUTFILE}
+ @tab @code{PARTIAL}
+@item @code{PRECISION}
+ @tab @code{PRIMARY}
+ @tab @code{PRIVILEGES}
+@item @code{PROCEDURE}
+ @tab @code{PURGE}
+ @tab @code{READ}
+@item @code{REAL}
+ @tab @code{REFERENCES}
+ @tab @code{REGEXP}
+@item @code{RENAME}
+ @tab @code{REPLACE}
+ @tab @code{REQUIRE}
+@item @code{RESTRICT}
+ @tab @code{RETURNS}
+ @tab @code{REVOKE}
+@item @code{RIGHT}
+ @tab @code{RLIKE}
+ @tab @code{SELECT}
+@item @code{SET}
+ @tab @code{SHOW}
+ @tab @code{SMALLINT}
+@item @code{SONAME}
+ @tab @code{SQL_AUTO_IS_NULL}
+ @tab @code{SQL_BIG_RESULT}
+@item @code{SQL_BIG_SELECTS}
+ @tab @code{SQL_BIG_TABLES}
+ @tab @code{SQL_BUFFER_RESULT}
+@item @code{SQL_CALC_FOUND_ROWS}
+ @tab @code{SQL_LOG_BIN}
+ @tab @code{SQL_LOG_OFF}
+@item @code{SQL_LOG_UPDATE}
+ @tab @code{SQL_LOW_PRIORITY_UPDATES}
+ @tab @code{SQL_MAX_JOIN_SIZE}
+@item @code{SQL_QUOTE_SHOW_CREATE}
+ @tab @code{SQL_SAFE_UPDATES}
+ @tab @code{SQL_SELECT_LIMIT}
+@item @code{SQL_SLAVE_SKIP_COUNTER}
+ @tab @code{SQL_SMALL_RESULT}
+ @tab @code{SQL_WARNINGS}
+@item @code{SSL}
+ @tab @code{STARTING}
+ @tab @code{STRAIGHT_JOIN}
+@item @code{STRIPED}
+ @tab @code{TABLE}
+ @tab @code{TABLES}
+@item @code{TERMINATED}
+ @tab @code{THEN}
+ @tab @code{TINYBLOB}
+@item @code{TINYINT}
+ @tab @code{TINYTEXT}
+ @tab @code{TO}
+@item @code{TRAILING}
+ @tab @code{UNION}
+ @tab @code{UNIQUE}
+@item @code{UNLOCK}
+ @tab @code{UNSIGNED}
+ @tab @code{UPDATE}
+@item @code{USAGE}
+ @tab @code{USE}
+ @tab @code{USING}
+@item @code{VALUES}
+ @tab @code{VARBINARY}
+ @tab @code{VARCHAR}
+@item @code{VARYING}
+ @tab @code{WHEN}
+ @tab @code{WHERE}
+@item @code{WITH}
+ @tab @code{WRITE}
+ @tab @code{YEAR_MONTH}
@item @code{ZEROFILL}
+ @tab
+ @tab
@end multitable
@c END_OF_RESERVED_WORDS
@@ -28397,7 +28709,7 @@ that are optional.
Note that if you specify @code{ZEROFILL} for a column, MySQL will
automatically add the @code{UNSIGNED} attribute to the column.
-@strong{Warning:} You should be aware that when you use subtraction
+@strong{Warning}: you should be aware that when you use subtraction
between integer values where one is of type @code{UNSIGNED}, the result
will be unsigned! @xref{Cast Functions}.
@@ -28653,7 +28965,7 @@ This is a synonym for @code{CHAR(1)}.
@tindex VARCHAR
@item [NATIONAL] VARCHAR(M) [BINARY]
-A variable-length string. @strong{Note:} Trailing spaces are removed when
+A variable-length string. @strong{Note}: trailing spaces are removed when
the value is stored (this differs from the ANSI SQL specification). The range
of @code{M} is 0 to 255 characters (1 to 255 prior to MySQL Version 4.0.2).
@code{VARCHAR} values are sorted and compared in case-insensitive fashion
@@ -28919,7 +29231,7 @@ When MySQL encounters a value for a date or time type that is
out of range or otherwise illegal for the type (see the start of this
section), it converts the value to the ``zero'' value for that type.
(The exception is that out-of-range @code{TIME} values are clipped to
-the appropriate endpoint of the @code{TIME} range.) The table below
+the appropriate endpoint of the @code{TIME} range.) The following table
shows the format of the ``zero'' value for each type:
@multitable @columnfractions .15 .55
@@ -28937,8 +29249,8 @@ explicitly using the values shown in the table. You can also do this
using the values @code{'0'} or @code{0}, which are easier to write.
@item
-``Zero'' date or time values used through @strong{MyODBC} are converted
-automatically to @code{NULL} in @strong{MyODBC} Version 2.50.12 and above,
+``Zero'' date or time values used through @code{MyODBC} are converted
+automatically to @code{NULL} in @code{MyODBC} Version 2.50.12 and above,
because ODBC can't handle such values.
@end itemize
@@ -29029,7 +29341,7 @@ You explicitly set the @code{TIMESTAMP} column to @code{NULL}.
@code{TIMESTAMP} columns other than the first may also be set to the current
date and time. Just set the column to @code{NULL} or to @code{NOW()}.
-You can set any @code{TIMESTAMP} column to a value different than the current
+You can set any @code{TIMESTAMP} column to a value different from the current
date and time by setting it explicitly to the desired value. This is true
even for the first @code{TIMESTAMP} column. You can use this property if,
for example, you want a @code{TIMESTAMP} to be set to the current date and
@@ -29055,7 +29367,7 @@ the year 2037, with a resolution of one second. Values are displayed as
numbers.
The format in which MySQL retrieves and displays @code{TIMESTAMP}
-values depends on the display size, as illustrated by the table below. The
+values depends on the display size, as illustrated by the following table. The
`full' @code{TIMESTAMP} format is 14 digits, but @code{TIMESTAMP} columns may
be created with shorter display sizes:
@@ -29150,7 +29462,7 @@ as though padded with leading zeros to the closest length.
@cindex strings, non-delimited
Values specified as non-delimited strings are interpreted using their length
as given. If the string is 8 or 14 characters long, the year is assumed to
-be given by the first 4 characters. Otherwise the year is assumed to be
+be given by the first 4 characters. Otherwise, the year is assumed to be
given by the first 2 characters. The string is interpreted from left to
right to find year, month, day, hour, minute, and second values, for as many
parts as are present in the string. This means you should not use strings
@@ -29230,6 +29542,15 @@ will be converted to @code{'0000-00-00'} because @code{'45'} is not a legal
month.
@item
+The MySQL server only performs basic checking on the validity of a date:
+days @code{00-31}, months @code{00-12}, years @code{1000-9999}.
+Any date not within this range will revert to @code{0000-00-00}.
+Please note that this still allows you to store invalid dates such as
+@code{2002-04-31}. It allows web applications to store data from a form
+without further checking. To ensure a date is valid, perform a check in
+your application.
+
+@item
Year values specified as two digits are ambiguous, because the century is
unknown. MySQL interprets 2-digit year values using the following
rules:
@@ -29345,9 +29666,9 @@ As a two-digit number in the range @code{1} to @code{99}. Values in the
ranges @code{1} to @code{69} and @code{70} to @code{99} are converted to
@code{YEAR} values in the ranges @code{2001} to @code{2069} and @code{1970}
to @code{1999}. Note that the range for two-digit numbers is slightly
-different than the range for two-digit strings, because you cannot specify zero
+different from the range for two-digit strings, because you cannot specify zero
directly as a number and have it be interpreted as @code{2000}. You
-@emph{must} specify it as a string @code{'0'} or @code{'00'} or it will be
+@strong{must} specify it as a string @code{'0'} or @code{'00'} or it will be
interpreted as @code{0000}.
@item
@@ -29404,7 +29725,7 @@ SQL specification.)
If you assign a value to a @code{CHAR} or @code{VARCHAR} column that
exceeds the column's maximum length, the value is truncated to fit.
-The table below illustrates the differences between the two types of columns
+The following table illustrates the differences between the two types of columns
by showing the result of storing various string values into @code{CHAR(4)}
and @code{VARCHAR(4)} columns:
@@ -29484,7 +29805,7 @@ when values are stored, as there is for @code{VARCHAR} columns.
@code{BLOB} and @code{TEXT} columns cannot have @code{DEFAULT} values.
@end itemize
-@strong{MyODBC} defines @code{BLOB} values as @code{LONGVARBINARY} and
+@code{MyODBC} defines @code{BLOB} values as @code{LONGVARBINARY} and
@code{TEXT} values as @code{LONGVARCHAR}.
Because @code{BLOB} and @code{TEXT} values may be extremely long, you
@@ -29498,7 +29819,7 @@ object. The standard way to do this is with the @code{SUBSTRING}
function. For example:
@example
-mysql> SELECT comment FROM tbl_name,substring(comment,20) AS substr
+mysql> SELECT comment FROM tbl_name,SUBSTRING(comment,20) AS substr
-> ORDER BY substr;
@end example
@@ -29509,8 +29830,8 @@ column are used when sorting. The default value of @code{max_sort_length} is
@code{TEXT} values by specifying the column position or by using an alias:
@example
-mysql> SELECT id,substring(blob_col,1,100) FROM tbl_name GROUP BY 2;
-mysql> SELECT id,substring(blob_col,1,100) AS b FROM tbl_name GROUP BY b;
+mysql> SELECT id,SUBSTRING(blob_col,1,100) FROM tbl_name GROUP BY 2;
+mysql> SELECT id,SUBSTRING(blob_col,1,100) AS b FROM tbl_name GROUP BY b;
@end example
@item
@@ -29575,7 +29896,7 @@ The index of the @code{NULL} value is @code{NULL}.
@end itemize
For example, a column specified as @code{ENUM("one", "two", "three")} can
-have any of the values shown below. The index of each value is also shown:
+have any of the values shown here. The index of each value is also shown:
@multitable @columnfractions .10 .10
@item @strong{Value} @tab @strong{Index}
@@ -29588,6 +29909,9 @@ have any of the values shown below. The index of each value is also shown:
An enumeration can have a maximum of 65535 elements.
+Starting from 3.23.51 trailing spaces are automatically deleted from
+@code{ENUM} values when the table is created.
+
Lettercase is irrelevant when you assign values to an @code{ENUM} column.
However, values retrieved from the column later have lettercase matching the
values that were used to specify the allowable values at table creation time.
@@ -29604,6 +29928,8 @@ If you store a number into an @code{ENUM}, the number is treated as an
index, and the value stored is the enumeration member with that index.
(However, this will not work with @code{LOAD DATA}, which treats all
input as strings.)
+It's not advisable to store numbers in an @code{ENUM} string because
+it will make things confusing.
@code{ENUM} values are sorted according to the order in which the enumeration
members were listed in the column specification. (In other words,
@@ -29642,6 +29968,9 @@ any of these values:
A @code{SET} can have a maximum of 64 different members.
+Starting from 3.23.51 trailing spaces are automatically deleted from
+@code{SET} values when the table is created.
+
MySQL stores @code{SET} values numerically, with the low-order bit
of the stored value corresponding to the first set member. If you retrieve a
@code{SET} value in a numeric context, the value retrieved has bits set
@@ -29737,7 +30066,7 @@ and convert results back to floating-point values only when necessary.
@cindex columns, other types
To make it easier to use code written for SQL implementations from other
-vendors, MySQL maps column types as shown in the table below. These
+vendors, MySQL maps column types as shown in the following table. These
mappings make it easier to move table definitions from other database engines
to MySQL:
@@ -29771,7 +30100,7 @@ MySQL types.
@cindex columns, storage requirements
The storage requirements for each of the column types supported by
-MySQL are listed below by category.
+MySQL are listed by category.
@cindex numeric types
@cindex types, numeric
@@ -29878,7 +30207,7 @@ An expression that contains @code{NULL} always produces a @code{NULL} value
unless otherwise indicated in the documentation for the operators and
functions involved in the expression.
-@strong{Note:} There must be no whitespace between a function name and the
+@strong{Note}: there must be no whitespace between a function name and the
parentheses following it. This helps the MySQL parser distinguish
between function calls and references to tables or columns that happen to
have the same name as a function. Spaces around arguments are permitted,
@@ -30006,7 +30335,7 @@ By default, string comparisons are done in case-independent fashion using the
current character set (ISO-8859-1 Latin1 by default, which also works
excellently for English).
-The examples below illustrate conversion of strings to numbers for comparison
+The following examples illustrate conversion of strings to numbers for comparison
operations:
@example
@@ -30026,15 +30355,15 @@ mysql> SELECT 0 = 'x6';
@item =
Equal:
@example
-mysql> select 1 = 0;
+mysql> SELECT 1 = 0;
-> 0
-mysql> select '0' = 0;
+mysql> SELECT '0' = 0;
-> 1
-mysql> select '0.0' = 0;
+mysql> SELECT '0.0' = 0;
-> 1
-mysql> select '0.01' = 0;
+mysql> SELECT '0.01' = 0;
-> 0
-mysql> select '.01' = 0.01;
+mysql> SELECT '.01' = 0.01;
-> 1
@end example
@@ -30046,11 +30375,11 @@ mysql> select '.01' = 0.01;
@itemx !=
Not equal:
@example
-mysql> select '.01' <> '0.01';
+mysql> SELECT '.01' <> '0.01';
-> 1
-mysql> select .01 <> '0.01';
+mysql> SELECT .01 <> '0.01';
-> 0
-mysql> select 'zapp' <> 'zappp';
+mysql> SELECT 'zapp' <> 'zappp';
-> 1
@end example
@@ -30059,7 +30388,7 @@ mysql> select 'zapp' <> 'zappp';
@item <=
Less than or equal:
@example
-mysql> select 0.1 <= 2;
+mysql> SELECT 0.1 <= 2;
-> 1
@end example
@@ -30068,7 +30397,7 @@ mysql> select 0.1 <= 2;
@item <
Less than:
@example
-mysql> select 2 < 2;
+mysql> SELECT 2 < 2;
-> 0
@end example
@@ -30077,7 +30406,7 @@ mysql> select 2 < 2;
@item >=
Greater than or equal:
@example
-mysql> select 2 >= 2;
+mysql> SELECT 2 >= 2;
-> 1
@end example
@@ -30086,7 +30415,7 @@ mysql> select 2 >= 2;
@item >
Greater than:
@example
-mysql> select 2 > 2;
+mysql> SELECT 2 > 2;
-> 0
@end example
@@ -30095,7 +30424,7 @@ mysql> select 2 > 2;
@item <=>
NULL safe equal:
@example
-mysql> select 1 <=> 1, NULL <=> NULL, 1 <=> NULL;
+mysql> SELECT 1 <=> 1, NULL <=> NULL, 1 <=> NULL;
-> 1 1 0
@end example
@@ -30104,11 +30433,11 @@ mysql> select 1 <=> 1, NULL <=> NULL, 1 <=> NULL;
@findex IS NOT NULL
@item IS NULL
@itemx IS NOT NULL
-Test whether or not a value is or is not @code{NULL}:
+Test whether a value is or is not @code{NULL}:
@example
-mysql> select 1 IS NULL, 0 IS NULL, NULL IS NULL;
+mysql> SELECT 1 IS NULL, 0 IS NULL, NULL IS NULL;
-> 0 0 1
-mysql> select 1 IS NOT NULL, 0 IS NOT NULL, NULL IS NOT NULL;
+mysql> SELECT 1 IS NOT NULL, 0 IS NOT NULL, NULL IS NOT NULL;
-> 1 1 0
@end example
@@ -30165,13 +30494,13 @@ Otherwise, a floating-point (real) comparison is done.
@end itemize
@example
-mysql> select 1 BETWEEN 2 AND 3;
+mysql> SELECT 1 BETWEEN 2 AND 3;
-> 0
-mysql> select 'b' BETWEEN 'a' AND 'c';
+mysql> SELECT 'b' BETWEEN 'a' AND 'c';
-> 1
-mysql> select 2 BETWEEN 2 AND '3';
+mysql> SELECT 2 BETWEEN 2 AND '3';
-> 1
-mysql> select 2 BETWEEN 2 AND 'x-3';
+mysql> SELECT 2 BETWEEN 2 AND 'x-3';
-> 0
@end example
@@ -30190,9 +30519,9 @@ is a case-sensitive string expression, the string comparison is performed in
case-sensitive fashion:
@example
-mysql> select 2 IN (0,3,5,'wefwf');
+mysql> SELECT 2 IN (0,3,5,'wefwf');
-> 0
-mysql> select 'wefwf' IN (0,3,5,'wefwf');
+mysql> SELECT 'wefwf' IN (0,3,5,'wefwf');
-> 1
@end example
@@ -30205,9 +30534,9 @@ Same as @code{NOT (expr IN (value,...))}.
If @code{expr} is @code{NULL}, @code{ISNULL()} returns @code{1}, otherwise
it returns @code{0}:
@example
-mysql> select ISNULL(1+1);
+mysql> SELECT ISNULL(1+1);
-> 0
-mysql> select ISNULL(1/0);
+mysql> SELECT ISNULL(1/0);
-> 1
@end example
@@ -30220,9 +30549,9 @@ false!
Returns first non-@code{NULL} element in list:
@example
-mysql> select COALESCE(NULL,1);
+mysql> SELECT COALESCE(NULL,1);
-> 1
-mysql> select COALESCE(NULL,NULL,NULL);
+mysql> SELECT COALESCE(NULL,NULL,NULL);
-> NULL
@end example
@@ -30234,21 +30563,21 @@ and so on. All arguments are treated as integers. It is required that
to work correctly. This is because a binary search is used (very fast):
@example
-mysql> select INTERVAL(23, 1, 15, 17, 30, 44, 200);
+mysql> SELECT INTERVAL(23, 1, 15, 17, 30, 44, 200);
-> 3
-mysql> select INTERVAL(10, 1, 10, 100, 1000);
+mysql> SELECT INTERVAL(10, 1, 10, 100, 1000);
-> 2
-mysql> select INTERVAL(22, 23, 30, 44, 200);
+mysql> SELECT INTERVAL(22, 23, 30, 44, 200);
-> 0
@end example
@end table
-If you are comparing case sensitive string with any of the standard
+If you are comparing case-sensitive string with any of the standard
operators (@code{=}, @code{<>}..., but not @code{LIKE}) end space will
be ignored.
@example
-mysql> select "a" ="A ";
+mysql> SELECT "a" ="A ";
-> 1
@end example
@@ -30256,10 +30585,10 @@ mysql> select "a" ="A ";
@node Logical Operators, Control flow functions, Comparison Operators, Non-typed Operators
@subsubsection Logical Operators
-@findex Logical functions
-@findex Functions, logical
+@findex Logical operators
+@findex Operators, logical
-All logical functions return @code{1} (TRUE), @code{0} (FALSE) or
+All logical operators evaluate to @code{1} (TRUE), @code{0} (FALSE) or
@code{NULL} (unknown, which is in most cases the same as FALSE):
@table @code
@@ -30267,34 +30596,34 @@ All logical functions return @code{1} (TRUE), @code{0} (FALSE) or
@findex ! (logical NOT)
@item NOT
@itemx !
-Logical NOT. Returns @code{1} if the argument is @code{0}, otherwise returns
-@code{0}.
-Exception: @code{NOT NULL} returns @code{NULL}:
+Logical NOT. Evaluates to @code{1} if the operand is @code{0}, otherwise
+evaluates to @code{0}.
+Exception: @code{NOT NULL} evaluates to @code{NULL}:
@example
-mysql> select NOT 1;
+mysql> SELECT NOT 1;
-> 0
-mysql> select NOT NULL;
+mysql> SELECT NOT NULL;
-> NULL
-mysql> select ! (1+1);
+mysql> SELECT ! (1+1);
-> 0
-mysql> select ! 1+1;
+mysql> SELECT ! 1+1;
-> 1
@end example
-The last example returns @code{1} because the expression evaluates
+The last example produces @code{1} because the expression evaluates
the same way as @code{(!1)+1}.
@findex OR, logical
@findex || (logical OR)
@item OR
@itemx ||
-Logical OR. Returns @code{1} if either argument is not @code{0} and not
+Logical OR. Evaluates to @code{1} if either operand is not @code{0} and not
@code{NULL}:
@example
-mysql> select 1 || 0;
+mysql> SELECT 1 || 0;
-> 1
-mysql> select 0 || 0;
+mysql> SELECT 0 || 0;
-> 0
-mysql> select 1 || NULL;
+mysql> SELECT 1 || NULL;
-> 1
@end example
@@ -30303,13 +30632,16 @@ mysql> select 1 || NULL;
@findex && (logical AND)
@item AND
@itemx &&
-Logical AND. Returns @code{0} if either argument is @code{0} or @code{NULL},
-otherwise returns @code{1}:
+Logical AND. For non-@code{NULL} operands, evaluates to @code{1} if both
+operands are non-zero and to @code{0} otherwise.
+Produces @code{NULL} if either operand is @code{NULL}:
@example
-mysql> select 1 && NULL;
- -> 0
-mysql> select 1 && 0;
+mysql> SELECT 1 && 1;
+ -> 1
+mysql> SELECT 1 && 0;
-> 0
+mysql> SELECT 1 && NULL;
+ -> NULL
@end example
@end table
@@ -30328,13 +30660,13 @@ If @code{expr1} is not @code{NULL}, @code{IFNULL()} returns @code{expr1},
else it returns @code{expr2}. @code{IFNULL()} returns a numeric or string
value, depending on the context in which it is used:
@example
-mysql> select IFNULL(1,0);
+mysql> SELECT IFNULL(1,0);
-> 1
-mysql> select IFNULL(NULL,10);
+mysql> SELECT IFNULL(NULL,10);
-> 10
-mysql> select IFNULL(1/0,10);
+mysql> SELECT IFNULL(1/0,10);
-> 10
-mysql> select IFNULL(1/0,'yes');
+mysql> SELECT IFNULL(1/0,'yes');
-> 'yes'
@end example
@@ -30343,9 +30675,9 @@ mysql> select IFNULL(1/0,'yes');
If @code{expr1 = expr2} is true, return @code{NULL} else return @code{expr1}.
This is the same as @code{CASE WHEN x = y THEN NULL ELSE x END}:
@example
-mysql> select NULLIF(1,1);
+mysql> SELECT NULLIF(1,1);
-> NULL
-mysql> select NULLIF(1,2);
+mysql> SELECT NULLIF(1,2);
-> 1
@end example
@@ -30360,11 +30692,11 @@ If @code{expr1} is TRUE (@code{expr1 <> 0} and @code{expr1 <> NULL}) then
in which it is used:
@example
-mysql> select IF(1>2,2,3);
+mysql> SELECT IF(1>2,2,3);
-> 3
-mysql> select IF(1<2,'yes','no');
+mysql> SELECT IF(1<2,'yes','no');
-> 'yes'
-mysql> select IF(strcmp('test','test1'),'no','yes');
+mysql> SELECT IF(STRCMP('test','test1'),'no','yes');
-> 'no'
@end example
@@ -30373,9 +30705,9 @@ testing floating-point or string values, you should do so using a comparison
operation:
@example
-mysql> select IF(0.1,1,0);
+mysql> SELECT IF(0.1,1,0);
-> 0
-mysql> select IF(0.1<>0,1,0);
+mysql> SELECT IF(0.1<>0,1,0);
-> 1
@end example
@@ -30389,13 +30721,16 @@ The default return type of @code{IF()} (which may matter when it is
stored into a temporary table) is calculated in MySQL Version
3.23 as follows:
-@multitable @columnfractions .45 .15
+@multitable @columnfractions .50 .20
@item @strong{Expression} @tab @strong{Return value}
@item expr2 or expr3 returns string @tab string
@item expr2 or expr3 returns a floating-point value @tab floating-point
@item expr2 or expr3 returns an integer @tab integer
@end multitable
+If expr2 and expr3 are strings, then the result is case-sensitive if
+both strings are case-sensitive. (Starting from 3.23.51)
+
@findex CASE
@item CASE value WHEN [compare-value] THEN result [WHEN [compare-value] THEN result ...] [ELSE result] END
@item CASE WHEN [condition] THEN result [WHEN [condition] THEN result ...] [ELSE result] END
@@ -30443,11 +30778,11 @@ Returns the ASCII code value of the leftmost character of the string
@code{NULL} if @code{str} is @code{NULL}:
@example
-mysql> select ASCII('2');
+mysql> SELECT ASCII('2');
-> 50
-mysql> select ASCII(2);
+mysql> SELECT ASCII(2);
-> 50
-mysql> select ASCII('dx');
+mysql> SELECT ASCII('dx');
-> 100
@end example
@@ -30463,7 +30798,7 @@ If the leftmost character is not a multi-byte character, returns the same
value that the @code{ASCII()} function does:
@example
-mysql> select ORD('2');
+mysql> SELECT ORD('2');
-> 50
@end example
@@ -30479,13 +30814,13 @@ signed number. Otherwise, @code{N} is treated as unsigned. @code{CONV} works
with 64-bit precision:
@example
-mysql> select CONV("a",16,2);
+mysql> SELECT CONV("a",16,2);
-> '1010'
-mysql> select CONV("6E",18,8);
+mysql> SELECT CONV("6E",18,8);
-> '172'
-mysql> select CONV(-17,10,-18);
+mysql> SELECT CONV(-17,10,-18);
-> '-H'
-mysql> select CONV(10+"10"+'10'+0xa,10,10);
+mysql> SELECT CONV(10+"10"+'10'+0xa,10,10);
-> '40'
@end example
@@ -30496,7 +30831,7 @@ Returns a string representation of the binary value of @code{N}, where
@code{CONV(N,10,2)}. Returns @code{NULL} if @code{N} is @code{NULL}:
@example
-mysql> select BIN(12);
+mysql> SELECT BIN(12);
-> '1100'
@end example
@@ -30507,7 +30842,7 @@ Returns a string representation of the octal value of @code{N}, where
Returns @code{NULL} if @code{N} is @code{NULL}:
@example
-mysql> select OCT(12);
+mysql> SELECT OCT(12);
-> '14'
@end example
@@ -30523,11 +30858,11 @@ character in N_OR_S is converted to 2 hexadecimal digits. This is the
invers of the @code{0xff} strings.
@example
-mysql> select HEX(255);
+mysql> SELECT HEX(255);
-> 'FF'
-mysql> select HEX("abc");
+mysql> SELECT HEX("abc");
-> 616263
-mysql> select 0x616263;
+mysql> SELECT 0x616263;
-> "abc"
@end example
@@ -30538,9 +30873,9 @@ consisting of the characters given by the ASCII code values of those
integers. @code{NULL} values are skipped:
@example
-mysql> select CHAR(77,121,83,81,'76');
+mysql> SELECT CHAR(77,121,83,81,'76');
-> 'MySQL'
-mysql> select CHAR(77,77.3,'77.3');
+mysql> SELECT CHAR(77,77.3,'77.3');
-> 'MMM'
@end example
@@ -30551,11 +30886,11 @@ Returns the string that results from concatenating the arguments. Returns
A numeric argument is converted to the equivalent string form:
@example
-mysql> select CONCAT('My', 'S', 'QL');
+mysql> SELECT CONCAT('My', 'S', 'QL');
-> 'MySQL'
-mysql> select CONCAT('My', NULL, 'QL');
+mysql> SELECT CONCAT('My', NULL, 'QL');
-> NULL
-mysql> select CONCAT(14.3);
+mysql> SELECT CONCAT(14.3);
-> '14.3'
@end example
@@ -30571,9 +30906,9 @@ separator argument. The separator will be added between the strings to be
concatenated:
@example
-mysql> select CONCAT_WS(",","First name","Second name","Last Name");
+mysql> SELECT CONCAT_WS(",","First name","Second name","Last Name");
-> 'First name,Second name,Last Name'
-mysql> select CONCAT_WS(",","First name",NULL,"Last Name");
+mysql> SELECT CONCAT_WS(",","First name",NULL,"Last Name");
-> 'First name,Last Name'
@end example
@@ -30588,9 +30923,9 @@ mysql> select CONCAT_WS(",","First name",NULL,"Last Name");
Returns the length of the string @code{str}:
@example
-mysql> select LENGTH('text');
+mysql> SELECT LENGTH('text');
-> 4
-mysql> select OCTET_LENGTH('text');
+mysql> SELECT OCTET_LENGTH('text');
-> 4
@end example
@@ -30602,7 +30937,7 @@ characters are only counted once.
Returns the length of the string @code{str} in bits:
@example
-mysql> select BIT_LENGTH('text');
+mysql> SELECT BIT_LENGTH('text');
-> 32
@end example
@@ -30614,14 +30949,14 @@ Returns the position of the first occurrence of substring @code{substr}
in string @code{str}. Returns @code{0} if @code{substr} is not in @code{str}:
@example
-mysql> select LOCATE('bar', 'foobarbar');
+mysql> SELECT LOCATE('bar', 'foobarbar');
-> 4
-mysql> select LOCATE('xbar', 'foobar');
+mysql> SELECT LOCATE('xbar', 'foobar');
-> 0
@end example
This function is multi-byte safe. In MySQL 3.23 this function is case
-insensitive, while in 4.0 it's only case insensitive if either argument is
+insensitive, while in 4.0 it's only case-insensitive if either argument is
a binary string.
@findex LOCATE()
@@ -30631,12 +30966,12 @@ string @code{str}, starting at position @code{pos}.
Returns @code{0} if @code{substr} is not in @code{str}:
@example
-mysql> select LOCATE('bar', 'foobarbar',5);
+mysql> SELECT LOCATE('bar', 'foobarbar',5);
-> 7
@end example
This function is multi-byte safe. In MySQL 3.23 this function is case
-insensitive, while in 4.0 it's only case insensitive if either argument is
+insensitive, while in 4.0 it's only case-insensitive if either argument is
a binary string.
@findex INSTR()
@@ -30646,14 +30981,14 @@ string @code{str}. This is the same as the two-argument form of
@code{LOCATE()}, except that the arguments are swapped:
@example
-mysql> select INSTR('foobarbar', 'bar');
+mysql> SELECT INSTR('foobarbar', 'bar');
-> 4
-mysql> select INSTR('xbar', 'foobar');
+mysql> SELECT INSTR('xbar', 'foobar');
-> 0
@end example
This function is multi-byte safe. In MySQL 3.23 this function is case
-insensitive, while in 4.0 it's only case insensitive if either argument is
+insensitive, while in 4.0 it's only case-insensitive if either argument is
a binary string.
@findex LPAD()
@@ -30663,7 +30998,7 @@ until @code{str} is @code{len} characters long. If @code{str} is longer
than @code{len'} then it will be shortened to @code{len} characters.
@example
-mysql> select LPAD('hi',4,'??');
+mysql> SELECT LPAD('hi',4,'??');
-> '??hi'
@end example
@@ -30675,7 +31010,7 @@ Returns the string @code{str}, right-padded with the string
@code{len} characters.
@example
-mysql> select RPAD('hi',5,'?');
+mysql> SELECT RPAD('hi',5,'?');
-> 'hi???'
@end example
@@ -30684,7 +31019,7 @@ mysql> select RPAD('hi',5,'?');
Returns the leftmost @code{len} characters from the string @code{str}:
@example
-mysql> select LEFT('foobarbar', 5);
+mysql> SELECT LEFT('foobarbar', 5);
-> 'fooba'
@end example
@@ -30695,7 +31030,7 @@ This function is multi-byte safe.
Returns the rightmost @code{len} characters from the string @code{str}:
@example
-mysql> select RIGHT('foobarbar', 4);
+mysql> SELECT RIGHT('foobarbar', 4);
-> 'rbar'
@end example
@@ -30711,7 +31046,7 @@ starting at position @code{pos}.
The variant form that uses @code{FROM} is ANSI SQL92 syntax:
@example
-mysql> select SUBSTRING('Quadratically',5,6);
+mysql> SELECT SUBSTRING('Quadratically',5,6);
-> 'ratica'
@end example
@@ -30723,9 +31058,9 @@ This function is multi-byte safe.
Returns a substring from string @code{str} starting at position @code{pos}:
@example
-mysql> select SUBSTRING('Quadratically',5);
+mysql> SELECT SUBSTRING('Quadratically',5);
-> 'ratically'
-mysql> select SUBSTRING('foobarbar' FROM 4);
+mysql> SELECT SUBSTRING('foobarbar' FROM 4);
-> 'barbar'
@end example
@@ -30741,9 +31076,9 @@ If @code{count} is negative, everything to the right of the final delimiter
(counting from the right) is returned:
@example
-mysql> select SUBSTRING_INDEX('www.mysql.com', '.', 2);
+mysql> SELECT SUBSTRING_INDEX('www.mysql.com', '.', 2);
-> 'www.mysql'
-mysql> select SUBSTRING_INDEX('www.mysql.com', '.', -2);
+mysql> SELECT SUBSTRING_INDEX('www.mysql.com', '.', -2);
-> 'mysql.com'
@end example
@@ -30754,7 +31089,7 @@ This function is multi-byte safe.
Returns the string @code{str} with leading space characters removed:
@example
-mysql> select LTRIM(' barbar');
+mysql> SELECT LTRIM(' barbar');
-> 'barbar'
@end example
@@ -30763,7 +31098,7 @@ mysql> select LTRIM(' barbar');
Returns the string @code{str} with trailing space characters removed:
@example
-mysql> select RTRIM('barbar ');
+mysql> SELECT RTRIM('barbar ');
-> 'barbar'
@end example
@@ -30777,13 +31112,13 @@ removed. If none of the specifiers @code{BOTH}, @code{LEADING} or
specified, spaces are removed:
@example
-mysql> select TRIM(' bar ');
+mysql> SELECT TRIM(' bar ');
-> 'bar'
-mysql> select TRIM(LEADING 'x' FROM 'xxxbarxxx');
+mysql> SELECT TRIM(LEADING 'x' FROM 'xxxbarxxx');
-> 'barxxx'
-mysql> select TRIM(BOTH 'x' FROM 'xxxbarxxx');
+mysql> SELECT TRIM(BOTH 'x' FROM 'xxxbarxxx');
-> 'bar'
-mysql> select TRIM(TRAILING 'xyz' FROM 'barxxyz');
+mysql> SELECT TRIM(TRAILING 'xyz' FROM 'barxxyz');
-> 'barx'
@end example
@@ -30800,9 +31135,9 @@ in the given string. All international alpha characters outside the A-Z range
are treated as vowels:
@example
-mysql> select SOUNDEX('Hello');
+mysql> SELECT SOUNDEX('Hello');
-> 'H400'
-mysql> select SOUNDEX('Quadratically');
+mysql> SELECT SOUNDEX('Quadratically');
-> 'Q36324'
@end example
@@ -30811,7 +31146,7 @@ mysql> select SOUNDEX('Quadratically');
Returns a string consisting of @code{N} space characters:
@example
-mysql> select SPACE(6);
+mysql> SELECT SPACE(6);
-> ' '
@end example
@@ -30821,7 +31156,7 @@ Returns the string @code{str} with all all occurrences of the string
@code{from_str} replaced by the string @code{to_str}:
@example
-mysql> select REPLACE('www.mysql.com', 'w', 'Ww');
+mysql> SELECT REPLACE('www.mysql.com', 'w', 'Ww');
-> 'WwWwWw.mysql.com'
@end example
@@ -30834,7 +31169,7 @@ times. If @code{count <= 0}, returns an empty string. Returns @code{NULL} if
@code{str} or @code{count} are @code{NULL}:
@example
-mysql> select REPEAT('MySQL', 3);
+mysql> SELECT REPEAT('MySQL', 3);
-> 'MySQLMySQLMySQL'
@end example
@@ -30843,7 +31178,7 @@ mysql> select REPEAT('MySQL', 3);
Returns the string @code{str} with the order of the characters reversed:
@example
-mysql> select REVERSE('abc');
+mysql> SELECT REVERSE('abc');
-> 'cba'
@end example
@@ -30856,7 +31191,7 @@ Returns the string @code{str}, with the substring beginning at position
@code{newstr}:
@example
-mysql> select INSERT('Quadratic', 3, 4, 'What');
+mysql> SELECT INSERT('Quadratic', 3, 4, 'What');
-> 'QuWhattic'
@end example
@@ -30870,9 +31205,9 @@ or greater than the number of arguments. @code{ELT()} is the complement of
@code{FIELD()}:
@example
-mysql> select ELT(1, 'ej', 'Heja', 'hej', 'foo');
+mysql> SELECT ELT(1, 'ej', 'Heja', 'hej', 'foo');
-> 'ej'
-mysql> select ELT(4, 'ej', 'Heja', 'hej', 'foo');
+mysql> SELECT ELT(4, 'ej', 'Heja', 'hej', 'foo');
-> 'foo'
@end example
@@ -30884,9 +31219,9 @@ Returns @code{0} if @code{str} is not found.
@code{FIELD()} is the complement of @code{ELT()}:
@example
-mysql> select FIELD('ej', 'Hej', 'ej', 'Heja', 'hej', 'foo');
+mysql> SELECT FIELD('ej', 'Hej', 'ej', 'Heja', 'hej', 'foo');
-> 2
-mysql> select FIELD('fo', 'Hej', 'ej', 'Heja', 'hej', 'foo');
+mysql> SELECT FIELD('fo', 'Hej', 'ej', 'Heja', 'hej', 'foo');
-> 0
@end example
@@ -30932,7 +31267,7 @@ with 'separator' (default ',') and only 'number_of_bits' (default 64) of
'bits' is used:
@example
-mysql> select EXPORT_SET(5,'Y','N',',',4)
+mysql> SELECT EXPORT_SET(5,'Y','N',',',4)
-> Y,N,Y,N
@end example
@@ -30945,7 +31280,7 @@ according to the current character set mapping (the default is ISO-8859-1
Latin1):
@example
-mysql> select LCASE('QUADRATICALLY');
+mysql> SELECT LCASE('QUADRATICALLY');
-> 'quadratically'
@end example
@@ -30960,7 +31295,7 @@ according to the current character set mapping (the default is ISO-8859-1
Latin1):
@example
-mysql> select UCASE('Hej');
+mysql> SELECT UCASE('Hej');
-> 'HEJ'
@end example
@@ -30978,7 +31313,7 @@ If the file doesn't exist or can't be read due to one of the above reasons,
the function returns @code{NULL}:
@example
-mysql> UPDATE table_name
+mysql> UPDATE tbl_name
SET blob_column=LOAD_FILE("/tmp/picture")
WHERE id=1;
@end example
@@ -31022,7 +31357,7 @@ a binary string. This only affects comparisons.
@cindex case sensitivity, in string comparisons
@cindex string comparisons, case sensitivity
-Normally, if any expression in a string comparison is case sensitive, the
+Normally, if any expression in a string comparison is case-sensitive, the
comparison is performed in case-sensitive fashion.
@table @code
@@ -31030,7 +31365,7 @@ comparison is performed in case-sensitive fashion.
@item expr LIKE pat [ESCAPE 'escape-char']
Pattern matching using
SQL simple regular expression comparison. Returns @code{1} (TRUE) or @code{0}
-(FALSE). With @code{LIKE} you can use the following two wild-card characters
+(FALSE). With @code{LIKE} you can use the following two wildcard characters
in the pattern:
@multitable @columnfractions .10 .60
@@ -31040,13 +31375,24 @@ in the pattern:
@end multitable
@example
-mysql> select 'David!' LIKE 'David_';
+mysql> SELECT 'David!' LIKE 'David_';
-> 1
-mysql> select 'David!' LIKE '%D%v%';
+mysql> SELECT 'David!' LIKE '%D%v%';
-> 1
+mysql> select TRUNCATE(-1,999,1);
+ -> -1.9
@end example
-To test for literal instances of a wild-card character, precede the character
+Starting from MySQL 3.23.51 all numbers are rounded towards zero.
+
+If @code{D} is negative, then the whole part of the number is zeroed out:
+
+@example
+mysql> select truncate(122,-2);
+ -> 100
+@end example
+
+To test for literal instances of a wildcard character, precede the character
with the escape character. If you don't specify the @code{ESCAPE} character,
@samp{\} is assumed:
@@ -31057,24 +31403,24 @@ with the escape character. If you don't specify the @code{ESCAPE} character,
@end multitable
@example
-mysql> select 'David!' LIKE 'David\_';
+mysql> SELECT 'David!' LIKE 'David\_';
-> 0
-mysql> select 'David_' LIKE 'David\_';
+mysql> SELECT 'David_' LIKE 'David\_';
-> 1
@end example
To specify a different escape character, use the @code{ESCAPE} clause:
@example
-mysql> select 'David_' LIKE 'David|_' ESCAPE '|';
+mysql> SELECT 'David_' LIKE 'David|_' ESCAPE '|';
-> 1
@end example
The following two statements illustrate that string comparisons are
-case insensitive unless one of the operands is a binary string:
+case-insensitive unless one of the operands is a binary string:
@example
-mysql> select 'abc' LIKE 'ABC';
+mysql> SELECT 'abc' LIKE 'ABC';
-> 1
mysql> SELECT 'abc' LIKE BINARY 'ABC';
-> 0
@@ -31084,7 +31430,7 @@ mysql> SELECT 'abc' LIKE BINARY 'ABC';
extension to the ANSI SQL @code{LIKE}.)
@example
-mysql> select 10 LIKE '1%';
+mysql> SELECT 10 LIKE '1%';
-> 1
@end example
@@ -31112,18 +31458,18 @@ returns @code{0}. @code{RLIKE} is a synonym for @code{REGEXP}, provided for
@code{mSQL} compatibility. Note: Because MySQL uses the C escape
syntax in strings (for example, @samp{\n}), you must double any @samp{\} that
you use in your @code{REGEXP} strings. As of MySQL Version 3.23.4,
-@code{REGEXP} is case insensitive for normal (not binary) strings:
+@code{REGEXP} is case-insensitive for normal (not binary) strings:
@example
-mysql> select 'Monty!' REGEXP 'm%y%%';
+mysql> SELECT 'Monty!' REGEXP 'm%y%%';
-> 0
-mysql> select 'Monty!' REGEXP '.*';
+mysql> SELECT 'Monty!' REGEXP '.*';
-> 1
-mysql> select 'new*\n*line' REGEXP 'new\\*.\\*line';
+mysql> SELECT 'new*\n*line' REGEXP 'new\\*.\\*line';
-> 1
-mysql> select "a" REGEXP "A", "a" REGEXP BINARY "A";
+mysql> SELECT "a" REGEXP "A", "a" REGEXP BINARY "A";
-> 1 0
-mysql> select "a" REGEXP "^[a-d]";
+mysql> SELECT "a" REGEXP "^[a-d]";
-> 1
@end example
@@ -31144,11 +31490,11 @@ argument is smaller than the second according to the current sort order,
and @code{1} otherwise:
@example
-mysql> select STRCMP('text', 'text2');
+mysql> SELECT STRCMP('text', 'text2');
-> -1
-mysql> select STRCMP('text2', 'text');
+mysql> SELECT STRCMP('text2', 'text');
-> 1
-mysql> select STRCMP('text', 'text');
+mysql> SELECT STRCMP('text', 'text');
-> 0
@end example
@@ -31176,12 +31522,12 @@ positive floating-point number. Zero relevance means no similarity.
@findex BINARY
@item @code{BINARY}
The @code{BINARY} operator casts the string following it to a binary string.
-This is an easy way to force a column comparison to be case sensitive even
+This is an easy way to force a column comparison to be case-sensitive even
if the column isn't defined as @code{BINARY} or @code{BLOB}:
@example
-mysql> select "a" = "A";
+mysql> SELECT "a" = "A";
-> 1
-mysql> select BINARY "a" = "A";
+mysql> SELECT BINARY "a" = "A";
-> 0
@end example
@@ -31232,7 +31578,7 @@ is also an integer, the result will be an unsigned integer.
@item +
Addition:
@example
-mysql> select 3+5;
+mysql> SELECT 3+5;
-> 8
@end example
@@ -31241,7 +31587,7 @@ mysql> select 3+5;
@item -
Subtraction:
@example
-mysql> select 3-5;
+mysql> SELECT 3-5;
-> -2
@end example
@@ -31250,11 +31596,11 @@ mysql> select 3-5;
@item *
Multiplication:
@example
-mysql> select 3*5;
+mysql> SELECT 3*5;
-> 15
-mysql> select 18014398509481984*18014398509481984.0;
+mysql> SELECT 18014398509481984*18014398509481984.0;
-> 324518553658426726783156020576256.0
-mysql> select 18014398509481984*18014398509481984;
+mysql> SELECT 18014398509481984*18014398509481984;
-> 0
@end example
@@ -31267,14 +31613,14 @@ calculations.
@item /
Division:
@example
-mysql> select 3/5;
+mysql> SELECT 3/5;
-> 0.60
@end example
Division by zero produces a @code{NULL} result:
@example
-mysql> select 102/(1-1);
+mysql> SELECT 102/(1-1);
-> NULL
@end example
@@ -31297,7 +31643,7 @@ All mathematical functions return @code{NULL} in case of an error.
@item -
Unary minus. Changes the sign of the argument:
@example
-mysql> select - 2;
+mysql> SELECT - 2;
-> -2
@end example
@@ -31309,9 +31655,9 @@ may have the value of @code{-2^63}!
@item ABS(X)
Returns the absolute value of @code{X}:
@example
-mysql> select ABS(2);
+mysql> SELECT ABS(2);
-> 2
-mysql> select ABS(-32);
+mysql> SELECT ABS(-32);
-> 32
@end example
@@ -31322,11 +31668,11 @@ This function is safe to use with @code{BIGINT} values.
Returns the sign of the argument as @code{-1}, @code{0}, or @code{1}, depending
on whether @code{X} is negative, zero, or positive:
@example
-mysql> select SIGN(-32);
+mysql> SELECT SIGN(-32);
-> -1
-mysql> select SIGN(0);
+mysql> SELECT SIGN(0);
-> 0
-mysql> select SIGN(234);
+mysql> SELECT SIGN(234);
-> 1
@end example
@@ -31338,11 +31684,11 @@ mysql> select SIGN(234);
Modulo (like the @code{%} operator in C).
Returns the remainder of @code{N} divided by @code{M}:
@example
-mysql> select MOD(234, 10);
+mysql> SELECT MOD(234, 10);
-> 4
-mysql> select 253 % 7;
+mysql> SELECT 253 % 7;
-> 1
-mysql> select MOD(29,9);
+mysql> SELECT MOD(29,9);
-> 2
@end example
@@ -31352,9 +31698,9 @@ This function is safe to use with @code{BIGINT} values.
@item FLOOR(X)
Returns the largest integer value not greater than @code{X}:
@example
-mysql> select FLOOR(1.23);
+mysql> SELECT FLOOR(1.23);
-> 1
-mysql> select FLOOR(-1.23);
+mysql> SELECT FLOOR(-1.23);
-> -2
@end example
@@ -31364,9 +31710,9 @@ Note that the return value is converted to a @code{BIGINT}!
@item CEILING(X)
Returns the smallest integer value not less than @code{X}:
@example
-mysql> select CEILING(1.23);
+mysql> SELECT CEILING(1.23);
-> 2
-mysql> select CEILING(-1.23);
+mysql> SELECT CEILING(-1.23);
-> -1
@end example
@@ -31376,18 +31722,18 @@ Note that the return value is converted to a @code{BIGINT}!
@item ROUND(X)
Returns the argument @code{X}, rounded to the nearest integer:
@example
-mysql> select ROUND(-1.23);
+mysql> SELECT ROUND(-1.23);
-> -1
-mysql> select ROUND(-1.58);
+mysql> SELECT ROUND(-1.58);
-> -2
-mysql> select ROUND(1.58);
+mysql> SELECT ROUND(1.58);
-> 2
@end example
Note that the behavior of @code{ROUND()} when the argument
is half way between two integers depends on the C library
implementation. Some round to the nearest even number,
-always up, always down, or always towards zero. If you need
+always up, always down, or always toward zero. If you need
one kind of rounding, you should use a well-defined function
like @code{TRUNCATE()} or @code{FLOOR()} instead.
@@ -31398,9 +31744,9 @@ If @code{D} is @code{0}, the result will have no decimal point or fractional
part:
@example
-mysql> select ROUND(1.298, 1);
+mysql> SELECT ROUND(1.298, 1);
-> 1.3
-mysql> select ROUND(1.298, 0);
+mysql> SELECT ROUND(1.298, 0);
-> 1
@end example
@@ -31409,18 +31755,18 @@ mysql> select ROUND(1.298, 0);
Returns the value of @code{e} (the base of natural logarithms) raised to
the power of @code{X}:
@example
-mysql> select EXP(2);
+mysql> SELECT EXP(2);
-> 7.389056
-mysql> select EXP(-2);
+mysql> SELECT EXP(-2);
-> 0.135335
@end example
@findex LOG()
@item LOG(X)
Returns the natural logarithm of @code{X}:
@example
-mysql> select LOG(2);
+mysql> SELECT LOG(2);
-> 0.693147
-mysql> select LOG(-2);
+mysql> SELECT LOG(-2);
-> NULL
@end example
If you want the log of a number @code{X} to some arbitary base @code{B}, use
@@ -31430,11 +31776,11 @@ the formula @code{LOG(X)/LOG(B)}.
@item LOG10(X)
Returns the base-10 logarithm of @code{X}:
@example
-mysql> select LOG10(2);
+mysql> SELECT LOG10(2);
-> 0.301030
-mysql> select LOG10(100);
+mysql> SELECT LOG10(100);
-> 2.000000
-mysql> select LOG10(-100);
+mysql> SELECT LOG10(-100);
-> NULL
@end example
@@ -31444,9 +31790,9 @@ mysql> select LOG10(-100);
@itemx POWER(X,Y)
Returns the value of @code{X} raised to the power of @code{Y}:
@example
-mysql> select POW(2,2);
+mysql> SELECT POW(2,2);
-> 4.000000
-mysql> select POW(2,-2);
+mysql> SELECT POW(2,-2);
-> 0.250000
@end example
@@ -31454,9 +31800,9 @@ mysql> select POW(2,-2);
@item SQRT(X)
Returns the non-negative square root of @code{X}:
@example
-mysql> select SQRT(4);
+mysql> SELECT SQRT(4);
-> 2.000000
-mysql> select SQRT(20);
+mysql> SELECT SQRT(20);
-> 4.472136
@end example
@@ -31465,7 +31811,7 @@ mysql> select SQRT(20);
Returns the value of PI. The default shown number of decimals is 5, but
MySQL internally uses the full double precession for PI.
@example
-mysql> select PI();
+mysql> SELECT PI();
-> 3.141593
mysql> SELECT PI()+0.000000000000000000;
-> 3.141592653589793116
@@ -31475,7 +31821,7 @@ mysql> SELECT PI()+0.000000000000000000;
@item COS(X)
Returns the cosine of @code{X}, where @code{X} is given in radians:
@example
-mysql> select COS(PI());
+mysql> SELECT COS(PI());
-> -1.000000
@end example
@@ -31483,7 +31829,7 @@ mysql> select COS(PI());
@item SIN(X)
Returns the sine of @code{X}, where @code{X} is given in radians:
@example
-mysql> select SIN(PI());
+mysql> SELECT SIN(PI());
-> 0.000000
@end example
@@ -31491,7 +31837,7 @@ mysql> select SIN(PI());
@item TAN(X)
Returns the tangent of @code{X}, where @code{X} is given in radians:
@example
-mysql> select TAN(PI()+1);
+mysql> SELECT TAN(PI()+1);
-> 1.557408
@end example
@@ -31501,11 +31847,11 @@ Returns the arc cosine of @code{X}, that is, the value whose cosine is
@code{X}. Returns @code{NULL} if @code{X} is not in the range @code{-1} to
@code{1}:
@example
-mysql> select ACOS(1);
+mysql> SELECT ACOS(1);
-> 0.000000
-mysql> select ACOS(1.0001);
+mysql> SELECT ACOS(1.0001);
-> NULL
-mysql> select ACOS(0);
+mysql> SELECT ACOS(0);
-> 1.570796
@end example
@@ -31515,9 +31861,9 @@ Returns the arc sine of @code{X}, that is, the value whose sine is
@code{X}. Returns @code{NULL} if @code{X} is not in the range @code{-1} to
@code{1}:
@example
-mysql> select ASIN(0.2);
+mysql> SELECT ASIN(0.2);
-> 0.201358
-mysql> select ASIN('foo');
+mysql> SELECT ASIN('foo');
-> 0.000000
@end example
@@ -31526,9 +31872,9 @@ mysql> select ASIN('foo');
Returns the arc tangent of @code{X}, that is, the value whose tangent is
@code{X}:
@example
-mysql> select ATAN(2);
+mysql> SELECT ATAN(2);
-> 1.107149
-mysql> select ATAN(-2);
+mysql> SELECT ATAN(-2);
-> -1.107149
@end example
@@ -31540,9 +31886,9 @@ similar to calculating the arc tangent of @code{Y / X}, except that the
signs of both arguments are used to determine the quadrant of the
result:
@example
-mysql> select ATAN(-2,2);
+mysql> SELECT ATAN(-2,2);
-> -0.785398
-mysql> select ATAN2(PI(),0);
+mysql> SELECT ATAN2(PI(),0);
-> 1.570796
@end example
@@ -31550,9 +31896,9 @@ mysql> select ATAN2(PI(),0);
@item COT(X)
Returns the cotangent of @code{X}:
@example
-mysql> select COT(12);
+mysql> SELECT COT(12);
-> -1.57267341
-mysql> select COT(0);
+mysql> SELECT COT(0);
-> NULL
@end example
@@ -31562,15 +31908,15 @@ mysql> select COT(0);
Returns a random floating-point value in the range @code{0} to @code{1.0}.
If an integer argument @code{N} is specified, it is used as the seed value:
@example
-mysql> select RAND();
+mysql> SELECT RAND();
-> 0.9233482386203
-mysql> select RAND(20);
+mysql> SELECT RAND(20);
-> 0.15888261251047
-mysql> select RAND(20);
+mysql> SELECT RAND(20);
-> 0.15888261251047
-mysql> select RAND();
+mysql> SELECT RAND();
-> 0.63553050033332
-mysql> select RAND();
+mysql> SELECT RAND();
-> 0.70100469486881
@end example
@@ -31586,7 +31932,7 @@ Note that a @code{RAND()} in a @code{WHERE} clause will be re-evaluated
every time the @code{WHERE} is executed.
@code{RAND()} is not meant to be a perfect random generator, but instead a
-fast way to generate add-hook random numbers that will be portable between
+fast way to generate ad hoc random numbers that will be portable between
platforms for the same MySQL version.
@findex LEAST()
@@ -31612,11 +31958,11 @@ In other cases, the arguments are compared as case-insensitive strings:
@end itemize
@example
-mysql> select LEAST(2,0);
+mysql> SELECT LEAST(2,0);
-> 0
-mysql> select LEAST(34.0,3.0,5.0,767.0);
+mysql> SELECT LEAST(34.0,3.0,5.0,767.0);
-> 3.0
-mysql> select LEAST("B","A","C");
+mysql> SELECT LEAST("B","A","C");
-> "A"
@end example
In MySQL versions prior to Version 3.22.5, you can use @code{MIN()}
@@ -31627,11 +31973,11 @@ instead of @code{LEAST}.
Returns the largest (maximum-valued) argument.
The arguments are compared using the same rules as for @code{LEAST}:
@example
-mysql> select GREATEST(2,0);
+mysql> SELECT GREATEST(2,0);
-> 2
-mysql> select GREATEST(34.0,3.0,5.0,767.0);
+mysql> SELECT GREATEST(34.0,3.0,5.0,767.0);
-> 767.0
-mysql> select GREATEST("B","A","C");
+mysql> SELECT GREATEST("B","A","C");
-> "C"
@end example
In MySQL versions prior to Version 3.22.5, you can use @code{MAX()}
@@ -31641,7 +31987,7 @@ instead of @code{GREATEST}.
@item DEGREES(X)
Returns the argument @code{X}, converted from radians to degrees:
@example
-mysql> select DEGREES(PI());
+mysql> SELECT DEGREES(PI());
-> 180.000000
@end example
@@ -31649,7 +31995,7 @@ mysql> select DEGREES(PI());
@item RADIANS(X)
Returns the argument @code{X}, converted from degrees to radians:
@example
-mysql> select RADIANS(90);
+mysql> SELECT RADIANS(90);
-> 1.570796
@end example
@@ -31658,11 +32004,11 @@ mysql> select RADIANS(90);
Returns the number @code{X}, truncated to @code{D} decimals. If @code{D}
is @code{0}, the result will have no decimal point or fractional part:
@example
-mysql> select TRUNCATE(1.223,1);
+mysql> SELECT TRUNCATE(1.223,1);
-> 1.2
-mysql> select TRUNCATE(1.999,1);
+mysql> SELECT TRUNCATE(1.999,1);
-> 1.9
-mysql> select TRUNCATE(1.999,0);
+mysql> SELECT TRUNCATE(1.999,0);
-> 1
@end example
@@ -31672,7 +32018,7 @@ result:
@cindex rounding errors
@example
-mysql> select TRUNCATE(10.28*100,0);
+mysql> SELECT TRUNCATE(10.28*100,0);
-> 1027
@end example
@@ -31690,11 +32036,11 @@ See @ref{Date and time types} for a description of the range of values
each type has and the valid formats in which date and time values may be
specified.
-Here is an example that uses date functions. The query below selects
+Here is an example that uses date functions. The following query selects
all records with a @code{date_col} value from within the last 30 days:
@example
-mysql> SELECT something FROM table
+mysql> SELECT something FROM tbl_name
WHERE TO_DAYS(NOW()) - TO_DAYS(date_col) <= 30;
@end example
@@ -31707,7 +32053,7 @@ for @code{date} (@code{1} = Sunday, @code{2} = Monday, ... @code{7} =
Saturday). These index values correspond to the ODBC standard:
@example
-mysql> select DAYOFWEEK('1998-02-03');
+mysql> SELECT DAYOFWEEK('1998-02-03');
-> 3
@end example
@@ -31717,9 +32063,9 @@ Returns the weekday index for
@code{date} (@code{0} = Monday, @code{1} = Tuesday, ... @code{6} = Sunday):
@example
-mysql> select WEEKDAY('1997-10-04 22:23:00');
+mysql> SELECT WEEKDAY('1997-10-04 22:23:00');
-> 5
-mysql> select WEEKDAY('1997-11-05');
+mysql> SELECT WEEKDAY('1997-11-05');
-> 2
@end example
@@ -31729,7 +32075,7 @@ Returns the day of the month for @code{date}, in the range @code{1} to
@code{31}:
@example
-mysql> select DAYOFMONTH('1998-02-03');
+mysql> SELECT DAYOFMONTH('1998-02-03');
-> 3
@end example
@@ -31739,7 +32085,7 @@ Returns the day of the year for @code{date}, in the range @code{1} to
@code{366}:
@example
-mysql> select DAYOFYEAR('1998-02-03');
+mysql> SELECT DAYOFYEAR('1998-02-03');
-> 34
@end example
@@ -31748,7 +32094,7 @@ mysql> select DAYOFYEAR('1998-02-03');
Returns the month for @code{date}, in the range @code{1} to @code{12}:
@example
-mysql> select MONTH('1998-02-03');
+mysql> SELECT MONTH('1998-02-03');
-> 2
@end example
@@ -31757,7 +32103,7 @@ mysql> select MONTH('1998-02-03');
Returns the name of the weekday for @code{date}:
@example
-mysql> select DAYNAME("1998-02-05");
+mysql> SELECT DAYNAME("1998-02-05");
-> 'Thursday'
@end example
@@ -31766,7 +32112,7 @@ mysql> select DAYNAME("1998-02-05");
Returns the name of the month for @code{date}:
@example
-mysql> select MONTHNAME("1998-02-05");
+mysql> SELECT MONTHNAME("1998-02-05");
-> 'February'
@end example
@@ -31776,7 +32122,7 @@ Returns the quarter of the year for @code{date}, in the range @code{1}
to @code{4}:
@example
-mysql> select QUARTER('98-04-01');
+mysql> SELECT QUARTER('98-04-01');
-> 2
@end example
@@ -31792,13 +32138,13 @@ second argument is @code{0}, on Monday if the second argument is
@code{1}:
@example
-mysql> select WEEK('1998-02-20');
+mysql> SELECT WEEK('1998-02-20');
-> 7
-mysql> select WEEK('1998-02-20',0);
+mysql> SELECT WEEK('1998-02-20',0);
-> 7
-mysql> select WEEK('1998-02-20',1);
+mysql> SELECT WEEK('1998-02-20',1);
-> 8
-mysql> select WEEK('1998-12-31',1);
+mysql> SELECT WEEK('1998-12-31',1);
-> 53
@end example
@@ -31810,7 +32156,7 @@ calendar in the USA.
Returns the year for @code{date}, in the range @code{1000} to @code{9999}:
@example
-mysql> select YEAR('98-02-03');
+mysql> SELECT YEAR('98-02-03');
-> 1998
@end example
@@ -31822,7 +32168,7 @@ different from the year in the date argument for the first and the last
week of the year:
@example
-mysql> select YEARWEEK('1987-01-01');
+mysql> SELECT YEARWEEK('1987-01-01');
-> 198653
@end example
@@ -31831,7 +32177,7 @@ mysql> select YEARWEEK('1987-01-01');
Returns the hour for @code{time}, in the range @code{0} to @code{23}:
@example
-mysql> select HOUR('10:05:03');
+mysql> SELECT HOUR('10:05:03');
-> 10
@end example
@@ -31840,7 +32186,7 @@ mysql> select HOUR('10:05:03');
Returns the minute for @code{time}, in the range @code{0} to @code{59}:
@example
-mysql> select MINUTE('98-02-03 10:05:03');
+mysql> SELECT MINUTE('98-02-03 10:05:03');
-> 5
@end example
@@ -31849,7 +32195,7 @@ mysql> select MINUTE('98-02-03 10:05:03');
Returns the second for @code{time}, in the range @code{0} to @code{59}:
@example
-mysql> select SECOND('10:05:03');
+mysql> SELECT SECOND('10:05:03');
-> 3
@end example
@@ -31858,10 +32204,10 @@ mysql> select SECOND('10:05:03');
Adds @code{N} months to period @code{P} (in the format @code{YYMM} or
@code{YYYYMM}). Returns a value in the format @code{YYYYMM}.
-Note that the period argument @code{P} is @emph{not} a date value:
+Note that the period argument @code{P} is @strong{not} a date value:
@example
-mysql> select PERIOD_ADD(9801,2);
+mysql> SELECT PERIOD_ADD(9801,2);
-> 199803
@end example
@@ -31870,11 +32216,11 @@ mysql> select PERIOD_ADD(9801,2);
Returns the number of months between periods @code{P1} and @code{P2}.
@code{P1} and @code{P2} should be in the format @code{YYMM} or @code{YYYYMM}.
-Note that the period arguments @code{P1} and @code{P2} are @emph{not}
+Note that the period arguments @code{P1} and @code{P2} are @strong{not}
date values:
@example
-mysql> select PERIOD_DIFF(9802,199703);
+mysql> SELECT PERIOD_DIFF(9802,199703);
-> 11
@end example
@@ -31894,7 +32240,7 @@ Version 3.22. @code{ADDDATE()} and @code{SUBDATE()} are synonyms for
In MySQL Version 3.23, you can use @code{+} and @code{-} instead of
@code{DATE_ADD()} and @code{DATE_SUB()} if the expression on the right side is
-a date or datetime column. (See example)
+a date or datetime column. (See example below.)
@code{date} is a @code{DATETIME} or @code{DATE} value specifying the starting
date. @code{expr} is an expression specifying the interval value to be added
@@ -31908,7 +32254,7 @@ interval from the date.
The following table shows how the @code{type} and @code{expr} arguments
are related:
-@multitable @columnfractions .25 .40
+@multitable @columnfractions .25 .45
@item @code{type} @strong{value} @tab @strong{Expected} @code{expr} @strong{format}
@item @code{SECOND} @tab @code{SECONDS}
@item @code{MINUTE} @tab @code{MINUTES}
@@ -31929,7 +32275,7 @@ MySQL allows any punctuation delimiter in the @code{expr} format.
Those shown in the table are the suggested delimiters. If the @code{date}
argument is a @code{DATE} value and your calculations involve only
@code{YEAR}, @code{MONTH}, and @code{DAY} parts (that is, no time parts), the
-result is a @code{DATE} value. Otherwise the result is a @code{DATETIME}
+result is a @code{DATE} value. Otherwise, the result is a @code{DATETIME}
value:
@example
@@ -31975,9 +32321,9 @@ contains a time part, the date value will be automatically converted to a
datetime value:
@example
-mysql> select date_add("1999-01-01", interval 1 day);
+mysql> SELECT DATE_ADD("1999-01-01", INTERVAL 1 DAY);
-> 1999-01-02
-mysql> select date_add("1999-01-01", interval 1 hour);
+mysql> SELECT DATE_ADD("1999-01-01", INTERVAL 1 HOUR);
-> 1999-01-01 01:00:00
@end example
@@ -31987,12 +32333,12 @@ has a day that is larger than the maximum day for the new month, the day is
adjusted to the maximum days in the new month:
@example
-mysql> select DATE_ADD('1998-01-30', Interval 1 month);
+mysql> SELECT DATE_ADD('1998-01-30', INTERVAL 1 MONTH);
-> 1998-02-28
@end example
Note from the preceding example that the word @code{INTERVAL} and the
-@code{type} keyword are not case sensitive.
+@code{type} keyword are not case-sensitive.
@findex EXTRACT()
@item EXTRACT(type FROM date)
@@ -32016,9 +32362,9 @@ Given a date @code{date}, returns a daynumber (the number of days since year
0):
@example
-mysql> select TO_DAYS(950501);
+mysql> SELECT TO_DAYS(950501);
-> 728779
-mysql> select TO_DAYS('1997-10-07');
+mysql> SELECT TO_DAYS('1997-10-07');
-> 729669
@end example
@@ -32031,7 +32377,7 @@ days that were lost when the calendar was changed.
Given a daynumber @code{N}, returns a @code{DATE} value:
@example
-mysql> select FROM_DAYS(729669);
+mysql> SELECT FROM_DAYS(729669);
-> '1997-10-07'
@end example
@@ -32071,27 +32417,27 @@ following specifiers may be used in the @code{format} string:
@item @code{%s} @tab Seconds (@code{00}..@code{59})
@item @code{%p} @tab @code{AM} or @code{PM}
@item @code{%w} @tab Day of the week (@code{0}=Sunday..@code{6}=Saturday)
-@item @code{%U} @tab Week (@code{0}..@code{53}), where Sunday is the first day of the week
-@item @code{%u} @tab Week (@code{0}..@code{53}), where Monday is the first day of the week
-@item @code{%V} @tab Week (@code{1}..@code{53}), where Sunday is the first day of the week. Used with '%X'
-@item @code{%v} @tab Week (@code{1}..@code{53}), where Monday is the first day of the week. Used with '%x'
+@item @code{%U} @tab Week (@code{00}..@code{53}), where Sunday is the first day of the week
+@item @code{%u} @tab Week (@code{00}..@code{53}), where Monday is the first day of the week
+@item @code{%V} @tab Week (@code{01}..@code{53}), where Sunday is the first day of the week. Used with '%X'
+@item @code{%v} @tab Week (@code{01}..@code{53}), where Monday is the first day of the week. Used with '%x'
@item @code{%%} @tab A literal @samp{%}.
@end multitable
All other characters are just copied to the result without interpretation:
@example
-mysql> select DATE_FORMAT('1997-10-04 22:23:00', '%W %M %Y');
+mysql> SELECT DATE_FORMAT('1997-10-04 22:23:00', '%W %M %Y');
-> 'Saturday October 1997'
-mysql> select DATE_FORMAT('1997-10-04 22:23:00', '%H:%i:%s');
+mysql> SELECT DATE_FORMAT('1997-10-04 22:23:00', '%H:%i:%s');
-> '22:23:00'
-mysql> select DATE_FORMAT('1997-10-04 22:23:00',
+mysql> SELECT DATE_FORMAT('1997-10-04 22:23:00',
'%D %y %a %d %m %b %j');
-> '4th 97 Sat 04 10 Oct 277'
-mysql> select DATE_FORMAT('1997-10-04 22:23:00',
+mysql> SELECT DATE_FORMAT('1997-10-04 22:23:00',
'%H %k %I %r %T %S %w');
-> '22 22 10 10:23:00 PM 22:23:00 00 6'
-mysql> select DATE_FORMAT('1999-01-01', '%X %V');
+mysql> SELECT DATE_FORMAT('1999-01-01', '%X %V');
-> '1998 52'
@end example
@@ -32115,9 +32461,9 @@ format, depending on whether the function is used in a string or numeric
context:
@example
-mysql> select CURDATE();
+mysql> SELECT CURDATE();
-> '1997-12-15'
-mysql> select CURDATE() + 0;
+mysql> SELECT CURDATE() + 0;
-> 19971215
@end example
@@ -32130,9 +32476,9 @@ format, depending on whether the function is used in a string or numeric
context:
@example
-mysql> select CURTIME();
+mysql> SELECT CURTIME();
-> '23:50:26'
-mysql> select CURTIME() + 0;
+mysql> SELECT CURTIME() + 0;
-> 235026
@end example
@@ -32147,9 +32493,9 @@ or @code{YYYYMMDDHHMMSS} format, depending on whether the function is used in
a string or numeric context:
@example
-mysql> select NOW();
+mysql> SELECT NOW();
-> '1997-12-15 23:50:26'
-mysql> select NOW() + 0;
+mysql> SELECT NOW() + 0;
-> 19971215235026
@end example
@@ -32165,17 +32511,18 @@ returns the value of the argument as seconds since @code{'1970-01-01
@code{YYMMDD} or @code{YYYYMMDD} in local time:
@example
-mysql> select UNIX_TIMESTAMP();
+mysql> SELECT UNIX_TIMESTAMP();
-> 882226357
-mysql> select UNIX_TIMESTAMP('1997-10-04 22:23:00');
+mysql> SELECT UNIX_TIMESTAMP('1997-10-04 22:23:00');
-> 875996580
@end example
When @code{UNIX_TIMESTAMP} is used on a @code{TIMESTAMP} column, the function
will return the internal timestamp value directly, with no implicit
``string-to-unix-timestamp'' conversion.
-If you give @code{UNIX_TIMESTAMP()} a wrong or out-of-range date, it will
-return 0.
+If you pass an out-of-range date to @code{UNIX_TIMESTAMP()} it will
+return 0, but please note that only basic checking is performed
+(year 1970-2037, month 01-12, day 01-31).
If you want to subtract @code{UNIX_TIMESTAMP()} columns, you may want to
cast the result to signed integers. @xref{Cast Functions}.
@@ -32187,9 +32534,9 @@ Returns a representation of the @code{unix_timestamp} argument as a value in
whether the function is used in a string or numeric context:
@example
-mysql> select FROM_UNIXTIME(875996580);
+mysql> SELECT FROM_UNIXTIME(875996580);
-> '1997-10-04 22:23:00'
-mysql> select FROM_UNIXTIME(875996580) + 0;
+mysql> SELECT FROM_UNIXTIME(875996580) + 0;
-> 19971004222300
@end example
@@ -32200,7 +32547,7 @@ the @code{format} string. @code{format} may contain the same specifiers as
those listed in the entry for the @code{DATE_FORMAT()} function:
@example
-mysql> select FROM_UNIXTIME(UNIX_TIMESTAMP(),
+mysql> SELECT FROM_UNIXTIME(UNIX_TIMESTAMP(),
'%Y %D %M %h:%i:%s %x');
-> '1997 23rd December 03:43:30 1997'
@end example
@@ -32212,9 +32559,9 @@ as a value in @code{'HH:MM:SS'} or @code{HHMMSS} format, depending on whether
the function is used in a string or numeric context:
@example
-mysql> select SEC_TO_TIME(2378);
+mysql> SELECT SEC_TO_TIME(2378);
-> '00:39:38'
-mysql> select SEC_TO_TIME(2378) + 0;
+mysql> SELECT SEC_TO_TIME(2378) + 0;
-> 3938
@end example
@@ -32223,9 +32570,9 @@ mysql> select SEC_TO_TIME(2378) + 0;
Returns the @code{time} argument, converted to seconds:
@example
-mysql> select TIME_TO_SEC('22:23:00');
+mysql> SELECT TIME_TO_SEC('22:23:00');
-> 80580
-mysql> select TIME_TO_SEC('00:39:38');
+mysql> SELECT TIME_TO_SEC('00:39:38');
-> 2378
@end example
@end table
@@ -32274,38 +32621,38 @@ CREATE TABLE new_table SELECT CAST('2000-01-01' AS DATE);
@code{CAST(string AS BINARY} is the same thing as @code{BINARY string}.
To cast a string to a numeric value, you don't normally have to do
-anything; Just use the string value as it would be a number:
+anything; just use the string value as it would be a number:
@example
-mysql> select 1+'1';
+mysql> SELECT 1+'1';
-> 2
@end example
-MySQL supports arithmetic with both signed and unsigned 64 bit values.
+MySQL supports arithmetic with both signed and unsigned 64-bit values.
If you are using an numerical operations (like @code{+}) and one of the
operands are @code{unsigned integer}, then the result will be unsigned.
You can override this by using the @code{SIGNED} and @code{UNSIGNED}
-cast operators, which will cast the operation to signed respective
-unsigned 64 bit integer.
+cast operators, which will cast the operation to a signed or
+unsigned 64-bit integer, respectively.
@example
-mysql> select CAST(1-2 AS UNSIGNED)
+mysql> SELECT CAST(1-2 AS UNSIGNED)
-> 18446744073709551615
-mysql select CAST(CAST(1-2 AS UNSIGNED) AS SIGNED);
+mysql> SELECT CAST(CAST(1-2 AS UNSIGNED) AS SIGNED);
-> -1
@end example
-Note that if either operation is a floating point value (In this context
-@code{DECIMAL()} is regarded as a floating point value) the result will
-be a floating point value and is not affected by the above rule.
+Note that if either operation is a floating-point value (In this context
+@code{DECIMAL()} is regarded as a floating-point value) the result will
+be a floating-point value and is not affected by the above rule.
@example
-mysql> select CAST(1 AS UNSIGNED) -2.0
+mysql> SELECT CAST(1 AS UNSIGNED) -2.0
-> -1.0
@end example
If you are using a string in an arithmetic operation, this is converted
-to a floating point number.
+to a floating-point number.
The @code{CAST()} and @code{CONVERT()} functions were added in MySQL 4.0.2.
@@ -32319,7 +32666,7 @@ result when subtracting two unsigned integer columns:
SELECT (unsigned_column_1+0.0)-(unsigned_column_2+0.0);
@end example
-The idea is that the columns are converted to floating point before doing
+The idea is that the columns are converted to floating-point before doing
the subtraction.
If you get a problem with @code{UNSIGNED} columns in your old MySQL
@@ -32354,58 +32701,58 @@ these operators have a maximum range of 64 bits.
@item |
Bitwise OR
@example
-mysql> select 29 | 15;
+mysql> SELECT 29 | 15;
-> 31
@end example
-The result is an unsigned 64 bit integer.
+The result is an unsigned 64-bit integer.
@findex & (bitwise AND)
@findex AND, bitwise
@item &
Bitwise AND:
@example
-mysql> select 29 & 15;
+mysql> SELECT 29 & 15;
-> 13
@end example
-The result is an unsigned 64 bit integer.
+The result is an unsigned 64-bit integer.
@findex << (left shift)
@item <<
Shifts a longlong (@code{BIGINT}) number to the left:
@example
-mysql> select 1 << 2;
+mysql> SELECT 1 << 2;
-> 4
@end example
-The result is an unsigned 64 bit integer.
+The result is an unsigned 64-bit integer.
@findex >> (right shift)
@item >>
Shifts a longlong (@code{BIGINT}) number to the right:
@example
-mysql> select 4 >> 2;
+mysql> SELECT 4 >> 2;
-> 1
@end example
-The result is an unsigned 64 bit integer.
+The result is an unsigned 64-bit integer.
@findex ~
@item ~
Invert all bits:
@example
-mysql> select 5 & ~1;
+mysql> SELECT 5 & ~1;
-> 4
@end example
-The result is an unsigned 64 bit integer.
+The result is an unsigned 64-bit integer.
@findex BIT_COUNT()
@item BIT_COUNT(N)
Returns the number of bits that are set in the argument @code{N}:
@example
-mysql> select BIT_COUNT(29);
+mysql> SELECT BIT_COUNT(29);
-> 4
@end example
@end table
@@ -32423,7 +32770,7 @@ mysql> select BIT_COUNT(29);
Returns the current database name:
@example
-mysql> select DATABASE();
+mysql> SELECT DATABASE();
-> 'test'
@end example
@@ -32438,16 +32785,16 @@ If there is no current database, @code{DATABASE()} returns the empty string.
Returns the current MySQL user name:
@example
-mysql> select USER();
+mysql> SELECT USER();
-> 'davida@@localhost'
@end example
In MySQL Version 3.22.11 or later, this includes the client hostname
as well as the user name. You can extract just the user name part like this
-(which works whether or not the value includes a hostname part):
+(which works whether the value includes a hostname part):
@example
-mysql> select substring_index(USER(),"@@",1);
+mysql> SELECT SUBSTRING_INDEX(USER(),"@@",1);
-> 'davida'
@end example
@@ -32458,7 +32805,7 @@ the function that is used for encrypting MySQL passwords for storage
in the @code{Password} column of the @code{user} grant table:
@example
-mysql> select PASSWORD('badpwd');
+mysql> SELECT PASSWORD('badpwd');
-> '7f84554057dd964b'
@end example
@@ -32478,7 +32825,7 @@ Encrypt @code{str} using the Unix @code{crypt()} system call. The
(As of MySQL Version 3.22.16, @code{salt} may be longer than two characters.):
@example
-mysql> select ENCRYPT("hello");
+mysql> SELECT ENCRYPT("hello");
-> 'VxuFAJXVARROc'
@end example
@@ -32509,7 +32856,7 @@ Calculates a MD5 checksum for the string. Value is returned as a 32 long
hex number that may, for example, be used as a hash key:
@example
-mysql> select MD5("testing");
+mysql> SELECT MD5("testing");
-> 'ae2b1fca515949e5d54fb22b8ed95575'
@end example
@@ -32526,7 +32873,7 @@ SSL support. @xref{Secure connections}.
The encryption key to use is chosen the following way:
-@multitable @columnfractions .20 .65
+@multitable @columnfractions .25 .65
@item @strong{Argument} @tab @strong{Description}
@item Only one argument @tab
The first key from @code{des-key-file} is used.
@@ -32585,7 +32932,7 @@ If no @code{key_string} argument is given, @code{DES_DECRYPT()} examines
the first byte of the encrypted string to determine the DES key number
that was used to encrypt the original string, then reads the key
from the @code{des-key-file} to decrypt the message. For this to work
-the user must have the @code{Process_priv} privilege.
+the user must have the @strong{process} privilege.
If you pass this function a @code{key_string} argument, that string
is used as the key for decrypting the message.
@@ -32602,7 +32949,7 @@ Returns the last automatically generated value that was inserted into an
@xref{mysql_insert_id,, @code{mysql_insert_id()}}.
@example
-mysql> select LAST_INSERT_ID();
+mysql> SELECT LAST_INSERT_ID();
-> 195
@end example
@@ -32620,19 +32967,19 @@ the same @code{INSERT} statement against some other server.
If @code{expr} is given as an argument to @code{LAST_INSERT_ID()}, then
the value of the argument is returned by the function, is set as the
next value to be returned by @code{LAST_INSERT_ID()} and used as the next
-auto_increment value. This can be used to simulate sequences:
+@code{AUTO_INCREMENT} value. This can be used to simulate sequences:
First create the table:
@example
-mysql> create table sequence (id int not null);
-mysql> insert into sequence values (0);
+mysql> CREATE TABLE sequence (id INT NOT NULL);
+mysql> INSERT INTO sequence VALUES (0);
@end example
Then the table can be used to generate sequence numbers like this:
@example
-mysql> update sequence set id=LAST_INSERT_ID(id+1);
+mysql> UPDATE sequence SET id=LAST_INSERT_ID(id+1);
@end example
You can generate sequences without calling @code{LAST_INSERT_ID()}, but the
@@ -32656,11 +33003,11 @@ to @code{D} decimals. If @code{D} is @code{0}, the result will have no
decimal point or fractional part:
@example
-mysql> select FORMAT(12332.123456, 4);
+mysql> SELECT FORMAT(12332.123456, 4);
-> '12,332.1235'
-mysql> select FORMAT(12332.1,4);
+mysql> SELECT FORMAT(12332.1,4);
-> '12,332.1000'
-mysql> select FORMAT(12332.2,0);
+mysql> SELECT FORMAT(12332.2,0);
-> '12,332'
@end example
@@ -32669,7 +33016,7 @@ mysql> select FORMAT(12332.2,0);
Returns a string indicating the MySQL server version:
@example
-mysql> select VERSION();
+mysql> SELECT VERSION();
-> '3.23.13-log'
@end example
@@ -32682,7 +33029,7 @@ Returns the connection id (@code{thread_id}) for the connection.
Every connection has its own unique id:
@example
-mysql> select CONNECTION_ID();
+mysql> SELECT CONNECTION_ID();
-> 1
@end example
@@ -32701,13 +33048,13 @@ the same name; clients that agree on a given lock string name can use the
string to perform cooperative advisory locking:
@example
-mysql> select GET_LOCK("lock1",10);
+mysql> SELECT GET_LOCK("lock1",10);
-> 1
-mysql> select GET_LOCK("lock2",10);
+mysql> SELECT GET_LOCK("lock2",10);
-> 1
-mysql> select RELEASE_LOCK("lock2");
+mysql> SELECT RELEASE_LOCK("lock2");
-> 1
-mysql> select RELEASE_LOCK("lock1");
+mysql> SELECT RELEASE_LOCK("lock1");
-> NULL
@end example
@@ -32735,9 +33082,9 @@ processes the expression. The result value is always @code{0}. The intended
use is in the @code{mysql} client, which reports query execution times:
@example
-mysql> select BENCHMARK(1000000,encode("hello","goodbye"));
+mysql> SELECT BENCHMARK(1000000,ENCODE("hello","goodbye"));
+----------------------------------------------+
-| BENCHMARK(1000000,encode("hello","goodbye")) |
+| BENCHMARK(1000000,ENCODE("hello","goodbye")) |
+----------------------------------------------+
| 0 |
+----------------------------------------------+
@@ -32755,7 +33102,7 @@ Given a numeric network address (4 or 8 byte), returns the dotted-quad
representation of the address as a string:
@example
-mysql> select INET_NTOA(3520061480);
+mysql> SELECT INET_NTOA(3520061480);
-> "209.207.224.40"
@end example
@@ -32766,11 +33113,11 @@ returns an integer that represents the numeric value of the address.
Addresses may be 4 or 8 byte addresses:
@example
-mysql> select INET_ATON("209.207.224.40");
+mysql> SELECT INET_ATON("209.207.224.40");
-> 3520061480
@end example
-The generated number is always in network byte order; For example the
+The generated number is always in network byte order; for example the
above number is calculated as @code{209*256^3 + 207*256^2 + 224*256 +40}.
@findex MASTER_POS_WAIT()
@@ -32792,7 +33139,7 @@ Returns the number of rows that the last @code{SELECT SQL_CALC_FOUND_ROWS ...}
command would have returned, if wasn't restricted with @code{LIMIT}.
@example
-mysql> SELECT SQL_CALC_FOUND_ROWS * FROM table_name
+mysql> SELECT SQL_CALC_FOUND_ROWS * FROM tbl_name
WHERE id > 100 LIMIT 10;
mysql> SELECT FOUND_ROWS();
@end example
@@ -32832,7 +33179,7 @@ mysql> SELECT student.student_name,COUNT(*)
@end example
@code{COUNT(*)} is somewhat different in that it returns a count of
-the number of rows retrieved, whether or not they contain @code{NULL}
+the number of rows retrieved, whether they contain @code{NULL}
values.
@code{COUNT(*)} is optimised to
@@ -32841,7 +33188,7 @@ other columns are retrieved, and there is no @code{WHERE} clause.
For example:
@example
-mysql> select COUNT(*) from student;
+mysql> SELECT COUNT(*) FROM student;
@end example
@findex COUNT(DISTINCT)
@@ -32850,7 +33197,7 @@ mysql> select COUNT(*) from student;
Returns a count of the number of different non-@code{NULL} values:
@example
-mysql> select COUNT(DISTINCT results) from student;
+mysql> SELECT COUNT(DISTINCT results) FROM student;
@end example
In MySQL you can get the number of distinct expression
@@ -32863,8 +33210,8 @@ inside @code{CODE(DISTINCT ...)}.
Returns the average value of @code{expr}:
@example
-mysql> select student_name, AVG(test_score)
- -> from student
+mysql> SELECT student_name, AVG(test_score)
+ -> FROM student
-> GROUP BY student_name;
@end example
@@ -32877,8 +33224,8 @@ Returns the minimum or maximum value of @code{expr}. @code{MIN()} and
minimum or maximum string value. @xref{MySQL indexes}.
@example
-mysql> select student_name, MIN(test_score), MAX(test_score)
- -> from student
+mysql> SELECT student_name, MIN(test_score), MAX(test_score)
+ -> FROM student
-> GROUP BY student_name;
@end example
@@ -32917,9 +33264,9 @@ grouping on unnecessary items. For example, you don't need to group on
@code{customer.name} in the following query:
@example
-mysql> select order.custid,customer.name,max(payments)
- -> from order,customer
- -> where order.custid = customer.custid
+mysql> SELECT order.custid,customer.name,MAX(payments)
+ -> FROM order,customer
+ -> WHERE order.custid = customer.custid
-> GROUP BY order.custid;
@end example
@@ -32937,7 +33284,7 @@ column value even if it isn't unique. The following gives the value of
column:
@example
-substr(MIN(concat(rpad(sort,6,' '),column)),7)
+SUBSTR(MIN(CONCAT(RPAD(sort,6,' '),column)),7)
@end example
@xref{example-Maximum-column-group-row}.
@@ -33031,8 +33378,8 @@ is used as the expression's column name and can be used with
@code{ORDER BY} or @code{HAVING} clauses. For example:
@example
-mysql> select concat(last_name,', ',first_name) AS full_name
- from mytable ORDER BY full_name;
+mysql> SELECT CONCAT(last_name,', ',first_name) AS full_name
+ FROM mytable ORDER BY full_name;
@end example
@item
@@ -33078,10 +33425,10 @@ forms.
A table reference may be aliased using @code{tbl_name [AS] alias_name}:
@example
-mysql> select t1.name, t2.salary from employee AS t1, info AS t2
- -> where t1.name = t2.name;
-mysql> select t1.name, t2.salary from employee t1, info t2
- -> where t1.name = t2.name;
+mysql> SELECT t1.name, t2.salary FROM employee AS t1, info AS t2
+ -> WHERE t1.name = t2.name;
+mysql> SELECT t1.name, t2.salary FROM employee t1, info t2
+ -> WHERE t1.name = t2.name;
@end example
@item
@@ -33090,11 +33437,11 @@ Columns selected for output may be referred to in @code{ORDER BY} and
positions. Column positions begin with 1:
@example
-mysql> select college, region, seed from tournament
+mysql> SELECT college, region, seed FROM tournament
-> ORDER BY region, seed;
-mysql> select college, region AS r, seed AS s from tournament
+mysql> SELECT college, region AS r, seed AS s FROM tournament
-> ORDER BY r, s;
-mysql> select college, region, seed from tournament
+mysql> SELECT college, region, seed FROM tournament
-> ORDER BY 2, 3;
@end example
@@ -33114,26 +33461,26 @@ the client, with no optimisation. Don't use @code{HAVING} for items that
should be in the @code{WHERE} clause. For example, do not write this:
@example
-mysql> select col_name from tbl_name HAVING col_name > 0;
+mysql> SELECT col_name FROM tbl_name HAVING col_name > 0;
@end example
Write this instead:
@example
-mysql> select col_name from tbl_name WHERE col_name > 0;
+mysql> SELECT col_name FROM tbl_name WHERE col_name > 0;
@end example
In MySQL Version 3.22.5 or later, you can also write queries like this:
@example
-mysql> select user,max(salary) from users
- -> group by user HAVING max(salary)>10;
+mysql> SELECT user,MAX(salary) FROM users
+ -> GROUP BY user HAVING MAX(salary)>10;
@end example
In older MySQL versions, you can write this instead:
@example
-mysql> select user,max(salary) AS sum from users
+mysql> SELECT user,MAX(salary) AS sum FROM users
-> group by user HAVING sum>10;
@end example
@@ -33209,20 +33556,6 @@ read the @code{GROUP BY} description.
@item
@cindex hints
-@code{SQL_BUFFER_RESULT} will force the result to be put into a temporary
-table. This will help MySQL free the table locks early and will help
-in cases where it takes a long time to send the result set to the client.
-
-@item
-@cindex hints
-@code{SQL_SMALL_RESULT}, a MySQL-specific option, can be used
-with @code{GROUP BY} or @code{DISTINCT} to tell the optimiser that the
-result set will be small. In this case, MySQL will use fast
-temporary tables to store the resulting table instead of using sorting. In
-MySQL Version 3.23 this shouldn't normally be needed.
-
-@item
-@cindex hints
@code{STRAIGHT_JOIN} forces the optimiser to join the tables in the order in
which they are listed in the @code{FROM} clause. You can use this to speed up
a query if the optimiser joins the tables in non-optimal order.
@@ -33238,13 +33571,13 @@ return, the second specifies the maximum number of rows to return.
The offset of the initial row is 0 (not 1):
@example
-mysql> select * from table LIMIT 5,10; # Retrieve rows 6-15
+mysql> SELECT * FROM table LIMIT 5,10; # Retrieve rows 6-15
@end example
If one argument is given, it indicates the maximum number of rows to return:
@example
-mysql> select * from table LIMIT 5; # Retrieve first 5 rows
+mysql> SELECT * FROM table LIMIT 5; # Retrieve first 5 rows
@end example
In other words, @code{LIMIT n} is equivalent to @code{LIMIT 0,n}.
@@ -33390,8 +33723,8 @@ A table reference may be aliased using @code{tbl_name AS alias_name} or
@code{tbl_name alias_name}:
@example
-mysql> select t1.name, t2.salary from employee AS t1, info AS t2
- -> where t1.name = t2.name;
+mysql> SELECT t1.name, t2.salary FROM employee AS t1, info AS t2
+ -> WHERE t1.name = t2.name;
@end example
@item
@@ -33405,9 +33738,9 @@ If there is no matching record for the right table in the @code{ON} or
records in a table that have no counterpart in another table:
@example
-mysql> select table1.* from table1
+mysql> SELECT table1.* FROM table1
-> LEFT JOIN table2 ON table1.id=table2.id
- -> where table2.id is NULL;
+ -> WHERE table2.id IS NULL;
@end example
This example finds all rows in @code{table1} with an @code{id} value that is
@@ -33514,7 +33847,7 @@ Only the last @code{SELECT} command can have @code{INTO OUTFILE}.
@end itemize
If you don't use the keyword @code{ALL} for the @code{UNION}, all
-returned rows will be unique, as if if you had done a @code{DISTINCT} for
+returned rows will be unique, as if you had done a @code{DISTINCT} for
the total result set. If you specify @code{ALL}, then you will get all
matching rows from all the used @code{SELECT} statements.
@@ -33533,47 +33866,51 @@ ORDER BY a;
@subsection @code{HANDLER} Syntax
@example
-HANDLER table OPEN [ AS alias ]
-HANDLER table READ index @{ = | >= | <= | < @} (value1, value2, ... )
-[ WHERE ... ] [LIMIT ... ]
-
-HANDLER table READ index @{ FIRST | NEXT | PREV | LAST @}
-[ WHERE ... ] [LIMIT ... ]
-
-HANDLER table READ @{ FIRST | NEXT @} [ WHERE ... ] [LIMIT ... ]
-HANDLER table CLOSE
+HANDLER tbl_name OPEN [ AS alias ]
+HANDLER tbl_name READ index_name @{ = | >= | <= | < @} (value1,value2,...)
+ [ WHERE ... ] [LIMIT ... ]
+HANDLER tbl_name READ index_name @{ FIRST | NEXT | PREV | LAST @}
+ [ WHERE ... ] [LIMIT ... ]
+HANDLER tbl_name READ @{ FIRST | NEXT @}
+ [ WHERE ... ] [LIMIT ... ]
+HANDLER tbl_name CLOSE
@end example
-The @code{HANDLER} statement provides direct access to MySQL table
-interface, bypassing SQL optimiser. Thus, it is faster then SELECT.
+The @code{HANDLER} statement provides direct access to the @code{MyISAM} table
+handler interface, bypassing the SQL optimiser. Thus, it is faster than
+@code{SELECT}.
The first form of @code{HANDLER} statement opens a table, making
-in accessible via the following @code{HANDLER ... READ} routines.
-This table object is not shared by other threads an will not be closed
-until the thread calls @code{HANDLER table_name CLOSE} or the thread dies.
+it accessible via subsequent @code{HANDLER ... READ} statements.
+This table object is not shared by other threads and will not be closed
+until the thread calls @code{HANDLER tbl_name CLOSE} or the thread dies.
+
+@c FIX The sentence below needs to be rewritten. The reference to "the condition" is not clear.
+@c FIX Also all mentions of the LIMIT clause need to be clarified in various sentences below.
-The second form fetches one (or, specified by @code{LIMIT} clause) row
+The second form fetches one row (or more, specified by @code{LIMIT} clause)
where the index specified complies to the condition and @code{WHERE}
condition is met. If the index consists of several parts (spans over
several columns) the values are specified in comma-separated list,
providing values only for few first columns is possible.
-The third form fetches one (or, specified by @code{LIMIT} clause) row
+The third form fetches one row (or more, specified by @code{LIMIT} clause)
from the table in index order, matching @code{WHERE} condition.
-The fourth form (without index specification) fetches one (or, specified
-by @code{LIMIT} clause) row from the table in natural row order (as stored
-in data file) matching @code{WHERE} condition. It is faster than
-@code{HANDLER table READ index} when full table scan is desired.
+The fourth form (without index specification) fetches one row (or more, specified
+by @code{LIMIT} clause) from the table in natural row order (as stored
+in datafile) matching @code{WHERE} condition. It is faster than
+@code{HANDLER tbl_name READ index_name} when a full table scan is desired.
-The last form closes the table, opened with @code{HANDLER ... OPEN}.
+@code{HANDLER ... CLOSE} closes a table that was opened with
+@code{HANDLER ... OPEN}.
-@code{HANDLER} is somewhat of a low-level statement, for example it does
-not provide consistency, that is @code{HANDLER ... OPEN} does @strong{NOT}
+@code{HANDLER} is a somewhat low-level statement. For example, it does
+not provide consistency. That is, @code{HANDLER ... OPEN} does @strong{NOT}
take a snapshot of the table, and does @strong{NOT} lock the table. This
means that after a @code{HANDLER ... OPEN} is issued, table data can be
-modified (by this or an other thread) and these modifications may only
-partially appear in @code{HANDLER ... NEXT} or @code{HANDLER ... PREV} scans.
+modified (by this or any other thread) and these modifications may appear
+only partially in @code{HANDLER ... NEXT} or @code{HANDLER ... PREV} scans.
@node INSERT, INSERT DELAYED, HANDLER, Data Manipulation
@@ -33674,7 +34011,7 @@ with the @code{mysql_insert_id} function.
If you use @code{INSERT ... SELECT} or an @code{INSERT ... VALUES}
statement with multiple value lists, you can use the C API function
@code{mysql_info()} to get information about the query. The format of the
-information string is shown below:
+information string is shown here:
@example
Records: 100 Duplicates: 0 Warnings: 0
@@ -33784,7 +34121,7 @@ Version 3.22.15. It is a MySQL extension to ANSI SQL92.
@code{INSERT DELAYED} only works with @code{ISAM} and @code{MyISAM}
tables. Note that as @code{MyISAM} tables supports concurrent
@code{SELECT} and @code{INSERT}, if there is no free blocks in the
-middle of the data file, you very seldom need to use @code{INSERT
+middle of the datafile, you very seldom need to use @code{INSERT
DELAYED} with @code{MyISAM}. @xref{MyISAM}.
When you use @code{INSERT DELAYED}, the client will get an OK at once
@@ -33812,7 +34149,7 @@ thread is created to process all @code{DELAYED} statements for the table, if
no such handler already exists.
@item
-The thread checks whether or not the handler has acquired a @code{DELAYED}
+The thread checks whether the handler has acquired a @code{DELAYED}
lock already; if not, it tells the handler thread to do so. The
@code{DELAYED} lock can be obtained even if other threads have a @code{READ}
or @code{WRITE} lock on the table. However, the handler will wait for all
@@ -33839,7 +34176,7 @@ the first row is inserted.
@item
After every @code{delayed_insert_limit} rows are written, the handler checks
-whether or not any @code{SELECT} statements are still pending. If so, it
+whether any @code{SELECT} statements are still pending. If so, it
allows these to execute before continuing.
@cindex delayed_insert_limit
@@ -33865,7 +34202,6 @@ table before exiting. During this time it will not accept any new
@code{INSERT} commands from another thread. If you execute an @code{INSERT
DELAYED} command after this, a new handler thread will be created.
-@item
Note that the above means that @code{INSERT DELAYED} commands have higher
priority than normal @code{INSERT} commands if there is an @code{INSERT
DELAYED} handler already running! Other update commands will have to wait
@@ -33876,7 +34212,7 @@ thread (with @code{KILL thread_id}), or someone executes @code{FLUSH TABLES}.
The following status variables provide information about @code{INSERT
DELAYED} commands:
-@multitable @columnfractions .30 .50
+@multitable @columnfractions .30 .55
@item @strong{Variable} @tab @strong{Meaning}
@item @code{Delayed_insert_threads} @tab Number of handler threads
@item @code{Delayed_writes} @tab Number of rows written with @code{INSERT DELAYED}
@@ -33901,7 +34237,7 @@ DELAYED} when you are really sure you need it!
@example
UPDATE [LOW_PRIORITY] [IGNORE] tbl_name
- SET col_name1=expr1, [col_name2=expr2, ...]
+ SET col_name1=expr1 [, col_name2=expr2, ...]
[WHERE where_definition]
[LIMIT #]
@end example
@@ -33909,7 +34245,7 @@ UPDATE [LOW_PRIORITY] [IGNORE] tbl_name
@code{UPDATE} updates columns in existing table rows with new values.
The @code{SET} clause indicates which columns to modify and the values
they should be given. The @code{WHERE} clause, if given, specifies
-which rows should be updated. Otherwise all rows are updated. If the
+which rows should be updated. Otherwise, all rows are updated. If the
@code{ORDER BY} clause is specified, the rows will be updated in the
order that is specified.
@@ -34003,7 +34339,7 @@ deletes.
In @code{MyISAM} tables, deleted records are maintained in a linked list and
subsequent @code{INSERT} operations reuse old record positions. To
-reclaim unused space and reduce file sizes, use the @code{OPTIMIZE
+reclaim unused space and reduce file-sizes, use the @code{OPTIMIZE
TABLE} statement or the @code{myisamchk} utility to reorganise tables.
@code{OPTIMIZE TABLE} is easier, but @code{myisamchk} is faster. See
@ref{OPTIMIZE TABLE, , @code{OPTIMIZE TABLE}} and @ref{Optimisation}.
@@ -34066,8 +34402,8 @@ TRUNCATE TABLE table_name
In 3.23 @code{TRUNCATE TABLE} is mapped to
@code{COMMIT ; DELETE FROM table_name}. @xref{DELETE}.
-The differences between @code{TRUNCATE TABLE} and @code{DELETE FROM ...}
-are:
+@code{TRUNCATE TABLE} differs from @code{DELETE FROM ...}
+in the following ways:
@itemize @bullet
@item
@@ -34178,9 +34514,9 @@ example the output from gunzip), use @code{LOAD DATA LOCAL INFILE}
instead.
@cindex @code{mysqlimport}
-You can also load data files by using the @code{mysqlimport} utility; it
+You can also load datafiles by using the @code{mysqlimport} utility; it
operates by sending a @code{LOAD DATA INFILE} command to the server. The
-@code{--local} option causes @code{mysqlimport} to read data files from the
+@code{--local} option causes @code{mysqlimport} to read datafiles from the
client host. You can specify the @code{--compress} option to get better
performance over slow networks if the client and server support the
compressed protocol.
@@ -34300,7 +34636,7 @@ The @code{IGNORE number LINES} option can be used to ignore a header of
column names at the start of the file:
@example
-mysql> LOAD DATA INFILE "/tmp/file_name" into table test IGNORE 1 LINES;
+mysql> LOAD DATA INFILE "/tmp/file_name" INTO TABLE test IGNORE 1 LINES;
@end example
When you use @code{SELECT ... INTO OUTFILE} in tandem with @code{LOAD
@@ -34324,7 +34660,7 @@ mysql> LOAD DATA INFILE 'data.txt' INTO TABLE table2
-> FIELDS TERMINATED BY ',';
@end example
-If instead you tried to read in the file with the statement shown below, it
+If instead you tried to read in the file with the statement shown here, it
wouldn't work because it instructs @code{LOAD DATA INFILE} to look for
tabs between fields:
@@ -34339,7 +34675,7 @@ a single field.
@code{LOAD DATA INFILE} can be used to read files obtained from
external sources, too. For example, a file in dBASE format will have
fields separated by commas and enclosed in double quotes. If lines in
-the file are terminated by newlines, the command shown below
+the file are terminated by newlines, the command shown here
illustrates the field and line handling options you would use to load
the file:
@@ -34362,17 +34698,17 @@ For example, to read a file of jokes, that are separated with a line
of @code{%%}, into a SQL table you can do:
@example
-create table jokes (a int not null auto_increment primary key, joke text
-not null);
-load data infile "/tmp/jokes.txt" into table jokes fields terminated by ""
-lines terminated by "\n%%\n" (joke);
+CREATE TABLE jokes (a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, joke TEXT
+NOT NULL);
+LOAD DATA INFILE "/tmp/jokes.txt" INTO TABLE jokes FIELDS TERMINATED BY ""
+LINES TERMINATED BY "\n%%\n" (joke);
@end example
@code{FIELDS [OPTIONALLY] ENCLOSED BY} controls quoting of fields. For
output (@code{SELECT ... INTO OUTFILE}), if you omit the word
@code{OPTIONALLY}, all fields are enclosed by the @code{ENCLOSED BY}
character. An example of such output (using a comma as the field
-delimiter) is shown below:
+delimiter) is shown here:
@example
"1","a string","100.20"
@@ -34396,7 +34732,7 @@ field value are escaped by prefixing them with the @code{ESCAPED BY}
character. Also note that if you specify an empty @code{ESCAPED BY}
value, it is possible to generate output that cannot be read properly by
@code{LOAD DATA INFILE}. For example, the output just shown above would
-appear as shown below if the escape character is empty. Observe that the
+appear as shown here if the escape character is empty. Observe that the
second field in the fourth line contains a comma following the quote, which
(erroneously) appears to terminate the field:
@@ -34408,14 +34744,14 @@ second field in the fourth line contains a comma following the quote, which
@end example
For input, the @code{ENCLOSED BY} character, if present, is stripped from the
-ends of field values. (This is true whether or not @code{OPTIONALLY} is
+ends of field values. (This is true whether @code{OPTIONALLY} is
specified; @code{OPTIONALLY} has no effect on input interpretation.)
Occurrences of the @code{ENCLOSED BY} character preceded by the
@code{ESCAPED BY} character are interpreted as part of the current field
value. In addition, duplicated @code{ENCLOSED BY} characters occurring
within fields are interpreted as single @code{ENCLOSED BY} characters if the
field itself starts with that character. For example, if @code{ENCLOSED BY
-'"'} is specified, quotes are handled as shown below:
+'"'} is specified, quotes are handled as shown here:
@example
"The ""BIG"" boss" -> The "BIG" boss
@@ -34588,7 +34924,7 @@ specified as strings!
@findex mysql_info()
If you are using the C API, you can get information about the query by
calling the API function @code{mysql_info()} when the @code{LOAD DATA INFILE}
-query finishes. The format of the information string is shown below:
+query finishes. The format of the information string is shown here:
@example
Records: 1 Deleted: 0 Skipped: 0 Warnings: 0
@@ -34809,7 +35145,7 @@ allowable table names are given in @ref{Legal names}. An error occurs if
there is no current database or if the table already exists.
In MySQL Version 3.22 or later, the table name can be specified as
-@code{db_name.tbl_name}. This works whether or not there is a current
+@code{db_name.tbl_name}. This works whether there is a current
database.
In MySQL Version 3.23, you can use the @code{TEMPORARY} keyword when
@@ -34830,7 +35166,7 @@ directory. In the case of MyISAM-type tables you will get:
@multitable @columnfractions .20 .30
@item @strong{File} @tab @strong{Purpose}
@item @code{tbl_name.frm} @tab Table definition (form) file
-@item @code{tbl_name.MYD} @tab Data file
+@item @code{tbl_name.MYD} @tab Datafile
@item @code{tbl_name.MYI} @tab Index file
@end multitable
@@ -34857,13 +35193,13 @@ If you delete the row containing the maximum value for an
with @code{DELETE FROM table_name} (without a @code{WHERE}) in
@code{AUTOCOMMIT} mode, the sequence starts over for all table types.
-@strong{NOTE:} There can be only one @code{AUTO_INCREMENT} column per
+@strong{Note}: there can be only one @code{AUTO_INCREMENT} column per
table, and it must be indexed. MySQL Version 3.23 will also only
-work properly if the auto_increment column only has positive
+work properly if the @code{AUTO_INCREMENT} column only has positive
values. Inserting a negative number is regarded as inserting a very large
positive number. This is done to avoid precision problems when
numbers 'wrap' over from positive to negative and also to ensure that one
-doesn't accidentally get an auto_increment column that contains 0.
+doesn't accidentally get an @code{AUTO_INCREMENT} column that contains 0.
In MyISAM and BDB tables you can specify @code{AUTO_INCREMENT} secondary
column in a multi-column key. @xref{example-AUTO_INCREMENT}.
@@ -34921,7 +35257,7 @@ column in a table, the default value is the current date and time.
@item
For string types other than @code{ENUM}, the default value is the empty
string. For @code{ENUM}, the default is the first enumeration value (if
-you haven't explicitely specified another default value with the
+you haven't explicitly specified another default value with the
@code{DEFAULT} directive).
@end itemize
@@ -34987,7 +35323,7 @@ Only the @code{MyISAM} table type supports indexing on @code{BLOB} and
@code{TEXT} columns. When putting an index on a @code{BLOB} or @code{TEXT}
column you MUST always specify the length of the index:
@example
-CREATE TABLE test (blob_col BLOB, index(blob_col(10)));
+CREATE TABLE test (blob_col BLOB, INDEX(blob_col(10)));
@end example
@item
@@ -35029,7 +35365,7 @@ implemented in MySQL Version 3.23 and above.
The different table types are:
-@multitable @columnfractions .25 .75
+@multitable @columnfractions .25 .70
@item @strong{Table type} @tab @strong{Description}
@item BDB or Berkeley_db @tab Transaction-safe tables with page locking. @xref{BDB}.
@item HEAP @tab The data for this table is only stored in memory. @xref{HEAP}.
@@ -35051,9 +35387,9 @@ The other table options are used to optimise the behavior of the
table. In most cases, you don't have to specify any of them.
The options work for all table types, if not otherwise indicated:
-@multitable @columnfractions .25 .75
+@multitable @columnfractions .25 .70
@item @strong{Option} @tab @strong{Description}
-@item @code{AUTO_INCREMENT} @tab The next auto_increment value you want to set for your table (MyISAM).
+@item @code{AUTO_INCREMENT} @tab The next @code{AUTO_INCREMENT} value you want to set for your table (MyISAM).
@item @code{AVG_ROW_LENGTH} @tab An approximation of the average row length for your table. You only need to set this for large tables with variable size records.
@item @code{CHECKSUM} @tab Set this to 1 if you want MySQL to maintain a checksum for all rows (makes the table a little slower to update but makes it easier to find corrupted tables) (MyISAM).
@item @code{COMMENT} @tab A 60-character comment for your table.
@@ -35096,9 +35432,9 @@ MySQL will create new fields for all elements in the
@code{SELECT}. For example:
@example
-mysql> CREATE TABLE test (a int not null auto_increment,
- -> primary key (a), key(b))
- -> TYPE=MyISAM SELECT b,c from test2;
+mysql> CREATE TABLE test (a INT NOT NULL AUTO_INCREMENT,
+ -> PRIMARY KEY (a), KEY(b))
+ -> TYPE=MyISAM SELECT b,c FROM test2;
@end example
This will create a @code{MyISAM} table with three columns, a, b, and c.
@@ -35107,18 +35443,18 @@ the right side of the table, not overlapped onto it. Take the following
example:
@example
-mysql> select * from foo;
+mysql> SELECT * FROM foo;
+---+
| n |
+---+
| 1 |
+---+
-mysql> create table bar (m int) select n from foo;
+mysql> CREATE TABLE bar (m INT) SELECT n FROM foo;
Query OK, 1 row affected (0.02 sec)
Records: 1 Duplicates: 0 Warnings: 0
-mysql> select * from bar;
+mysql> SELECT * FROM bar;
+------+---+
| m | n |
+------+---+
@@ -35136,7 +35472,7 @@ possible. If you want to have indexes in the created table, you should
specify these before the @code{SELECT} statement:
@example
-mysql> create table bar (unique (n)) select n from foo;
+mysql> CREATE TABLE bar (UNIQUE (n)) SELECT n FROM foo;
@end example
If any errors occur while copying the data to the table, it will
@@ -35147,9 +35483,9 @@ original tables, MySQL will not allow concurrent inserts during
@code{CREATE TABLE ... SELECT}.
@item
The @code{RAID_TYPE} option will help you to break the 2G/4G limit for
-the MyISAM data file (not the index file) on operating systems that
+the MyISAM datafile (not the index file) on operating systems that
don't support big files. Note that this option is not recommended for
-file system that supports big files!
+filesystem that supports big files!
You can get more speed from the I/O bottleneck by putting @code{RAID}
directories on different physical disks. @code{RAID_TYPE} will work on
@@ -35161,15 +35497,16 @@ If you specify @code{RAID_TYPE=STRIPED} for a @code{MyISAM} table,
@code{MyISAM} will create @code{RAID_CHUNKS} subdirectories named 00,
01, 02 in the database directory. In each of these directories
@code{MyISAM} will create a @code{table_name.MYD}. When writing data
-to the data file, the @code{RAID} handler will map the first
+to the datafile, the @code{RAID} handler will map the first
@code{RAID_CHUNKSIZE} *1024 bytes to the first file, the next
@code{RAID_CHUNKSIZE} *1024 bytes to the next file and so on.
@item
@code{UNION} is used when you want to use a collection of identical
-tables as one. This only works with MERGE tables. @xref{MERGE}.
+tables as one. This only works with @code{MERGE} tables.
+@xref{MERGE, , @code{MERGE}}.
-For the moment you need to have @code{SELECT}, @code{UPDATE}, and
-@code{DELETE} privileges on the tables you map to a @code{MERGE} table.
+For the moment you need to have @strong{select}, @strong{update}, and
+@strong{delete} privileges on the tables you map to a @code{MERGE} table.
All mapped tables must be in the same database as the @code{MERGE} table.
@item
@@ -35238,7 +35575,7 @@ MySQL maps certain column types used by other SQL database vendors
to MySQL types. @xref{Other-vendor column types}.
@end itemize
-If you want to see whether or not MySQL used a column type other
+If you want to see whether MySQL used a column type other
than the one you specified, issue a @code{DESCRIBE tbl_name} statement after
creating or altering your table.
@@ -35304,11 +35641,14 @@ Note that if you use any other option to @code{ALTER TABLE} than
if the data wouldn't strictly need to be copied (like when you change the
name of a column). We plan to fix this in the future, but as one doesn't
normally do @code{ALTER TABLE} that often this isn't that high on our TODO.
+For MyISAM tables, you can speed up the index recreation part (which is the
+slowest part of the recreation process) by setting the
+@code{myisam_sort_buffer_size} variable to a high value.
@itemize @bullet
@item
-To use @code{ALTER TABLE}, you need @strong{ALTER}, @strong{INSERT},
-and @strong{CREATE} privileges on the table.
+To use @code{ALTER TABLE}, you need @strong{alter}, @strong{insert},
+and @strong{create} privileges on the table.
@item
@code{IGNORE} is a MySQL extension to ANSI SQL92.
@@ -35429,7 +35769,7 @@ specific order. Note that the table will not remain in this order after
inserts and deletes. In some cases, it may make sorting easier for
MySQL if the table is in order by the column that you wish to
order it by later. This option is mainly useful when you know that you
-are mostly going to query the rows in a certain order; By using this
+are mostly going to query the rows in a certain order; by using this
option after big changes to the table, you may be able to get higher
performance.
@@ -35465,7 +35805,7 @@ that create tables with references.
@end itemize
Here is an example that shows some of the uses of @code{ALTER TABLE}. We
-begin with a table @code{t1} that is created as shown below:
+begin with a table @code{t1} that is created as shown here:
@example
mysql> CREATE TABLE t1 (a INTEGER,b CHAR(10));
@@ -35535,7 +35875,7 @@ column, the numbers will start from 1 again.
@findex RENAME TABLE
@example
-RENAME TABLE tbl_name TO new_table_name[, tbl_name2 TO new_table_name2,...]
+RENAME TABLE tbl_name TO new_tbl_name[, tbl_name2 TO new_tbl_name2,...]
@end example
The rename is done atomically, which means that no other thread can
@@ -35560,15 +35900,15 @@ As long as two databases are on the same disk you can also rename
from one database to another:
@example
-RENAME TABLE current_database.table_name TO other_database.table_name;
+RENAME TABLE current_db.tbl_name TO other_db.tbl_name;
@end example
When you execute @code{RENAME}, you can't have any locked tables or
-active transactions. You must also have the @code{ALTER} and @code{DROP}
-privilege on the original table and @code{CREATE} and @code{INSERT}
-privilege on the new table.
+active transactions. You must also have the @strong{alter} and @strong{drop}
+privileges on the original table, and the @strong{create} and @strong{insert}
+privileges on the new table.
-If MySQL encounters any errors in a multiple table rename, it
+If MySQL encounters any errors in a multiple-table rename, it
will do a reverse rename for all renamed tables to get everything back
to the original state.
@@ -35628,7 +35968,7 @@ columns.
For @code{CHAR} and @code{VARCHAR} columns, indexes can be created that
use only part of a column, using @code{col_name(length)} syntax. (On
@code{BLOB} and @code{TEXT} columns the length is required.) The
-statement shown below creates an index using the first 10 characters of
+statement shown here creates an index using the first 10 characters of
the @code{name} column:
@example
@@ -35696,14 +36036,14 @@ is issued:
@example
mysql> USE db1;
-mysql> SELECT count(*) FROM mytable; # selects from db1.mytable
+mysql> SELECT COUNT(*) FROM mytable; # selects from db1.mytable
mysql> USE db2;
-mysql> SELECT count(*) FROM mytable; # selects from db2.mytable
+mysql> SELECT COUNT(*) FROM mytable; # selects from db2.mytable
@end example
Making a particular database current by means of the @code{USE} statement
-does not preclude you from accessing tables in other databases. The example
-below accesses the @code{author} table from the @code{db1} database and the
+does not preclude you from accessing tables in other databases. The following example
+accesses the @code{author} table from the @code{db1} database and the
@code{editor} table from the @code{db2} database:
@example
@@ -35732,9 +36072,9 @@ The @code{USE} statement is provided for Sybase compatibility.
@code{DESCRIBE} provides information about a table's columns. @code{col_name}
may be a column name or a string containing the SQL @samp{%} and @samp{_}
-wild-card characters.
+wildcard characters.
-If the column types are different than you expect them to be based on a
+If the column types are different from what you expect them to be based on a
@code{CREATE TABLE} statement, note that MySQL sometimes
changes column types. @xref{Silent column changes}.
@@ -35806,7 +36146,7 @@ rolled back are not stored. @xref{Binary log}.
The following commands automatically end a transaction (as if you had done
a @code{COMMIT} before executing the command):
-@multitable @columnfractions .20 .20 .20
+@multitable @columnfractions .25 .25 .25
@item @strong{Command} @tab @strong{Command} @tab @strong{Command}
@item @code{ALTER TABLE} @tab @code{BEGIN} @tab @code{CREATE INDEX}
@item @code{DROP DATABASE} @tab @code{DROP TABLE} @tab @code{RENAME TABLE}
@@ -35918,13 +36258,13 @@ each SQL statement). This speeds up inserting/updateing/deletes on
If you are using a table handler in MySQL that doesn't support
transactions, you must use @code{LOCK TABLES} if you want to ensure that
no other thread comes between a @code{SELECT} and an @code{UPDATE}. The
-example shown below requires @code{LOCK TABLES} in order to execute safely:
+example shown here requires @code{LOCK TABLES} in order to execute safely:
@example
mysql> LOCK TABLES trans READ, customer WRITE;
-mysql> select sum(value) from trans where customer_id= some_id;
-mysql> update customer set total_value=sum_from_previous_statement
- -> where customer_id=some_id;
+mysql> SELECT SUM(value) FROM trans WHERE customer_id=some_id;
+mysql> UPDATE customer SET total_value=sum_from_previous_statement
+ -> WHERE customer_id=some_id;
mysql> UNLOCK TABLES;
@end example
@@ -35947,7 +36287,7 @@ See @ref{Internal locking}, for more information on locking policy.
You can lock all tables in all databases with read locks with the
@code{FLUSH TABLES WITH READ LOCK} command. @xref{FLUSH}. This is very
-convenient way to get backups if you have a file system, like Veritas,
+convenient way to get backups if you have a filesystem, like Veritas,
that can take snapshots in time.
@strong{NOTE}: @code{LOCK TABLES} is not transaction-safe and will
@@ -35958,26 +36298,26 @@ tables.
@node SET TRANSACTION, , LOCK TABLES, Transactional Commands
@subsection @code{SET TRANSACTION} Syntax
+@findex SET TRANSACTION
@findex ISOLATION LEVEL
@example
SET [GLOBAL | SESSION] TRANSACTION ISOLATION LEVEL
-[READ UNCOMMITTED | READ COMMITTED | REPEATABLE READ | SERIALIZABLE]
+@{ READ UNCOMMITTED | READ COMMITTED | REPEATABLE READ | SERIALIZABLE @}
@end example
Sets the transaction isolation level for the global, whole session or
the next transaction.
-The default behavior is to set the isolation level for the next (not started)
-transaction.
-
-If you set the @code{GLOBAL} privilege it will affect all new created threads.
-You will need the @code{PROCESS} privilege to do do this.
+The default behavior is to set the isolation level for the next (not
+started) transaction. If you use the @code{GLOBAL} keyword, the statement
+sets the default transaction level globally for all new connections
+created from that point on. You will need the @strong{process}
+privilege to do do this. Using the @code{SESSION} keyword sets the
+default transaction level for all future transactions performed on the
+current connection.
-Setting the @code{SESSION} privilege will affect the following and all
-future transactions.
-
-You can set the default isolation level for @code{mysqld} with
+You can set the default global isolation level for @code{mysqld} with
@code{--transaction-isolation=...}. @xref{Command-line options}.
@node Fulltext Search, Query Cache, Transactional Commands, Reference
@@ -36183,6 +36523,9 @@ others, but will not be excluded altogether, as it would be with the
@item *
An asterisk is the truncation operator. Unlike the other operators, it
should be @strong{appended} to the word, not prepended.
+@item "
+The phrase, that is enclosed in double quotes @code{"}, matches only
+rows that contain this phrase @strong{literally, as it was typed}.
@end table
And here are some examples:
@@ -36191,16 +36534,18 @@ And here are some examples:
@item apple banana
find rows that contain at least one of these words.
@item +apple +juice
-... both words
+... both words.
@item +apple macintosh
-... word ``apple'', but rank it higher if it also contain ``macintosh''
+... word ``apple'', but rank it higher if it also contain ``macintosh''.
@item +apple -macintosh
-... word ``apple'' but not ``macintosh''
+... word ``apple'' but not ``macintosh''.
@item +apple +(>pie <strudel)
... ``apple'' and ``pie'', or ``apple'' and ``strudel'' (in any
order), but rank ``apple pie'' higher than ``apple strudel''.
@item apple*
-... ``apple'', ``apples'', ``applesauce'', and ``applet''
+... ``apple'', ``apples'', ``applesauce'', and ``applet''.
+@item "some words"
+... ``some words of wisdom'', but not ``some noise words''.
@end table
@menu
@@ -36244,8 +36589,8 @@ unless you know what you are doing!
@item
The minimum length of words to be indexed is defined by the MySQL
variable @code{ft_min_word_length}. @xref{SHOW VARIABLES}.
-Change it to the value you prefer, and rebuild
-your @code{FULLTEXT} indexes.
+Change it to the value you prefer, and rebuild your @code{FULLTEXT} indexes.
+(This variable is only available from MySQL version 4.0.)
@item
The stopword list is defined in @file{myisam/ft_static.c}
@@ -36264,7 +36609,7 @@ To:
@end example
Then recompile MySQL.
There is no need to rebuild the indexes in this case.
-@strong{Note:} by doing this you @strong{severely} decrease MySQL's ability
+@strong{Note}: by doing this you @strong{severely} decrease MySQL's ability
to provide adequate relevance values for the @code{MATCH()} function.
If you really need to search for such common words, it would be better to
search using @code{IN BOOLEAN MODE} instead, which does not observe the 50%
@@ -36284,16 +36629,14 @@ Still, this variable is read-only, its value is set in
@itemize @bullet
@item Make all operations with @code{FULLTEXT} index @strong{faster}.
-@item Phrase search, proximity operators
-@item Boolean search can work without @code{FULLTEXT} index
-(yes, @strong{very} slow).
+@item Proximity operators
@item Support for "always-index words". They could be any strings
the user wants to treat as words, examples are "C++", "AS/400", "TCP/IP", etc.
@item Support for full-text search in @code{MERGE} tables.
@item Support for multi-byte charsets.
@item Make stopword list to depend of the language of the data.
@item Stemming (dependent of the language of the data, of course).
-@item Generic user-suppliable UDF (?) preparser.
+@item Generic user-suppliable UDF preparser.
@item Make the model more flexible (by adding some adjustable
parameters to @code{FULLTEXT} in @code{CREATE/ALTER TABLE}).
@end itemize
@@ -36325,6 +36668,8 @@ Following are some performance data for the query cache
@item
If you want to disable the query cache code set @code{query_cache_size=0}.
By disabling the query cache code there is no noticeable overhead.
+(query cache can be excluded from code with help of configure option
+@code{--without-query-cache})
@item
If all of the queries you're preforming are simple (such as selecting a
row from a table with one row); but still differ so that the queries can
@@ -36384,21 +36729,31 @@ Transactional @code{InnoDB} tables that have been changed will be invalidated
when a @code{COMMIT} is performed.
A query cannot be cached if it contains one of the functions:
-@multitable @columnfractions .25 .25 .25 .25
-@item @strong{Function} @tab @strong{Function}
- @tab @strong{Function} @tab @strong{Function}
-@item @code{User Defined Functions} @tab @code{CONNECTION_ID}
- @tab @code{FOUND_ROWS} @tab @code{GET_LOCK}
-@item @code{RELEASE_LOCK} @tab @code{LOAD_FILE}
- @tab @code{MASTER_POS_WAIT} @tab @code{NOW}
-@item @code{SYSDATE} @tab @code{CURRENT_TIMESTAMP}
- @tab @code{CURDATE} @tab @code{CURRENT_DATE}
-@item @code{CURTIME} @tab @code{CURRENT_TIME}
- @tab @code{DATABASE} @tab @code{ENCRYPT} (with one parameter)
-@item @code{LAST_INSERT_ID} @tab @code{RAND}
- @tab @code{UNIX_TIMESTAMP} (without parameters) @tab @code{USER}
-@item @code{BENCHMARK} @tab
- @tab @tab
+@multitable @columnfractions .33 .33 .34
+@item @strong{Function}
+ @tab @strong{Function}
+ @tab @strong{Function}
+@item @code{User-Defined Functions}
+ @tab @code{CONNECTION_ID}
+ @tab @code{FOUND_ROWS}
+@item @code{GET_LOCK}
+ @tab @code{RELEASE_LOCK}
+ @tab @code{LOAD_FILE}
+@item @code{MASTER_POS_WAIT}
+ @tab @code{NOW}
+ @tab @code{SYSDATE}
+@item @code{CURRENT_TIMESTAMP}
+ @tab @code{CURDATE}
+ @tab @code{CURRENT_DATE}
+@item @code{CURTIME}
+ @tab @code{CURRENT_TIME}
+ @tab @code{DATABASE}
+@item @code{ENCRYPT} (with one parameter)
+ @tab @code{LAST_INSERT_ID}
+ @tab @code{RAND}
+@item @code{UNIX_TIMESTAMP} (without parameters)
+ @tab @code{USER}
+ @tab @code{BENCHMARK}
@end multitable
Nor can a query be cached if it contains user variables,
@@ -36421,7 +36776,7 @@ tables. If this is not the case, the cached result will not be used.
The query cache adds a few @code{MySQL} system variables for
@code{mysqld} which may be set in a configuration file, on the
-command line when starting @code{mysqld}.
+command-line when starting @code{mysqld}.
@itemize
@item @code{query_cache_limit}
@@ -36629,13 +36984,13 @@ The following is new in @code{MyISAM}:
@itemize @bullet
@item
-There is a flag in the @code{MyISAM} file that indicates whether or not
+There is a flag in the @code{MyISAM} file that indicates whether
the table was closed correctly. If @code{mysqld} is started with
@code{--myisam-recover}, @code{MyISAM} tables will automatically be
checked and/or repaired on open if the table wasn't closed properly.
@item
You can @code{INSERT} new rows in a table that doesn't have free blocks
-in the middle of the data file, at the same time other threads are
+in the middle of the datafile, at the same time other threads are
reading from the table (concurrent insert). An free block can come from
an update of a dynamic length row with much data to a row with less data
or when deleting rows. When all free blocks are used up, all future
@@ -36652,7 +37007,7 @@ mainstream machines). The only area of machines that may not support
binary compatibility are embedded systems (because they sometimes have
peculiar processors).
-There is no big speed penalty in storing data low byte first; The bytes
+There is no big speed penalty in storing data low byte first; the bytes
in a table row is normally unaligned and it doesn't take that much more
power to read an unaligned byte in order than in reverse order. The
actual fetch-column-value code is also not time critical compared to
@@ -36708,7 +37063,7 @@ will be able to use in the near future:
@itemize @bullet
@item
-Support for a true @code{VARCHAR} type; A @code{VARCHAR} column starts
+Support for a true @code{VARCHAR} type; a @code{VARCHAR} column starts
with a length stored in 2 bytes.
@item
Tables with @code{VARCHAR} may have fixed or dynamic record length.
@@ -36724,7 +37079,7 @@ can't search on a @code{UNIQUE} computed index, however.)
Note that index files are usually much smaller with @code{MyISAM} than with
@code{ISAM}. This means that @code{MyISAM} will normally use less
-system resources than @code{ISAM}, but will need more CPU when inserting
+system resources than @code{ISAM}, but will need more CPU time when inserting
data into a compressed index.
The following options to @code{mysqld} can be used to change the behavior of
@@ -36732,7 +37087,7 @@ The following options to @code{mysqld} can be used to change the behavior of
@multitable @columnfractions .40 .60
@item @strong{Option} @tab @strong{Description}
-@item @code{--myisam-recover=#} @tab Automatic recover of crashed tables.
+@item @code{--myisam-recover=#} @tab Automatic recovery of crashed tables.
@item @code{-O myisam_sort_buffer_size=#} @tab Buffer used when recovering tables.
@item @code{--delay-key-write-for-all-tables} @tab Don't flush key buffers between writes for any MyISAM table
@item @code{-O myisam_max_extra_sort_file_size=#} @tab Used to help MySQL to decide when to use the slow but safe key cache index create method. @strong{Note} that this parameter is given in megabytes!
@@ -36751,10 +37106,10 @@ count variable for the table is not 0 and you are running with
The table is checked for errors.
@item
If we found an error, try to do a fast repair (with sorting and without
-re-creating the data file) of the table.
+re-creating the datafile) of the table.
@item
-If the repair fails because of an error in the data file (for example a
-duplicate key error), we try again, but this time we re-create the data file.
+If the repair fails because of an error in the datafile (for example a
+duplicate key error), we try again, but this time we re-create the datafile.
@item
If the repair fails, retry once more with the old repair option method
(write row by row without sorting) which should be able to repair any
@@ -36819,7 +37174,7 @@ high-byte first.
@node MyISAM table formats, MyISAM table problems, Key space, MyISAM
@subsection MyISAM Table Formats
-@strong{MyISAM} supports 3 different table types. Two of them are chosen
+@code{MyISAM} supports 3 different table types. Two of them are chosen
automatically depending on the type of columns you are using. The third,
compressed tables, can only be created with the @code{myisampack} tool.
@@ -37105,7 +37460,7 @@ Many @code{mysqld} servers are using the table and one has done a
@code{REPAIR} or @code{CHECK} of the table while it was in use by
another server. In this setup the @code{CHECK} is safe to do (even if
you will get the warning from other servers), but @code{REPAIR} should
-be avoided as it currently replaces the data file with a new one, which
+be avoided as it currently replaces the datafile with a new one, which
is not signaled to the other servers.
@end itemize
@@ -37130,9 +37485,9 @@ will only clear the mapping for the table, not delete everything in the
mapped tables. (We plan to fix this in 4.1).
With identical tables we mean that all tables are created with identical
-column and key information. You can't put a MERGE over tables where the
-columns are packed differently, doesn't have exactly the same columns or
-have the keys in different order. Some of the tables can however be
+column and key information. You can't merge tables in which the
+columns are packed differently, doesn't have exactly the same columns,
+or have the keys in different order. However, some of the tables can be
compressed with @code{myisampack}. @xref{myisampack, , @code{myisampack}}.
When you create a @code{MERGE} table, you will get a @file{.frm} table
@@ -37141,8 +37496,8 @@ contains a list of the index files (@file{.MYI} files) that should
be used as one. All used tables must be in the same database as the
@code{MERGE} table itself.
-For the moment you need to have @code{SELECT}, @code{UPDATE}, and
-@code{DELETE} privileges on the tables you map to a @code{MERGE} table.
+For the moment, you need to have @strong{select}, @strong{update}, and
+@strong{delete} privileges on the tables you map to a @code{MERGE} table.
@code{MERGE} tables can help you solve the following problems:
@@ -37160,7 +37515,7 @@ kind of benefits.)
@item
Do more efficient searches. If you know exactly what you are looking
after, you can search in just one of the split tables for some queries
-and use @strong{MERGE} table for others. You can even have many
+and use @code{MERGE} table for others. You can even have many
different @code{MERGE} tables active, with possible overlapping files.
@item
More efficient repairs. It's easier to repair the individual files that
@@ -37176,11 +37531,12 @@ If you have a set of tables that you join to a big table on demand or
batch, you should instead create a @code{MERGE} table on them on demand.
This is much faster and will save a lot of disk space.
@item
-Go around the file size limit for the operating system.
+Go around the file-size limit for the operating system.
@item
-You can create an alias/synonym for a table by just using MERGE over one
-table. There shouldn't be any really notable performance impacts of doing this
-(only a couple of indirect calls and memcpy's for each read).
+You can create an alias/synonym for a table by just using @code{MERGE}
+over one table. There shouldn't be any really notable performance
+impacts of doing this (only a couple of indirect calls and @code{memcpy()}
+calls for each read).
@end itemize
The disadvantages with @code{MERGE} tables are:
@@ -37194,8 +37550,8 @@ You can only use identical @code{MyISAM} tables for a @code{MERGE} table.
@code{REPLACE} doesn't work.
@item
@code{MERGE} tables uses more file descriptors. If you are using a
-@strong{MERGE} that maps over 10 tables and 10 users are using this, you
-are using 10*10 + 10 file descriptors. (10 data files for 10 users
+@code{MERGE} that maps over 10 tables and 10 users are using this, you
+are using 10*10 + 10 file descriptors. (10 datafiles for 10 users
and 10 shared index files.)
@item
Key reads are slower. When you do a read on a key, the @code{MERGE}
@@ -37249,7 +37605,7 @@ shell> mysqladmin flush-tables
Now you can do things like:
@example
-mysql> select * from total;
+mysql> SELECT * FROM total;
+---+---------+
| a | message |
+---+---------+
@@ -37382,7 +37738,7 @@ without overflow areas. There is no extra space needed for free lists.
normally is common with hashed tables:
@example
-mysql> CREATE TABLE test TYPE=HEAP SELECT ip,SUM(downloads) as down
+mysql> CREATE TABLE test TYPE=HEAP SELECT ip,SUM(downloads) AS down
-> FROM log_table GROUP BY ip;
mysql> SELECT COUNT(ip),AVG(down) FROM test;
mysql> DROP TABLE test;
@@ -37461,7 +37817,7 @@ SUM_OVER_ALL_KEYS(max_length_of_key + sizeof(char*) * 2)
* InnoDB transaction model:: InnoDB Transaction Model.
* Implementation:: Implementation of Multi-versioning
* Table and index:: Table and Index Structures
-* File space management:: File Space Management and Disk i/o
+* File space management:: File Space Management and Disk I/O
* Error handling:: Error Handling
* InnoDB restrictions:: Restrictions on InnoDB Tables
* InnoDB contact information:: InnoDB Contact Information.
@@ -37497,7 +37853,7 @@ memory. InnoDB stores its tables and indexes in a tablespace, which
may consist of several files. This is different from, for example,
MyISAM tables where each table is stored as a separate file.
InnoDB tables can be of any size also on those operating
-systems where file size is limited to 2 GB.
+systems where file-size is limited to 2 GB.
You can find the latest information about InnoDB at
@uref{http://www.innodb.com/}. The most up-to-date version of the
@@ -37550,7 +37906,7 @@ innodb_data_file_path=ibdata:30M
@end example
but to get good performance it is best that you specify options
-like recommended below in the section 'InnoDB startup options'.
+as recommended. @xref{InnoDB start}.
InnoDB is distributed under the GNU GPL License Version 2 (of June 1991).
In the source distribution of MySQL, InnoDB appears as a subdirectory.
@@ -37570,27 +37926,27 @@ At the minimum, in 3.23 you must specify @code{innodb_data_file_path}.
In MySQL-4.0 you do not need to specify even
@code{innodb_data_file_path}: the default for it is to create
an auto-extending 16 MB file @file{ibdata1} to the @code{datadir}
-of MySQL. (In MySQL-4.0.0 and 4.0.1 the data file is 64 MB and not
+of MySQL. (In MySQL-4.0.0 and 4.0.1 the datafile is 64 MB and not
auto-extending.)
But to get good performance you MUST explicitly set the InnoDB parameters
-listed below in the examples.
+listed in the following examples.
Starting from versions 3.23.50 and 4.0.2 InnoDB allows the last
-data file on the @code{innodb_data_file_path} line
+datafile on the @code{innodb_data_file_path} line
to be specified as @strong{auto-extending}. The syntax for
@code{innodb_data_file_path} is then the following:
@example
pathtodatafile:sizespecification;pathtodatafile:sizespecification;...
... ;pathtodatafile:sizespecification[:autoextend[:max:sizespecification]]
@end example
-If you specify the last data file with the autoextend option, InnoDB
-will extend the last data file if it runs out of free space in the
+If you specify the last datafile with the autoextend option, InnoDB
+will extend the last datafile if it runs out of free space in the
tablespace. The increment is 8 MB at a time. An example:
@example
innodb_data_file_path = /ibdata/ibdata1:100M:autoextend
@end example
-instructs InnoDB to create just a single data file whose initial size is
+instructs InnoDB to create just a single datafile whose initial size is
100 MB and which is extended in 8 MB blocks when space runs out.
If the disk becomes full you may want to add another data
file to another disk, for example. Then you have to look the size
@@ -37598,20 +37954,20 @@ of @file{ibdata1}, round the size downward to
the closest multiple of 1024 * 1024 bytes (= 1 MB), and specify
the rounded size of @file{ibdata1} explicitly in
@code{innodb_data_file_path}.
-After that you can add another data file:
+After that you can add another datafile:
@example
innodb_data_file_path = /ibdata/ibdata1:988M;/disk2/ibdata2:50M:autoextend
@end example
-Be cautious on file systems where the maximum file size is 2 GB!
-InnoDB is not aware of the OS maximum file size. On those file systems
-you might want to specify the max size for the data file:
+Be cautious on filesystems where the maximum file-size is 2 GB!
+InnoDB is not aware of the OS maximum file-size. On those filesystems
+you might want to specify the max size for the datafile:
@example
innodb_data_file_path = /ibdata/ibdata1:100M:autoextend:max:2000M
@end example
Suppose you have a Windows NT computer with 128 MB RAM and a
single 10 GB hard disk.
-Below is an example of possible configuration parameters in
+Following is an example of possible configuration parameters in
@file{my.cnf} or @file{my.ini} for InnoDB:
@example
@@ -37620,7 +37976,7 @@ Below is an example of possible configuration parameters in
# ...
#
innodb_data_home_dir = c:\ibdata
-# Data files must be able to
+# Datafiles must be able to
# hold your data and indexes
innodb_data_file_path = ibdata1:2000M;ibdata2:2000M
# Set buffer pool size to 50 - 80 %
@@ -37633,7 +37989,7 @@ innodb_log_group_home_dir = c:\iblogs
innodb_log_arch_dir = c:\iblogs
innodb_log_archive=0
set-variable = innodb_log_files_in_group=3
-# Set the log file size to about
+# Set the log file-size to about
# 15 % of the buffer pool size
set-variable = innodb_log_file_size=10M
set-variable = innodb_log_buffer_size=8M
@@ -37645,20 +38001,20 @@ set-variable = innodb_file_io_threads=4
set-variable = innodb_lock_wait_timeout=50
@end example
-Note that @strong{InnoDB does not create directories:
-you have to create them yourself.}
+Note that @code{InnoDB} @strong{does not create directories:
+you must create them yourself.}
Use the Unix or MS-DOS @code{mkdir} command to create
the data and log group home directories.
Check also that the MySQL server
has @strong{the rights to create files} in the directories you specify.
-Note that data files must be < 2G in
-some file systems! The combined size of data files
+Note that datafiles must be < 2G in
+some filesystems! The combined size of datafiles
must be >= 10 MB.
The combined size of the log files must be < 4G.
If you do not specify @code{innodb_data_home_dir}, then
-the default is that InnoDB creates its data files to the
+the default is that InnoDB creates its datafiles to the
@code{datadir} of MySQL. Then you cannot use absolute
file paths in @code{innodb_data_file_path}.
@@ -37671,8 +38027,8 @@ For example, in Windows you can start @file{mysqld-max.exe} with:
@example
your-path-to-mysqld>mysqld-max --standalone --console
@end example
-See the manual section `Creating an InnoDB database' about what
-the printout should look like.
+For information about what the printout should look like,
+see @ref{InnoDB init}.
@strong{Where to put @file{my.cnf} or @file{my.ini} in Windows?}
The rules for Windows are the following:
@@ -37710,7 +38066,7 @@ option to the server:
Suppose you have a Linux computer with 512 MB RAM and
three 20 GB hard disks (at directory paths @file{`/'},
@file{`/dr2'} and @file{`/dr3'}).
-Below is an example of possible configuration parameters
+Here is an example of possible configuration parameters
in @file{my.cnf} for
InnoDB:
@@ -37720,7 +38076,7 @@ InnoDB:
# ...
#
innodb_data_home_dir = /
-# Data files must be able to
+# Datafiles must be able to
# hold your data and indexes
innodb_data_file_path = ibdata/ibdata1:2000M;dr2/ibdata/ibdata2:2000M
# Set buffer pool size to 50 - 80 %
@@ -37735,7 +38091,7 @@ innodb_log_group_home_dir = /dr3/iblogs
innodb_log_arch_dir = /dr3/iblogs
innodb_log_archive=0
set-variable = innodb_log_files_in_group=3
-# Set the log file size to about
+# Set the log file-size to about
# 15 % of the buffer pool size
set-variable = innodb_log_file_size=50M
set-variable = innodb_log_buffer_size=8M
@@ -37750,22 +38106,22 @@ set-variable = innodb_lock_wait_timeout=50
#set-variable = innodb_thread_concurrency=5
@end example
-Note that we have placed the two data files on different disks.
+Note that we have placed the two datafiles on different disks.
The reason for the name @code{innodb_data_file_path} is that
-you can also specify paths to your data files, and
+you can also specify paths to your datafiles, and
@code{innodb_data_home_dir} is just textually catenated
-before your data file paths, adding a possible slash or
+before your datafile paths, adding a possible slash or
backslash in between. InnoDB will fill the tablespace
-formed by the data files from bottom up. In some cases it will
+formed by the datafiles from bottom up. In some cases it will
improve the performance of the database if all data is not placed
on the same physical disk. Putting log files on a different disk from
data is very often beneficial for performance.
You can also use @strong{raw disk partitions} (raw devices)
-as data files. In some Unixes
-they speed up i/o. See the manual section on InnoDB file space management
+as datafiles. In some Unixes
+they speed up I/O. See the manual section on InnoDB file space management
about how to specify them in @file{my.cnf}.
-@strong{Warning:} on Linux x86 you must be careful you @strong{do not set memory usage
+@strong{Warning}: on Linux x86 you must be careful you @strong{do not set memory usage
too high}. glibc will allow the process heap to grow over thread stacks,
which will crash your server. It is a risk if the value of
@example
@@ -37800,19 +38156,19 @@ parameter format: @code{set-variable = innodb... = 123}, others
The meanings of the configuration parameters are the following:
-@multitable @columnfractions .30 .70
+@multitable @columnfractions .35 .65
@item @strong{Option} @tab @strong{Description}
@item @code{innodb_data_home_dir} @tab
-The common part of the directory path for all InnoDB data files.
+The common part of the directory path for all InnoDB datafiles.
The default for this parameter is the @code{datadir} of MySQL.
@item @code{innodb_data_file_path} @tab
-Paths to individual data files and their sizes. The full directory path
-to each data file is acquired by concatenating innodb_data_home_dir to
-the paths specified here. The file sizes are specified in megabytes,
+Paths to individual datafiles and their sizes. The full directory path
+to each datafile is acquired by concatenating innodb_data_home_dir to
+the paths specified here. The file-sizes are specified in megabytes,
hence the 'M' after the size specification above.
InnoDB also understands the abbreviation 'G', 1G meaning 1024M.
Starting from
-3.23.44 you can set the file size bigger than 4 GB on those
+3.23.44 you can set the file-size bigger than 4 GB on those
operating systems which support big files.
On some operating systems files must be < 2 GB.
The sum of the sizes of the files must be at least 10 MB.
@@ -37830,7 +38186,7 @@ from 1M to 1/nth of the size of the buffer pool specified below,
where n is the number of log files in the group. The
bigger the value,
the less checkpoint flush activity is needed in the buffer pool,
-saving disk i/o. But bigger log files also mean that recovery will be
+saving disk I/O. But bigger log files also mean that recovery will be
slower in case of a crash. The combined size of log files must
be < 4 GB on 32-bit computers.
@item @code{innodb_log_buffer_size} @tab
@@ -37838,13 +38194,13 @@ The size of the buffer which InnoDB uses to write log to the log files
on disk. Sensible values range from 1M to half the combined size of log
files. A big log buffer allows large transactions to run without a need
to write the log to disk until the transaction commit. Thus, if you have
-big transactions, making the log buffer big will save disk i/o.
+big transactions, making the log buffer big will save disk I/O.
@item @code{innodb_flush_log_at_trx_commit} @tab
Normally this is set to 1, meaning that at a transaction commit the log
is flushed to disk, and the modifications made by the transaction become
permanent, and survive a database crash. If you are willing to
compromise this safety, and you are running small transactions, you may
-set this to 0 to reduce disk i/o to the logs.
+set this to 0 to reduce disk I/O to the logs.
@item @code{innodb_log_arch_dir} @tab
The directory where fully written log files would be archived if we used
log archiving. The value of this parameter should currently be set the
@@ -37855,7 +38211,7 @@ done by MySQL using its own log files, there is currently no need to
archive InnoDB log files.
@item @code{innodb_buffer_pool_size} @tab
The size of the memory buffer InnoDB uses to cache data and indexes of
-its tables. The bigger you set this the less disk i/o is needed to
+its tables. The bigger you set this the less disk I/O is needed to
access data in tables. On a dedicated database server you may set this
parameter up to 80 % of the machine physical memory size. Do not set it
too large, though, because competition of the physical memory may cause
@@ -37868,8 +38224,8 @@ need to allocate here. If InnoDB runs out of memory in this pool, it
will start to allocate memory from the operating system, and write
warning messages to the MySQL error log.
@item @code{innodb_file_io_threads} @tab
-Number of file i/o threads in InnoDB. Normally, this should be 4, but
-on Windows disk i/o may benefit from a larger number.
+Number of file I/O threads in InnoDB. Normally, this should be 4, but
+on Windows disk I/O may benefit from a larger number.
@item @code{innodb_lock_wait_timeout} @tab
Timeout in seconds an InnoDB transaction may wait for a lock before
being rolled back. InnoDB automatically detects transaction deadlocks
@@ -37891,22 +38247,22 @@ Another option is @code{O_DSYNC}.
Suppose you have installed MySQL and have edited @file{my.cnf} so that
it contains the necessary InnoDB configuration parameters.
Before starting MySQL you should check that the directories you have
-specified for InnoDB data files and log files exist and that you have
+specified for InnoDB datafiles and log files exist and that you have
access rights to those directories. InnoDB
cannot create directories, only files. Check also you have enough disk space
for the data and log files.
-When you now start MySQL, InnoDB will start creating your data files
+When you now start MySQL, InnoDB will start creating your datafiles
and log files. InnoDB will print something like the following:
@example
~/mysqlm/sql > mysqld
-InnoDB: The first specified data file /home/heikki/data/ibdata1
+InnoDB: The first specified datafile /home/heikki/data/ibdata1
did not exist:
InnoDB: a new database to be created!
InnoDB: Setting file /home/heikki/data/ibdata1 size to 134217728
InnoDB: Database physically writes the file full: wait...
-InnoDB: Data file /home/heikki/data/ibdata2 did not exist:
+InnoDB: datafile /home/heikki/data/ibdata2 did not exist:
new to be created
InnoDB: Setting file /home/heikki/data/ibdata2 size to 262144000
InnoDB: Database physically writes the file full: wait...
@@ -37935,7 +38291,7 @@ InnoDB: Starting shutdown...
InnoDB: Shutdown completed
@end example
-You can now look at the data files and logs directories and you
+You can now look at the datafiles and logs directories and you
will see the files created. The log directory will also contain
a small file named @file{ib_arch_log_0000000000}. That file
resulted from the database creation, after which InnoDB switched off
@@ -37966,14 +38322,14 @@ directories.
@item @file{mysqld} does not read the right @file{my.cnf} or @file{my.ini}
file, and consequently does not see the options you specified.
@item The disk is full or a disk quota is exceeded.
-@item You have created a subdirectory whose name is equal to a data file
+@item You have created a subdirectory whose name is equal to a datafile
you specified.
@item There is a syntax error in @code{innodb_data_home_dir}
or @code{innodb_data_file_path}.
@end itemize
If something goes wrong in an InnoDB database creation, you should
-delete all files created by InnoDB. This means all data files, all log
+delete all files created by InnoDB. This means all datafiles, all log
files, the small archived log file, and in the case you already did
create some InnoDB tables, delete also the corresponding @file{.frm}
files for these tables from the MySQL database
@@ -37993,7 +38349,7 @@ CREATE TABLE CUSTOMER (A INT, B CHAR (20), INDEX (A)) TYPE = InnoDB;
@end example
This SQL command will create a table and an index on column @code{A}
-into the InnoDB tablespace consisting of the data files you specified
+into the InnoDB tablespace consisting of the datafiles you specified
in @file{my.cnf}. In addition MySQL will create a file
@file{CUSTOMER.frm} to the MySQL database directory @file{test}.
Internally, InnoDB will add to its own data dictionary an entry
@@ -38037,7 +38393,7 @@ After all data has been inserted you can rename the tables.
During the conversion of big tables you should set the InnoDB
buffer pool size big
-to reduce disk i/o. Not bigger than 80 % of the physical memory, though.
+to reduce disk I/O. Not bigger than 80 % of the physical memory, though.
You should set InnoDB log files big, and also the log buffer large.
Make sure you do not run out of tablespace: InnoDB tables take a lot
@@ -38045,7 +38401,7 @@ more space than MyISAM tables. If an @code{ALTER TABLE} runs out
of space, it will start a rollback, and that can take hours if it is
disk-bound.
In inserts InnoDB uses the insert buffer to merge secondary index records
-to indexes in batches. That saves a lot of disk i/o. In rollback no such
+to indexes in batches. That saves a lot of disk I/O. In rollback no such
mechanism is used, and the rollback can take 30 times longer than the
insertion.
@@ -38053,7 +38409,7 @@ In the case of a runaway rollback, if you do not have valuable data in your
database,
it is better that you kill the database process and delete all InnoDB data
and log files and all InnoDB table @file{.frm} files, and start
-your job again, rather than wait for millions of disk i/os to complete.
+your job again, rather than wait for millions of disk I/Os to complete.
@subsubsection Foreign Key Constraints
@@ -38064,22 +38420,49 @@ constraints to guard the integrity of your data.
The syntax of a foreign key constraint definition in InnoDB:
@example
FOREIGN KEY (index_col_name, ...)
- REFERENCES table_name (index_col_name, ...)
+ REFERENCES table_name (index_col_name, ...)
+ [ON DELETE CASCADE | ON DELETE SET NULL]
@end example
+Both tables have to be InnoDB type and @strong{there must be an index
+where the foreign key and the referenced key are listed as the first
+columns}. InnoDB does not auto-create indexes on foreign keys or
+referenced keys: you have to create them explicitly.
+
+Corresponding columns in the foreign key
+and the referenced key must have similar internal data types
+inside InnoDB so that they can be compared without a type
+conversion.
+The size and the signedness of integer types has to be the same.
+The length of string types need not be the same.
+
+Starting from version 3.23.50 you can also associate the
+@code{ON DELETE CASCADE} or @code{ON DELETE SET NULL}
+clause with the foreign key constraint.
+
+If @code{ON DELETE CASCADE} is specified, and a row in the parent
+table is deleted, then InnoDB automatically deletes also all those rows
+in the child table whose foreign key values are equal to
+the referenced key value in the parent row. If @code{ON DELETE SET NULL}
+is specified, the child rows are automatically updated so that the
+columns in the foreign key are set to the SQL NULL value.
+
+Starting from version 3.23.50, InnoDB does not check foreign key
+constraints on those foreign key or referenced key values
+which contain a NULL column.
+
Starting from version 3.23.50 the InnoDB parser allows you to
use backquotes (`) around table and column names in the above
-definition.
+definition but the InnoDB parser is not yet aware of possible
+variable @code{lower_case_table_names} you give in @file{my.cnf}.
An example:
@example
CREATE TABLE parent(id INT NOT NULL, PRIMARY KEY (id)) TYPE=INNODB;
CREATE TABLE child(id INT, parent_id INT, INDEX par_ind (parent_id),
- FOREIGN KEY (parent_id) REFERENCES parent(id)) TYPE=INNODB;
+ FOREIGN KEY (parent_id) REFERENCES parent(id)
+ ON DELETE SET NULL
+) TYPE=INNODB;
@end example
-Both tables have to be InnoDB type and @strong{there must be an index
-where the foreign key and the referenced key are listed as the first
-columns}. InnoDB does not auto-create indexes on foreign keys or
-referenced keys: you have to create them explicitly.
If MySQL gives the error number 1005 from a @code{CREATE TABLE}
statement, and the error message string refers to errno 150, then
@@ -38097,10 +38480,6 @@ ALTER TABLE yourtablename
@end example
Remember to create the required indexes first, though.
-Starting from version 3.23.50, InnoDB does not check foreign key
-constraints on those foreign key or referenced key values
-which contain a NULL column.
-
In InnoDB versions < 3.23.50 @code{ALTER TABLE}
or @code{CREATE INDEX}
should not be used in connection with tables which have foreign
@@ -38116,12 +38495,6 @@ A @code{CREATE INDEX} statement is in MySQL
processed as an @code{ALTER TABLE}, and these
restrictions apply also to it.
-Corresponding columns in the foreign key
-and the referenced key must have similar internal data types
-inside InnoDB so that they can be compared without a type
-conversion. The length of string types need not be the same.
-The size and the signedness of integer types has to be the same.
-
When doing foreign key checks InnoDB sets shared row
level locks on child or parent records it has to look at.
InnoDB checks foreign key constraints immediately: the check
@@ -38162,13 +38535,13 @@ or other special options on the constraints.
@node Adding and removing, Backing up, Using InnoDB tables, InnoDB
@subsection Adding and Removing InnoDB Data and Log Files
-You cannot increase the size of an InnoDB data file. To add more into
-your tablespace you have to add a new data file. To do this you have to
+You cannot increase the size of an InnoDB datafile. To add more into
+your tablespace you have to add a new datafile. To do this you have to
shut down your MySQL database, edit the @file{my.cnf} file, adding a
new file to @code{innodb_data_file_path}, and then start MySQL
again.
-Currently you cannot remove a data file from InnoDB. To decrease the
+Currently you cannot remove a datafile from InnoDB. To decrease the
size of your database you have to use @file{mysqldump} to dump
all your tables, create a new database, and import your tables to the
new database.
@@ -38204,7 +38577,7 @@ a 'binary' backup of your database you have to do the following:
@item
Shut down your MySQL database and make sure it shuts down without errors.
@item
-Copy all your data files into a safe place.
+Copy all your datafiles into a safe place.
@item
Copy all your InnoDB log files to a safe place.
@item
@@ -38214,7 +38587,7 @@ Copy all the @file{.frm} files for your InnoDB tables into a
safe place.
@end itemize
-There is currently no on-line or incremental backup tool available for
+There is currently no online or incremental backup tool available for
InnoDB, though they are in the TODO list.
In addition to taking the binary backups described above,
@@ -38307,7 +38680,7 @@ has to make a checkpoint and often this involves flushing of
modified database pages to disk.
The above explains why making your log files very big may save
-disk i/o in checkpointing. It can make sense to set
+disk I/O in checkpointing. It can make sense to set
the total size of the log files as big as the buffer pool or even bigger.
The drawback in big log files is that crash recovery can last longer
because there will be more log to apply to the database.
@@ -38317,14 +38690,14 @@ because there will be more log to apply to the database.
@subsection Moving an InnoDB Database to Another Machine
InnoDB data and log files are binary-compatible on all platforms
-if the floating point number format on the machines is the same.
+if the floating-point number format on the machines is the same.
You can move an InnoDB database simply by copying all the relevant
files, which we already listed in the previous section on backing up
-a database. If the floating point formats on the machines are
+a database. If the floating-point formats on the machines are
different but you have not used @code{FLOAT} or @code{DOUBLE}
data types in your tables then the procedure is the same: just copy
the relevant files. If the formats are different and your tables
-contain floating point data, you have to use @file{mysqldump}
+contain floating-point data, you have to use @file{mysqldump}
and @file{mysqlimport} to move those tables.
A performance tip is to switch off the auto commit when you import
@@ -38559,11 +38932,12 @@ constraint fails, InnoDB sets these locks.
@code{LOCK TABLES ... } : sets table locks. In the implementation
the MySQL layer of code sets these locks. The automatic deadlock detection
of InnoDB cannot detect deadlocks where such table locks are involved:
-see the next section below. See also section 13 'InnoDB restrictions'
-about the following: since MySQL does know about row level locks,
+see the following section.
+Also, since MySQL does know about row level locks,
it is possible that you
get a table lock on a table where another user currently has row level
locks. But that does not put transaction integerity into danger.
+@xref{InnoDB restrictions}.
@end itemize
@@ -38603,7 +38977,7 @@ This is called multi-versioned concurrency control.
@example
User A User B
- set autocommit=0; set autocommit=0;
+ SET AUTOCOMMIT=0; SET AUTOCOMMIT=0;
time
| SELECT * FROM t;
| empty set
@@ -38626,10 +39000,10 @@ v SELECT * FROM t;
Thus user A sees the row inserted by B only when B has committed the
insert, and A has committed his own transaction so that the timepoint
-is advanced past the the commit of B.
+is advanced past the commit of B.
-If you want to see the 'freshest' state of the database, you should use
-a locking read:
+If you want to see the ``freshest'' state of the database, you should
+use a locking read:
@example
SELECT * FROM t LOCK IN SHARE MODE;
@@ -38684,22 +39058,22 @@ to @code{O_DSYNC}, though O_DSYNC seems to be slower on most systems.
Put before your plain SQL import file line
@example
-set autocommit=0;
+SET AUTOCOMMIT=0;
@end example
and after it
@example
-commit;
+COMMIT;
@end example
If you use the @file{mysqldump} option @code{--opt}, you will get dump
files which are fast to import also to an InnoDB table, even without wrapping
-them to the above @code{set autocommit=0; ... commit;} wrappers.
+them to the above @code{SET AUTOCOMMIT=0; ... COMMIT;} wrappers.
@strong{8.}
Beware of big rollbacks of mass inserts: InnoDB uses the insert buffer
-to save disk i/o in inserts, but in a corresponding rollback no such
+to save disk I/O in inserts, but in a corresponding rollback no such
mechanism is used. A disk-bound rollback can take 30 times the time
of the corresponding insert. Killing the database process will not
help because the rollback will start again at the database startup. The
@@ -38750,7 +39124,7 @@ lock waits of a transactions,
@item
semaphore waits of threads,
@item
-pending file i/o requests,
+pending file I/O requests,
@item
buffer pool statistics, and
@item
@@ -38866,18 +39240,18 @@ Section SYNC ARRAY INFO reports threads waiting
for a semaphore and statistics on how many times
threads have needed a spin or a wait on a mutex or
a rw-lock semaphore. A big number of threads waiting
-for semaphores may be a result of disk i/o, or
+for semaphores may be a result of disk I/O, or
contention problems inside InnoDB. Contention can be
due to heavy parallelism of queries, or problems in
operating system thread scheduling.
@item
Section CURRENT PENDING FILE I/O'S lists pending
-file i/o requests. A large number of these indicates
-that the workload is disk i/o -bound.
+file I/O requests. A large number of these indicates
+that the workload is disk I/O-bound.
@item
Section BUFFER POOL gives you statistics
on pages read and written. You can calculate from these
-numbers how many data file i/o's your queries are
+numbers how many datafile I/Os your queries are
currently doing.
@end itemize
@@ -38964,7 +39338,7 @@ Accessing a row through the clustered index is fast, because
the row data will be on the same page where the index search
leads us. In many databases the data is traditionally stored on a different
page from the index record. If a table is large, the clustered
-index architecture often saves a disk i/o when compared to the
+index architecture often saves a disk I/O when compared to the
traditional solution.
The records in non-clustered indexes (we also call them secondary indexes),
@@ -39007,7 +39381,7 @@ clustered index do not require random reads from a disk.
On the other hand, secondary indexes are usually non-unique and
insertions happen in a relatively random order into secondary indexes.
-This would cause a lot of random disk i/o's without a special mechanism
+This would cause a lot of random disk I/Os without a special mechanism
used in InnoDB.
If an index record should be inserted to a non-unique secondary index,
@@ -39020,7 +39394,7 @@ pool, and insertions can be made to it very fast.
The insert buffer is periodically merged to the secondary index
trees in the database. Often we can merge several insertions on the
-same page in of the index tree, and hence save disk i/o's.
+same page in of the index tree, and hence save disk I/Os.
It has been measured that the insert buffer can speed up insertions
to a table up to 15 times.
@@ -39080,7 +39454,7 @@ table @code{T}
where an auto-increment column has been defined, and the user does not provide
an explicit value for the column, then InnoDB executes @code{SELECT
MAX(auto-inc-column) FROM T}, and assigns that value incremented
-by one to the the column and the auto-increment counter of the table.
+by one to the column and the auto-increment counter of the table.
We say that
the auto-increment counter for table @code{T} has been initialised.
@@ -39108,27 +39482,27 @@ integer that can be stored in the specified integer type.
@node File space management, Error handling, Table and index, InnoDB
-@subsection File Space Management and Disk i/o
+@subsection File Space Management and Disk I/O
@menu
-* InnoDB Disk i/o:: Disk i/o
+* InnoDB Disk I/O:: Disk I/O
* InnoDB File space:: File Space Management
* InnoDB File Defragmenting:: Defragmenting a Table
@end menu
-@node InnoDB Disk i/o, InnoDB File space, File space management, File space management
-@subsubsection Disk i/o
+@node InnoDB Disk I/O, InnoDB File space, File space management, File space management
+@subsubsection Disk I/O
-In disk i/o InnoDB uses asynchronous i/o. On Windows NT
-it uses the native asynchronous i/o provided by the operating system.
-On Unix, InnoDB uses simulated asynchronous i/o built
-into InnoDB: InnoDB creates a number of i/o threads to take care
-of i/o operations, such as read-ahead. In a future version we will
+In disk I/O InnoDB uses asynchronous I/O. On Windows NT
+it uses the native asynchronous I/O provided by the operating system.
+On Unix, InnoDB uses simulated asynchronous I/O built
+into InnoDB: InnoDB creates a number of I/O threads to take care
+of I/O operations, such as read-ahead. In a future version we will
add support for simulated aio on Windows NT and native aio on those
versions of Unix which have one.
-On Windows NT InnoDB uses non-buffered i/o. That means that the disk
+On Windows NT InnoDB uses non-buffered I/O. That means that the disk
pages InnoDB reads or writes are not buffered in the operating system
file cache. This saves some memory bandwidth.
@@ -39138,19 +39512,19 @@ It adds safety to crash recovery after an operating system crash
or a power outage, and improves performance on most Unix flavors
by reducing the need for fsync operations.
-Doublewrite means that InnoDB before writing pages to a data file
+Doublewrite means that InnoDB before writing pages to a datafile
first writes them to a contiguous tablespace area called the
doublewrite buffer. Only after the write and the flush to the doublewrite
buffer has completed, InnoDB writes the pages to their proper
-positions in the data file. If the operating system crashes in the
+positions in the datafile. If the operating system crashes in the
middle of a page write, InnoDB will in recovery find a good
copy of the page from the doublewrite buffer.
Starting from 3.23.41
-you can also use a raw disk partition as a data file, though this has
-not been tested yet. When you create a new data file you have
+you can also use a raw disk partition as a datafile, though this has
+not been tested yet. When you create a new datafile you have
to put the keyword @code{newraw} immediately after the data
-file size in @code{innodb_data_file_path}. The partition must be
+file-size in @code{innodb_data_file_path}. The partition must be
>= than you specify as the size. Note that 1M in InnoDB is
1024 x 1024 bytes, while in disk specifications 1 MB usually means
1000 000 bytes.
@@ -39160,29 +39534,29 @@ innodb_data_file_path=hdd1:5Gnewraw;hdd2:2Gnewraw
@end example
When you start the database again you @strong{must} change the keyword
-to @code{raw}. Otherwise InnoDB will write over your
+to @code{raw}. Otherwise, InnoDB will write over your
partition!
@example
innodb_data_file_path=hdd1:5Graw;hdd2:2Graw
@end example
-By using a raw disk you can on some Unixes perform unbuffered i/o.
+By using a raw disk you can on some Unixes perform unbuffered I/O.
There are two read-ahead heuristics in InnoDB: sequential read-ahead
and random read-ahead. In sequential read-ahead InnoDB notices that
the access pattern to a segment in the tablespace is sequential.
Then InnoDB will post in advance a batch of reads of database pages to the
-i/o system. In random read-ahead InnoDB notices that some area
+I/O system. In random read-ahead InnoDB notices that some area
in a tablespace seems to be in the process of being
fully read into the buffer pool. Then InnoDB posts the remaining
-reads to the i/o system.
+reads to the I/O system.
-@node InnoDB File space, InnoDB File Defragmenting, InnoDB Disk i/o, File space management
+@node InnoDB File space, InnoDB File Defragmenting, InnoDB Disk I/O, File space management
@subsubsection File Space Management
-The data files you define in the configuration file form the tablespace
+The datafiles you define in the configuration file form the tablespace
of InnoDB. The files are simply catenated to form the tablespace,
there is no striping in use.
Currently you cannot directly instruct where the space is allocated
@@ -39212,10 +39586,9 @@ allocated to segments as a whole, but only as individual pages.
When you issue a query @code{SHOW TABLE STATUS FROM ... LIKE ...}
to ask for available free space in the tablespace, InnoDB will
-report you the space which is certainly usable in totally free extents
-of the tablespace. InnoDB always reserves some extents for
-clean-up and other internal purposes; these reserved extents are not
-included in the free space.
+report the extents which are definitely free in the tablespace.
+InnoDB always reserves some extents for clean-up and other internal
+purposes; these reserved extents are not included in the free space.
When you delete data from a table, InnoDB will contract the corresponding
B-tree indexes. It depends on the pattern of deletes if that frees
@@ -39246,7 +39619,7 @@ Note that a @code{MyISAM} table must fit in a single file
on your operating system.
If the insertions to and index are always ascending and
-records are deleted only from the end, then the the file space management
+records are deleted only from the end, then the file space management
algorithm of InnoDB guarantees that fragmentation in the index will
not occur.
@@ -39290,8 +39663,8 @@ they roll back the corresponding SQL statement.
@itemize @bullet
@item
-@strong{WARNING:} Do @strong{NOT} convert MySQL system tables from
-MyISAM TO InnoDB tables! This is not supported; If you do this MySQL
+@strong{Warning}: do @strong{NOT} convert MySQL system tables from
+MyISAM TO InnoDB tables! This is not supported; if you do this MySQL
will not restart until you restore the old system tables from a backup
or re-generate them with the mysql_install_db script.
@@ -39343,7 +39716,7 @@ pages. After InnoDB has modified the row by storing long fields on
separate pages, the remaining length of the row must be less
than half a database page. The maximun key length is 7000 bytes.
@item
-On some operating systems data files must be < 2 GB. The combined
+On some operating systems datafiles must be < 2 GB. The combined
size of log files must be < 4 GB on 32-bit computers.
@item
The maximum tablespace size is 4 billion database pages. This is also
@@ -39381,7 +39754,7 @@ Finland
* BDB start:: BDB startup options
* BDB characteristics:: Characteristics of @code{BDB} tables:
* BDB TODO:: Things we need to fix for BDB in the near future:
-* BDB portability:: Operating systems supported by @strong{BDB}
+* BDB portability:: Operating systems supported by @code{BDB}
* BDB restrictions:: Restrictions on BDB Tables
* BDB errors:: Errors That May Occur When Using BDB Tables
@end menu
@@ -39488,7 +39861,7 @@ calculate the query.
You may also want to change @code{binlog_cache_size} and
@code{max_binlog_cache_size} if you are using big multi-line transactions.
-@xref{COMMIT}.
+@xref{COMMIT, , @code{COMMIT}}.
@node BDB characteristics, BDB TODO, BDB start, BDB
@@ -39539,7 +39912,7 @@ Internal locking in @code{BDB} tables is done on page level.
maintain a count of the number of rows in the table.
@item
Scanning is slower than with @code{MyISAM} tables as one has data in BDB
-tables stored in B-trees and not in a separate data file.
+tables stored in B-trees and not in a separate datafile.
@item
The application must always be prepared to handle cases where
any change of a @code{BDB} table may make an automatic rollback and any
@@ -39557,9 +39930,9 @@ MyISAM tables.
The optimiser needs to know an approximation of the number of rows in
the table. MySQL solves this by counting inserts and
maintaining this in a separate segment in each BDB table. If you don't
-do a lot of @code{DELETE} or @code{ROLLBACK}:s this number should be
-accurate enough for the MySQL optimiser, but as MySQL
-only store the number on close, it may be wrong if MySQL dies
+issue a lot of @code{DELETE} or @code{ROLLBACK} statements, this number
+should be accurate enough for the MySQL optimiser, but as MySQL
+only stores the number on close, it may be incorrect if MySQL dies
unexpectedly. It should not be fatal even if this number is not 100 %
correct. One can update the number of rows by executing @code{ANALYZE
TABLE} or @code{OPTIMIZE TABLE}. @xref{ANALYZE TABLE} . @xref{OPTIMIZE
@@ -39578,8 +39951,8 @@ wait for enough free disk before continuing.
@itemize @bullet
@item
It's very slow to open many BDB tables at the same time. If you are
-going to use BDB tables, you should not have a very big table cache (>
-256 ?) and you should use @code{--no-auto-rehash} with the @code{mysql}
+going to use BDB tables, you should not have a very big table cache
+(like >256) and you should use @code{--no-auto-rehash} with the @code{mysql}
client. We plan to partly fix this in 4.0.
@item
@code{SHOW TABLE STATUS} doesn't yet provide that much information for BDB
@@ -39592,7 +39965,7 @@ Change to not use page locks at all when we are scanning tables.
@node BDB portability, BDB restrictions, BDB TODO, BDB
-@subsection Operating systems supported by @strong{BDB}
+@subsection Operating systems supported by @code{BDB}
If you after having built MySQL with support for BDB tables get
the following error in the log file when you start @code{mysqld}:
@@ -39605,8 +39978,8 @@ Can't init dtabases
This means that @code{BDB} tables are not supported for your architecture.
In this case you have to rebuild MySQL without BDB table support.
-NOTE: The following list is not complete; We will update this as we get
-more information about this.
+Note: The following list is not complete; we will update it as we
+receive more information about this.
Currently we know that BDB tables works with the following operating
system.
@@ -39639,7 +40012,7 @@ Here follows the restrictions you have when using BDB tables:
@itemize @bullet
@item
BDB tables store in the .db file the path to the file as it was created
-(My guess is that this is to be able to detect locks in a multi-user
+This was done to be able to detect locks in a multi-user
environment that supports symlinks).
The effect of this is that BDB tables are not movable between directories!
@@ -39721,9 +40094,9 @@ other APIs.
@cindex PHP API
PHP is a server-side, HTML-embedded scripting language that may be used to
-create dynamic Web pages. It contains support for accessing several
+create dynamic web pages. It contains support for accessing several
databases, including MySQL. PHP may be run as a separate program
-or compiled as a module for use with the Apache Web server.
+or compiled as a module for use with the Apache web server.
The distribution and documentation are available at the PHP web site
(@uref{http://www.php.net/}).
@@ -39737,7 +40110,7 @@ The distribution and documentation are available at the PHP web site
@itemize @bullet
@item Error: "Maximum Execution Time Exceeded"
-This is a PHP limit; Go into the @file{php3.ini} file and set the maximum
+This is a PHP limit; go into the @file{php3.ini} file and set the maximum
execution time up from 30 seconds to something higher, as needed.
It is also not a bad idea to double the ram allowed per script to 16MB instead of
8 MB.
@@ -39782,10 +40155,10 @@ without change. You need a DataBase Driver (DBD) defined for each
database type. For MySQL, this driver is called
@code{DBD::mysql}.
-For more information on the Perl5 DBI, please visit the @code{DBI} Web
+For more information on the Perl5 DBI, please visit the @code{DBI} web
page and read the documentation:
@example
-@uref{http://www.symbolstone.org/technology/perl/DBI/}
+@uref{http://dbi.perl.org/}
@end example
For more information on Object Oriented Programming
(OOP) as defined in Perl5, see the Perl OOP page:
@@ -39969,7 +40342,7 @@ affected. If no rows are affected, @code{execute} returns @code{"0E0"},
which Perl treats as zero but regards as true. If an error occurs,
@code{execute} returns @code{undef}. For @code{SELECT} statements,
@code{execute} only starts the SQL query in the database; you need to use one
-of the @code{fetch_*} methods described below to retrieve the data.
+of the @code{fetch_*} methods described here to retrieve the data.
Example:
@example
$rv = $sth->execute
@@ -40134,7 +40507,7 @@ handle (and any future children of the handle). Setting @code{$trace_level}
to 2 provides detailed trace information. Setting @code{$trace_level} to 0
disables tracing. Trace output goes to the standard error output by
default. If @code{$trace_filename} is specified, the file is opened in
-append mode and output for @emph{all} traced handles is written to that
+append mode and output for @strong{all} traced handles is written to that
file. Example:
@example
DBI->trace(2); # trace everything
@@ -40156,11 +40529,11 @@ environment variable. Setting it to a numeric value is equivalent to calling
@noindent
@strong{MySQL-specific Methods}
-The methods shown below are MySQL-specific and not part of the
+The methods shown here are MySQL-specific and not part of the
@code{DBI} standard. Several of them are now deprecated:
@code{is_blob}, @code{is_key}, @code{is_num}, @code{is_pri_key},
@code{is_not_null}, @code{length}, @code{max_length}, and @code{table}.
-Where @code{DBI}-standard alternatives exist, they are noted below:
+Where @code{DBI}-standard alternatives exist, they are noted here:
@table @code
@findex DBI->@{insertid@}
@@ -40297,7 +40670,7 @@ You can also use the @code{pod2man}, @code{pod2html}, etc., tools to
translate to other formats.
You can find the latest @code{DBI} information at
-the @code{DBI} Web page:
+the @code{DBI} web page:
@example
@uref{http://www.symbolstone.org/technology/perl/DBI/}
@end example
@@ -40315,48 +40688,48 @@ the @code{DBI} Web page:
* ODBC administrator:: How to fill in the various fields in the ODBC administrator program
* MyODBC connect parameters:: Connect parameters for MyODBC
* ODBC Problems:: How to report problems with MySQL ODBC
-* MyODBC clients:: Programs known to work with @strong{MyODBC}
+* MyODBC clients:: Programs known to work with @code{MyODBC}
* ODBC and last_insert_id:: How to get the value of an @code{AUTO_INCREMENT} column in ODBC
* MyODBC bug report:: Reporting problems with MyODBC
@end menu
-MySQL provides support for ODBC by means of the @strong{MyODBC}
-program. This chapter will teach you how to install @strong{MyODBC},
+MySQL provides support for ODBC by means of the @code{MyODBC}
+program. This chapter will teach you how to install @code{MyODBC},
and how to use it. Here, you will also find a list of common programs that
-are known to work with @strong{MyODBC}.
+are known to work with @code{MyODBC}.
@node Installing MyODBC, ODBC administrator, ODBC, ODBC
@subsection How To Install MyODBC
-@strong{MyODBC} is a 32-bit ODBC (2.50) level 0 (with level 1 and
+@code{MyODBC} is a 32-bit ODBC (2.50) level 0 (with level 1 and
level 2 features) driver for connecting an ODBC-aware application
-to MySQL. @strong{MyODBC} works on Windows 9x/Me/NT/2000/XP
+to MySQL. @code{MyODBC} works on Windows 9x/Me/NT/2000/XP
and most Unix platforms.
-@strong{MyODBC} is in public domain, and you can find the newest
+@code{MyODBC} is in public domain, and you can find the newest
version at @uref{http://www.mysql.com/downloads/api-myodbc.html}.
-If you have problem with @strong{MyODBC} and your program also works
+If you have problem with @code{MyODBC} and your program also works
with OLEDB, you should try the OLEDB driver.
-Normally you only need to install @strong{MyODBC} on Windows machines.
-You only need @strong{MyODBC} for Unix if you have a program like
+Normally you only need to install @code{MyODBC} on Windows machines.
+You only need @code{MyODBC} for Unix if you have a program like
ColdFusion that is running on the Unix machine and uses ODBC to connect
to the databases.
-If you want to install @strong{MyODBC} on a Unix box, you will also need
-an @strong{ODBC} manager. @strong{MyODBC} is known to work with
+If you want to install @code{MyODBC} on a Unix box, you will also need
+an @code{ODBC} manager. @code{MyODBC} is known to work with
most of the Unix ODBC managers. @xref{Portals}.
-To install @strong{MyODBC} on Windows, you should download the
-appropriate @strong{MyODBC} @file{.zip} file,
+To install @code{MyODBC} on Windows, you should download the
+appropriate @code{MyODBC} @file{.zip} file,
unpack it with @code{WinZIP} or some similar program,
and execute the @file{SETUP.EXE} file.
On Windows/NT/XP you may get the following error when trying to install
-@strong{MyODBC}:
+@code{MyODBC}:
@example
An error occurred while copying C:\WINDOWS\SYSTEM\MFC30.DLL. Restart
@@ -40371,14 +40744,14 @@ cases you can continue by just pressing @code{Ignore} to copy the rest
of the MyODBC files and the final installation should still work. If
this doesn't work, the solution is to reboot your computer in ``safe
mode`` (Choose this by pressing F8 just before your machine starts
-Windows during rebooting), install @strong{MyODBC}, and reboot to normal
+Windows during rebooting), install @code{MyODBC}, and reboot to normal
mode.
@itemize @bullet
@item
To make a connection to a Unix box from a Windows box, with an ODBC
application (one that doesn't support MySQL natively), you must
-first install @strong{MyODBC} on the Windows machine.
+first install @code{MyODBC} on the Windows machine.
@item
The user and Windows machine must have the access privileges to the
MySQL server on the Unix machine. This is set up with the
@@ -40390,7 +40763,7 @@ You must create an ODBC DSN entry as follows:
@item
Open the Control Panel on the Windows machine.
@item
-Double-click the ODBC Data Sources 32 bits icon.
+Double-click the ODBC Data Sources 32-bit icon.
@item
Click the tab User DSN.
@item
@@ -40473,8 +40846,8 @@ You can use all options that are usable by @code{mysql_options()}.
@node MyODBC connect parameters, ODBC Problems, ODBC administrator, ODBC
@subsection Connect parameters for MyODBC
-One can specify the following parameters for @strong{MyODBC} on
-the @code{[Servername]} section of an @code{ODBC.INI} file or
+One can specify the following parameters for @code{MyODBC} on
+the @code{[Servername]} section of an @file{ODBC.INI} file or
through the @code{InConnectionString} argument in the
@code{SQLDriverConnect()} call.
@@ -40483,22 +40856,22 @@ through the @code{InConnectionString} argument in the
@item user @tab ODBC (on Windows) @tab The username used to connect to MySQL.
@item server @tab localhost @tab The hostname of the MySQL server.
@item database @tab @tab The default database
-@item option @tab 0 @tab A integer by which you can specify how @strong{MyODBC} should work. See below.
+@item option @tab 0 @tab A integer by which you can specify how @code{MyODBC} should work. See below.
@item port @tab 3306 @tab The TCP/IP port to use if @code{server} is not @code{localhost}.
@item stmt @tab @tab A statement that will be executed when connection to @code{MySQL}.
@item password @tab @tab The password for the @code{server} @code{user} combination.
@item socket @tab @tab The socket or Windows pipe to connect to.
@end multitable
-The option argument is used to tell @strong{MyODBC} that the client isn't 100%
+The option argument is used to tell @code{MyODBC} that the client isn't 100%
ODBC compliant. On Windows, one normally sets the option flag by
toggling the different options on the connection screen but one can also
set this in the opton argument. The following options are listed in the
-same order as they appear in the @strong{MyODBC} connect screen:
+same order as they appear in the @code{MyODBC} connect screen:
@multitable @columnfractions .10 .90
@item @strong{Bit} @tab @strong{Description}
-@item 1 @tab The client can't handle that @strong{MyODBC} returns the real width of a column.
+@item 1 @tab The client can't handle that @code{MyODBC} returns the real width of a column.
@item 2 @tab The client can't handle that MySQL returns the true value of affected rows. If this flag is set then MySQL returns 'found rows' instead. One must have MySQL 3.21.14 or newer to get this to work.
@item 4 @tab Make a debug log in c:\myodbc.log. This is the same as putting @code{MYSQL_DEBUG=d:t:O,c::\myodbc.log} in @file{AUTOEXEC.BAT}
@item 8 @tab Don't set any packet limit for results and parameters.
@@ -40523,22 +40896,22 @@ example setting option to 12 (4+8) gives you debugging without package
limits!
The default @file{MYODBC.DLL} is compiled for optimal performance. If
-you want to to debug @strong{MyODBC} (for example to enable tracing),
-you should instead use @code{MYODBCD.DLL}. To install this file, copy
-@file{MYODBCD.DLL} over the installed @code{MYODBC.DLL} file.
+you want to to debug @code{MyODBC} (for example to enable tracing),
+you should instead use @file{MYODBCD.DLL}. To install this file, copy
+@file{MYODBCD.DLL} over the installed @file{MYODBC.DLL} file.
@node ODBC Problems, MyODBC clients, MyODBC connect parameters, ODBC
@subsection How to Report Problems with MyODBC
-@strong{MyODBC} has been tested with Access, Admndemo.exe, C++-Builder,
+@code{MyODBC} has been tested with Access, Admndemo.exe, C++-Builder,
Borland Builder 4, Centura Team Developer (formerly Gupta SQL/Windows),
ColdFusion (on Solaris and NT with svc pack 5), Crystal Reports,
DataJunction, Delphi, ERwin, Excel, iHTML, FileMaker Pro, FoxPro, Notes
4.5/4.6, SBSS, Perl DBD-ODBC, Paradox, Powerbuilder, Powerdesigner 32
bit, VC++, and Visual Basic.
-If you know of any other applications that work with @strong{MyODBC}, please
+If you know of any other applications that work with @code{MyODBC}, please
send mail to @email{myodbc@@lists.mysql.com} about this!
With some programs you may get an error like:
@@ -40562,8 +40935,8 @@ try to figure out why things go wrong.
@node MyODBC clients, ODBC and last_insert_id, ODBC Problems, ODBC
@subsection Programs Known to Work with MyODBC
-Most programs should work with @strong{MyODBC}, but for each of those
-listed below, we have tested it ourselves or received confirmation from
+Most programs should work with @code{MyODBC}, but for each of those
+listed here, we have tested it ourselves or received confirmation from
some user that it works:
@table @asis
@@ -40652,12 +41025,12 @@ This will give you problems if you have values > 127 in the column!
@cindex ADO program
@item ADO
-When you are coding with the ADO API and @strong{MyODBC} you need to put
+When you are coding with the ADO API and @code{MyODBC} you need to put
attention in some default properties that aren't supported by the
MySQL server. For example, using the @code{CursorLocation
Property} as @code{adUseServer} will return for the @code{RecordCount
Property} a result of -1. To have the right value, you need to set this
-property to @code{adUseClient}, like is showing in the VB code below:
+property to @code{adUseClient}, like is showing in the VB code here:
@example
Dim myconn As New ADODB.Connection
@@ -40697,10 +41070,10 @@ your tables are big!
The following information is taken from the ColdFusion documentation:
Use the following information to configure ColdFusion Server for Linux
-to use the unixODBC driver with @strong{MyODBC} for MySQL data
-sources. Allaire has verified that @strong{MyODBC} Version 2.50.26
+to use the unixODBC driver with @code{MyODBC} for MySQL data
+sources. Allaire has verified that @code{MyODBC} Version 2.50.26
works with MySQL Version 3.22.27 and ColdFusion for Linux. (Any
-newer version should also work.) You can download @strong{MyODBC} at
+newer version should also work.) You can download @code{MyODBC} at
@uref{http://www.mysql.com/downloads/api-myodbc.html}
@cindex ColdFusion program
@@ -40708,7 +41081,7 @@ ColdFusion Version 4.5.1 allows you to us the ColdFusion Administrator
to add the MySQL data source. However, the driver is not
included with ColdFusion Version 4.5.1. Before the MySQL driver
will appear in the ODBC datasources drop-down list, you must build and
-copy the @strong{MyODBC} driver to
+copy the @code{MyODBC} driver to
@file{/opt/coldfusion/lib/libmyodbc.so}.
The Contrib directory contains the program @file{mydsn-xxx.zip} which allows
@@ -40754,7 +41127,7 @@ For example, create a db with a table containing 2 columns of text:
@item
Insert rows using the @code{mysql} client command-line tool.
@item
-Create a DSN file using the MyODBC driver, for example, my for the db above.
+Create a DSN file using the ODBC manager, for example, @file{my} for the db above.
@item
Open the Word application.
@item
@@ -40794,7 +41167,7 @@ You must use BDE Version 3.2 or newer. Set the @code{Don't optimize column widt
option field when connecting to MySQL.
Also, here is some potentially useful Delphi code that sets up both an
-ODBC entry and a BDE entry for @strong{MyODBC} (the BDE entry requires a BDE
+ODBC entry and a BDE entry for @code{MyODBC} (the BDE entry requires a BDE
Alias Editor that is free at a Delphi Super Page near
you. (Thanks to Bryan Brunton @email{bryan@@flesherfab.com} for this):
@@ -40903,28 +41276,28 @@ SELECT * FROM tbl_name WHERE auto IS NULL;
@cindex problems, ODBC
@cindex MyODBC, reporting problems
-If you encounter difficulties with @strong{MyODBC}, you should start by
+If you encounter difficulties with @code{MyODBC}, you should start by
making a log file from the ODBC manager (the log you get when requesting
-logs from ODBCADMIN) and a @strong{MyODBC} log.
+logs from ODBCADMIN) and a @code{MyODBC} log.
-To get a @strong{MyODBC} log, you need to do the following:
+To get a @code{MyODBC} log, you need to do the following:
@enumerate
@item
-Ensure that you are using @code{myodbcd.dll} and not @code{myodbc.dll}.
-The easiest way to do this is to get @code{myodbcd.dll} from the MyODBC
-distribution and copy it over the @code{myodbc.dll}, which is probably
-in your @code{C:\windows\system32} or @code{C:\winnt\system32} directory.
+Ensure that you are using @file{myodbcd.dll} and not @file{myodbc.dll}.
+The easiest way to do this is to get @file{myodbcd.dll} from the MyODBC
+distribution and copy it over the @file{myodbc.dll}, which is probably
+in your @file{C:\windows\system32} or @file{C:\winnt\system32} directory.
Note that you probably want to restore the old myodbc.dll file when you
-have finished testing, as this is a lot faster than @code{myodbcd.dll}.
+have finished testing, as this is a lot faster than @file{myodbcd.dll}.
@item
-Tag the `Trace MyODBC' option flag in the @strong{MyODBC} connect/configure
+Tag the `Trace MyODBC' option flag in the @code{MyODBC} connect/configure
screen. The log will be written to file @file{C:\myodbc.log}.
If the trace option is not remembered when you are going back to the
above screen, it means that you are not using the @code{myodbcd.dll}
-driver (see above).
+driver (see the item above).
@item
Start your application and try to get it to fail.
@end enumerate
@@ -41045,7 +41418,7 @@ values may contain null bytes internally.) Rows are obtained by calling
@tindex MYSQL_FIELD C type
@item MYSQL_FIELD
This structure contains information about a field, such as the field's
-name, type, and size. Its members are described in more detail below.
+name, type, and size. Its members are described in more detail here.
You may obtain the @code{MYSQL_FIELD} structures for each field by
calling @code{mysql_fetch_field()} repeatedly. Field values are not part of
this structure; they are contained in a @code{MYSQL_ROW} structure.
@@ -41073,7 +41446,7 @@ printf (Number of rows: %lu\n", (unsigned long) mysql_num_rows(result));
@end table
@noindent
-The @code{MYSQL_FIELD} structure contains the members listed below:
+The @code{MYSQL_FIELD} structure contains the members listed here:
@table @code
@item char * name
@@ -41091,7 +41464,7 @@ only if you use @code{mysql_list_fields()}.
The type of the field.
The @code{type} value may be one of the following:
-@multitable @columnfractions .30 .50
+@multitable @columnfractions .35 .55
@item @strong{Type value} @tab @strong{Type description}
@item @code{FIELD_TYPE_TINY} @tab @code{TINYINT} field
@item @code{FIELD_TYPE_SHORT} @tab @code{SMALLINT} field
@@ -41114,7 +41487,7 @@ The @code{type} value may be one of the following:
@item @code{FIELD_TYPE_CHAR} @tab Deprecated; use @code{FIELD_TYPE_TINY} instead
@end multitable
-You can use the @code{IS_NUM()} macro to test whether or not a field has a
+You can use the @code{IS_NUM()} macro to test whether a field has a
numeric type. Pass the @code{type} value to @code{IS_NUM()} and it
will evaluate to TRUE if the field is numeric:
@@ -41137,7 +41510,7 @@ value of this variable is zero.
Different bit-flags for the field. The @code{flags} value may have zero
or more of the following bits set:
-@multitable @columnfractions .30 .45
+@multitable @columnfractions .35 .55
@item @strong{Flag value} @tab @strong{Flag description}
@item @code{NOT_NULL_FLAG} @tab Field can't be @code{NULL}
@item @code{PRI_KEY_FLAG} @tab Field is part of a primary key
@@ -41161,7 +41534,7 @@ a field rather than an attribute of its type. It is preferable to test
@code{FIELD_TYPE_SET}, or @code{FIELD_TYPE_TIMESTAMP} instead.
@noindent
-The example below illustrates a typical use of the @code{flags} value:
+The following example illustrates a typical use of the @code{flags} value:
@example
if (field->flags & NOT_NULL_FLAG)
@@ -41171,7 +41544,7 @@ if (field->flags & NOT_NULL_FLAG)
You may use the following convenience macros to determine the boolean
status of the @code{flags} value:
-@multitable @columnfractions .25 .50
+@multitable @columnfractions .25 .55
@item @strong{Flag status} @tab @strong{Description}
@item @code{IS_NOT_NULL(flags)} @tab True if this field is defined as @code{NOT NULL}
@item @code{IS_PRI_KEY(flags)} @tab True if this field is a primary key
@@ -41189,11 +41562,11 @@ The number of decimals for numeric fields.
@cindex C API, functions
@cindex functions, C API
-The functions available in the C API are listed below and are described in
-greater detail in the next section.
+The functions available in the C API are listed here and are described in
+greater detail in a later section.
@xref{C API functions}.
-@multitable @columnfractions .30 .70
+@multitable @columnfractions .32 .68
@item @strong{Function} @tab @strong{Description}
@item @strong{mysql_affected_rows()} @tab
@@ -41231,7 +41604,7 @@ Drops a database. This function is deprecated; use the SQL command
Makes the server write debug information to the log.
@item @strong{mysql_eof()} @tab
-Determines whether or not the last row of a result set has been read.
+Determines whether the last row of a result set has been read.
This function is deprecated; @code{mysql_errno()} or @code{mysql_error()}
may be used instead.
@@ -41319,7 +41692,7 @@ Returns the number of rows in a result set.
Sets connect options for @code{mysql_connect()}.
@item @strong{mysql_ping()} @tab
-Checks whether or not the connection to the server is working, reconnecting
+Checks whether the connection to the server is working, reconnecting
as necessary.
@item @strong{mysql_query()} @tab
@@ -41361,7 +41734,7 @@ Retrieves a complete result set to the client.
Returns the current thread ID.
@item @strong{mysql_thread_safe()} @tab
-Returns 1 if the clients are compiled as thread safe.
+Returns 1 if the clients are compiled as thread-safe.
@item @strong{mysql_use_result()} @tab
Initiates a row-by-row result set retrieval.
@@ -41432,7 +41805,7 @@ faster). Disadvantages are that you must process each row quickly to avoid
tying up the server, you don't have random access to rows within the result
set (you can only access rows sequentially), and you don't know how many rows
are in the result set until you have retrieved them all. Furthermore, you
-@emph{must} retrieve all the rows even if you determine in mid-retrieval that
+@strong{must} retrieve all the rows even if you determine in mid-retrieval that
you've found the information you were looking for.
The API makes it possible for clients to respond appropriately to
@@ -41441,7 +41814,7 @@ not the query is a @code{SELECT}. You can do this by calling
@code{mysql_store_result()} after each @code{mysql_query()} (or
@code{mysql_real_query()}). If the result set call succeeds, the query
was a @code{SELECT} and you can read the rows. If the result set call
-fails, call @code{mysql_field_count()} to determine whether or not a
+fails, call @code{mysql_field_count()} to determine whether a
result was actually to be expected. If @code{mysql_field_count()}
returns zero, the query returned no data (indicating that it was an
@code{INSERT}, @code{UPDATE}, @code{DELETE}, etc.), and was not
@@ -41525,7 +41898,7 @@ when an error occurred and what it was.
* mysql_use_result:: @code{mysql_use_result()}
@end menu
-In the descriptions below, a parameter or return value of @code{NULL} means
+In the descriptions here, a parameter or return value of @code{NULL} means
@code{NULL} in the sense of the C programming language, not a
MySQL @code{NULL} value.
@@ -41832,7 +42205,7 @@ None.
@subsubheading Example
-The call shown below causes the client library to generate a trace file in
+The call shown here causes the client library to generate a trace file in
@file{/tmp/client.trace} on the client machine:
@example
@@ -41921,7 +42294,7 @@ An unknown error occurred.
This function is deprecated. @code{mysql_errno()} or @code{mysql_error()}
may be used instead.
-@code{mysql_eof()} determines whether or not the last row of a result
+@code{mysql_eof()} determines whether the last row of a result
set has been read.
If you acquire a result set from a successful call to
@@ -42203,7 +42576,7 @@ for(i = 0; i < num_fields; i++)
Returns the lengths of the columns of the current row within a result set.
If you plan to copy field values, this length information is also useful for
optimisation, because you can avoid calling @code{strlen()}. In addition, if
-the result set contains binary data, you @emph{must} use this function to
+the result set contains binary data, you @strong{must} use this function to
determine the size of the data, because @code{strlen()} returns incorrect
results for any field containing null characters.
@@ -42268,7 +42641,7 @@ The lengths of the field values in the row may be obtained by calling
@code{mysql_fetch_lengths()}. Empty fields and fields containing
@code{NULL} both have length 0; you can distinguish these by checking
the pointer for the field value. If the pointer is @code{NULL}, the field
-is @code{NULL}; otherwise the field is empty.
+is @code{NULL}; otherwise, the field is empty.
@subsubheading Return Values
@@ -42322,10 +42695,10 @@ Returns the number of columns for the most recent query on the connection.
The normal use of this function is when @code{mysql_store_result()}
returned @code{NULL} (and thus you have no result set pointer).
In this case, you can call @code{mysql_field_count()} to
-determine whether or not @code{mysql_store_result()} should have produced a
+determine whether @code{mysql_store_result()} should have produced a
non-empty result. This allows the client program to take proper action
-without knowing whether or not the query was a @code{SELECT} (or
-@code{SELECT}-like) statement. The example shown below illustrates how this
+without knowing whether the query was a @code{SELECT} (or
+@code{SELECT}-like) statement. The example shown here illustrates how this
may be done.
@xref{NULL mysql_store_result, , @code{NULL mysql_store_result()}}.
@@ -42375,7 +42748,7 @@ else // query succeeded, process any data returned by it
An alternative is to replace the @code{mysql_field_count(&mysql)} call with
@code{mysql_errno(&mysql)}. In this case, you are checking directly for an
error from @code{mysql_store_result()} rather than inferring from the value
-of @code{mysql_field_count()} whether or not the statement was a
+of @code{mysql_field_count()} whether the statement was a
@code{SELECT}.
@@ -42533,9 +42906,9 @@ None.
@subsubheading Description
Retrieves a string providing information about the most recently executed
-query, but only for the statements listed below. For other statements,
+query, but only for the statements listed here. For other statements,
@code{mysql_info()} returns @code{NULL}. The format of the string varies
-depending on the type of query, as described below. The numbers are
+depending on the type of query, as described here. The numbers are
illustrative only; the string will contain values appropriate for the query.
@table @code
@@ -42576,7 +42949,7 @@ None.
Allocates or initialises a @code{MYSQL} object suitable for
@code{mysql_real_connect()}. If @code{mysql} is a @code{NULL} pointer, the
-function allocates, initialises, and returns a new object. Otherwise the
+function allocates, initialises, and returns a new object. Otherwise, the
object is initialised and the address of the object is returned. If
@code{mysql_init()} allocates a new object, it will be freed when
@code{mysql_close()} is called to close the connection.
@@ -42668,7 +43041,7 @@ An unknown error occurred.
Returns a result set consisting of database names on the server that match
the simple regular expression specified by the @code{wild} parameter.
-@code{wild} may contain the wild-card characters @samp{%} or @samp{_}, or may
+@code{wild} may contain the wildcard characters @samp{%} or @samp{_}, or may
be a @code{NULL} pointer to match all databases. Calling
@code{mysql_list_dbs()} is similar to executing the query @code{SHOW
databases [LIKE wild]}.
@@ -42706,7 +43079,7 @@ An unknown error occurred.
Returns a result set consisting of field names in the given table that match
the simple regular expression specified by the @code{wild} parameter.
-@code{wild} may contain the wild-card characters @samp{%} or @samp{_}, or may
+@code{wild} may contain the wildcard characters @samp{%} or @samp{_}, or may
be a @code{NULL} pointer to match all fields. Calling
@code{mysql_list_fields()} is similar to executing the query @code{SHOW
COLUMNS FROM tbl_name [LIKE wild]}.
@@ -42778,7 +43151,7 @@ An unknown error occurred.
Returns a result set consisting of table names in the current database that
match the simple regular expression specified by the @code{wild} parameter.
-@code{wild} may contain the wild-card characters @samp{%} or @samp{_}, or may
+@code{wild} may contain the wildcard characters @samp{%} or @samp{_}, or may
be a @code{NULL} pointer to match all tables. Calling
@code{mysql_list_tables()} is similar to executing the query @code{SHOW
tables [LIKE wild]}.
@@ -42827,11 +43200,11 @@ Note that you can get the number of columns either from a pointer to a result
set or to a connection handle. You would use the connection handle if
@code{mysql_store_result()} or @code{mysql_use_result()} returned
@code{NULL} (and thus you have no result set pointer). In this case, you can
-call @code{mysql_field_count()} to determine whether or not
+call @code{mysql_field_count()} to determine whether
@code{mysql_store_result()} should have produced a non-empty result. This
allows the client program to take proper action without knowing whether or
not the query was a @code{SELECT} (or @code{SELECT}-like) statement. The
-example shown below illustrates how this may be done.
+example shown here illustrates how this may be done.
@xref{NULL mysql_store_result, , @code{NULL mysql_store_result()}}.
@@ -42930,7 +43303,7 @@ argument is the value for the option. If the option is an integer, then
Possible options values:
-@multitable @columnfractions .40 .25 .35
+@multitable @columnfractions .42 .20 .38
@item @strong{Option} @tab @strong{Argument type} @tab @strong{Function}
@item @code{MYSQL_OPT_CONNECT_TIMEOUT} @tab @code{unsigned int *} @tab Connect timeout in seconds.
@item @code{MYSQL_OPT_COMPRESS} @tab Not used @tab Use the compressed client/server protocol.
@@ -42946,7 +43319,7 @@ Note that the group @code{client} is always read if you use
The specified group in the option file may contain the following options:
-@multitable @columnfractions .20 .60
+@multitable @columnfractions .25 .60
@item @strong{Option} @tab @strong{Description}
@item @code{connect-timeout} @tab Connect timeout in seconds. On Linux this timeout is also used for waiting for the first answer from the server.
@item @code{compress} @tab Use the compressed client/server protocol.
@@ -42990,7 +43363,7 @@ if (!mysql_real_connect(&mysql,"host","user","passwd","database",0,NULL,0))
@end example
The above requests the client to use the compressed client/server protocol and
-read the additional options from the @code{odbc} section in the @code{my.cnf}
+read the additional options from the @code{odbc} section in the @file{my.cnf}
file.
@@ -43003,11 +43376,11 @@ file.
@subsubheading Description
-Checks whether or not the connection to the server is working. If it has gone
+Checks whether the connection to the server is working. If it has gone
down, an automatic reconnection is attempted.
This function can be used by clients that remain idle for a long while,
-to check whether or not the server has closed the connection and reconnect
+to check whether the server has closed the connection and reconnect
if necessary.
@subsubheading Return Values
@@ -43114,7 +43487,7 @@ allows the database administrator to set up the MySQL privilege
system in such a way that users get different privileges depending on whether
or not they have specified a password.
-NOTE: Do not attempt to encrypt the password before calling
+Note: Do not attempt to encrypt the password before calling
@code{mysql_real_connect()}; password encryption is handled automatically by
the client API.
@@ -43137,7 +43510,7 @@ parameter determines the type of the connection.
The value of @code{client_flag} is usually 0, but can be set to a combination
of the following flags in very special circumstances:
-@multitable @columnfractions .30 .70
+@multitable @columnfractions .30 .65
@item @strong{Flag name} @tab @strong{Flag description}
@item @code{CLIENT_COMPRESS} @tab Use compression protocol.
@item @code{CLIENT_FOUND_ROWS} @tab Return the number of found (matched) rows, not the number of affected rows.
@@ -43213,7 +43586,7 @@ if (!mysql_real_connect(&mysql,"host","user","passwd","database",0,NULL,0))
@end example
By using @code{mysql_options()} the MySQL library will read the
-@code{[client]} and @code{your_prog_name} sections in the @code{my.cnf}
+@code{[client]} and @code{your_prog_name} sections in the @file{my.cnf}
file which will ensure that your program will work, even if someone has
set up MySQL in some non-standard way.
@@ -43298,7 +43671,7 @@ Executes the SQL query pointed to by @code{query}, which should be a string
You should not add a terminating semicolon (@samp{;}) or @code{\g} to the
statement.
-You @emph{must} use @code{mysql_real_query()} rather than
+You @strong{must} use @code{mysql_real_query()} rather than
@code{mysql_query()} for queries that contain binary data, because binary data
may contain the @samp{\0} character. In addition, @code{mysql_real_query()}
is faster than @code{mysql_query()} because it does not call @code{strlen()} on
@@ -43633,9 +44006,9 @@ This will tie up the server and prevent other threads from updating any
tables from which the data is being fetched.
When using @code{mysql_use_result()}, you must execute
-@code{mysql_fetch_row()} until a @code{NULL} value is returned, otherwise the
+@code{mysql_fetch_row()} until a @code{NULL} value is returned, otherwise, the
unfetched rows will be returned as part of the result set for your next
-query. The C API will give the error @code{Commands out of sync; You can't
+query. The C API will give the error @code{Commands out of sync; you can't
run this command now} if you forget to do this!
You may not use @code{mysql_data_seek()}, @code{mysql_row_seek()},
@@ -43678,6 +44051,7 @@ threaded client. @xref{Threaded clients}.
* my_init:: @code{my_init()}
* mysql_thread_init:: @code{mysql_thread_init()}
* mysql_thread_end:: @code{mysql_thread_end()}
+* mysql_thread_safe:: @code{mysql_thread_safe()}
@end menu
@node my_init, mysql_thread_init, C Thread functions, C Thread functions
@@ -43719,7 +44093,7 @@ This is automatically called by @code{my_init()} and @code{mysql_connect()}.
None.
-@node mysql_thread_end, , mysql_thread_init, C Thread functions
+@node mysql_thread_end, mysql_thread_safe, mysql_thread_init, C Thread functions
@subsubsection @code{mysql_thread_end()}
@findex @code{mysql_thread_end()}
@@ -43738,6 +44112,21 @@ library. It must be called explicitly to avoid a memory leak.
None.
+@node mysql_thread_safe, , mysql_thread_end, C Thread functions
+@subsubsection @code{mysql_thread_safe()}
+
+@findex @code{mysql_thread_safe()}
+
+@code{unsigned int mysql_thread_safe(void)}
+
+@subsubheading Description
+
+This function indicates whether the client is compiled as thread-safe.
+
+@subsubheading Return Values
+
+1 is the client is thread-safe, 0 otherwise.
+
@node C Embedded Server func, C API problems, C Thread functions, C
@subsection C Embedded Server Function Descriptions
@@ -43867,7 +44256,7 @@ The query returned no data (for example, it was an @code{INSERT},
@code{UPDATE}, or @code{DELETE}).
@end itemize
-You can always check whether or not the statement should have produced a
+You can always check whether the statement should have produced a
non-empty result by calling @code{mysql_field_count()}. If
@code{mysql_field_count()} returns zero, the result is empty and the last
query was a statement that does not return values (for example, an
@@ -43989,7 +44378,7 @@ adding @code{-lm} to the end of the compile/link line.
@cindex programs, client
If you compile MySQL clients that you've written yourself or that
-you obtain from a third party, they must be linked using the
+you obtain from a third-party, they must be linked using the
@code{-lmysqlclient -lz} option on the link command. You may also need to
specify a @code{-L} option to tell the linker where to find the library. For
example, if the library is installed in @file{/usr/local/mysql/lib}, use
@@ -44007,26 +44396,26 @@ files.
@cindex clients, threaded
@cindex threaded clients
-The client library is almost thread safe. The biggest problem is
+The client library is almost thread-safe. The biggest problem is
that the subroutines in @file{net.c} that read from sockets are not
interrupt safe. This was done with the thought that you might want to
have your own alarm that can break a long read to a server. If you
install interrupt handlers for the @code{SIGPIPE} interrupt,
-the socket handling should be thread safe.
+the socket handling should be thread-safe.
In the older binaries we distribute on our web site
(@uref{http://www.mysql.com/}), the client libraries are not normally
compiled with the thread-safe option (the Windows binaries are by
-default compiled to be thread safe). Newer binary distributions should
+default compiled to be thread-safe). Newer binary distributions should
have both a normal and a thread-safe client library.
To get a threaded client where you can interrupt the client from other
threads and set timeouts when talking with the MySQL server, you should
-use the @code{-lmysys}, @code{-lstring}, and @code{-ldbug} libraries and
+use the @code{-lmysys}, @code{-lmystrings}, and @code{-ldbug} libraries and
the @code{net_serv.o} code that the server uses.
-If you don't need interrupts or timeouts, you can just compile a thread
-safe client library @code{(mysqlclient_r)} and use this. @xref{C,,
+If you don't need interrupts or timeouts, you can just compile a
+thread-safe client library @code{(mysqlclient_r)} and use this. @xref{C,,
MySQL C API}. In this case you don't have to worry about the
@code{net_serv.o} object file or the other MySQL libraries.
@@ -44037,13 +44426,13 @@ interrupts, you can make great use of the routines in the
@code{my_init()} first! @xref{C Thread functions}.
All functions except @code{mysql_real_connect()} are by default
-thread safe. The following notes describe how to compile a thread-safe
+thread-safe. The following notes describe how to compile a thread-safe
client library and use it in a thread-safe manner. (The notes below for
@code{mysql_real_connect()} actually apply to @code{mysql_connect()} as
well, but because @code{mysql_connect()} is deprecated, you should be
using @code{mysql_real_connect()} anyway.)
-To make @code{mysql_real_connect()} thread safe, you must recompile the
+To make @code{mysql_real_connect()} thread-safe, you must recompile the
client library with this command:
@example
@@ -44051,9 +44440,9 @@ shell> ./configure --enable-thread-safe-client
@end example
This will create a thread-safe client library @code{libmysqlclient_r}.
-@code{--enable-thread-safe-client}. This library is thread safe per
-connection. You can let two threads share the same connection with
-the following caveats:
+(Assuming your OS has a thread-safe @code{gethostbyname_r()} function.)
+This library is thread-safe per connection. You can let two threads
+share the same connection with the following caveats:
@itemize @bullet
@item
@@ -44142,9 +44531,9 @@ client/server version. To change an old threaded application to use the
embedded library, you normally only have to add calls to the following
functions:
-@multitable @columnfractions .25 .65
+@multitable @columnfractions .25 .70
@item @strong{Function} @tab @strong{When to call}
-@item @code{mysql_server_init()} @tab Should be called before any other other MySQL function is called, preferably early in the @code{main()} function.
+@item @code{mysql_server_init()} @tab Should be called before any other MySQL function is called, preferably early in the @code{main()} function.
@item @code{mysql_server_end()} @tab Should be called before your program exits.
@item @code{mysql_thread_init()} @tab Should be called in each thread you create that will access MySQL.
@item @code{mysql_thread_end()} @tab Should be called before calling @code{pthread_exit()}
@@ -44310,8 +44699,8 @@ language = /path/to/source/of/mysql/sql/share/english
one = db_connect("test");
two = db_connect(NULL);
- db_do_query(one, "show table status");
- db_do_query(two, "show databases");
+ db_do_query(one, "SHOW TABLE STATUS");
+ db_do_query(two, "SHOW DATABASES");
mysql_close(two);
mysql_close(one);
@@ -44441,9 +44830,9 @@ compatible with the GPL).
We encourage everyone to promote free software by releasing
code under the GPL or a compatible license. For those who
-are not able to do this, another option is to purchase the
-MySQL code from MySQL AB under a commercial license. For details
-concerning this issue, please see @ref{MySQL server licenses}.
+are not able to do this, another option is to purchase a
+commercial licence for the MySQL code from MySQL AB.
+For details, please see @ref{MySQL licenses}.
@node Cplusplus, Java, C, Clients
@section MySQL C++ APIs
@@ -44577,7 +44966,7 @@ The MySQL server creates the following threads:
@item
The TCP/IP connection thread handles all connection requests and
creates a new dedicated thread to handle the authentication and
-and SQL query processing for each connection.
+SQL query processing for each connection.
@item
On Windows NT there is a named pipe handler thread that does the same work as
@@ -44689,12 +45078,12 @@ The tests are located in @code{mysql-test/t/*.test}
@item
A test case consists of @code{;} terminated statements and is similar to the
-input of @code{mysql} command line client. A statement by default is a query
+input of @code{mysql} command-line client. A statement by default is a query
to be sent to MySQL server, unless it is recognised as internal
command (eg. @code{sleep}).
@item
-All queries that produce results, e.g. @code{SELECT}, @code{SHOW},
+All queries that produce results@-e.g., @code{SELECT}, @code{SHOW},
@code{EXPLAIN}, etc., must be preceded with @code{@@/path/to/result/file}. The
file must contain the expected results. An easy way to generate the result
file is to run @code{mysqltest -r < t/test-case-name.test} from
@@ -44967,7 +45356,7 @@ The C/C++ functions that you write to implement the interface for
@item @code{xxx()} (required)
The main function. This is where the function result is computed.
The correspondence between the SQL type and return type of your C/C++
-function is shown below:
+function is shown here:
@multitable @columnfractions .15 .15
@item @strong{SQL type} @tab @strong{C/C++ type}
@@ -44993,7 +45382,7 @@ Specify the maximum length of the result.
@item
Specify (for @code{REAL} functions) the maximum number of decimals.
@item
-Specify whether or not the result can be @code{NULL}.
+Specify whether the result can be @code{NULL}.
@end itemize
@item @code{xxx_deinit()} (optional)
@@ -45042,7 +45431,7 @@ Repeat 3-5 until all rows has been processed
Call @code{xxx_deinit()} to let the UDF free any memory it has allocated.
@end enumerate
-All functions must be thread safe (not just the main function,
+All functions must be thread-safe (not just the main function,
but the initialisation and deinitialisation functions as well). This means
that you are not allowed to allocate any global or static variables that
change! If you need memory, you should allocate it in @code{xxx_init()}
@@ -45054,7 +45443,7 @@ and free it in @code{xxx_deinit()}.
@cindex calling sequences for simple functions, UDF
-The main function should be declared as shown below. Note that the return
+The main function should be declared as shown here. Note that the return
type and parameters differ, depending on whether you will declare the SQL
function @code{XXX()} to return @code{STRING}, @code{INTEGER}, or @code{REAL}
in the @code{CREATE FUNCTION} statement:
@@ -45118,7 +45507,7 @@ digits. For real functions, the default is 13 plus the number of decimals
indicated by @code{initid->decimals}. (For numeric functions, the length
includes any sign or decimal point characters.)
-If you want to return a blob, you can set this to 65K or 16M; This
+If you want to return a blob, you can set this to 65K or 16M; this
memory is not allocated but used to decide which column type to use if
there is a need to temporary store the data.
@@ -45199,7 +45588,7 @@ will return @code{NULL} as the result for the group function.
@cindex processing, arguments
The @code{args} parameter points to a @code{UDF_ARGS} structure that has the
-members listed below:
+members listed here:
@table @code
@item unsigned int arg_count
@@ -45355,7 +45744,7 @@ parameter to @code{1}:
If @code{xxx()} sets @code{*error} to @code{1} for any row, the function
value is @code{NULL} for the current row and for any subsequent rows
processed by the statement in which @code{XXX()} was invoked. (@code{xxx()}
-will not even be called for subsequent rows.) @strong{Note:} In
+will not even be called for subsequent rows.) @strong{Note}: in
MySQL versions prior to 3.22.10, you should set both @code{*error}
and @code{*is_null}:
@@ -45463,7 +45852,7 @@ You should not use @code{CREATE FUNCTION} to add a function that has already
been created. If you need to reinstall a function, you should remove it with
@code{DROP FUNCTION} and then reinstall it with @code{CREATE FUNCTION}. You
would need to do this, for example, if you recompile a new version of your
-function, so that @code{mysqld} gets the new version. Otherwise the server
+function, so that @code{mysqld} gets the new version. Otherwise, the server
will continue to use the old version.
Active functions are reloaded each time the server starts, unless you start
@@ -45480,7 +45869,7 @@ one that has been loaded with @code{CREATE FUNCTION} and not removed with
@cindex native functions, adding
@cindex functions, native, adding
-The procedure for adding a new native function is described below. Note
+The procedure for adding a new native function is described here. Note
that you cannot add native functions to a binary distribution because
the procedure involves modifying MySQL source code. You must
compile MySQL yourself from a source distribution. Also note
@@ -45543,7 +45932,7 @@ can take a look at @code{Item_func_mod::fix_length_and_dec} for a
typical example of how to do this.
@end enumerate
-All functions must be thread safe (in other words, don't use any global or
+All functions must be thread-safe (in other words, don't use any global or
static variables in the functions without protecting them with mutexes).
If you want to return @code{NULL}, from @code{::val()}, @code{::val_int()}
@@ -45733,7 +46122,7 @@ If a program fails, it's always useful to know:
@item
Has the program in question made a segmentation fault (core dumped)?
@item
-Is the program taking the whole CPU? Check with @code{top}. Let the
+Is the program taking up the whole CPU? Check with @code{top}. Let the
program run for a while, it may be evaluating something heavy.
@item
If it's the @code{mysqld} server that is causing problems, can you
@@ -45803,16 +46192,13 @@ Another common reason to receive the @code{MySQL server has gone away} error
is because you have issued a ``close'' on your MySQL connection
and then tried to run a query on the closed connection.
-You can check that the MySQL hasn't died by executing
-@code{mysqladmin version} and examining the uptime.
-
If you have a script, you just have to issue the query again for the client
to do an automatic reconnection.
You normally can get the following error codes in this case
(which one you get is OS-dependent):
-@multitable @columnfractions .35 .60
+@multitable @columnfractions .35 .65
@item @strong{Error code} @tab @strong{Description}
@item @code{CR_SERVER_GONE_ERROR} @tab The client couldn't send a question to the
server.
@@ -45820,6 +46206,15 @@ server.
to the server, but it didn't get a full answer (or any answer) to the question.
@end multitable
+You will also get this error if someone has kills the running thread with
+@code{kill #threadid#}.
+
+You can check that the MySQL hasn't died by executing @code{mysqladmin
+version} and examining the uptime. If the problem is that mysqld
+crashed you should concentrate one finding the reason for the crash.
+You should in this case start by checking if issuing the query again
+will kill MySQL again. @xref{Crashing}.
+
You can also get these errors if you send a query to the server that is
incorrect or too large. If @code{mysqld} gets a packet that is too large
or out of order, it assumes that something has gone wrong with the client and
@@ -45830,6 +46225,26 @@ starting @code{mysqld} with the @code{-O max_allowed_packet=#} option
use more memory only when you issue a big query or when @code{mysqld} must
return a big result row!
+If you want to make a bug report regarding this problem, be sure that
+you include the following information:
+
+@itemize @bullet
+@item
+Include information if MySQL died or not. (You can find this in the
+@code{hostname.err file}. @xref{Crashing}.
+@item
+If a specific query kills @code{mysqld} and the involved tables where
+checked with @code{CHECK TABLE} before you did the query, can you do
+a test case for this? @xref{Reproduceable test case}.
+@item
+What is the value of the @code{wait_timeout} variable in the MySQL server ?
+@code{mysqladmin variables} gives you the value of this
+@item
+Have you tried to run @code{mysqld} with @code{--log} and check if the
+issued query appears in the log ?
+@end itemize
+
+@xref{Asking questions}.
@node Can not connect to server, Blocked host, Gone away, Common errors
@appendixsubsec @code{Can't connect to [local] MySQL server} Error
@@ -46073,7 +46488,7 @@ Note that both the client and the server has it's own
you have to increase this variable both in the client and in the server.
It's safe to increase this variable as memory is only allocated when
-needed; This variable is more a precaution to catch wrong packets
+needed; this variable is more a precaution to catch wrong packets
between the client/server and also to ensure that you don't accidently
use big packets so that you run out of memory.
@@ -46225,7 +46640,7 @@ Error code 28: No space left on device
@cindex commands out of sync
-If you get @code{Commands out of sync; You can't run this command now}
+If you get @code{Commands out of sync; you can't run this command now}
in your client code, you are calling client functions in the wrong order!
This can happen, for example, if you are using @code{mysql_use_result()} and
@@ -46239,7 +46654,7 @@ a @code{mysql_use_result()} or @code{mysql_store_result()} in between.
If you get the following error:
-@code{Found wrong password for user: 'some_user@@some_host'; Ignoring user}
+@code{Found wrong password for user: 'some_user@@some_host'; ignoring user}
this means that when @code{mysqld} was started or when it reloaded the
permissions tables, it found an entry in the @code{user} table with
@@ -46270,8 +46685,8 @@ You have specified a password in the @code{user} table without using the
function:
@example
-mysql> update user set password=PASSWORD('your password')
- -> where user='XXX';
+mysql> UPDATE user SET password=PASSWORD('your password')
+ -> WHERE user='XXX';
@end example
@end itemize
@@ -46284,8 +46699,8 @@ find file: 'xxx' (errno: 2)}, this means that no table exists
in the current database with the name @code{xxx}.
Note that as MySQL uses directories and files to store databases and
-tables, the database and table names are @strong{case sensitive}!
-(On Windows the databases and tables names are not case sensitive, but all
+tables, the database and table names are @strong{case-sensitive}!
+(On Windows the databases and tables names are not case-sensitive, but all
references to a given table within a query must use the same case!)
You can check which tables you have in the current database with
@@ -46534,7 +46949,7 @@ as a Unix user other than @code{root}; just specify the @code{-u root} option
to the client program.
Note that accessing MySQL as @code{root}, by supplying @code{-u
-root} on the command line, has @emph{nothing} to do with MySQL running
+root} on the command-line, has @strong{nothing} to do with MySQL running
as the Unix @code{root} user, or, indeed, as another Unix user. The access
permissions and user names of MySQL are completely separate from
Unix user names. The only connection with Unix user names is that if you
@@ -46652,11 +47067,11 @@ Someone is manipulating the data/index files outside of @strong{mysqld}
without locking the table properly.
@item
If you are running many @code{mysqld} servers on the same data on a
-system that doesn't support good file system locks (normally handled by
+system that doesn't support good filesystem locks (normally handled by
the @code{lockd} daemon ) or if you are running
multiple servers with @code{--skip-locking}
@item
-You have a crashed index/data file that contains very wrong data that
+You have a crashed index/datafile that contains very wrong data that
got @code{mysqld} confused.
@item
You have found a bug in the data storage code. This isn't that likely,
@@ -46666,11 +47081,16 @@ repaired copy of the table!
@end itemize
Because it is very difficult to know why something is crashing, first try to
-check whether or not things that work for others crash for you. Please try
+check whether things that work for others crash for you. Please try
the following things:
@itemize @bullet
@item
+Cleaned up @code{NULL} handling for default values in @code{DESCRIBE
+table_name}.
+@item
+Fixed @code{truncate()} to round up negative values to the nearest integer.
+@item
Take down the @code{mysqld} daemon with @code{mysqladmin shutdown}, run
@code{myisamchk --silent --force */*.MYI} on all tables, and restart the
@code{mysqld} daemon. This will ensure that you are running from a clean
@@ -46678,7 +47098,7 @@ state. @xref{MySQL Database Administration}.
@item
Use @code{mysqld --log} and try to determine from the information in the log
-whether or not some specific query kills the server. About 95% of all bugs are
+whether some specific query kills the server. About 95% of all bugs are
related to a particular query! Normally this is one of the last queries in
the log file just before MySQL restarted. @xref{Query log}.
If you can repeatadly kill MySQL with one of the queries, even
@@ -46843,7 +47263,7 @@ When a disk-full condition occurs, MySQL does the following:
@itemize @bullet
@item
-It checks once every minute to see whether or not there is enough space to
+It checks once every minute to see whether there is enough space to
write the current row. If there is enough space, it continues as if nothing had
happened.
@item
@@ -46885,16 +47305,16 @@ unchanged).
MySQL uses the value of the @code{TMPDIR} environment variable as
the pathname of the directory in which to store temporary files. If you don't
have @code{TMPDIR} set, MySQL uses the system default, which is
-normally @file{/tmp} or @file{/usr/tmp}. If the file system containing your
+normally @file{/tmp} or @file{/usr/tmp}. If the filesystem containing your
temporary file directory is too small, you should edit @code{safe_mysqld} to
-set @code{TMPDIR} to point to a directory in a file system where you have
+set @code{TMPDIR} to point to a directory in a filesystem where you have
enough space! You can also set the temporary directory using the
@code{--tmpdir} option to @code{mysqld}.
MySQL creates all temporary files as hidden files. This ensures
that the temporary files will be removed if @code{mysqld} is terminated. The
disadvantage of using hidden files is that you will not see a big temporary
-file that fills up the file system in which the temporary file directory is
+file that fills up the filesystem in which the temporary file directory is
located.
When sorting (@code{ORDER BY} or @code{GROUP BY}), MySQL normally
@@ -46924,14 +47344,14 @@ the original table.
If you have problems with the fact that anyone can delete the
MySQL communication socket @file{/tmp/mysql.sock}, you can,
-on most versions of Unix, protect your @file{/tmp} file system by setting
+on most versions of Unix, protect your @file{/tmp} filesystem by setting
the @code{sticky} bit on it. Log in as @code{root} and do the following:
@example
shell> chmod +t /tmp
@end example
-This will protect your @file{/tmp} file system so that files can be deleted
+This will protect your @file{/tmp} filesystem so that files can be deleted
only by their owners or the superuser (@code{root}).
You can check if the @code{sticky} bit is set by executing @code{ls -ld /tmp}.
@@ -46956,7 +47376,7 @@ socket=path-for-socket-file
@end example
@xref{Option files}.
@item
-Specifying this on the command line to @code{safe_mysqld} and most
+Specifying this on the command-line to @code{safe_mysqld} and most
clients with the @code{--socket=path-for-socket-file} option.
@item
Specify the path to the socket in the @code{MYSQL_UNIX_PORT} environment
@@ -46999,7 +47419,7 @@ the server runs, for example, in @code{safe_mysqld} or @code{mysql.server}.
* Problems with alias:: Problems with @code{alias}
* Deleting from related tables:: Deleting Rows from Related Tables
* No matching rows:: Solving Problems with No Matching Rows
-* Problems with float:: Problems with floating point comparison
+* Problems with float:: Problems with floating-point comparison
@end menu
@node Case sensitivity, Using DATE, Query Issues, Query Issues
@@ -47011,7 +47431,7 @@ the server runs, for example, in @code{safe_mysqld} or @code{mysql.server}.
@cindex Big5 Chinese character encoding
By default, MySQL searches are case-insensitive (although there are
-some character sets that are never case insensitive, such as @code{czech}).
+some character sets that are never case-insensitive, such as @code{czech}).
That means that if you search with @code{col_name LIKE 'a%'}, you will get all
column values that start with @code{A} or @code{a}. If you want to make this
search case-sensitive, use something like @code{INSTR(col_name, "A")=1} to
@@ -47064,8 +47484,8 @@ makes sense as a date.
The special date @code{'0000-00-00'} can be stored and retrieved as
@code{'0000-00-00'.} When using a @code{'0000-00-00'} date through
-@strong{MyODBC}, it will automatically be converted to @code{NULL} in
-@strong{MyODBC} Version 2.50.12 and above, because ODBC can't handle this kind of
+@code{MyODBC}, it will automatically be converted to @code{NULL} in
+@code{MyODBC} Version 2.50.12 and above, because ODBC can't handle this kind of
date.
Because MySQL performs the conversions described above, the following
@@ -47081,7 +47501,7 @@ mysql> INSERT INTO tbl_name (idate) VALUES ('0000-00-00');
mysql> SELECT idate FROM tbl_name WHERE idate >= '1997-05-05';
mysql> SELECT idate FROM tbl_name WHERE idate >= 19970505;
-mysql> SELECT mod(idate,100) FROM tbl_name WHERE idate >= 19970505;
+mysql> SELECT MOD(idate,100) FROM tbl_name WHERE idate >= 19970505;
mysql> SELECT idate FROM tbl_name WHERE idate >= '19970505';
@end example
@@ -47096,7 +47516,7 @@ mysql> SELECT idate FROM tbl_name WHERE STRCMP(idate,'19970505')=0;
a string and performs a string comparison. It does not convert
@code{'19970505'} to a date and perform a date comparison.
-Note that MySQL does no checking whether or not the date is
+Note that MySQL does no checking whether the date is
correct. If you store an incorrect date, such as @code{'1998-2-31'}, the
wrong date will be stored. If the date cannot be converted to any reasonable
value, a @code{0} is stored in the @code{DATE} field. This is mainly a speed
@@ -47113,7 +47533,7 @@ the server.
The concept of the @code{NULL} value is a common source of confusion for
newcomers to SQL, who often think that @code{NULL} is the same thing as an
-empty string @code{''}. This is not the case! For example, the following
+empty string @code{""}. This is not the case! For example, the following
statements are completely different:
@example
@@ -47153,10 +47573,12 @@ mysql> SELECT * FROM my_table WHERE phone IS NULL;
mysql> SELECT * FROM my_table WHERE phone = "";
@end example
-In MySQL, as in many other SQL servers, you can't index
-columns that can have @code{NULL} values. You must declare such columns
-@code{NOT NULL}. Conversely, you cannot insert @code{NULL} into an indexed
-column.
+Note that you can only add an index on a column that can have @code{NULL}
+values if you are using MySQL Version 3.23.2 or newer and are using the
+@code{MyISAM} or @code{InnoDB} table type.
+In earlier versions and with other table types, you must declare such
+columns @code{NOT NULL}. This also means you cannot then insert
+@code{NULL} into an indexed column.
@findex LOAD DATA INFILE
When reading data with @code{LOAD DATA INFILE}, empty columns are updated
@@ -47219,9 +47641,9 @@ decide which rows from the result set should be used.
@cindex rows, deleting
@cindex tables, deleting rows
-As MySQL doesn't support sub-selects or use of more than one table
-in the @code{DELETE} statement, you should use the following approach to
-delete rows from 2 related tables:
+As MySQL doesn't yet support sub-selects, nor the use of more than one
+table in the @code{DELETE} statement (prior to Version 4.0), you should
+use the following approach to delete rows from 2 related tables:
@enumerate
@item
@@ -47292,17 +47714,17 @@ Post the test file using @code{mysqlbug} to @email{mysql@@lists.mysql.com}.
@end enumerate
@node Problems with float, , No matching rows, Query Issues
-@appendixsubsec Problems with Floating Point Comparison
+@appendixsubsec Problems with Floating-Point Comparison
-Floating point numbers cause confusion sometimes, because these numbers
+floating-point numbers cause confusion sometimes, because these numbers
are not stored as exact values inside computer architecture. What one
can see on the screen usually is not the exact value of the number.
Field types @code{FLOAT}, @code{DOUBLE} and @code{DECIMAL} are such.
@example
-CREATE TABLE t1 (i int, d1 decimal(9,2), d2 decimal(9,2));
-INSERT INTO t1 values (1, 101.40, 21.40), (1, -80.00, 0.00),
+CREATE TABLE t1 (i INT, d1 DECIMAL(9,2), d2 DECIMAL(9,2));
+INSERT INTO t1 VALUES (1, 101.40, 21.40), (1, -80.00, 0.00),
(2, 0.00, 0.00), (2, -13.20, 0.00), (2, 59.60, 46.40),
(2, 30.40, 30.40), (3, 37.00, 7.40), (3, -29.60, 0.00),
(4, 60.00, 15.40), (4, -10.60, 0.00), (4, -34.00, 0.00),
@@ -47329,7 +47751,7 @@ difference between the numbers show up around tenth decimal, or so
depending on computer architecture.
The problem cannot be solved by using ROUND() (or similar function),
-because the result is still a floating point number. Example:
+because the result is still a floating-point number. Example:
@example
mysql> SELECT i, ROUND(SUM(d1), 2) AS a, ROUND(SUM(d2), 2) AS b
@@ -47363,7 +47785,7 @@ mysql> SELECT i, ROUND(SUM(d1), 2)*1.0000000000000000 AS a,
@end example
Depending on the computer architecture you may or may not see similar results.
-Each CPU may evaluate floating point numbers differently. For example in
+Each CPU may evaluate floating-point numbers differently. For example in
some machines you may get 'right' results by multiplaying both arguments
with 1, an example follows.
@@ -47381,14 +47803,14 @@ mysql> SELECT i, ROUND(SUM(d1), 2)*1 AS a, ROUND(SUM(d2), 2)*1 AS b
@end example
The reason why the above example seems to be working is that on the
-particular machine where the test was done, the CPU floating point
+particular machine where the test was done, the CPU floating-point
arithmetics happens to round the numbers to same, but there is no
rule that any CPU should do so, so it cannot be trusted.
-The correct way to do floating point number comparison is to first
+The correct way to do floating-point number comparison is to first
decide on what is the wanted tolerance between the numbers and then do
the comparsion against the tolerance number. For example, if we agree on
-that floating point numbers should be regarded the same, if they are
+that floating-point numbers should be regarded the same, if they are
same with precision of one of ten thousand (0.0001), the comparsion
should be done like this:
@@ -47523,14 +47945,14 @@ The following are a list of the limitations with @code{TEMPORARY TABLES}.
@itemize @bullet
@item
-A temporary table can only be of type @code{HEAP}, @code{ISAM} or
-@code{MyISAM}.
+A temporary table can only be of type @code{HEAP}, @code{ISAM},
+@code{MyISAM} or @code{InnoDB}.
@item
You can't use temporary tables more than once in the same query.
For example, the following doesn't work.
@example
-select * from temporary_table, temporary_table as t2;
+mysql> SELECT * FROM temporary_table, temporary_table AS t2;
@end example
We plan to fix the above in 4.0.
@@ -47555,7 +47977,7 @@ tools and add-ons.
A list of what is available at
@uref{http://www.mysql.com/Downloads/Contrib/}
-(or any mirror) is shown below.
+(or any mirror) is shown here.
Please visit our Software Portal at
@uref{http://www.mysql.com/portal/software/}.
@@ -47620,7 +48042,7 @@ license. Please check @uref{http://www.worldserver.com/mm.mysql/} for
the latest drivers (and other JDBC information) because these drivers may be out of date.
@item @uref{http://www.caucho.com/projects/jdbc-mysql/index.xtp}
-The Resin commercial JDBC driver, which is released under Open Source.
+The Resin commercial JDBC driver, which is released under @code{Open Source}.
It claims to be faster than the mm driver, but we haven't received that much
information about this yet.
@@ -47714,7 +48136,7 @@ Python interface for MySQL. By Joseph Skinner @email{joe@@earthlight.co.nz}. Mod
@item @uref{http://www.mysql.com/Downloads/Contrib/MySQL-python-0.3.0.tar.gz}
MySQLdb Python is an DB-API v2.0-compliant interface to MySQL. Transactions
are supported if the server and tables support them. It is
-thread safe, and contains a compatibility module for older code
+thread-safe, and contains a compatibility module for older code
written for the no-longer-maintained MySQLmodule interface.
@item @uref{http://www.mysql.com/Downloads/Contrib/mysql_mex_12.tar.gz}
@@ -47777,7 +48199,7 @@ By Ken Menzel @email{kenm@@icarz.com}.
@item @uref{http://www.mysql.com/Downloads/Contrib/MYSQLX.EXE}
MySQL ActiveX Object for directly accessing your MySQL
servers from IIS/ASP, VB, VC++ skipping the slower ODBC methods. Fully
-updatable, multithreaded with full support for all MySQL fieldtypes
+updatable, multi-threaded with full support for all MySQL fieldtypes
(version 2001.1.1). By SciBit @uref{http://www.scibit.com/}.
@item @uref{http://www.fastflow.it/mylua/}
@@ -47912,7 +48334,7 @@ The xmysql homepage is at @uref{http://web.wt.net/~dblhack/}
Requires @uref{http://bragg.phys.uwm.edu/xforms/} (xforms 0.88) to work.
@item @uref{http://www.tamos.net/sw/dbMetrix/}
-dbMatrix is an Open Source client for exploring databases and executing
+dbMatrix is an @code{Open Source} client for exploring databases and executing
SQL. Supports MySQL, Oracle, PostgreSQL, and mSQL.
@item @uref{http://www.multimania.com/bbrox/GtkSQL/}
@@ -47942,7 +48364,7 @@ Oracle 8 and MySQL as the back-end databases. It requires JDK 1.3 from
JavaSoft.
@item @uref{http://www.jetools.com/products/databrowser/}
The DataBrowser is a cross-database, cross-platform data access tool. It is more
-user friendly than tools like SQL Plus, psql (command line based tools). It is more
+user friendly than tools like SQL Plus, psql (command-line based tools). It is more
flexible than TOAD, ISQL, PGAccess which are GUI's that are limitied to a single
platform or database.
@item @uref{http://www.intrex.net/amit/software/}
@@ -47970,7 +48392,7 @@ WWW MySQL administrator for the @code{user,} @code{db} and
@item @uref{http://www.mysql.com/Downloads/Contrib/mysql-webadmin-1.0a8-rz.tar.gz}
A tool written in PHP-FI to administrate MySQL databases
-remotely over the web within a Web-Browser. By Peter Kuppelwieser,
+remotely over the web within a web-browser. By Peter Kuppelwieser,
@email{peter.kuppelwieser@@kantea.it}. Updated by Wim Bonis,
@email{bonis@@kiss.de}. Not maintained anymore!
@@ -48008,8 +48430,8 @@ This cgi scripts in Perl enables you to edit content of Mysql
database. By Tomas Zeman.
@item @uref{http://worldcommunity.com/opensource/futuresql/}
-FutureSQL by Peter F. Brown, is a free, Open Source rapid application
-development Web database administration tool, written in Perl,
+FutureSQL by Peter F. Brown, is a free, @code{Open Source} rapid application
+development web database administration tool, written in Perl,
using MySQL. It uses @code{DBI:DBD} and @code{CGI.pm}.
FutureSQL allows one to easily set up config files to view, edit, delete,
@@ -48184,13 +48606,13 @@ while converting, quotes @strong{all} special characters in text and
binary data, and so on. It will also convert to @code{mSQL} v1 and v2,
and is free of charge for anyone. See
@uref{http://www.cynergi.net/exportsql/} for the latest version. By
-Pedro Freire, @email{support@@cynergi.net}. NOTE: Doesn't work with
+Pedro Freire, @email{support@@cynergi.net}. Note: Doesn't work with
Access2!
@item @uref{http://www.mysql.com/Downloads/Contrib/access_to_mysql.txt}
Paste this function into an Access module of a database that has the
tables you want to export. See also @code{exportsql}. By Brian Andrews.
-NOTE: Doesn't work with Access2!
+Note: Doesn't work with Access2!
@item @uref{http://www.mysql.com/Downloads/Contrib/importsql.txt}
A script that does the exact reverse of @code{exportsql.txt}. That is,
@@ -48200,7 +48622,7 @@ use Access for all DB design and administration, and synchronise with
your actual MySQL server either way. Free of charge. See
@uref{http://www.netdive.com/freebies/importsql/} for any updates.
Created by Laurent Bossavit of NetDIVE.
-@strong{NOTE:} Doesn't work with Access2!
+@strong{Note}: doesn't work with Access2!
@item @uref{http://www.mysql.com/Downloads/Contrib/mdb2sql.bas}
Converter from Access97 to MySQL by Moshe Gurvich.
@@ -48420,7 +48842,7 @@ hashing. In use since 1981 and published around 1984.
@item
The @code{replace} program (take a look at it, it's @strong{COOL}!).
@item
-@strong{MyODBC}, the ODBC driver for Windows95.
+@code{MyODBC}, the ODBC driver for Windows95.
@item
Fixing bugs in MIT-pthreads to get it to work for MySQL Server. And
also Unireg, a curses-based application tool with many utilities.
@@ -48881,7 +49303,7 @@ This appendix lists the changes from version to version in the MySQL
source code.
Note that we tend to update the manual at the same time we make changes to
-MySQL. If you find a version listed below that you can't
+MySQL. If you find a version listed here that you can't
find on the MySQL download page
(@uref{http://www.mysql.com/downloads/}),
this means that the version has not yet been released!
@@ -48909,8 +49331,8 @@ Our TODO section contains what we plan to have in 4.0. @xref{TODO MySQL 4.0}.
@menu
* News-4.0.2:: Changes in release 4.0.2
-* News-4.0.1:: Changes in release 4.0.1
-* News-4.0.0:: Changes in release 4.0.0
+* News-4.0.1:: Changes in release 4.0.1 (23 Dec 2001)
+* News-4.0.0:: Changes in release 4.0.0 (Oct 2001: Alpha)
@end menu
@node News-4.0.2, News-4.0.1, News-4.0.x, News-4.0.x
@@ -48918,7 +49340,47 @@ Our TODO section contains what we plan to have in 4.0. @xref{TODO MySQL 4.0}.
@itemize @bullet
@item
-@code{INET_NTOA()} now returns @code{NULL} if you give it a too big argument.
+Fixed bug in @code{GROUP BY} with two or more fields, where at least one
+field can contain @code{NULL} values.
+@item
+Use @code{Turbo Boyer-Moore} algorithm to speed up @code{LIKE "%keyword%"}
+searches.
+@item
+Fixed bug in @code{DROP DATABASE} with symlink.
+@item
+Fixed crash in @code{REPAIR ... USE_FRM}.
+@item
+Fixed bug in @code{EXPLAIN} with @code{LIMIT offset != 0}
+@item
+Fixed bug in phrase operator @code{"..."} in boolean full-text search.
+@item
+Fixed bug that caused duplicated rows when using truncation operator
+@code{*} in boolean full-text search.
+@item
+Fixed bug in truncation operator of boolean full-text search (wrong results
+when there are only @code{+word*}'s in the query).
+@item
+Fixed bug in boolean full-text search that caused a crash when an identical
+@code{MATCH} expression that did not use an index appeared twice.
+@item
+Query cache is now automatically disabled in @code{mysqldump}.
+@item
+Fixed problem on Windows 98 that made sending of results very slow.
+@item
+Boolean full-text search weighting scheme changed to something more reasonable.
+@item
+Fixed bug in boolean full-text search that caused MySQL to ignore queries of
+@code{ft_min_word_len} characters.
+@item
+Boolean full-text search now supports ``phrase searches''.
+@item
+New configure option @code{--without-query-cache}.
+@item
+Memory allocation strategy for ``root memory'' changed. Block size now grows
+with number of allocated blocks.
+@item
+@code{INET_NTOA()} now returns @code{NULL} if you give it an argument that
+is too large (greater than the value corresponding to @code{255.255.255.255}).
@item
Fix @code{SQL_CALC_FOUND_ROWS} to work with @code{UNION}s. It will work only
if the first @code{SELECT} has this option and if there is global @code{LIMIT}
@@ -49062,17 +49524,27 @@ Changed order in which keys are created in tables.
@item
Added new columns @code{Null} and @code{Index_type} to @code{SHOW INDEX}
output.
+@item
+Added @code{--no-beep} and @code{--prompt} options to @code{mysql} command-line client.
+@item
+New feature: management of user resources.
+@example
+GRANT ... WITH MAX_QUERIES_PER_HOUR = N1
+ MAX_UPDATES_PER_HOUR = N2
+ MAX_CONNECTIONS_PER_HOUR = N3;
+@end example
+@xref{User resources}.
@end itemize
@node News-4.0.1, News-4.0.0, News-4.0.2, News-4.0.x
-@appendixsubsec Changes in release 4.0.1
+@appendixsubsec Changes in release 4.0.1 (23 Dec 2001)
@itemize @bullet
@item
Fixed bug when @code{HANDLER} was used with some unsupported table type.
@item
@code{mysqldump} now puts @code{ALTER TABLE tbl_name DISABLE KEYS} and
-@code{ALTER TABLE tbl_name DISABLE KEYS} in the sql dump.
+@code{ALTER TABLE tbl_name ENABLE KEYS} in the sql dump.
@item
Added @code{mysql_fix_extensions} script.
@item
@@ -49118,7 +49590,7 @@ Added support for @code{MATCH ... AGAINST(... IN BOOLEAN MODE)}.
@code{ALTER TABLE tablename TYPE=MyISAM} to be
able to use boolean full-text search}.
@item
-@code{LOCATE()} and @code{INSTR()} are now case sensitive if either
+@code{LOCATE()} and @code{INSTR()} are now case-sensitive if either
argument is a binary string.
@item
Changed @code{RAND()} initialisation so that @code{RAND(N)} and
@@ -49139,7 +49611,7 @@ Indexes are now used with @code{ORDER BY} on a whole @code{InnoDB} table.
@end itemize
@node News-4.0.0, , News-4.0.1, News-4.0.x
-@appendixsubsec Changes in release 4.0.0
+@appendixsubsec Changes in release 4.0.0 (Oct 2001: Alpha)
@itemize @bullet
@item
@@ -49169,7 +49641,7 @@ now handle signed and unsigned @code{BIGINT} numbers correctly.
New character set @code{latin_de} which provides correct German sorting.
@item
@code{STRCMP()} now uses the current character set when doing comparisons,
-which means that the default comparison behavior now is case insensitive.
+which means that the default comparison behavior now is case-insensitive.
@item
@code{TRUNCATE TABLE} and @code{DELETE FROM tbl_name} are now separate
functions. One bonus is that @code{DELETE FROM tbl_name} now returns
@@ -49211,7 +49683,8 @@ Optimised queries of type:
@item
@code{LOAD DATA FROM MASTER} ``auto-magically'' sets up a slave.
@item
-Renamed @code{safe_mysqld} to @code{mysqld_safe}.
+Renamed @code{safe_mysqld} to @code{mysqld_safe} to make this name more
+in line with other MySQL scripts/commands.
@item
Added support for symbolic links to @code{MyISAM} tables. Symlink handling is
now enabled by default for Windows.
@@ -49263,12 +49736,12 @@ present in previous versions. We have added three new
table types:
@table @asis
-@item @strong{MyISAM}
+@item @code{MyISAM}
A new ISAM library which is tuned for SQL and supports large files.
-@item @strong{BerkeleyDB} or @strong{BDB}
+@item @code{BerkeleyDB} or @code{BDB}
Uses the Berkeley DB library from Sleepycat Software to implement
transaction-safe tables.
-@item @strong{InnoDB}
+@item @code{InnoDB}
A transaction-safe table handler that supports row level locking, and many
Oracle-like features.
@end table
@@ -49296,43 +49769,43 @@ not yet 100% confident in this code.
@menu
* News-3.23.51:: Changes in release 3.23.51
-* News-3.23.50:: Changes in release 3.23.50
+* News-3.23.50:: Changes in release 3.23.50 (21 Apr 2002)
* News-3.23.49:: Changes in release 3.23.49
-* News-3.23.48:: Changes in release 3.23.48
-* News-3.23.47:: Changes in release 3.23.47
-* News-3.23.46:: Changes in release 3.23.46
-* News-3.23.45:: Changes in release 3.23.45
-* News-3.23.44:: Changes in release 3.23.44
+* News-3.23.48:: Changes in release 3.23.48 (07 Feb 2002)
+* News-3.23.47:: Changes in release 3.23.47 (27 Dec 2001)
+* News-3.23.46:: Changes in release 3.23.46 (29 Nov 2001)
+* News-3.23.45:: Changes in release 3.23.45 (22 Nov 2001)
+* News-3.23.44:: Changes in release 3.23.44 (31 Oct 2001)
* News-3.23.43:: Changes in release 3.23.43
-* News-3.23.42:: Changes in release 3.23.42
-* News-3.23.41:: Changes in release 3.23.41
+* News-3.23.42:: Changes in release 3.23.42 (08 Sep 2001)
+* News-3.23.41:: Changes in release 3.23.41 (11 Aug 2001)
* News-3.23.40:: Changes in release 3.23.40
-* News-3.23.39:: Changes in release 3.23.39
-* News-3.23.38:: Changes in release 3.23.38
-* News-3.23.37:: Changes in release 3.23.37
-* News-3.23.36:: Changes in release 3.23.36
-* News-3.23.35:: Changes in release 3.23.35
+* News-3.23.39:: Changes in release 3.23.39 (12 Jun 2001)
+* News-3.23.38:: Changes in release 3.23.38 (09 May 2001)
+* News-3.23.37:: Changes in release 3.23.37 (17 Apr 2001)
+* News-3.23.36:: Changes in release 3.23.36 (27 Mar 2001)
+* News-3.23.35:: Changes in release 3.23.35 (15 Mar 2001)
* News-3.23.34a:: Changes in release 3.23.34a
-* News-3.23.34:: Changes in release 3.23.34
-* News-3.23.33:: Changes in release 3.23.33
-* News-3.23.32:: Changes in release 3.23.32
-* News-3.23.31:: Changes in release 3.23.31
-* News-3.23.30:: Changes in release 3.23.30
-* News-3.23.29:: Changes in release 3.23.29
-* News-3.23.28:: Changes in release 3.23.28
-* News-3.23.27:: Changes in release 3.23.27
+* News-3.23.34:: Changes in release 3.23.34 (10 Mar 2001)
+* News-3.23.33:: Changes in release 3.23.33 (09 Feb 2001)
+* News-3.23.32:: Changes in release 3.23.32 (22 Jan 2001: Stable)
+* News-3.23.31:: Changes in release 3.23.31 (17 Jan 2001)
+* News-3.23.30:: Changes in release 3.23.30 (04 Jan 2001)
+* News-3.23.29:: Changes in release 3.23.29 (16 Dec 2000)
+* News-3.23.28:: Changes in release 3.23.28 (22 Nov 2000: Gamma)
+* News-3.23.27:: Changes in release 3.23.27 (24 Oct 2000)
* News-3.23.26:: Changes in release 3.23.26
* News-3.23.25:: Changes in release 3.23.25
-* News-3.23.24:: Changes in release 3.23.24
+* News-3.23.24:: Changes in release 3.23.24 (08 Sep 2000)
* News-3.23.23:: Changes in release 3.23.23
-* News-3.23.22:: Changes in release 3.23.22
+* News-3.23.22:: Changes in release 3.23.22 (31 Jul 2000)
* News-3.23.21:: Changes in release 3.23.21
* News-3.23.20:: Changes in release 3.23.20
* News-3.23.19:: Changes in release 3.23.19
* News-3.23.18:: Changes in release 3.23.18
* News-3.23.17:: Changes in release 3.23.17
* News-3.23.16:: Changes in release 3.23.16
-* News-3.23.15:: Changes in release 3.23.15
+* News-3.23.15:: Changes in release 3.23.15 (May 2000: Beta)
* News-3.23.14:: Changes in release 3.23.14
* News-3.23.13:: Changes in release 3.23.13
* News-3.23.12:: Changes in release 3.23.12
@@ -49347,7 +49820,7 @@ not yet 100% confident in this code.
* News-3.23.3:: Changes in release 3.23.3
* News-3.23.2:: Changes in release 3.23.2
* News-3.23.1:: Changes in release 3.23.1
-* News-3.23.0:: Changes in release 3.23.0
+* News-3.23.0:: Changes in release 3.23.0 (Sep 1999: Alpha)
@end menu
@node News-3.23.51, News-3.23.50, News-3.23.x, News-3.23.x
@@ -49355,16 +49828,71 @@ not yet 100% confident in this code.
@itemize @bullet
@item
-Fixed @code{SIGINT} and @code{SIGQUIT} problems in @code{mysql}.
+Remove end space from @code{enum} values. (This fixed a problem with
+@code{SHOW CREATE TABLE}).
@item
-Fixed bug in character table converts when used with big ( > 64K) strings.
+Fixed bug in @code{CONCAT_WS()} that cut the result.
+@item
+Changed name of variables @code{Com_show_master_stat} to
+@code{Com_show_master_status} and @code{Com_show_slave_stat} to
+@code{Com_show_slave_status}.
+@item
+Changed handling of @code{gethostbyname()} to make the client library
+threadsafe even if @code{gethostbyname_r} doesn't exists.
+@item
+Fixed core-dump problem when giving a wrong password string to @code{GRANT}.
+@item
+Fixed bug in @code{DROP DATABASE} with symlinked directory.
+@item
+Fixed optimization problem with @code{DATETIME} and value outside
+@code{DATETIME} range.
+@item
+Removed BDB documentation.
+@item
+Fixed mit-pthreads to compile with glibc 2.2 (needed for @code{make dist}).
+@item
+Fixed the @code{FLOAT(X+1,X)} is not converted to @code{FLOAT(X+2,X)}.
+(This also affected @code{DECIMAL}, @code{DOUBLE} and @code{REAL} types)
+@item
+Fixed the result from @code{IF()} is case in-sensitive if the 2 and
+third arguments are case sensitive.
+@item
+Fixed core dump problem on OSF in @code{gethostbyname_r}.
+@item
+Fixed that underflowed decimal fields is not zero filled.
+@item
+If we get an overflow when inserting @code{'+11111'} for
+@code{decimal(5,0) unsigned} columns, we will just drop the sign.
+@item
+Fixed optimization bug with @code{ISNULL(expression_which_cannot_be_null)} and
+@code{ISNULL(constant_expression)}.
+@item
+Fixed host lookup bug in the glibc library that we used with the 3.23.50
+Linux-x86 binaries.
@end itemize
@node News-3.23.50, News-3.23.49, News-3.23.51, News-3.23.x
-@appendixsubsec Changes in release 3.23.50
+@appendixsubsec Changes in release 3.23.50 (21 Apr 2002)
@itemize @bullet
@item
+Fixed problem with @code{crash-me} and @code{gcc} 3.0.4.
+@item
+Fixed that @code{@@@@unknown_variable} doesn't hang server.
+@item
+Added @code{@@@@VERSION} as a synonym for @code{VERSION()}.
+@item
+@code{SHOW VARIABLES LIKE 'xxx'} is now case-insensitive.
+@item
+Fixed timeout for @code{GET_LOCK()} on HPUX with DCE threads.
+@item
+Fixed memory allocation bug in the glibc library used to build Linux
+binaries, which caused mysqld to die in 'free()'.
+@item
+Fixed @code{SIGINT} and @code{SIGQUIT} problems in @code{mysql}.
+@item
+Fixed bug in character table converts when used with big ( > 64K) strings.
+@item
@code{InnoDB} now retains foreign key constraints through @code{ALTER TABLE}
and @code{CREATE/DROP INDEX}.
@item
@@ -49418,7 +49946,7 @@ with @code{GROUP BY}.
@itemize @bullet
@item
-Don't give warning for a statement that is only a comment; This is needed for
+Don't give warning for a statement that is only a comment; this is needed for
@code{mysqldump --disable-keys} to work.
@item
Fixed unlikely caching bug when doing a join without keys. In this case
@@ -49434,7 +49962,7 @@ Fixed shutdown problem on NT.
@end itemize
@node News-3.23.48, News-3.23.47, News-3.23.49, News-3.23.x
-@appendixsubsec Changes in release 3.23.48
+@appendixsubsec Changes in release 3.23.48 (07 Feb 2002)
@itemize @bullet
@item
@@ -49493,7 +50021,7 @@ this situation.
@end itemize
@node News-3.23.47, News-3.23.46, News-3.23.48, News-3.23.x
-@appendixsubsec Changes in release 3.23.47
+@appendixsubsec Changes in release 3.23.47 (27 Dec 2001)
@itemize @bullet
@item
@@ -49525,7 +50053,7 @@ Fixed bug when using @code{t1 LEFT JOIN t2 ON t2.key=constant}.
@end itemize
@node News-3.23.46, News-3.23.45, News-3.23.47, News-3.23.x
-@appendixsubsec Changes in release 3.23.46
+@appendixsubsec Changes in release 3.23.46 (29 Nov 2001)
@itemize @bullet
@item
@@ -49554,7 +50082,7 @@ Fixed bug in replication on Mac OS X.
@end itemize
@node News-3.23.45, News-3.23.44, News-3.23.46, News-3.23.x
-@appendixsubsec Changes in release 3.23.45
+@appendixsubsec Changes in release 3.23.45 (22 Nov 2001)
@itemize @bullet
@item
@@ -49585,13 +50113,13 @@ date_column was declared as @code{NOT NULL}.
@item
Fixed bug with @code{BDB} tables and keys on @code{BLOB} columns.
@item
-Fixed bug in @code{MERGE} tables on OS with 32 bit file pointers.
+Fixed bug in @code{MERGE} tables on OS with 32-bit file pointers.
@item
Fixed bug in @code{TIME_TO_SEC()} when using negative values.
@end itemize
@node News-3.23.44, News-3.23.43, News-3.23.45, News-3.23.x
-@appendixsubsec Changes in release 3.23.44
+@appendixsubsec Changes in release 3.23.44 (31 Oct 2001)
@itemize @bullet
@item
@@ -49640,7 +50168,7 @@ Foreign keys checking is now done for @code{InnoDB} tables.
@item
@code{DROP DATABASE} now works also for @code{InnoDB} tables.
@item
-@code{InnoDB} now supports data files and raw disk partitions bigger
+@code{InnoDB} now supports datafiles and raw disk partitions bigger
than 4 GB on those operating systems that have big files.
@item
@code{InnoDB} calculates better table cardinality estimates for the
@@ -49649,7 +50177,7 @@ MySQL optimiser.
Accent characters in the default character set @code{latin1} are ordered
according to the MySQL ordering.
-NOTE: if you are using @code{latin1} and have inserted characters whose
+Note: if you are using @code{latin1} and have inserted characters whose
code is greater than 127 into an indexed @code{CHAR} column, you should
run @code{CHECK TABLE} on your table when you upgrade to 3.23.44, and
drop and reimport the table if @code{CHECK TABLE} reports an error!
@@ -49657,10 +50185,10 @@ drop and reimport the table if @code{CHECK TABLE} reports an error!
A new @file{my.cnf} parameter, @code{innodb_thread_concurrency}, helps in
performance tuning in heavily concurrent environments.
@item
-A new @code{my.cnf} parameter, @code{innodb_fast_shutdown}, speeds up
+A new @file{my.cnf} parameter, @code{innodb_fast_shutdown}, speeds up
server shutdown.
@item
-A new @code{my.cnf} parameter, @code{innodb_force_recovery}, helps to save
+A new @file{my.cnf} parameter, @code{innodb_force_recovery}, helps to save
your data in case the disk image of the database becomes corrupt.
@item
@code{innodb_monitor} has been improved and a new
@@ -49674,7 +50202,7 @@ multiple-line inserts.
Fixed a bug when the case of letters changes in an update of an indexed
secondary column.
@item
-Fixed a hang when there are > 24 data files.
+Fixed a hang when there are > 24 datafiles.
@item
Fixed a crash when @code{MAX(col)} is selected from an empty table, and
@code{col} is not the first column in a multi-column index.
@@ -49714,7 +50242,7 @@ Fixed bug in @code{--safe-user-create}.
@end itemize
@node News-3.23.42, News-3.23.41, News-3.23.43, News-3.23.x
-@appendixsubsec Changes in release 3.23.42
+@appendixsubsec Changes in release 3.23.42 (08 Sep 2001)
@itemize @bullet
@item
@@ -49772,7 +50300,7 @@ other threads.
@end itemize
@node News-3.23.41, News-3.23.40, News-3.23.42, News-3.23.x
-@appendixsubsec Changes in release 3.23.41
+@appendixsubsec Changes in release 3.23.41 (11 Aug 2001)
@itemize @bullet
@item
@@ -49831,7 +50359,7 @@ Fixed problem with @code{UPDATE} and @code{BDB} tables.
Fixed hard bug in @code{BDB} tables when using key parts.
@item
Fixed problem when using @code{GRANT FILE ON database.* ...}; previously
-we added the @code{DROP} privilege for the database.
+we added the @strong{drop} privilege for the database.
@item
Fixed @code{DELETE FROM tbl_name ... LIMIT 0} and
@code{UPDATE FROM tbl_name ... LIMIT 0}, which acted as though the
@@ -49867,12 +50395,12 @@ Fixed a bug when using @code{COUNT(DISTINCT)} with @code{LEFT JOIN} and
there weren't any matching rows.
@item
Removed all documentation referring to the @code{GEMINI} table
-type. @code{GEMINI} is not released under an Open Source license.
+type. @code{GEMINI} is not released under an @code{Open Source} license.
@end itemize
@node News-3.23.39, News-3.23.38, News-3.23.40, News-3.23.x
-@appendixsubsec Changes in release 3.23.39
+@appendixsubsec Changes in release 3.23.39 (12 Jun 2001)
@itemize @bullet
@item
@@ -49915,7 +50443,7 @@ Fixed problem with @code{MERGE} tables and big tables (> 4G) when using
@node News-3.23.38, News-3.23.37, News-3.23.39, News-3.23.x
-@appendixsubsec Changes in release 3.23.38
+@appendixsubsec Changes in release 3.23.38 (09 May 2001)
@itemize @bullet
@item
@@ -49967,7 +50495,7 @@ Fixed bug with @code{LOCK TABLE} and @code{BDB} tables.
@node News-3.23.37, News-3.23.36, News-3.23.38, News-3.23.x
-@appendixsubsec Changes in release 3.23.37
+@appendixsubsec Changes in release 3.23.37 (17 Apr 2001)
@itemize @bullet
@item
@@ -49986,7 +50514,7 @@ configuration files where you have used @code{innobase} options!
Fixed bug when using indexes on @code{CHAR(255) NULL} columns.
@item
Slave thread will now be started even if @code{master-host} is not set, as
-long as @code{server-id} is set and valid @code{master.info} is present.
+long as @code{server-id} is set and valid @file{master.info} is present.
@item
Partial updates (terminated with kill) are now logged with a special error
code to the binary log. Slave will refuse to execute them if the error code
@@ -50033,7 +50561,7 @@ Added @code{--skip-safemalloc} option to @code{mysqld}.
@node News-3.23.36, News-3.23.35, News-3.23.37, News-3.23.x
-@appendixsubsec Changes in release 3.23.36
+@appendixsubsec Changes in release 3.23.36 (27 Mar 2001)
@itemize @bullet
@item
@@ -50074,7 +50602,7 @@ Changed some macros to be able to use fast mutex with @code{glibc} 2.2.
@node News-3.23.35, News-3.23.34a, News-3.23.36, News-3.23.x
-@appendixsubsec Changes in release 3.23.35
+@appendixsubsec Changes in release 3.23.35 (15 Mar 2001)
@itemize @bullet
@item
@@ -50103,7 +50631,7 @@ to be compiled.
@node News-3.23.34, News-3.23.33, News-3.23.34a, News-3.23.x
-@appendixsubsec Changes in release 3.23.34
+@appendixsubsec Changes in release 3.23.34 (10 Mar 2001)
@itemize @bullet
@item
@@ -50179,7 +50707,7 @@ where @code{bar} is a column reference, an error was not properly generated.
@node News-3.23.33, News-3.23.32, News-3.23.34, News-3.23.x
-@appendixsubsec Changes in release 3.23.33
+@appendixsubsec Changes in release 3.23.33 (09 Feb 2001)
@itemize @bullet
@item
@@ -50229,7 +50757,7 @@ Added @code{Table_locks_immediate} and @code{Table_locks_waited} status
variables.
@item
Fixed bug in replication that broke slave server start with existing
-@code{master.info}. This fixes a bug introduced in 3.23.32.
+@file{master.info}. This fixes a bug introduced in 3.23.32.
@item
Added @code{SET SQL_SLAVE_SKIP_COUNTER=n} command to recover from
replication glitches without a full database copy.
@@ -50271,7 +50799,7 @@ the disk cache.
@node News-3.23.32, News-3.23.31, News-3.23.33, News-3.23.x
-@appendixsubsec Changes in release 3.23.32
+@appendixsubsec Changes in release 3.23.32 (22 Jan 2001: Stable)
@itemize @bullet
@item
@@ -50313,7 +50841,7 @@ Added @code{MASTER_POS_WAIT()}.
@node News-3.23.31, News-3.23.30, News-3.23.32, News-3.23.x
-@appendixsubsec Changes in release 3.23.31
+@appendixsubsec Changes in release 3.23.31 (17 Jan 2001)
@itemize @bullet
@item
@@ -50369,7 +50897,7 @@ Added @code{Threads_created} status variable to @code{mysqld}.
@node News-3.23.30, News-3.23.29, News-3.23.31, News-3.23.x
-@appendixsubsec Changes in release 3.23.30
+@appendixsubsec Changes in release 3.23.30 (04 Jan 2001)
@itemize @bullet
@item
@@ -50432,7 +50960,7 @@ Fixed bug when running two simultaneous @code{SHOW LOGS} queries.
@node News-3.23.29, News-3.23.28, News-3.23.30, News-3.23.x
-@appendixsubsec Changes in release 3.23.29
+@appendixsubsec Changes in release 3.23.29 (16 Dec 2000)
@itemize @bullet
@item
@@ -50511,7 +51039,7 @@ debugging and testing of replication.
Fixed replication of temporary tables. Handles everything except
slave server restart.
@item
-@code{SHOW KEYS} now shows whether or not key is @code{FULLTEXT}.
+@code{SHOW KEYS} now shows whether key is @code{FULLTEXT}.
@item
New script @code{mysqld_multi}. @xref{mysqld_multi, , @code{mysqld_multi}}.
@item
@@ -50561,7 +51089,7 @@ read by @code{mysql_options()}.
@node News-3.23.28, News-3.23.27, News-3.23.29, News-3.23.x
-@appendixsubsec Changes in release 3.23.28
+@appendixsubsec Changes in release 3.23.28 (22 Nov 2000: Gamma)
@itemize @bullet
@item
@@ -50684,12 +51212,12 @@ new table with the rows in a specific order.
@node News-3.23.27, News-3.23.26, News-3.23.28, News-3.23.x
-@appendixsubsec Changes in release 3.23.27
+@appendixsubsec Changes in release 3.23.27 (24 Oct 2000)
@itemize @bullet
@item
Fixed a bug where the automatic repair of @code{MyISAM} tables sometimes failed
-when the data file was corrupt.
+when the datafile was corrupt.
@item
Fixed a bug in @code{SHOW CREATE} when using @code{AUTO_INCREMENT} columns.
@item
@@ -50708,6 +51236,9 @@ Small portability fixes.
@itemize @bullet
@item
+Renamed @code{FLUSH MASTER} and @code{FLUSH SLAVE} to @code{RESET MASTER}
+and @code{RESET SLAVE}.
+@item
Fixed @code{<>} to work properly with @code{NULL}.
@item
Fixed a problem with @code{SUBSTRING_INDEX()} and @code{REPLACE()}.
@@ -50871,7 +51402,7 @@ Added file mutexes to make @code{pwrite()} safe on Windows.
@node News-3.23.24, News-3.23.23, News-3.23.25, News-3.23.x
-@appendixsubsec Changes in release 3.23.24
+@appendixsubsec Changes in release 3.23.24 (08 Sep 2000)
@itemize @bullet
@item
@@ -50900,7 +51431,7 @@ Restored the @code{win1251} character set (it's now only marked deprecated).
@itemize @bullet
@item
-Changed sort order for 'German'; All tables created with 'German' sortorder
+Changed sort order for 'German'; all tables created with 'German' sortorder
must be repaired with @code{REPAIR TABLE} or @code{myisamchk} before use!
@item
Added @code{--core-file} option to @code{mysqld} to get a core file on
@@ -51007,7 +51538,7 @@ Full-text search via the @code{MATCH()} function and @code{FULLTEXT} index type
@node News-3.23.22, News-3.23.21, News-3.23.23, News-3.23.x
-@appendixsubsec Changes in release 3.23.22
+@appendixsubsec Changes in release 3.23.22 (31 Jul 2000)
@itemize @bullet
@item
@@ -51022,10 +51553,10 @@ Fixed that open transactions in @code{BDB} tables are rolled back if the
connection is closed unexpectedly.
@item
Added workaround for a bug in @code{gcc} 2.96 (intel) and @code{gcc} 2.9
-(Ia64) in @code{gen_lex_hash.c}.
+(IA64) in @code{gen_lex_hash.c}.
@item
Fixed memory leak in the client library when using @code{host=} in the
-@code{my.cnf} file.
+@file{my.cnf} file.
@item
Optimised functions that manipulate the hours/minutes/seconds.
@item
@@ -51035,7 +51566,7 @@ against a number.
Changed the meaning of @code{-F, --fast} for @code{myisamchk}. Added
@code{-C, --check-only-changed} option to @code{myisamchk}.
@item
-Added @code{ANALYZE table_name} to update key statistics for tables.
+Added @code{ANALYZE tbl_name} to update key statistics for tables.
@item
Changed binary items @code{0x...} to be regarded as integers by default.
@item
@@ -51158,7 +51689,7 @@ Fixed big/little endian problem in the replication.
Fixed a problem from 3.23.17 when choosing character set on the client side.
@item
Added @code{FLUSH TABLES WITH READ LOCK} to make a global lock suitable for
-making a copy of MySQL data files.
+making a copy of MySQL datafiles.
@item
@code{CREATE TABLE ... SELECT ... PROCEDURE} now works.
@item
@@ -51184,7 +51715,7 @@ Added table locks to Berkeley DB.
Fixed a bug with @code{LEFT JOIN} and @code{ORDER BY} where the first
table had only one matching row.
@item
-Added 4 sample @code{my.cnf} example files in the @file{support-files}
+Added 4 sample @file{my.cnf} example files in the @file{support-files}
directory.
@item
Fixed @code{duplicated key} problem when doing big @code{GROUP BY} operations.
@@ -51211,7 +51742,7 @@ Changed protocol to let client know if the server is in @code{AUTOCOMMIT} mode
and if there is a pending transaction. If there is a pending transaction,
the client library will give an error before reconnecting to the server to
let the client know that the server did a rollback.
-The protocol is still backward compatible with old clients.
+The protocol is still backward-compatible with old clients.
@item
@code{KILL} now works on a thread that is locked on a 'write' to a dead client.
@item
@@ -51237,6 +51768,8 @@ Added deadlock detection sanity checks to @code{INSERT DELAYED}.
@itemize @bullet
@item
+Added @code{SLAVE START} and @code{SLAVE STOP} statements.
+@item
Added @code{TYPE=QUICK} option to @code{CHECK} and to @code{REPAIR}.
@item
Fixed bug in @code{REPAIR TABLE} when the table was in use by other threads.
@@ -51264,13 +51797,13 @@ Added @code{SQL_LOG_BIN} option.
@node News-3.23.15, News-3.23.14, News-3.23.16, News-3.23.x
-@appendixsubsec Changes in release 3.23.15
+@appendixsubsec Changes in release 3.23.15 (May 2000: Beta)
@itemize @bullet
@item
To start @code{mysqld} as @code{root}, you must now use the @code{--user=root} option.
@item
-Added interface to Berkeley DB. (This is not yet functional; Play with it at
+Added interface to Berkeley DB. (This is not yet functional; play with it at
your own risk!)
@item
Replication between master and slaves.
@@ -51486,7 +52019,7 @@ Fix problem with timezones that have half hour offsets.
@item
Allow the syntax @code{UNIQUE INDEX} in @code{CREATE} statements.
@item
-@code{mysqlhotcopy} - fast on-line hot-backup utility for local
+@code{mysqlhotcopy} - fast online hot-backup utility for local
MySQL databases. By Tim Bunce.
@item
New more secure @code{mysqlaccess}. Thanks to Steve Harvey for this.
@@ -51662,7 +52195,7 @@ FROM pos)}, @code{SUBSTRING_INDEX(str,delim,count)}, @code{RTRIM(str)},
@code{TRIM([[BOTH | TRAILING] [remstr] FROM] str)},
@code{REPLACE(str,from_str,to_str)}, @code{REVERSE(str)},
@code{INSERT(str,pos,len,newstr)}, @code{LCASE(str)}, @code{LOWER(str)},
-@code{UCASE(str)} and @code{UPPER(str)}; Patch by Wei He.
+@code{UCASE(str)} and @code{UPPER(str)}; patch by Wei He.
@item
Fix core dump when releasing a lock from a non-existent table.
@item
@@ -51712,7 +52245,7 @@ Added @code{--quote-names} option to @code{mysqldump}.
@item
Fixed bug that one could make a part of a @code{PRIMARY KEY NOT NULL}.
@item
-Fixed @code{encrypt()} to be thread safe and not reuse buffer.
+Fixed @code{encrypt()} to be thread-safe and not reuse buffer.
@item
Added @code{mysql_odbc_escape_string()} function to support big5 characters in
MyODBC.
@@ -51766,7 +52299,7 @@ Fixed problem when using an @code{AUTO_INCREMENT} column in two keys
@item
With @code{MyISAM}, you now can have an @code{AUTO_INCREMENT} column as a key
sub part:
-@code{CREATE TABLE foo (a int not null auto_increment, b char(5), primary key (b,a))}
+@code{CREATE TABLE foo (a INT NOT NULL AUTO_INCREMENT, b CHAR(5), PRIMARY KEY (b,a))}
@item
Fixed bug in @code{MyISAM} with packed char keys that could be @code{NULL}.
@item
@@ -51835,9 +52368,9 @@ Fixed privilege check for @code{LOAD DATA REPLACE}.
@item
Automatic fixing of broken include files on Solaris 2.7
@item
-Some configure issues to fix problems with big file system detection.
+Some configure issues to fix problems with big filesystem detection.
@item
-@code{REGEXP} is now case insensitive if you use non-binary strings.
+@code{REGEXP} is now case-insensitive if you use non-binary strings.
@end itemize
@@ -51906,7 +52439,7 @@ Added handling of fuzzy dates (dates where day or month is 0), such as
@code{'1999-01-00'}.
@item
Fixed optimisation of @code{SELECT ... WHERE key_part1=const1 AND
-key_part_2=const2 AND key_part1=const4 AND key_part2=const4}; Indextype
+key_part_2=const2 AND key_part1=const4 AND key_part2=const4}; indextype
should be @code{range} instead of @code{ref}.
@item
Fixed @code{egcs} 1.1.2 optimiser bug (when using @code{BLOB}s) on Linux Alpha.
@@ -51960,7 +52493,7 @@ Fixed some compilation problems.
@node News-3.23.0, , News-3.23.1, News-3.23.x
-@appendixsubsec Changes in release 3.23.0
+@appendixsubsec Changes in release 3.23.0 (Sep 1999: Alpha)
@itemize @bullet
@item
@@ -52023,11 +52556,11 @@ WHERE ... PROCEDURE ANALYSE([max elements,[max memory]])
This procedure is extremely useful when you want to check the data in your
table!
@item
-@code{BINARY} cast to force a string to be compared in case sensitive fashion.
+@code{BINARY} cast to force a string to be compared in case-sensitive fashion.
@item
Added @code{--skip-show-database} option to @code{mysqld}.
@item
-Check whether or not a row has changed in an @code{UPDATE} now also works
+Check whether a row has changed in an @code{UPDATE} now also works
with @code{BLOB}/@code{TEXT} columns.
@item
Added the @code{INNER} join syntax. @strong{NOTE}: This made @code{INNER}
@@ -52082,7 +52615,7 @@ All C client API macros are now functions to make shared libraries more
reliable. Because of this, you can no longer call @code{mysql_num_fields()} on
a @code{MYSQL} object, you must use @code{mysql_field_count()} instead.
@item
-Added use of @code{LIBEWRAP}; Patch by Henning P . Schmiedehausen.
+Added use of @code{LIBEWRAP}; patch by Henning P. Schmiedehausen.
@item
Don't allow @code{AUTO_INCREMENT} for other than numerical columns.
@item
@@ -52091,7 +52624,7 @@ Using @code{AUTO_INCREMENT} will now automatically make the column
@item
Show @code{NULL} as the default value for @code{AUTO_INCREMENT} columns.
@item
-Added @code{SQL_BIG_RESULT}; @code{SQL_SMALL_RESULT} is now default.
+Added @code{SQL_BIG_RESULT}; @code{SQL_SMALL_RESULT} is now default.
@item
Added a shared library RPM. This enhancement was contributed by David
Fox (@email{dsfox@@cogsci.ucsd.edu}).
@@ -52135,10 +52668,10 @@ be very easy and painless. @xref{Upgrading-from-3.21}.
* News-3.22.22:: Changes in release 3.22.22
* News-3.22.21:: Changes in release 3.22.21
* News-3.22.20:: Changes in release 3.22.20
-* News-3.22.19:: Changes in release 3.22.19
+* News-3.22.19:: Changes in release 3.22.19 (Mar 1999: Stable)
* News-3.22.18:: Changes in release 3.22.18
* News-3.22.17:: Changes in release 3.22.17
-* News-3.22.16:: Changes in release 3.22.16
+* News-3.22.16:: Changes in release 3.22.16 (Feb 1999: Gamma)
* News-3.22.15:: Changes in release 3.22.15
* News-3.22.14:: Changes in release 3.22.14
* News-3.22.13:: Changes in release 3.22.13
@@ -52147,13 +52680,13 @@ be very easy and painless. @xref{Upgrading-from-3.21}.
* News-3.22.10:: Changes in release 3.22.10
* News-3.22.9:: Changes in release 3.22.9
* News-3.22.8:: Changes in release 3.22.8
-* News-3.22.7:: Changes in release 3.22.7
+* News-3.22.7:: Changes in release 3.22.7 (Sep 1998: Beta)
* News-3.22.6:: Changes in release 3.22.6
* News-3.22.5:: Changes in release 3.22.5
* News-3.22.4:: Changes in release 3.22.4
* News-3.22.3:: Changes in release 3.22.3
* News-3.22.2:: Changes in release 3.22.2
-* News-3.22.1:: Changes in release 3.22.1
+* News-3.22.1:: Changes in release 3.22.1 (Jun 1998: Alpha)
* News-3.22.0:: Changes in release 3.22.0
@end menu
@@ -52179,7 +52712,7 @@ on a table with only one row.
@itemize @bullet
@item
-Fixed problem with @code{GROUP BY} on @code{TINYBLOB} columns; This
+Fixed problem with @code{GROUP BY} on @code{TINYBLOB} columns; this
caused bugzilla to not show rows in some queries.
@item
Had to do total recompile of the Windows binary version as VC++ didn't
@@ -52207,7 +52740,7 @@ Fixed problem when storing numbers in timestamps.
@item
Fix problem with timezones that have half hour offsets.
@item
-Added @code{mysqlhotcopy}, a fast on-line hot-backup utility for local MySQL
+Added @code{mysqlhotcopy}, a fast online hot-backup utility for local MySQL
databases. By Tim Bunce.
@item
New more secure @code{mysqlaccess}. Thanks to Steve Harvey for this.
@@ -52298,7 +52831,7 @@ Fixed problem with @code{AVG()} and @code{STD()} with @code{NULL} values.
@item
Fixed prototype in @file{my_ctype.h} when using other character sets.
@item
-Some configure issues to fix problems with big file system detection.
+Some configure issues to fix problems with big filesystem detection.
@item
Fixed problem when sorting on big @code{BLOB} columns.
@item
@@ -52429,7 +52962,7 @@ another thread.
@item
Fixed bug in @code{LEFT JOIN} involving empty tables.
@item
-Changed the @code{mysql.db} column from @code{char(32)} to @code{char(60)}.
+Changed the @code{mysql.db} column from @code{CHAR(32)} to @code{CHAR(60)}.
@item
@code{MODIFY} and @code{DELAYED} are not reserved words anymore.
@item
@@ -52458,7 +52991,7 @@ The update log didn't have newlines on some operating systems.
@node News-3.22.19, News-3.22.18, News-3.22.20, News-3.22.x
-@appendixsubsec Changes in release 3.22.19
+@appendixsubsec Changes in release 3.22.19 (Mar 1999: Stable)
@itemize @bullet
@item
@@ -52476,8 +53009,8 @@ columns.
@itemize @bullet
@item
-Fixes a fatal problem in 3.22.17 on Linux; After @code{shutdown}
-all threads didn't die properly.
+Fixes a fatal problem in 3.22.17 on Linux; after @code{shutdown}
+not all threads died properly.
@item
Added option @code{-O flush_time=#} to @code{mysqld}. This is mostly
useful on Windows and tells how often MySQL should close all
@@ -52504,7 +53037,7 @@ Using @code{LEFT JOIN} on tables that had circular dependencies caused
@node News-3.22.16, News-3.22.15, News-3.22.17, News-3.22.x
-@appendixsubsec Changes in release 3.22.16
+@appendixsubsec Changes in release 3.22.16 (Feb 1999: Gamma)
@itemize @bullet
@item
@@ -52585,7 +53118,7 @@ Added a patch for @code{localtime_r()} on Windows so that it will not crash
anymore if your date is > 2039, but instead will return a time of all zero.
@item
Names for
-user-defined functions are no longer case sensitive.
+user-defined functions are no longer case-sensitive.
@item
Added escape of @code{^Z} (ASCII 26) to @code{\Z} as @code{^Z} doesn't
work with pipes on Windows.
@@ -52833,7 +53366,7 @@ Added patches for UNIXWARE 7.
@node News-3.22.7, News-3.22.6, News-3.22.8, News-3.22.x
-@appendixsubsec Changes in release 3.22.7
+@appendixsubsec Changes in release 3.22.7 (Sep 1998: Beta)
@itemize @bullet
@item
@@ -52858,7 +53391,7 @@ Changed optimiser to make it better at deciding when to do a full join
and when using keys.
@item
You can now use @code{mysqladmin proc} to display information about your own
-threads. Only users with the @code{Process_priv} privilege can get
+threads. Only users with the @strong{process} privilege can get
information about all threads.
@item
Added handling of formats @code{YYMMDD}, @code{YYYYMMDD},
@@ -52940,7 +53473,7 @@ New better compressed server/client protocol.
You can now store values in the range @code{-838:59:59} <= x <=
@code{838:59:59} in a @code{TIME} column.
@item
-@strong{WARNING: INCOMPATIBLE CHANGE!!}
+@strong{Warning: incompatible change!!}
If you set a @code{TIME} column to too short a value, MySQL now
assumes the value is given as: @code{[[[D ]HH:]MM:]SS} instead of
@code{HH[:MM[:SS]]}.
@@ -52990,13 +53523,13 @@ trailing @samp{;}.
@item
Fix for corrupted fixed-format output generated by @code{SELECT INTO OUTFILE}.
@item
-@strong{Warning: Incompatible change!}
+@strong{Warning: incompatible change!}
Added Oracle @code{GREATEST()} and @code{LEAST()} functions. You must now use
these instead of the @code{MAX()} and @code{MIN()} functions to get the
largest/smallest value from a list of values. These can now handle @code{REAL},
@code{BIGINT} and string (@code{CHAR} or @code{VARCHAR}) values.
@item
-@strong{Warning: Incompatible change!}
+@strong{Warning: incompatible change!}
@code{DAYOFWEEK()} had offset 0 for Sunday. Changed the offset to 1.
@item
Give an error for queries that mix @code{GROUP BY} columns and fields when
@@ -53126,7 +53659,7 @@ All bug fixes from MySQL Version 3.21.32.
@node News-3.22.1, News-3.22.0, News-3.22.2, News-3.22.x
-@appendixsubsec Changes in release 3.22.1
+@appendixsubsec Changes in release 3.22.1 (Jun 1998: Alpha)
@itemize @bullet
@item
@@ -53161,7 +53694,7 @@ matched and updated, and how many ``warnings'' occurred when doing the update.
Fixed incorrect result from @code{FORMAT(-100,2)}.
@item
@code{ENUM} and @code{SET} columns were compared in binary (case-sensitive)
-fashion; changed to be case insensitive.
+fashion; changed to be case-insensitive.
@end itemize
@@ -53170,7 +53703,7 @@ fashion; changed to be case insensitive.
@itemize @bullet
@item
-New (backward compatible) connect protocol that allows you to
+New (backward-compatible) connect protocol that allows you to
specify the database to use when connecting, to get much faster
connections to a specific database.
@@ -53186,7 +53719,7 @@ Each connection is handled by its own thread, rather than by the
master @code{accept()} thread. This fixes permanently the telnet bug
that was a topic on the mail list some time ago.
@item
-All TCP/IP connections are now checked with backward resolution of
+All TCP/IP connections are now checked with backward-resolution of
the hostname to get better security. @code{mysqld} now has a local hostname
resolver cache so connections should actually be faster than before,
even with this feature.
@@ -53243,7 +53776,7 @@ to join them in a specific order.
@item
String functions now return @code{VARCHAR} rather than @code{CHAR} and
the column type is now @code{VARCHAR} for fields saved as @code{VARCHAR}.
-This should make the @strong{MyODBC} driver better, but may break some old
+This should make the @code{MyODBC} driver better, but may break some old
MySQL clients that don't handle @code{FIELD_TYPE_VARCHAR} the same
way as @code{FIELD_TYPE_CHAR}.
@item
@@ -53398,7 +53931,7 @@ it more easily in the future.
@item
@code{mysql} now returns an exit code > 0 if the query returned an error.
@item
-Saving of command line history to file in @code{mysql} client.
+Saving of command-line history to file in @code{mysql} client.
By Tommy Larsen @email{tommy@@mix.hive.no}.
@item
Fixed problem with empty lines that were ignored in @file{mysql.cc}.
@@ -53606,7 +54139,7 @@ Setting a @code{TIMESTAMP} to @code{NULL} in @code{LOAD DATA INFILE ...} didn't
set the current time for the @code{TIMESTAMP}.
@item
Fix @code{BETWEEN} to recognise binary strings. Now @code{BETWEEN} is
-case sensitive.
+case-sensitive.
@item
Added @code{--skip-thread-priority} option to @code{mysqld}, for systems
where @code{mysqld}'s thread scheduling doesn't work properly (BSDI 3.1).
@@ -53649,7 +54182,7 @@ Fix @code{COUNT(*)} problems when the @code{WHERE} clause didn't match any
records. (Bug from 3.21.17.)
@item
Removed that @code{NULL = NULL} is true. Now you must use @code{IS NULL}
-or @code{IS NOT NULL} to test whether or not a value is @code{NULL}.
+or @code{IS NOT NULL} to test whether a value is @code{NULL}.
(This is according to ANSI SQL but may break
old applications that are ported from @code{mSQL}.)
You can get the old behavior by compiling with @code{-DmSQL_COMPLIANT}.
@@ -53868,7 +54401,7 @@ designed to find as many limits as possible in a SQL server. Tested with
@item
Fixed bug in range-optimiser that crashed MySQL on some queries.
@item
-Table and column name completion for @code{mysql} command line tool, by Zeev
+Table and column name completion for @code{mysql} command-line tool, by Zeev
Suraski and Andi Gutmans.
@item
Added new command @code{REPLACE} that works like @code{INSERT} but
@@ -54190,7 +54723,7 @@ Added more secure password handling.
Added new client function @code{mysql_errno()}, to get the error number of
the error message. This makes error checking in the client much easier.
This makes the new server incompatible with the 3.20.x server when running
-without @code{--old-protocol}. The client code is backward compatible.
+without @code{--old-protocol}. The client code is backward-compatible.
More information can be found in the @file{README} file!
@item
Fixed some problems when using very long, illegal names.
@@ -54334,7 +54867,7 @@ memory. Also added more checks to handle ``out of memory'' problems.
multiple threads.
@item
When the maximum connection limit is reached, one extra connection by a user
-with the @strong{PROCESS_ACL} privilege is granted.
+with the @strong{process_acl} privilege is granted.
@item
Added @code{-O backlog=#} option to @code{mysqld}.
@item
@@ -54560,8 +55093,8 @@ Inserts of timestamps with values didn't always work.
@item
Added some tests to @code{safe_mysqld} to make it ``safer''.
@item
-@code{LIKE} was case sensitive in some places and case insensitive in others.
-Now @code{LIKE} is always case insensitive.
+@code{LIKE} was case-sensitive in some places and case-insensitive in others.
+Now @code{LIKE} is always case-insensitive.
@item
@file{mysql.cc}: Allow @code{'#'} anywhere on the line.
@item
@@ -54925,7 +55458,7 @@ New math functions:
The @code{configure} source now compiles a thread-free client library
@code{-lmysqlclient}. This is the only library that needs to be linked
with client applications. When using the binary releases, you must
-link with @code{-lmysql -lmysys -ldbug -lstrings} as before.
+link with @code{-lmysql -lmysys -ldbug -lmystrings} as before.
@item
New @code{readline} library from @code{bash-2.0}.
@item
@@ -54972,8 +55505,8 @@ compiler.
@item
SQL functions must now have a @code{'('} immediately after the function name
(no intervening space).
-For example, @code{'user('} is regarded as beginning a function call, and
-@code{'user ('} is regarded as an identifier @code{user} followed by a
+For example, @code{'USER('} is regarded as beginning a function call, and
+@code{'USER ('} is regarded as an identifier @code{USER} followed by a
@code{'('}, not as a function call.
@end itemize
@@ -55184,7 +55717,7 @@ If you run into problems with a new port, you may have to do some debugging
of MySQL!
@xref{Debugging server}.
-@strong{NOTE:} Before you start debugging @code{mysqld}, first get the test
+@strong{Note}: before you start debugging @code{mysqld}, first get the test
programs @code{mysys/thr_alarm} and @code{mysys/thr_lock} to work. This
will ensure that your thread installation has even a remote chance to work!
@@ -55212,8 +55745,8 @@ disables a lot of optimisation that may cause problems.
@xref{Crashing}.
If @code{mysqld} doesn't want to start, you should check that you don't have
-any @code{my.cnf} files that interfere with your setup!
-You can check your @code{my.cnf} arguments with @code{mysqld --print-defaults}
+any @file{my.cnf} files that interfere with your setup!
+You can check your @file{my.cnf} arguments with @code{mysqld --print-defaults}
and avoid using them by starting with @code{mysqld --no-defaults ...}.
If @code{mysqld} starts to eat up CPU or memory or if it ``hangs'', you
@@ -55252,7 +55785,7 @@ problems that may be unique to your environment.
If you have some very specific problem, you can always try to debug
MySQL. To do this you must configure MySQL with the
@code{--with-debug} or the @code{--with-debug=full} option. You can check
-whether or not MySQL was compiled with debugging by doing:
+whether MySQL was compiled with debugging by doing:
@code{mysqld --help}. If the @code{--debug} flag is listed with the
options then you have debugging enabled. @code{mysqladmin ver} also
lists the @code{mysqld} version as @code{mysql ... --debug} in this case.
@@ -55325,7 +55858,7 @@ In a DOS window do:
mysqld --debug --standalone
@end example
-After this you can use the @code{mysql.exe} command line tool in a
+After this you can use the @code{mysql.exe} command-line tool in a
second DOS window to reproduce the problem. You can take down the above
@code{mysqld} server with @code{mysqladmin shutdown}.
@@ -55353,7 +55886,7 @@ The trace file is made with the @strong{DBUG} package by Fred Fish.
@cindex gdb, using
-On most system you can also start @code{mysqld} from @code{gdb} to get
+On most systems you can also start @code{mysqld} from @code{gdb} to get
more information if @code{mysqld} crashes.
With some older @code{gdb} versions on Linux you must use @code{run
@@ -55518,7 +56051,7 @@ If you are using @code{--log} without a file name, the log is stored in
the database directory as 'hostname'.log In most cases it's the last
query in the log file that killed @code{mysqld}, but if possible you
should verify this by restarting @code{mysqld} and executing the found
-query from the @code{mysql} command line tools. If this works, you
+query from the @code{mysql} command-line tools. If this works, you
should also test all complicated queries that didn't complete.
You can also try the command @code{EXPLAIN} on all @code{SELECT}
@@ -55698,7 +56231,7 @@ The currently recognised flag characters are:
@end multitable
Some examples of debug control strings which might appear on a shell
-command line (the "-#" is typically used to introduce a control string
+command-line (the "-#" is typically used to introduce a control string
to an application program) are:
@example
@@ -55752,7 +56285,7 @@ Cons:
@item
Takes more memory than page level or table locks.
@item
-Is slower than page level or table locks when used one a big part of the table,
+Is slower than page level or table locks when used on a big part of the table,
because one has to do many more locks.
@item
Is definitely much worse than other locks if you do often do @code{GROUP
@@ -55770,7 +56303,7 @@ following cases:
@item
Mostly reads
@item
-Read and updates on strict keys; This is where one updates or deletes
+Read and updates on strict keys; this is where one updates or deletes
a row that can be fetched with one key read:
@example
UPDATE table_name SET column=value WHERE unique_key#
@@ -55792,7 +56325,7 @@ on when one started to access it. Other names for this are time travel,
copy on write or copy on demand.
Copy on demand is in many case much better than page or row level
-locking; The worst case does, however, use much more memory than
+locking; the worst case does, however, use much more memory than
when using normal locks.
Instead of using row level locks one can use application level locks
@@ -55801,7 +56334,7 @@ only in well-behaved applications.
In many cases one can do an educated guess which locking type is best
for the application but generally it's very hard to say that a given
-lock type is better than another; Everything depends on the application
+lock type is better than another; everything depends on the application
and different part of the application may require different lock types.
Here are some tips about locking in MySQL:
@@ -55948,7 +56481,7 @@ threads have to wait for data. If the user thread packages are
integrated in the standard libs (FreeBSD and BSDI threads) the thread
package requires less overhead than thread packages that have to map all
unsafe calls (MIT-pthreads, FSU Pthreads and RTS threads). In some
-environments (for example, SCO), all system calls are thread safe so the
+environments (for example, SCO), all system calls are thread-safe so the
mapping can be done very easily (FSU Pthreads on SCO). Downside: All
mapped calls take a little time and it's quite tricky to be able to
handle all situations. There are usually also some system calls that are
@@ -55966,7 +56499,7 @@ somewhat expensive.
Kernel threads. Thread switching is handled by the thread library or the
kernel and is very fast. Everything is done in one process, but on some
systems, @code{ps} may show the different threads. If one thread aborts, the
-whole process aborts. Most system calls are thread safe and should
+whole process aborts. Most system calls are thread-safe and should
require very little overhead. Solaris, HP-UX, AIX and OSF/1 have kernel
threads.
@end itemize
@@ -55988,7 +56521,7 @@ Here is a list of all the environment variables that are used directly or
indirectly by MySQL. Most of these can also be found in other
places in this manual.
-Note that any options on the command line will take precedence over
+Note that any options on the command-line will take precedence over
values specified in configuration files and environment variables, and
values in configuration files take precedence over values in environment
variables.
@@ -56101,57 +56634,57 @@ characters/constructs:
@item ^
Match the beginning of a string.
@example
-mysql> select "fo\nfo" REGEXP "^fo$"; -> 0
-mysql> select "fofo" REGEXP "^fo"; -> 1
+mysql> SELECT "fo\nfo" REGEXP "^fo$"; -> 0
+mysql> SELECT "fofo" REGEXP "^fo"; -> 1
@end example
@item $
Match the end of a string.
@example
-mysql> select "fo\no" REGEXP "^fo\no$"; -> 1
-mysql> select "fo\no" REGEXP "^fo$"; -> 0
+mysql> SELECT "fo\no" REGEXP "^fo\no$"; -> 1
+mysql> SELECT "fo\no" REGEXP "^fo$"; -> 0
@end example
@item .
Match any character (including newline).
@example
-mysql> select "fofo" REGEXP "^f.*"; -> 1
-mysql> select "fo\nfo" REGEXP "^f.*"; -> 1
+mysql> SELECT "fofo" REGEXP "^f.*"; -> 1
+mysql> SELECT "fo\nfo" REGEXP "^f.*"; -> 1
@end example
@item a*
Match any sequence of zero or more @code{a} characters.
@example
-mysql> select "Ban" REGEXP "^Ba*n"; -> 1
-mysql> select "Baaan" REGEXP "^Ba*n"; -> 1
-mysql> select "Bn" REGEXP "^Ba*n"; -> 1
+mysql> SELECT "Ban" REGEXP "^Ba*n"; -> 1
+mysql> SELECT "Baaan" REGEXP "^Ba*n"; -> 1
+mysql> SELECT "Bn" REGEXP "^Ba*n"; -> 1
@end example
@item a+
Match any sequence of one or more @code{a} characters.
@example
-mysql> select "Ban" REGEXP "^Ba+n"; -> 1
-mysql> select "Bn" REGEXP "^Ba+n"; -> 0
+mysql> SELECT "Ban" REGEXP "^Ba+n"; -> 1
+mysql> SELECT "Bn" REGEXP "^Ba+n"; -> 0
@end example
@item a?
Match either zero or one @code{a} character.
@example
-mysql> select "Bn" REGEXP "^Ba?n"; -> 1
-mysql> select "Ban" REGEXP "^Ba?n"; -> 1
-mysql> select "Baan" REGEXP "^Ba?n"; -> 0
+mysql> SELECT "Bn" REGEXP "^Ba?n"; -> 1
+mysql> SELECT "Ban" REGEXP "^Ba?n"; -> 1
+mysql> SELECT "Baan" REGEXP "^Ba?n"; -> 0
@end example
@item de|abc
Match either of the sequences @code{de} or @code{abc}.
@example
-mysql> select "pi" REGEXP "pi|apa"; -> 1
-mysql> select "axe" REGEXP "pi|apa"; -> 0
-mysql> select "apa" REGEXP "pi|apa"; -> 1
-mysql> select "apa" REGEXP "^(pi|apa)$"; -> 1
-mysql> select "pi" REGEXP "^(pi|apa)$"; -> 1
-mysql> select "pix" REGEXP "^(pi|apa)$"; -> 0
+mysql> SELECT "pi" REGEXP "pi|apa"; -> 1
+mysql> SELECT "axe" REGEXP "pi|apa"; -> 0
+mysql> SELECT "apa" REGEXP "pi|apa"; -> 1
+mysql> SELECT "apa" REGEXP "^(pi|apa)$"; -> 1
+mysql> SELECT "pi" REGEXP "^(pi|apa)$"; -> 1
+mysql> SELECT "pix" REGEXP "^(pi|apa)$"; -> 0
@end example
@item (abc)*
Match zero or more instances of the sequence @code{abc}.
@example
-mysql> select "pi" REGEXP "^(pi)*$"; -> 1
-mysql> select "pip" REGEXP "^(pi)*$"; -> 0
-mysql> select "pipi" REGEXP "^(pi)*$"; -> 1
+mysql> SELECT "pi" REGEXP "^(pi)*$"; -> 1
+mysql> SELECT "pip" REGEXP "^(pi)*$"; -> 0
+mysql> SELECT "pipi" REGEXP "^(pi)*$"; -> 1
@end example
@item @{1@}
@itemx @{2,3@}
@@ -56187,12 +56720,12 @@ literal @code{-} character, it must be written first or last. So
a defined meaning inside a @code{[]} pair has no special meaning and
matches only itself.
@example
-mysql> select "aXbc" REGEXP "[a-dXYZ]"; -> 1
-mysql> select "aXbc" REGEXP "^[a-dXYZ]$"; -> 0
-mysql> select "aXbc" REGEXP "^[a-dXYZ]+$"; -> 1
-mysql> select "aXbc" REGEXP "^[^a-dXYZ]+$"; -> 0
-mysql> select "gheis" REGEXP "^[^a-dXYZ]+$"; -> 1
-mysql> select "gheisa" REGEXP "^[^a-dXYZ]+$"; -> 0
+mysql> SELECT "aXbc" REGEXP "[a-dXYZ]"; -> 1
+mysql> SELECT "aXbc" REGEXP "^[a-dXYZ]$"; -> 0
+mysql> SELECT "aXbc" REGEXP "^[a-dXYZ]+$"; -> 1
+mysql> SELECT "aXbc" REGEXP "^[^a-dXYZ]+$"; -> 0
+mysql> SELECT "gheis" REGEXP "^[^a-dXYZ]+$"; -> 1
+mysql> SELECT "gheisa" REGEXP "^[^a-dXYZ]+$"; -> 0
@end example
@item [[.characters.]]
The sequence of characters of that collating element. The sequence is a
@@ -56228,8 +56761,8 @@ These stand for the character classes defined in the @code{ctype(3)} manual
page. A locale may provide others. A character class may not be used as an
endpoint of a range.
@example
-mysql> select "justalnums" REGEXP "[[:alnum:]]+"; -> 1
-mysql> select "!!" REGEXP "[[:alnum:]]+"; -> 0
+mysql> SELECT "justalnums" REGEXP "[[:alnum:]]+"; -> 1
+mysql> SELECT "!!" REGEXP "[[:alnum:]]+"; -> 0
@end example
@item [[:<:]]
@@ -56240,20 +56773,20 @@ is neither preceded nor followed by word characters. A word character is
an alnum character (as defined by @code{ctype(3)}) or an underscore
(@code{_}).
@example
-mysql> select "a word a" REGEXP "[[:<:]]word[[:>:]]"; -> 1
-mysql> select "a xword a" REGEXP "[[:<:]]word[[:>:]]"; -> 0
+mysql> SELECT "a word a" REGEXP "[[:<:]]word[[:>:]]"; -> 1
+mysql> SELECT "a xword a" REGEXP "[[:<:]]word[[:>:]]"; -> 0
@end example
@end table
@example
-mysql> select "weeknights" REGEXP "^(wee|week)(knights|nights)$"; -> 1
+mysql> SELECT "weeknights" REGEXP "^(wee|week)(knights|nights)$"; -> 1
@end example
@node GPL license, LGPL license, Regexp, Top
-@appendix GNU GENERAL PUBLIC LICENSE
+@appendix GNU General Public License
@cindex GPL, General Public License
@cindex GPL, GNU General Public License
@@ -56420,7 +56953,7 @@ source code, which must be distributed under the terms of Sections
@item
Accompany it with a written offer, valid for at least three
-years, to give any third party, for a charge no more than your
+years, to give any third-party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
@@ -56654,7 +57187,7 @@ Public License instead of this License.
@node LGPL license, Function Index, GPL license, Top
-@appendix GNU LESSER GENERAL PUBLIC LICENSE
+@appendix GNU Lesser General Public License
@cindex LGPL, Library General Public License
@cindex LGPL, GNU Library General Public License
@@ -56949,7 +57482,7 @@ Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
+whether they are linked directly with the Library itself.
@item
As an exception to the Sections above, you may also combine or
@@ -56983,7 +57516,7 @@ to use the modified definitions.)
@item
Use a suitable shared library mechanism for linking with the Library. A
-suitable mechanism is one that (1) uses at run time a copy of the
+suitable mechanism is one that (1) uses at runtime a copy of the
library already present on the user's computer system, rather than
copying library functions into the executable, and (2) will operate
properly with a modified version of the library, if the user installs
diff --git a/Docs/mirrors.texi b/Docs/mirrors.texi
index 61bb08f3979..6042d168316 100644
--- a/Docs/mirrors.texi
+++ b/Docs/mirrors.texi
@@ -63,6 +63,11 @@ WWW (@uref{http://mysql-mirror.free.fr/})
FTP (@uref{ftp://ftp.free.fr/pub/MySQL/})
@item
+@image{Flags/france} France [mir2.ovh.net/] @@
+WWW (@uref{http://mir2.ovh.net/ftp.mysql.com/})
+FTP (@uref{ftp://mir1.ovh.net/ftp.mysql.com/})
+
+@item
@image{Flags/france} France [Netsample] @@
WWW (@uref{http://www.mysql.netsample.com/})
@@ -71,6 +76,11 @@ WWW (@uref{http://www.mysql.netsample.com/})
WWW (@uref{http://mysql.omegatomic.com/})
@item
+@image{Flags/france} France [Universite Paris 10] @@
+WWW (@uref{http://ftp.u-paris10.fr/mysql.com})
+FTP (@uref{ftp://ftp.u-paris10.fr/mysql.com})
+
+@item
@image{Flags/germany} Germany [GWDG] @@
WWW (@uref{http://ftp.gwdg.de/pub/misc/mysql/})
FTP (@uref{ftp://ftp.gwdg.de/pub/misc/mysql/})
@@ -110,9 +120,8 @@ WWW (@uref{http://mysql.sote.hu/})
FTP (@uref{ftp://xenia.sote.hu/pub/mirrors/www.mysql.com/})
@item
-@image{Flags/iceland} Iceland [GM] @@
-WWW (@uref{http://mysql.gm.is/})
-FTP (@uref{ftp://ftp.gm.is/pub/mysql/})
+@image{Flags/iceland} Iceland [Tvíund] @@
+WWW (@uref{http://mysql.tviund.is/})
@item
@image{Flags/ireland} Ireland [Esat Net] @@
@@ -124,6 +133,10 @@ FTP (@uref{ftp://ftp.esat.net/mirrors/download.sourceforge.net/pub/mirrors/mysql
WWW (@uref{http://mirrors.nmtbmedia.com/mysql/})
@item
+@image{Flags/israel} Israel [fresh.co.il] @@
+WWW (@uref{http://mysql.fresh.co.il/})
+
+@item
@image{Flags/italy} Italy [feelinglinux.com] @@
WWW (@uref{http://mysql.feelinglinux.com/})
@@ -171,16 +184,16 @@ WWW (@uref{http://darkstar.ist.utl.pt/mysql/})
FTP (@uref{ftp://darkstar.ist.utl.pt/pub/mysql/})
@item
-@image{Flags/portugal} Portugal [Netc] @@
-WWW (@uref{http://ftp.netc.pt/pub/mysql/})
-FTP (@uref{ftp://ftp.netc.pt/pub/mysql/})
-
-@item
@image{Flags/portugal} Portugal [Netvisão] @@
WWW (@uref{http://mysql.netvisao.pt/})
FTP (@uref{ftp://mirrors2.netvisao.pt/pub/mysql/})
@item
+@image{Flags/portugal} Portugal [VIZZAVI] @@
+WWW (@uref{http://ftp.vizzavi.pt/pub/mysql/})
+FTP (@uref{ftp://ftp.vizzavi.pt/pub/mysql/})
+
+@item
@image{Flags/romania} Romania [roedu.net/Bucharest] @@
FTP (@uref{ftp://ftp.roedu.net/pub/mirrors/ftp.mysql.com/})
@@ -199,11 +212,6 @@ WWW (@uref{http://ftp.arnes.si/mysql/})
FTP (@uref{ftp://ftp.arnes.si/packages/mysql/})
@item
-@image{Flags/spain} Spain [GMC Control Systems] @@
-WWW (@uref{http://mysql.neptuno2000.com/})
-FTP (@uref{ftp://ftp.neptuno2000.com/pub/mysql/})
-
-@item
@image{Flags/sweden} Sweden [Sunet] @@
WWW (@uref{http://ftp.sunet.se/pub/unix/databases/relational/mysql/})
FTP (@uref{ftp://ftp.sunet.se/pub/unix/databases/relational/mysql/})
@@ -293,11 +301,6 @@ FTP (@uref{ftp://mirror.sit.wisc.edu/mirrors/mysql/})
WWW (@uref{http://mysql.secsup.org/})
FTP (@uref{ftp://mysql.secsup.org/pub/software/mysql/})
-@item
-@image{Flags/usa} USA [ValueClick / Los Angeles, CA] @@
-WWW (@uref{http://mysql.valueclick.com/})
-FTP (@uref{ftp://mysql.valueclick.com/pub/mysql/})
-
@end itemize
@strong{South America:}
@@ -334,11 +337,6 @@ FTP (@uref{ftp://mysql.ogmios.co.cr/pub/mysql/})
@itemize @bullet
@item
-@image{Flags/china} China [Gremlins/Hong Kong] @@
-WWW (@uref{http://mysql.gremlins.com.hk/})
-FTP (@uref{ftp://ftp.mirrors.gremlins.com.hk/mysql/})
-
-@item
@image{Flags/china} China [HKLPG/Hong Kong] @@
WWW (@uref{http://mysql.hklpg.org/})
@@ -363,6 +361,7 @@ FTP (@uref{ftp://mysql.incaf.net/})
@item
@image{Flags/indonesia} Indonesia [M-Web] @@
WWW (@uref{http://mysql.mweb.net.id/})
+FTP (@uref{ftp://mysql.mweb.net.id/pub/database/mysql/})
@item
@image{Flags/indonesia} Indonesia [web.id] @@
@@ -413,6 +412,10 @@ WWW (@uref{http://mysql.ttn.net/})
WWW (@uref{http://mysql.planetmirror.com/})
FTP (@uref{ftp://planetmirror.com/pub/mysql/})
+@item
+@image{Flags/new-zealand} New Zealand [Cubalan] @@
+WWW (@uref{http://mysql.soa.co.nz/})
+
@end itemize
@strong{Africa:}
diff --git a/Docs/mysqld_error.txt b/Docs/mysqld_error.txt
index 7a5b6cf38d0..db663e3d1f5 100644
--- a/Docs/mysqld_error.txt
+++ b/Docs/mysqld_error.txt
@@ -1,457 +1,457 @@
/* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB
This file is public domain and comes with NO WARRANTY of any kind */
-#define ER_HASHCHK 0
+#define ER_HASHCHK 1000
"hashchk",
-#define ER_NISAMCHK 1
+#define ER_NISAMCHK 1001
"isamchk",
-#define ER_NO 2
+#define ER_NO 1002
"NO",
-#define ER_YES 3
+#define ER_YES 1003
"YES",
-#define ER_CANT_CREATE_FILE 4
+#define ER_CANT_CREATE_FILE 1004
"Can't create file '%-.64s' (errno: %d)",
-#define ER_CANT_CREATE_TABLE 5
+#define ER_CANT_CREATE_TABLE 1005
"Can't create table '%-.64s' (errno: %d)",
-#define ER_CANT_CREATE_DB 6
+#define ER_CANT_CREATE_DB 1006
"Can't create database '%-.64s'. (errno: %d)",
-#define ER_DB_CREATE_EXISTS 7
+#define ER_DB_CREATE_EXISTS 1007
"Can't create database '%-.64s'. Database exists",
-#define ER_DB_DROP_EXISTS 8
+#define ER_DB_DROP_EXISTS 1008
"Can't drop database '%-.64s'. Database doesn't exist",
-#define ER_DB_DROP_DELETE 9
+#define ER_DB_DROP_DELETE 1009
"Error dropping database (can't delete '%-.64s', errno: %d)",
-#define ER_DB_DROP_RMDIR 10
+#define ER_DB_DROP_RMDIR 1010
"Error dropping database (can't rmdir '%-.64s', errno: %d)",
-#define ER_CANT_DELETE_FILE 11
+#define ER_CANT_DELETE_FILE 1011
"Error on delete of '%-.64s' (errno: %d)",
-#define ER_CANT_FIND_SYSTEM_REC 12
+#define ER_CANT_FIND_SYSTEM_REC 1012
"Can't read record in system table",
-#define ER_CANT_GET_STAT 13
+#define ER_CANT_GET_STAT 1013
"Can't get status of '%-.64s' (errno: %d)",
-#define ER_CANT_GET_WD 14
+#define ER_CANT_GET_WD 1014
"Can't get working directory (errno: %d)",
-#define ER_CANT_LOCK 15
+#define ER_CANT_LOCK 1015
"Can't lock file (errno: %d)",
-#define ER_CANT_OPEN_FILE 16
+#define ER_CANT_OPEN_FILE 1016
"Can't open file: '%-.64s'. (errno: %d)",
-#define ER_FILE_NOT_FOUND 17
+#define ER_FILE_NOT_FOUND 1017
"Can't find file: '%-.64s' (errno: %d)",
-#define ER_CANT_READ_DIR 18
+#define ER_CANT_READ_DIR 1018
"Can't read dir of '%-.64s' (errno: %d)",
-#define ER_CANT_SET_WD 19
+#define ER_CANT_SET_WD 1019
"Can't change dir to '%-.64s' (errno: %d)",
-#define ER_CHECKREAD 20
+#define ER_CHECKREAD 1020
"Record has changed since last read in table '%-.64s'",
-#define ER_DISK_FULL 21
+#define ER_DISK_FULL 1021
"Disk full (%s). Waiting for someone to free some space....",
-#define ER_DUP_KEY 22
+#define ER_DUP_KEY 1022
"Can't write, duplicate key in table '%-.64s'",
-#define ER_ERROR_ON_CLOSE 23
+#define ER_ERROR_ON_CLOSE 1023
"Error on close of '%-.64s' (errno: %d)",
-#define ER_ERROR_ON_READ 24
+#define ER_ERROR_ON_READ 1024
"Error reading file '%-.64s' (errno: %d)",
-#define ER_ERROR_ON_RENAME 25
+#define ER_ERROR_ON_RENAME 1025
"Error on rename of '%-.64s' to '%-.64s' (errno: %d)",
-#define ER_ERROR_ON_WRITE 26
+#define ER_ERROR_ON_WRITE 1026
"Error writing file '%-.64s' (errno: %d)",
-#define ER_FILE_USED 27
+#define ER_FILE_USED 1027
"'%-.64s' is locked against change",
-#define ER_FILSORT_ABORT 28
+#define ER_FILSORT_ABORT 1028
"Sort aborted",
-#define ER_FORM_NOT_FOUND 29
+#define ER_FORM_NOT_FOUND 1029
"View '%-.64s' doesn't exist for '%-.64s'",
-#define ER_GET_ERRNO 30
+#define ER_GET_ERRNO 1030
"Got error %d from table handler",
-#define ER_ILLEGAL_HA 31
+#define ER_ILLEGAL_HA 1031
"Table handler for '%-.64s' doesn't have this option",
-#define ER_KEY_NOT_FOUND 32
+#define ER_KEY_NOT_FOUND 1032
"Can't find record in '%-.64s'",
-#define ER_NOT_FORM_FILE 33
+#define ER_NOT_FORM_FILE 1033
"Incorrect information in file: '%-.64s'",
-#define ER_NOT_KEYFILE 34
+#define ER_NOT_KEYFILE 1034
"Incorrect key file for table: '%-.64s'. Try to repair it",
-#define ER_OLD_KEYFILE 35
+#define ER_OLD_KEYFILE 1035
"Old key file for table '%-.64s'; Repair it!",
-#define ER_OPEN_AS_READONLY 36
+#define ER_OPEN_AS_READONLY 1036
"Table '%-.64s' is read only",
-#define ER_OUTOFMEMORY 37
+#define ER_OUTOFMEMORY 1037
"Out of memory. Restart daemon and try again (needed %d bytes)",
-#define ER_OUT_OF_SORTMEMORY 38
+#define ER_OUT_OF_SORTMEMORY 1038
"Out of sort memory. Increase daemon sort buffer size",
-#define ER_UNEXPECTED_EOF 39
+#define ER_UNEXPECTED_EOF 1039
"Unexpected eof found when reading file '%-.64s' (errno: %d)",
-#define ER_CON_COUNT_ERROR 40
+#define ER_CON_COUNT_ERROR 1040
"Too many connections",
-#define ER_OUT_OF_RESOURCES 41
+#define ER_OUT_OF_RESOURCES 1041
"Out of memory; Check if mysqld or some other process uses all available memory. If not you may have to use 'ulimit' to allow mysqld to use more memory or you can add more swap space",
-#define ER_BAD_HOST_ERROR 42
+#define ER_BAD_HOST_ERROR 1042
"Can't get hostname for your address",
-#define ER_HANDSHAKE_ERROR 43
+#define ER_HANDSHAKE_ERROR 1043
"Bad handshake",
-#define ER_DBACCESS_DENIED_ERROR 44
+#define ER_DBACCESS_DENIED_ERROR 1044
"Access denied for user: '%-.32s@%-.64s' to database '%-.64s'",
-#define ER_ACCESS_DENIED_ERROR 45
+#define ER_ACCESS_DENIED_ERROR 1045
"Access denied for user: '%-.32s@%-.64s' (Using password: %s)",
-#define ER_NO_DB_ERROR 46
+#define ER_NO_DB_ERROR 1046
"No Database Selected",
-#define ER_UNKNOWN_COM_ERROR 47
+#define ER_UNKNOWN_COM_ERROR 1047
"Unknown command",
-#define ER_BAD_NULL_ERROR 48
+#define ER_BAD_NULL_ERROR 1048
"Column '%-.64s' cannot be null",
-#define ER_BAD_DB_ERROR 49
+#define ER_BAD_DB_ERROR 1049
"Unknown database '%-.64s'",
-#define ER_TABLE_EXISTS_ERROR 50
+#define ER_TABLE_EXISTS_ERROR 1050
"Table '%-.64s' already exists",
-#define ER_BAD_TABLE_ERROR 51
+#define ER_BAD_TABLE_ERROR 1051
"Unknown table '%-.64s'",
-#define ER_NON_UNIQ_ERROR 52
+#define ER_NON_UNIQ_ERROR 1052
"Column: '%-.64s' in %-.64s is ambiguous",
-#define ER_SERVER_SHUTDOWN 53
+#define ER_SERVER_SHUTDOWN 1053
"Server shutdown in progress",
-#define ER_BAD_FIELD_ERROR 54
+#define ER_BAD_FIELD_ERROR 1054
"Unknown column '%-.64s' in '%-.64s'",
-#define ER_WRONG_FIELD_WITH_GROUP 55
+#define ER_WRONG_FIELD_WITH_GROUP 1055
"'%-.64s' isn't in GROUP BY",
-#define ER_WRONG_GROUP_FIELD 56
+#define ER_WRONG_GROUP_FIELD 1056
"Can't group on '%-.64s'",
-#define ER_WRONG_SUM_SELECT 57
+#define ER_WRONG_SUM_SELECT 1057
"Statement has sum functions and columns in same statement",
-#define ER_WRONG_VALUE_COUNT 58
+#define ER_WRONG_VALUE_COUNT 1058
"Column count doesn't match value count",
-#define ER_TOO_LONG_IDENT 59
+#define ER_TOO_LONG_IDENT 1059
"Identifier name '%-.100s' is too long",
-#define ER_DUP_FIELDNAME 60
+#define ER_DUP_FIELDNAME 1060
"Duplicate column name '%-.64s'",
-#define ER_DUP_KEYNAME 61
+#define ER_DUP_KEYNAME 1061
"Duplicate key name '%-.64s'",
-#define ER_DUP_ENTRY 62
+#define ER_DUP_ENTRY 1062
"Duplicate entry '%-.64s' for key %d",
-#define ER_WRONG_FIELD_SPEC 63
+#define ER_WRONG_FIELD_SPEC 1063
"Incorrect column specifier for column '%-.64s'",
-#define ER_PARSE_ERROR 64
+#define ER_PARSE_ERROR 1064
"%s near '%-.80s' at line %d",
-#define ER_EMPTY_QUERY 65
+#define ER_EMPTY_QUERY 1065
"Query was empty",
-#define ER_NONUNIQ_TABLE 66
+#define ER_NONUNIQ_TABLE 1066
"Not unique table/alias: '%-.64s'",
-#define ER_INVALID_DEFAULT 67
+#define ER_INVALID_DEFAULT 1067
"Invalid default value for '%-.64s'",
-#define ER_MULTIPLE_PRI_KEY 68
+#define ER_MULTIPLE_PRI_KEY 1068
"Multiple primary key defined",
-#define ER_TOO_MANY_KEYS 69
+#define ER_TOO_MANY_KEYS 1069
"Too many keys specified. Max %d keys allowed",
-#define ER_TOO_MANY_KEY_PARTS 70
+#define ER_TOO_MANY_KEY_PARTS 1070
"Too many key parts specified. Max %d parts allowed",
-#define ER_TOO_LONG_KEY 71
+#define ER_TOO_LONG_KEY 1071
"Specified key was too long. Max key length is %d",
-#define ER_KEY_COLUMN_DOES_NOT_EXITS 72
+#define ER_KEY_COLUMN_DOES_NOT_EXITS 1072
"Key column '%-.64s' doesn't exist in table",
-#define ER_BLOB_USED_AS_KEY 73
+#define ER_BLOB_USED_AS_KEY 1073
"BLOB column '%-.64s' can't be used in key specification with the used table type",
-#define ER_TOO_BIG_FIELDLENGTH 74
+#define ER_TOO_BIG_FIELDLENGTH 1074
"Too big column length for column '%-.64s' (max = %d). Use BLOB instead",
-#define ER_WRONG_AUTO_KEY 75
+#define ER_WRONG_AUTO_KEY 1075
"Incorrect table definition; There can only be one auto column and it must be defined as a key",
-#define ER_READY 76
+#define ER_READY 1076
"%s: ready for connections\n",
-#define ER_NORMAL_SHUTDOWN 77
+#define ER_NORMAL_SHUTDOWN 1077
"%s: Normal shutdown\n",
-#define ER_GOT_SIGNAL 78
+#define ER_GOT_SIGNAL 1078
"%s: Got signal %d. Aborting!\n",
-#define ER_SHUTDOWN_COMPLETE 79
+#define ER_SHUTDOWN_COMPLETE 1079
"%s: Shutdown Complete\n",
-#define ER_FORCING_CLOSE 80
+#define ER_FORCING_CLOSE 1080
"%s: Forcing close of thread %ld user: '%-.32s'\n",
-#define ER_IPSOCK_ERROR 81
+#define ER_IPSOCK_ERROR 1081
"Can't create IP socket",
-#define ER_NO_SUCH_INDEX 82
+#define ER_NO_SUCH_INDEX 1082
"Table '%-.64s' has no index like the one used in CREATE INDEX. Recreate the table",
-#define ER_WRONG_FIELD_TERMINATORS 83
+#define ER_WRONG_FIELD_TERMINATORS 1083
"Field separator argument is not what is expected. Check the manual",
-#define ER_BLOBS_AND_NO_TERMINATED 84
+#define ER_BLOBS_AND_NO_TERMINATED 1084
"You can't use fixed rowlength with BLOBs. Please use 'fields terminated by'.",
-#define ER_TEXTFILE_NOT_READABLE 85
+#define ER_TEXTFILE_NOT_READABLE 1085
"The file '%-.64s' must be in the database directory or be readable by all",
-#define ER_FILE_EXISTS_ERROR 86
+#define ER_FILE_EXISTS_ERROR 1086
"File '%-.80s' already exists",
-#define ER_LOAD_INFO 87
+#define ER_LOAD_INFO 1087
"Records: %ld Deleted: %ld Skipped: %ld Warnings: %ld",
-#define ER_ALTER_INFO 88
+#define ER_ALTER_INFO 1088
"Records: %ld Duplicates: %ld",
-#define ER_WRONG_SUB_KEY 89
+#define ER_WRONG_SUB_KEY 1089
"Incorrect sub part key. The used key part isn't a string, the used length is longer than the key part or the table handler doesn't support unique sub keys",
-#define ER_CANT_REMOVE_ALL_FIELDS 90
+#define ER_CANT_REMOVE_ALL_FIELDS 1090
"You can't delete all columns with ALTER TABLE. Use DROP TABLE instead",
-#define ER_CANT_DROP_FIELD_OR_KEY 91
+#define ER_CANT_DROP_FIELD_OR_KEY 1091
"Can't DROP '%-.64s'. Check that column/key exists",
-#define ER_INSERT_INFO 92
+#define ER_INSERT_INFO 1092
"Records: %ld Duplicates: %ld Warnings: %ld",
-#define ER_INSERT_TABLE_USED 93
+#define ER_INSERT_TABLE_USED 1093
"INSERT TABLE '%-.64s' isn't allowed in FROM table list",
-#define ER_NO_SUCH_THREAD 94
+#define ER_NO_SUCH_THREAD 1094
"Unknown thread id: %lu",
-#define ER_KILL_DENIED_ERROR 95
+#define ER_KILL_DENIED_ERROR 1095
"You are not owner of thread %lu",
-#define ER_NO_TABLES_USED 96
+#define ER_NO_TABLES_USED 1096
"No tables used",
-#define ER_TOO_BIG_SET 97
+#define ER_TOO_BIG_SET 1097
"Too many strings for column %-.64s and SET",
-#define ER_NO_UNIQUE_LOGFILE 98
+#define ER_NO_UNIQUE_LOGFILE 1098
"Can't generate a unique log-filename %-.64s.(1-999)\n",
-#define ER_TABLE_NOT_LOCKED_FOR_WRITE 99
+#define ER_TABLE_NOT_LOCKED_FOR_WRITE 1099
"Table '%-.64s' was locked with a READ lock and can't be updated",
-#define ER_TABLE_NOT_LOCKED 100
+#define ER_TABLE_NOT_LOCKED 1100
"Table '%-.64s' was not locked with LOCK TABLES",
-#define ER_BLOB_CANT_HAVE_DEFAULT 101
+#define ER_BLOB_CANT_HAVE_DEFAULT 1101
"BLOB column '%-.64s' can't have a default value",
-#define ER_WRONG_DB_NAME 102
+#define ER_WRONG_DB_NAME 1102
"Incorrect database name '%-.100s'",
-#define ER_WRONG_TABLE_NAME 103
+#define ER_WRONG_TABLE_NAME 1103
"Incorrect table name '%-.100s'",
-#define ER_TOO_BIG_SELECT 104
+#define ER_TOO_BIG_SELECT 1104
"The SELECT would examine too many records and probably take a very long time. Check your WHERE and use SET OPTION SQL_BIG_SELECTS=1 if the SELECT is ok",
-#define ER_UNKNOWN_ERROR 105
+#define ER_UNKNOWN_ERROR 1105
"Unknown error",
-#define ER_UNKNOWN_PROCEDURE 106
+#define ER_UNKNOWN_PROCEDURE 1106
"Unknown procedure '%-.64s'",
-#define ER_WRONG_PARAMCOUNT_TO_PROCEDURE 107
+#define ER_WRONG_PARAMCOUNT_TO_PROCEDURE 1107
"Incorrect parameter count to procedure '%-.64s'",
-#define ER_WRONG_PARAMETERS_TO_PROCEDURE 108
+#define ER_WRONG_PARAMETERS_TO_PROCEDURE 1108
"Incorrect parameters to procedure '%-.64s'",
-#define ER_UNKNOWN_TABLE 109
+#define ER_UNKNOWN_TABLE 1109
"Unknown table '%-.64s' in %-.32s",
-#define ER_FIELD_SPECIFIED_TWICE 110
+#define ER_FIELD_SPECIFIED_TWICE 1110
"Column '%-.64s' specified twice",
-#define ER_INVALID_GROUP_FUNC_USE 111
+#define ER_INVALID_GROUP_FUNC_USE 1111
"Invalid use of group function",
-#define ER_UNSUPPORTED_EXTENSION 112
+#define ER_UNSUPPORTED_EXTENSION 1112
"Table '%-.64s' uses an extension that doesn't exist in this MySQL version",
-#define ER_TABLE_MUST_HAVE_COLUMNS 113
+#define ER_TABLE_MUST_HAVE_COLUMNS 1113
"A table must have at least 1 column",
-#define ER_RECORD_FILE_FULL 114
+#define ER_RECORD_FILE_FULL 1114
"The table '%-.64s' is full",
-#define ER_UNKNOWN_CHARACTER_SET 115
+#define ER_UNKNOWN_CHARACTER_SET 1115
"Unknown character set: '%-.64s'",
-#define ER_TOO_MANY_TABLES 116
+#define ER_TOO_MANY_TABLES 1116
"Too many tables. MySQL can only use %d tables in a join",
-#define ER_TOO_MANY_FIELDS 117
+#define ER_TOO_MANY_FIELDS 1117
"Too many columns",
-#define ER_TOO_BIG_ROWSIZE 118
+#define ER_TOO_BIG_ROWSIZE 1118
"Too big row size. The maximum row size, not counting BLOBs, is %d. You have to change some fields to BLOBs",
-#define ER_STACK_OVERRUN 119
+#define ER_STACK_OVERRUN 1119
"Thread stack overrun: Used: %ld of a %ld stack. Use 'mysqld -O thread_stack=#' to specify a bigger stack if needed",
-#define ER_WRONG_OUTER_JOIN 120
+#define ER_WRONG_OUTER_JOIN 1120
"Cross dependency found in OUTER JOIN. Examine your ON conditions",
-#define ER_NULL_COLUMN_IN_INDEX 121
+#define ER_NULL_COLUMN_IN_INDEX 1121
"Column '%-.64s' is used with UNIQUE or INDEX but is not defined as NOT NULL",
-#define ER_CANT_FIND_UDF 122
+#define ER_CANT_FIND_UDF 1122
"Can't load function '%-.64s'",
-#define ER_CANT_INITIALIZE_UDF 123
+#define ER_CANT_INITIALIZE_UDF 1123
"Can't initialize function '%-.64s'; %-.80s",
-#define ER_UDF_NO_PATHS 124
+#define ER_UDF_NO_PATHS 1124
"No paths allowed for shared library",
-#define ER_UDF_EXISTS 125
+#define ER_UDF_EXISTS 1125
"Function '%-.64s' already exist",
-#define ER_CANT_OPEN_LIBRARY 126
+#define ER_CANT_OPEN_LIBRARY 1126
"Can't open shared library '%-.64s' (errno: %d %-.64s)",
-#define ER_CANT_FIND_DL_ENTRY 127
+#define ER_CANT_FIND_DL_ENTRY 1127
"Can't find function '%-.64s' in library'",
-#define ER_FUNCTION_NOT_DEFINED 128
+#define ER_FUNCTION_NOT_DEFINED 1128
"Function '%-.64s' is not defined",
-#define ER_HOST_IS_BLOCKED 129
+#define ER_HOST_IS_BLOCKED 1129
"Host '%-.64s' is blocked because of many connection errors. Unblock with 'mysqladmin flush-hosts'",
-#define ER_HOST_NOT_PRIVILEGED 130
+#define ER_HOST_NOT_PRIVILEGED 1130
"Host '%-.64s' is not allowed to connect to this MySQL server",
-#define ER_PASSWORD_ANONYMOUS_USER 131
+#define ER_PASSWORD_ANONYMOUS_USER 1131
"You are using MySQL as an anonymous users and anonymous users are not allowed to change passwords",
-#define ER_PASSWORD_NOT_ALLOWED 132
+#define ER_PASSWORD_NOT_ALLOWED 1132
"You must have privileges to update tables in the mysql database to be able to change passwords for others",
-#define ER_PASSWORD_NO_MATCH 133
+#define ER_PASSWORD_NO_MATCH 1133
"Can't find any matching row in the user table",
-#define ER_UPDATE_INFO 134
+#define ER_UPDATE_INFO 1134
"Rows matched: %ld Changed: %ld Warnings: %ld",
-#define ER_CANT_CREATE_THREAD 135
+#define ER_CANT_CREATE_THREAD 1135
"Can't create a new thread (errno %d). If you are not out of available memory, you can consult the manual for a possible OS-dependent bug",
-#define ER_WRONG_VALUE_COUNT_ON_ROW 136
+#define ER_WRONG_VALUE_COUNT_ON_ROW 1136
"Column count doesn't match value count at row %ld",
-#define ER_CANT_REOPEN_TABLE 137
+#define ER_CANT_REOPEN_TABLE 1137
"Can't reopen table: '%-.64s'",
-#define ER_INVALID_USE_OF_NULL 138
+#define ER_INVALID_USE_OF_NULL 1138
"Invalid use of NULL value",
-#define ER_REGEXP_ERROR 139
+#define ER_REGEXP_ERROR 1139
"Got error '%-.64s' from regexp",
-#define ER_MIX_OF_GROUP_FUNC_AND_FIELDS 140
+#define ER_MIX_OF_GROUP_FUNC_AND_FIELDS 1140
"Mixing of GROUP columns (MIN(),MAX(),COUNT()...) with no GROUP columns is illegal if there is no GROUP BY clause",
-#define ER_NONEXISTING_GRANT 141
+#define ER_NONEXISTING_GRANT 1141
"There is no such grant defined for user '%-.32s' on host '%-.64s'",
-#define ER_TABLEACCESS_DENIED_ERROR 142
+#define ER_TABLEACCESS_DENIED_ERROR 1142
"%-.16s command denied to user: '%-.32s@%-.64s' for table '%-.64s'",
-#define ER_COLUMNACCESS_DENIED_ERROR 143
+#define ER_COLUMNACCESS_DENIED_ERROR 1143
"%-.16s command denied to user: '%-.32s@%-.64s' for column '%-.64s' in table '%-.64s'",
-#define ER_ILLEGAL_GRANT_FOR_TABLE 144
+#define ER_ILLEGAL_GRANT_FOR_TABLE 1144
"Illegal GRANT/REVOKE command. Please consult the manual which privileges can be used.",
-#define ER_GRANT_WRONG_HOST_OR_USER 145
+#define ER_GRANT_WRONG_HOST_OR_USER 1145
"The host or user argument to GRANT is too long",
-#define ER_NO_SUCH_TABLE 146
+#define ER_NO_SUCH_TABLE 1146
"Table '%-.64s.%-.64s' doesn't exist",
-#define ER_NONEXISTING_TABLE_GRANT 147
+#define ER_NONEXISTING_TABLE_GRANT 1147
"There is no such grant defined for user '%-.32s' on host '%-.64s' on table '%-.64s'",
-#define ER_NOT_ALLOWED_COMMAND 148
+#define ER_NOT_ALLOWED_COMMAND 1148
"The used command is not allowed with this MySQL version",
-#define ER_SYNTAX_ERROR 149
+#define ER_SYNTAX_ERROR 1149
"You have an error in your SQL syntax",
-#define ER_DELAYED_CANT_CHANGE_LOCK 150
+#define ER_DELAYED_CANT_CHANGE_LOCK 1150
"Delayed insert thread couldn't get requested lock for table %-.64s",
-#define ER_TOO_MANY_DELAYED_THREADS 151
+#define ER_TOO_MANY_DELAYED_THREADS 1151
"Too many delayed threads in use",
-#define ER_ABORTING_CONNECTION 152
+#define ER_ABORTING_CONNECTION 1152
"Aborted connection %ld to db: '%-.64s' user: '%-.32s' (%-.64s)",
-#define ER_NET_PACKET_TOO_LARGE 153
+#define ER_NET_PACKET_TOO_LARGE 1153
"Got a packet bigger than 'max_allowed_packet'",
-#define ER_NET_READ_ERROR_FROM_PIPE 154
+#define ER_NET_READ_ERROR_FROM_PIPE 1154
"Got a read error from the connection pipe",
-#define ER_NET_FCNTL_ERROR 155
+#define ER_NET_FCNTL_ERROR 1155
"Got an error from fcntl()",
-#define ER_NET_PACKETS_OUT_OF_ORDER 156
+#define ER_NET_PACKETS_OUT_OF_ORDER 1156
"Got packets out of order",
-#define ER_NET_UNCOMPRESS_ERROR 157
+#define ER_NET_UNCOMPRESS_ERROR 1157
"Couldn't uncompress communication packet",
-#define ER_NET_READ_ERROR 158
+#define ER_NET_READ_ERROR 1158
"Got an error reading communication packets",
-#define ER_NET_READ_INTERRUPTED 159
+#define ER_NET_READ_INTERRUPTED 1159
"Got timeout reading communication packets",
-#define ER_NET_ERROR_ON_WRITE 160
+#define ER_NET_ERROR_ON_WRITE 1160
"Got an error writing communication packets",
-#define ER_NET_WRITE_INTERRUPTED 161
+#define ER_NET_WRITE_INTERRUPTED 1161
"Got timeout writing communication packets",
-#define ER_TOO_LONG_STRING 162
+#define ER_TOO_LONG_STRING 1162
"Result string is longer than max_allowed_packet",
-#define ER_TABLE_CANT_HANDLE_BLOB 163
+#define ER_TABLE_CANT_HANDLE_BLOB 1163
"The used table type doesn't support BLOB/TEXT columns",
-#define ER_TABLE_CANT_HANDLE_AUTO_INCREMENT 164
+#define ER_TABLE_CANT_HANDLE_AUTO_INCREMENT 1164
"The used table type doesn't support AUTO_INCREMENT columns",
-#define ER_DELAYED_INSERT_TABLE_LOCKED 165
+#define ER_DELAYED_INSERT_TABLE_LOCKED 1165
"INSERT DELAYED can't be used with table '%-.64s', because it is locked with LOCK TABLES",
-#define ER_WRONG_COLUMN_NAME 166
+#define ER_WRONG_COLUMN_NAME 1166
"Incorrect column name '%-.100s'",
-#define ER_WRONG_KEY_COLUMN 167
+#define ER_WRONG_KEY_COLUMN 1167
"The used table handler can't index column '%-.64s'",
-#define ER_WRONG_MRG_TABLE 168
+#define ER_WRONG_MRG_TABLE 1168
"All tables in the MERGE table are not identically defined",
-#define ER_DUP_UNIQUE 169
+#define ER_DUP_UNIQUE 1169
"Can't write, because of unique constraint, to table '%-.64s'",
-#define ER_BLOB_KEY_WITHOUT_LENGTH 170
+#define ER_BLOB_KEY_WITHOUT_LENGTH 1170
"BLOB column '%-.64s' used in key specification without a key length",
-#define ER_PRIMARY_CANT_HAVE_NULL 171
+#define ER_PRIMARY_CANT_HAVE_NULL 1171
"All parts of a PRIMARY KEY must be NOT NULL; If you need NULL in a key, use UNIQUE instead",
-#define ER_TOO_MANY_ROWS 172
+#define ER_TOO_MANY_ROWS 1172
"Result consisted of more than one row",
-#define ER_REQUIRES_PRIMARY_KEY 173
+#define ER_REQUIRES_PRIMARY_KEY 1173
"This table type requires a primary key",
-#define ER_NO_RAID_COMPILED 174
+#define ER_NO_RAID_COMPILED 1174
"This version of MySQL is not compiled with RAID support",
-#define ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE 175
+#define ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE 1175
"You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column",
-#define ER_KEY_DOES_NOT_EXITS 176
+#define ER_KEY_DOES_NOT_EXITS 1176
"Key '%-.64s' doesn't exist in table '%-.64s'",
-#define ER_CHECK_NO_SUCH_TABLE 177
+#define ER_CHECK_NO_SUCH_TABLE 1177
"Can't open table",
-#define ER_CHECK_NOT_IMPLEMENTED 178
+#define ER_CHECK_NOT_IMPLEMENTED 1178
"The handler for the table doesn't support check/repair",
-#define ER_CANT_DO_THIS_DURING_AN_TRANSACTION 179
+#define ER_CANT_DO_THIS_DURING_AN_TRANSACTION 1179
"You are not allowed to execute this command in a transaction",
-#define ER_ERROR_DURING_COMMIT 180
+#define ER_ERROR_DURING_COMMIT 1180
"Got error %d during COMMIT",
-#define ER_ERROR_DURING_ROLLBACK 181
+#define ER_ERROR_DURING_ROLLBACK 1181
"Got error %d during ROLLBACK",
-#define ER_ERROR_DURING_FLUSH_LOGS 182
+#define ER_ERROR_DURING_FLUSH_LOGS 1182
"Got error %d during FLUSH_LOGS",
-#define ER_ERROR_DURING_CHECKPOINT 183
+#define ER_ERROR_DURING_CHECKPOINT 1183
"Got error %d during CHECKPOINT",
-#define ER_NEW_ABORTING_CONNECTION 184
+#define ER_NEW_ABORTING_CONNECTION 1184
"Aborted connection %ld to db: '%-.64s' user: '%-.32s' host: `%-.64s' (%-.64s)",
-#define ER_DUMP_NOT_IMPLEMENTED 185
+#define ER_DUMP_NOT_IMPLEMENTED 1185
"The handler for the table does not support binary table dump",
-#define ER_FLUSH_MASTER_BINLOG_CLOSED 186
+#define ER_FLUSH_MASTER_BINLOG_CLOSED 1186
"Binlog closed, cannot RESET MASTER",
-#define ER_INDEX_REBUILD 187
+#define ER_INDEX_REBUILD 1187
"Failed rebuilding the index of dumped table '%-.64s'",
-#define ER_MASTER 188
+#define ER_MASTER 1188
"Error from master: '%-.64s'",
-#define ER_MASTER_NET_READ 189
+#define ER_MASTER_NET_READ 1189
"Net error reading from master",
-#define ER_MASTER_NET_WRITE 190
+#define ER_MASTER_NET_WRITE 1190
"Net error writing to master",
-#define ER_FT_MATCHING_KEY_NOT_FOUND 191
+#define ER_FT_MATCHING_KEY_NOT_FOUND 1191
"Can't find FULLTEXT index matching the column list",
-#define ER_LOCK_OR_ACTIVE_TRANSACTION 192
+#define ER_LOCK_OR_ACTIVE_TRANSACTION 1192
"Can't execute the given command because you have active locked tables or an active transaction",
-#define ER_UNKNOWN_SYSTEM_VARIABLE 193
-"Unknown system variable '%-.64'",
-#define ER_CRASHED_ON_USAGE 194
+#define ER_UNKNOWN_SYSTEM_VARIABLE 1193
+"Unknown system variable '%-.64s'",
+#define ER_CRASHED_ON_USAGE 1194
"Table '%-.64s' is marked as crashed and should be repaired",
-#define ER_CRASHED_ON_REPAIR 195
+#define ER_CRASHED_ON_REPAIR 1195
"Table '%-.64s' is marked as crashed and last (automatic?) repair failed",
-#define ER_WARNING_NOT_COMPLETE_ROLLBACK 196
+#define ER_WARNING_NOT_COMPLETE_ROLLBACK 1196
"Warning: Some non-transactional changed tables couldn't be rolled back",
-#define ER_TRANS_CACHE_FULL 197
+#define ER_TRANS_CACHE_FULL 1197
"Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage. Increase this mysqld variable and try again',
-#define ER_SLAVE_MUST_STOP 198
+#define ER_SLAVE_MUST_STOP 1198
"This operation cannot be performed with a running slave, run SLAVE STOP first",
-#define ER_SLAVE_NOT_RUNNING 199
+#define ER_SLAVE_NOT_RUNNING 1199
"This operation requires a running slave, configure slave and do SLAVE START",
-#define ER_BAD_SLAVE 200
+#define ER_BAD_SLAVE 1200
"The server is not configured as slave, fix in config file or with CHANGE MASTER TO",
-#define ER_MASTER_INFO 201
+#define ER_MASTER_INFO 1201
"Could not initialize master info structure, check permisions on master.info",
-#define ER_SLAVE_THREAD 202
+#define ER_SLAVE_THREAD 1202
"Could not create slave thread, check system resources",
-#define ER_TOO_MANY_USER_CONNECTIONS 203
+#define ER_TOO_MANY_USER_CONNECTIONS 1203
"User %-.64s has already more than 'max_user_connections' active connections",
-#define ER_SET_CONSTANTS_ONLY 204
+#define ER_SET_CONSTANTS_ONLY 1204
"You may only use constant expressions with SET",
-#define ER_LOCK_WAIT_TIMEOUT 205
+#define ER_LOCK_WAIT_TIMEOUT 1205
"Lock wait timeout exceeded; Try restarting transaction",
-#define ER_LOCK_TABLE_FULL 206
+#define ER_LOCK_TABLE_FULL 1206
"The total number of locks exceeds the lock table size",
-#define ER_READ_ONLY_TRANSACTION 207
+#define ER_READ_ONLY_TRANSACTION 1207
"Update locks cannot be acquired during a READ UNCOMMITTED transaction",
-#define ER_DROP_DB_WITH_READ_LOCK 208
+#define ER_DROP_DB_WITH_READ_LOCK 1208
"DROP DATABASE not allowed while thread is holding global read lock",
-#define ER_CREATE_DB_WITH_READ_LOCK 209
+#define ER_CREATE_DB_WITH_READ_LOCK 1209
"CREATE DATABASE not allowed while thread is holding global read lock",
-#define ER_WRONG_ARGUMENTS 210
+#define ER_WRONG_ARGUMENTS 1210
"Wrong arguments to %s",
-#define ER_NO_PERMISSION_TO_CREATE_USER 211
+#define ER_NO_PERMISSION_TO_CREATE_USER 1211
"%-.32s@%-.64s is not allowed to create new users",
-#define ER_UNION_TABLES_IN_DIFFERENT_DIR 212
+#define ER_UNION_TABLES_IN_DIFFERENT_DIR 1212
"Incorrect table definition; All MERGE tables must be in the same database",
-#define ER_LOCK_DEADLOCK 213
+#define ER_LOCK_DEADLOCK 1213
"Deadlock found when trying to get lock; Try restarting transaction",
-#define ER_TABLE_CANT_HANDLE_FULLTEXT 214
+#define ER_TABLE_CANT_HANDLE_FULLTEXT 1214
"The used table type doesn't support FULLTEXT indexes",
-#define ER_CANNOT_ADD_FOREIGN 215
+#define ER_CANNOT_ADD_FOREIGN 1215
"Cannot add foreign key constraint",
-#define ER_NO_REFERENCED_ROW 216
+#define ER_NO_REFERENCED_ROW 1216
"Cannot add a child row: a foreign key constraint fails",
-#define ER_ROW_IS_REFERENCED 217
+#define ER_ROW_IS_REFERENCED 1217
"Cannot delete a parent row: a foreign key constraint fails",
-#define ER_CONNECT_TO_MASTER 218
+#define ER_CONNECT_TO_MASTER 1218
"Error connecting to master: %-.128s",
-#define ER_QUERY_ON_MASTER 219
+#define ER_QUERY_ON_MASTER 1219
"Error running query on master: %-.128s",
-#define ER_ERROR_WHEN_EXECUTING_COMMAND 220
+#define ER_ERROR_WHEN_EXECUTING_COMMAND 1220
"Error when executing command %s: %-.128s",
-#define ER_WRONG_USAGE 221
+#define ER_WRONG_USAGE 1221
"Wrong usage of %s and %s",
-#define ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT 222
+#define ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT 1222
"The used SELECT statements have a different number of columns",
-#define ER_CANT_UPDATE_WITH_READLOCK 223
+#define ER_CANT_UPDATE_WITH_READLOCK 1223
"Can't execute the query because you have a conflicting read lock",
-#define ER_MIXING_NOT_ALLOWED 224
+#define ER_MIXING_NOT_ALLOWED 1224
"Mixing of transactional and non-transactional tables is disabled",
-#define ER_DUP_ARGUMENT 225
+#define ER_DUP_ARGUMENT 1225
"Option '%s' used twice in statement",
-#define ER_TOO_MANY_USER_CONNECTIONS 203
-"User %-.64s has already more than 'max_user_connections' active connections",
+#define ER_USER_LIMIT_REACHED 1226
+"User '%-64s' has exceeded the '%s' resource (current value: %ld)",