Commit 61fd6baf authored by monty@donna.mysql.com's avatar monty@donna.mysql.com

Bug fix for NATURAL JOIN, Split manual sections and more statistic variables

parent b31d0768
......@@ -148,7 +148,8 @@ version see the relevant distribution.
* Function Index:: SQL command, type and function index
* Concept Index:: Concept Index
@detailmenu --- The Detailed Node Listing ---
@detailmenu
--- The Detailed Node Listing ---
General Information About MySQL
......@@ -482,6 +483,15 @@ MyISAM table formats
* Dynamic format:: Dynamic table characteristics
* Compressed format:: Compressed table characteristics
BDB or Berkeley_db tables
* BDB overview::
* BDB install::
* BDB start::
* BDB characteristic::
* BDB TODO::
* BDB errors::
MySQL Tutorial
* Connecting-disconnecting:: Connecting to and disconnecting from the server
......@@ -806,6 +816,11 @@ MySQL internals
* MySQL threads:: MySQL threads
* MySQL full-text search:: MySQL full-text search
Credits
* developers::
* Contributors::
MySQL change history
* News-3.23.x:: Changes in release 3.23.x (Recommended; beta)
......@@ -1287,7 +1302,7 @@ mysql> SELECT author_name FROM biblio_db.author_list;
@end example
SQL statements may be written in uppercase or lowercase. When this manual
shows an SQL statement, uppercase is used for particular keywords if those
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:
......@@ -1975,6 +1990,8 @@ Apart from the following links, you can find and download a lot of
@item @uref{http://www.4t2.com/mysql. German MySQL maling list}
Information about the German MySQL mailing list.
@item @uref{http://www.bitmover.com:8888//home/bk/mysql, MySQL bitkeeper repository}
@item @uref{http://www.analysisandsolutions.com/code/mybasic.htm}@*
Beginners @strong{MySQL} Tutorial on how to install and set up
@strong{MySQL} on a Windows machine.
......@@ -2409,7 +2426,7 @@ A Contact Database using @strong{MySQL} and PHP.
Web based interface and Community Calender with PHP.
@item @uref{http://www.odbsoft.com/cook/sources.htm}@*
Perl package to generate html from an SQL table structure and for generating
Perl package to generate html from a SQL table structure and for generating
SQL statements from an html form.
@item @uref{http://www.gusnet.cx/proj/telsql/}@*
......@@ -9113,7 +9130,9 @@ Log updates to @code{file.#} where @code{#} is a unique number if not given.
@xref{Update log}.
@item --log-long-format
Log some extra information to update log.
Log some extra information to update log. If you are using
@code{--log-slow-queries} then queries that are not using indexes are logged
to the slow query log.
@item --low-priority-updates
Table-modifying operations (@code{INSERT}/@code{DELETE}/@code{UPDATE})
......@@ -10413,7 +10432,7 @@ In @strong{MySQL} Version 3.23 you can, however, use:
The following discussion only concerns you if you are running a @strong{MySQL}
version earlier than Version 3.23:
If you have an SQL program in a text file that contains @samp{--} comments
If you have a SQL program in a text file that contains @samp{--} comments
you should use:
@example
......@@ -14539,7 +14558,7 @@ statement, @strong{MySQL} reports the table structure using the equivalent
@node Functions, CREATE DATABASE, Column types, Reference
@section Functions for Use in @code{SELECT} and @code{WHERE} Clauses
A @code{select_expression} or @code{where_definition} in an SQL statement
A @code{select_expression} or @code{where_definition} in a SQL statement
can consist of any expression using the functions described below.
An expression that contains @code{NULL} always produces a @code{NULL} value
......@@ -19763,6 +19782,7 @@ The status variables listed above have the following meaning:
@item @code{Connections} @tab Number of connection attempts to the @strong{MySQL} server.
@item @code{Created_tmp_disk_tables} @tab Number of implicit temporary tables on disk that have been created while executing statements.
@item @code{Created_tmp_tables} @tab Number of implicit temporary tables in memory that have been created while executing statements.
@item @code{Created_tmp_files} @tab How many temporary files @code{mysqld} have 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}).
......@@ -19804,6 +19824,7 @@ have..
@item @code{Questions} @tab Number of queries sent to the server.
@item @code{Slow_launch_threads} @tab Number of threads that have taken more than @code{slow_launch_time} to connect.
@item @code{Slow_queries} @tab Number of queries that has 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_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.
......@@ -19824,9 +19845,16 @@ 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}.
@item
If @code{Handler_read_rnd} is big, then you have a probably a lot of queries
that requires @strong{MySQL} to scan whole tables or you have joins that doesn't use
keys properly.
If @code{Handler_read_rnd} is big, then you have a probably a lot of
queries that requires @strong{MySQL} to scan whole tables or you have
joins that doesn't use keys properly.
@item
If @code{Created_tmp_tables} or @code{Sort_merge_passes} are high then
your @code{mysqld} @code{sort_buffer} variables is probably too small.
@item
@code{Created_tmp_files} doesn't count the files needed to handle temporary
tables.
@item
@end itemize
@node SHOW VARIABLES, SHOW PROCESSLIST, SHOW STATUS, SHOW
......@@ -22128,6 +22156,18 @@ SUM_OVER_ALL_KEYS(max_length_of_key + sizeof(char*) * 2)
@node BDB, , HEAP, Table types
@section BDB or Berkeley_db tables
@menu
* BDB overview::
* BDB install::
* BDB start::
* BDB characteristic::
* BDB TODO::
* BDB errors::
@end menu
@node BDB overview, BDB install, BDB, BDB
@subsection Overview over BDB tables
Berkeley DB (@uref{http://www.sleepycat.com}) has provided
@strong{MySQL} with a transaction safe table handler. This will survive
crashes and also provides @code{COMMIT} and @code{ROLLBACK} on
......@@ -22138,6 +22178,9 @@ will need Berkeley DB 3.1.14 or newer which can be downloaded from
Sleepycat's download page at
@uref{http://www.sleepycat.com/download.html}.
@node BDB install, BDB start, BDB overview, BDB
@subsection Installing BDB
To install Berkeley DB first uncompress the @code{BDB} distribution
and follow the instructions in the README provided in the distiribution
directory. Basically what you need to do is:
......@@ -22165,6 +22208,9 @@ Even if Berkeley DB is in itself very tested and reliably, the
@strong{MySQL} interface is still very alpha, but we are actively
improving and optimizing it to get it this stable real soon.
@node BDB start, BDB characteristic, BDB install, BDB
@subsection BDB startup options
If you are running with @code{AUTOCOMMIT=0} then your changes in @code{BDB}
tables will not be updated until you execute @code{COMMIT}. Instead of commit
you can execute @code{ROLLBACK} to forget your changes. @xref{COMMIT}.
......@@ -22191,7 +22237,8 @@ Normally you should start mysqld with @code{--bdb-recover} if you intend
to use BDB tables. This may however give you problems when you try to
start mysqld if the BDB log files are corrupted. @xref{Starting server}.
Some characteristic of @code{BDB} tables:
@node BDB characteristic, BDB TODO, BDB start, BDB
@subsection Some characteristic of @code{BDB} tables
@itemize @bullet
@item
......@@ -22243,22 +22290,32 @@ to rotate and remove old logs when using @code{BDB} tables than using other tabl
types.
@end itemize
Some things that we have to fix in the near future:
@node BDB TODO, BDB errors, BDB characteristic, BDB
@subsection Some things we need to fix for BDB in the near future
@itemize @bullet
@item
Remove the requirement that @code{BDB} tables must have a primary key. This
will be fixed by having an automatic hidden auto_increment column for
the tables without a primary key.
@item
@code{LOCK TABLES} should work as for other @strong{MySQL} tables.
@item
@code{ALTER TABLE} doesn't yet work.
@item
@code{SHOW TABLE STATUS} doesn't yet provide that much information for BDB
tables.
@item
Optimize performance.
@end itemize
@node BDB errors, , BDB TODO, BDB
@subsection Errors you may get when using BDB tables
If you are running in not @code{auto_commit} mode and delete a table you
are using you may get the following error messages in the @strong{MySQL}
error file:
@example
001119 23:43:56 bdb: Missing log fileid entry
001119 23:43:56 bdb: txn_abort: Log undo failed for LSN: 1 3644744: Invalid
@end example
This is not fatal but we don't recommend you to delete tables you are
using in not @code{auto_commit} mode.
@cindex tutorial
@cindex terminal monitor, defined
@cindex monitor, terminal
......@@ -22402,7 +22459,7 @@ This query illustrates several things about @code{mysql}:
@itemize @bullet
@item
A command normally consists of an SQL statement followed by a semicolon.
A command normally consists of a SQL statement followed by a semicolon.
(There are some exceptions where a semicolon is not needed. @code{QUIT},
mentioned earlier, is one of them. We'll get to others later.)
......@@ -23942,7 +23999,7 @@ mysql> SELECT * FROM pet WHERE name REGEXP "[wW]";
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
side of the pattern to get it to match the entire value like it would be if
you used an SQL pattern.
you used a SQL pattern.
To find names containing exactly five characters, use @samp{^} and @samp{$}
to match the beginning and end of the name, and five instances of @samp{.}
......@@ -24669,7 +24726,7 @@ default character set in use to the client. The client will switch to
use this character set for this connection.
One should use @code{mysql_real_escape_string()} when escaping strings
for an SQL query. @code{mysql_real_escape_string()} is identical to the
for a SQL query. @code{mysql_real_escape_string()} is identical to the
old @code{mysql_escape_string()} function, except that it takes the MYSQL
connection handle as the first parameter.
......@@ -27508,7 +27565,7 @@ results. We would have used PHP or mod_perl instead but they were
not available at that time.
For graphical data we wrote a simple tool in @code{C} that can produce
GIFs based on the result of an SQL query (with some processing of the
GIFs based on the result of a SQL query (with some processing of the
result). This is also dynamically executed from the Perl script that
parses the @code{HTML} files.
......@@ -27868,7 +27925,7 @@ If you have problems due to insufficient memory in the client, use the
retrieve the result set.
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 an SQL statement, end it with @samp{;}, @samp{\g} or @samp{\G}
@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 return/enter.
@cindex command line options
......@@ -27913,7 +27970,7 @@ Print the output of a query (rows) vertically. Without this option you
can also force this output by ending your statements with @code{\G}.
@cindex force option
@item -f, --force
Continue even if we get an SQL error.
Continue even if we get a SQL error.
@cindex no-named-commands option
@item -g, --no-named-commands
Named commands are disabled. Use \* form only, or use named commands
......@@ -28015,7 +28072,7 @@ ego (\G) Send command to mysql server; Display result vertically
print (\p) Print current command
quit (\q) Quit mysql
rehash (\#) Rebuild completion hash
source (\.) Execute an SQL script file. Takes a file name as an argument
source (\.) Execute a SQL script file. Takes a file name as an argument
status (\s) Get status information from the server
use (\u) Use another database. Takes database name as argument
@end example
......@@ -28216,7 +28273,7 @@ meaning as the corresponding clauses for @code{LOAD DATA INFILE}.
@item -F, --flush-logs
Flush log file in the @strong{MySQL} server before starting the dump.
@item -f, --force,
Continue even if we get an SQL error during a table dump.
Continue even if we get a SQL error during a table dump.
@item -h, --host=..
Dump data from the @strong{MySQL} server on the named host. The default host
is @code{localhost}.
......@@ -30038,7 +30095,7 @@ functions. Consult this file to see how UDF calling conventions work.
For each function that you want to use in SQL statements, you should define
corresponding C (or C++) functions. In the discussion below, the name
``xxx'' is used for an example function name. To distinquish between SQL and
C/C++ usage, @code{XXX()} (uppercase) indicates an SQL function call, and
C/C++ usage, @code{XXX()} (uppercase) indicates a SQL function call, and
@code{xxx()} (lowercase) indicates a C/C++ function call.
The C/C++ functions that you write to implement the inferface for
......@@ -30082,7 +30139,7 @@ The deinitialization function for @code{xxx()}. It should deallocate any
memory allocated by the initialization function.
@end table
When an SQL statement invokes @code{XXX()}, @strong{MySQL} calls the
When a SQL statement invokes @code{XXX()}, @strong{MySQL} calls the
initialization function @code{xxx_init()} to let it perform any required
setup, such as argument checking or memory allocation. If @code{xxx_init()}
returns an error, the SQL statement is aborted with an error message and the
......@@ -32659,7 +32716,7 @@ backup. To get a consistent backup, do a @code{LOCK TABLES} on the
relevant tables. @xref{LOCK TABLES, , @code{LOCK TABLES}}. You only need a
read lock; this allows other threads to continue to query the tables while
you are making a copy of the files in the database directory. If you want to
make an SQL level backup of a table, you can use @code{SELECT INTO OUTFILE}.
make a SQL level backup of a table, you can use @code{SELECT INTO OUTFILE}.
Another way to backup a database is to use the @code{mysqldump} program:
@xref{mysqldump}.
......@@ -33231,11 +33288,11 @@ Returns the error number for the most recently invoked @strong{MySQL} function.
Returns the error message for the most recently invoked @strong{MySQL} function.
@item @strong{mysql_real_escape_string()} @tab
Escapes special characters in a string for use in an SQL statement taking
Escapes special characters in a string for use in a SQL statement taking
into account the current charset of the connection.
@item @strong{mysql_escape_string()} @tab
Escapes special characters in a string for use in an SQL statement.
Escapes special characters in a string for use in a SQL statement.
@item @strong{mysql_fetch_field()} @tab
Returns the type of the next table field.
......@@ -33316,13 +33373,13 @@ Checks whether or not the connection to the server is working, reconnecting
as necessary.
@item @strong{mysql_query()} @tab
Executes an SQL query specified as a null-terminated string.
Executes a SQL query specified as a null-terminated string.
@item @strong{mysql_real_connect()} @tab
Connects to a @strong{MySQL} server.
@item @strong{mysql_real_query()} @tab
Executes an SQL query specified as a counted string.
Executes a SQL query specified as a counted string.
@item @strong{mysql_reload()} @tab
Tells the server to reload the grant tables.
......@@ -33743,7 +33800,7 @@ None.
Creates the database named by the @code{db} parameter.
This function is deprecated. It is preferable to use @code{mysql_query()}
to issue an SQL @code{CREATE DATABASE} statement instead.
to issue a SQL @code{CREATE DATABASE} statement instead.
@subsubheading Return values
......@@ -33836,7 +33893,7 @@ mysql_debug("d:t:O,/tmp/client.trace");
Drops the database named by the @code{db} parameter.
This function is deprecated. It is preferable to use @code{mysql_query()}
to issue an SQL @code{DROP DATABASE} statement instead.
to issue a SQL @code{DROP DATABASE} statement instead.
@subsubheading Return values
......@@ -34870,6 +34927,7 @@ The specified group in the option file may contain the following options:
@item @code{debug} @tab Debug options.
@item @code{host} @tab Default host name.
@item @code{init-command} @tab Command to execute when connecting to @strong{MySQL} server. Will automatically be re-executed when reconnecting.
@item @code{interactive-timeout} @tab Same as specifying @code{CLIENT_INTERACTIVE} to @code{mysql_real_connect()}. @xref{mysql_real_connect}.
@item @code{password} @tab Default password.
@item @code{pipe} @tab Use named pipes to connect to a @strong{MySQL} server on NT.
@item @code{port} @tab Default port number.
......@@ -35045,11 +35103,14 @@ of the following flags in very special circumstances:
@multitable @columnfractions .25 .7
@item @strong{Flag name} @tab @strong{Flag meaning}
@code{mysqld} to be more ODBC-friendly.
@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.
@item @code{CLIENT_IGNORE_SPACE} $tab Allow spaces after function names. Makes all functions names reserved words.
@item @code{CLIENT_INTERACTIVE} @tab Allow @code{interactive_timeout} seconds (instead of @code{wait_timeout} seconds) of inactivity before closing the connection.
@item @code{CLIENT_NO_SCHEMA} @tab Don't allow the @code{db_name.tbl_name.col_name} syntax. This is for ODBC; It causes the parser to generate an error if you use that syntax, which is useful for trapping bugs in some ODBC programs.
@item @code{CLIENT_COMPRESS} @tab Use compression protocol.
@item @code{CLIENT_ODBC} @tab The client is an ODBC client. This changes
@code{mysqld} to be more ODBC-friendly.
@item @code{CLIENT_SSL} @tab Use SSL (encrypted protocol).
@end multitable
@end itemize
......@@ -35137,7 +35198,7 @@ try reconnecting to the server before giving up.
Encodes the string in @code{from} to an escaped SQL string, taking into
account the current charset of the connection, that can be sent to the
server in an SQL statement, places the result in @code{to}, and adds a
server in a SQL statement, places the result in @code{to}, and adds a
terminating null byte. Characters encoded are @code{NUL} (ASCII 0),
@samp{\n}, @samp{\r}, @samp{\}, @samp{'}, @samp{"} and Control-Z
(@pxref{Literals}).
......@@ -35236,7 +35297,7 @@ Asks the @strong{MySQL} server to reload the grant tables. The
connected user must have the @strong{reload} privilege.
This function is deprecated. It is preferable to use @code{mysql_query()}
to issue an SQL @code{FLUSH PRIVILEGES} statement instead.
to issue a SQL @code{FLUSH PRIVILEGES} statement instead.
@subsubheading Return values
......@@ -35806,9 +35867,9 @@ Installation instructions for @strong{MySQL} Perl support are given in
@multitable @columnfractions .3 .7
@item @code{connect} @tab Establishes a connection to a database server.
@item @code{disconnect} @tab Disconnects from the database server.
@item @code{prepare} @tab Prepares an SQL statement for execution.
@item @code{prepare} @tab Prepares a SQL statement for execution.
@item @code{execute} @tab Executes prepared statements.
@item @code{do} @tab Prepares and executes an SQL statement.
@item @code{do} @tab Prepares and executes a SQL statement.
@item @code{quote} @tab Quotes string or @code{BLOB} values to be inserted.
@item @code{fetchrow_array} @tab Fetches the next row as an array of fields.
@item @code{fetchrow_arrayref} @tab Fetches next row as a reference array of fields.
......@@ -35941,7 +36002,7 @@ $rc = $dbh->disconnect;
@findex DBI->prepare()
@findex prepare() DBI method
@item prepare($statement)
Prepares an SQL statement for execution by the database engine
Prepares a SQL statement for execution by the database engine
and returns a statement handle @code{($sth)} which you can use to invoke
the @code{execute} method.
Typically you handle @code{SELECT} statements (and @code{SELECT}-like statements
......@@ -35972,7 +36033,7 @@ $rv = $sth->execute
@findex DBI->do()
@findex do() DBI method
@item do($statement)
The @code{do} method prepares and executes an SQL statement and returns the
The @code{do} method prepares and executes a SQL statement and returns the
number of rows affected. If no rows are affected, @code{do} returns
@code{"0E0"}, which Perl treats as zero but regards as true. This method is
generally used for non-@code{SELECT} statements which cannot be prepared in
......@@ -37867,15 +37928,15 @@ and "post-processing" on both fields, records and operations.
@itemize @bullet
@item @uref{http://www.mysql.com/Downloads/Contrib/mod_mysql_include_1.0.tar.gz, mod_mysql_include_1.0.tar.gz}
Apache module to include HTML from MySQL queries into your pages, and run update queries.
Originally written to implement a simple fast low-overhead banner-rotation system.
By Sasha Pachev.
Apache module to include HTML from MySQL queries into your pages, and
run update queries. Originally written to implement a simple fast
low-overhead banner-rotation system. By Sasha Pachev.
@item @uref{http://www.odbsoft.com/cook/sources.htm}
This package has various functions for generating html code from an SQL
This package has various functions for generating html code from a SQL
table structure and for generating SQL statements (Select, Insert,
Update, Delete) from an html form. You can build a complete forms
interface to an SQL database (query, add, update, delete) without any
interface to a SQL database (query, add, update, delete) without any
programming! By Marc Beneteau, @email{marc@@odbsoft.com}.
@item @uref{http://www.mysql.com/Downloads/Contrib/sqlhtml.tar.gz, sqlhtml.tar.gz}
......@@ -38050,7 +38111,7 @@ By Steve Shreeve.
@itemize @bullet
@item @uref{http://www.mysql.com/Downloads/Contrib/emacs-sql-mode.tar.gz, emacs-sql-mode.tar.gz}
Raw port of an SQL mode for XEmacs. Supports completion. Original by
Raw port of a SQL mode for XEmacs. Supports completion. Original by
Peter D. Pezaris @email{pez@@atlantic2.sbi.com} and partial
@strong{MySQL} port by David Axmark.
......@@ -38186,26 +38247,35 @@ interested in.
@end itemize
@page
@cindex contributors, list of
@cindex credits
@node Credits, News, Contrib, Top
@appendix Contributors to MySQL
@appendix Credits
Contributors to the @strong{MySQL} distribution are listed below, in
somewhat random order:
The following persons have helped us make MySQL what it's today
@cindex developers, list of
@menu
* developers::
* Contributors::
@end menu
@node developers, Contributors, Credits, Credits
@appendixsubsec Delevopers at MySQL AB
Developers that are or has been employed by MySQL AB to work on MySQL.
(In about the order they started to work with us)
@table @asis
@item Michael (Monty) Widenius
Has written the following parts of @strong{MySQL}:
@itemize @bullet
@item
All the main code in @code{mysqld}.
Most the main code in @code{mysqld}.
@item
New functions for the string library.
@item
Most of the @code{mysys} library.
@item
The @code{ISAM} and @code{MyISAM} libraries (B-tree index file
The @code{ISAM},@code{MyISAM} and @code{MERGE} libraries (B-tree index file
handlers with index compression and different record formats).
@item
The @code{HEAP} library. A memory table system with our superior full dynamic
......@@ -38221,24 +38291,23 @@ also Unireg, a curses-based application tool with many utilities.
Porting of @code{mSQL} tools like @code{msqlperl}, @code{DBD}/@code{DBI} and
@code{DB2mysql}.
@item
Most parts of crash-me and the @strong{MySQL} benchmarks.
Most parts of crash-me and the foundation for the @strong{MySQL} benchmarks.
@end itemize
@item David Axmark
@itemize @bullet
@item
Coordinator and main writer for the @strong{Reference Manual}, including
enhancements to @code{texi2html}. Also automatic website updating from
this manual.
Coordinator and intial main writer for the @strong{Reference Manual},
including enhancements to @code{texi2html}. Also automatic website
updating from this manual.
@item
Autoconf, Automake and @code{libtool} support.
Inital Autoconf, Automake and @code{libtool} support.
@item
The licensing stuff.
@item
Parts of all the text files. (Nowadays only the @file{README} is
left. The rest ended up in the manual.)
@item
Our Mail master.
@item
Lots of testing of new features.
@item
Our in-house ``free'' software lawyer.
......@@ -38251,6 +38320,125 @@ only some parts of @code{mysys} are left.
Someone for Monty to call in the middle of the night when he just got
that new feature to work. :-)
@end itemize
@item Jani Tolonen
@itemize @bullet
@item
@code{mysqlimport}
@item
A lot of extensions to the @code{mysql} client.
@item
@code{procedure analyse}
@end itemize
@item Sinisa Milivojevic
@itemize @bullet
@item
Compression (with @code{zlib}) to the client/server protocol.
@item
Perfect hashing for the lexical analyzer phase.
@item
The MySQLGUI client.
@item
Maintainer of mysql++.
@end itemize
@item Tõnu Samual
@itemize @bullet
@item
Our security expert.
@item
Vio interface (foundation for the the encrypted client/server protocol).
@item
@code{RAID} support for @code{MyISAM} tables.
@end itemize
@item Sasha Pachev
@itemize @bullet
@item
Replication.
@item
@code{SHOW TABLE CREATE}.
@item
mod_mysql_include
@item
cgi++
@item
mysql-bench
@end itemize
@item Matt Wagner
@itemize @bullet
@item
@strong{MySQL} test suite
@item
Our web master.
@end itemize
@item Miguel Solórzano
@itemize @bullet
Winmysqladmin
@end itemize
@item Timothy Smith
@itemize @bullet
@item
Dynamic character support.
@item
Responsible for @strong{MySQL} configure.
@end itemize
@item Sergei A. Golubchick
@itemize @bullet
@item
Text search
@item
Added keys to the @code{MERGE} library.
@end itemize
@item Jeremy Cole
@itemize @bullet
@item
Proofreading and editing this fine manual.
@item
@code{ALTER TABLE ... ORDER BY}
@end itemize
@item John Dean
@itemize @bullet
@item
The new @strong{MySQL} GUI client.
@end itemize
@item Indrek Sitan
@itemize @bullet
Desinger/programmer of our web interface.
@end itemize
@end table
The following non developers are also working in/with MySQL AB
@table @asis
@item
Hans Kierkegaard ; Resonsible for MySQL license handling.
@item
Antti Halonen ; Sales manager
@item
Jonas Norrman ; Handles licensing questions sent to @email{info@@mysql.com}.
@item
Erik Granberg ; Handles MySQL partners (and a lot of other stuff)
@item
Allan Larsson (The BOSS for TCX DataKonsult AB).
@end table
@cindex contributors, list of
@node Contributors, , developers, Credits
@appendixsubsec Contributors to MySQL
Contributors to the @strong{MySQL} distribution are listed below, in
somewhat random order:
@table @asis
@item Paul DuBois
Help with making the Reference Manual correct and understandable. That
includes rewriting Monty's and David's attempts at English into English
......@@ -38260,10 +38448,6 @@ The initial port to Win32/NT.
@item Kim Aldale
Helped to rewrite Monty's and David's early attempts at English into
English.
@item Allan Larsson (The BOSS for TCX DataKonsult AB)
For all the time he has allowed Monty to spend on this ``maybe useful''
tool (@strong{MySQL}). Dedicated user (and bug finder) of Unireg &
@strong{MySQL}.
@item Per Eric Olsson
For more or less constructive criticism and real testing of the dynamic
record format.
......@@ -38273,7 +38457,7 @@ Win32 port with Borland compiler. @code{mysqlshutdown.exe} and
@item David J. Hughes
For the effort to make a shareware SQL database. We at TcX started with
@code{mSQL}, but found that it couldn't satisfy our purposes so instead we
wrote an SQL interface to our application builder Unireg. @code{mysqladmin}
wrote a SQL interface to our application builder Unireg. @code{mysqladmin}
and @code{mysql} are programs that were largely influenced by their
@code{mSQL} counterparts. We have put a lot of effort into making the
@strong{MySQL} syntax a superset of @code{mSQL}. Many of the APIs ideas are
......@@ -38308,6 +38492,8 @@ incredible help we got in managing the @strong{MySQL} mailing lists.
Monty).
@item Tim Bunce, Alligator Descartes
For the @code{DBD} (Perl) interface.
@item Tim Bunce
Author of @code{mysqlhotcopy}.
@item Andreas Koenig @email{a.koenig@@mind.de}
For the Perl interface to @strong{MySQL}.
@item Eugene Chan @email{eugene@@acenet.com.sg}
......@@ -38409,19 +38595,15 @@ The @file{libmysql.dll} library.
Mysqlmanager, a Win32 GUI tool for administrating @strong{MySQL}.
@item Curt Sampson @email{cjs@@portal.ca}
Porting of MIT-pthreads to NetBSD/Alpha and NetBSD 1.3/i386.
@item Sinisa Milivojevic @email{sinisa@@coresinc.com}
Compression (with @code{zlib}) to the client/server protocol.
Perfect hashing for the lexical analyzer phase.
@item Antony T. Curtis @email{antony.curtis@@olcs.net}
Porting of @strong{MySQL} to OS/2.
@item Martin Ramsch @email{m.ramsch@@computer.org}
Examples in the @strong{MySQL} Tutorial.
@item Tim Bunce
Author of @code{mysqlhotcopy}.
@item Steve Harvey
For making @code{mysqlaccess} more secure.
@item Jeremy Cole @email{jeremy@@spaceapes.com}
Proofreading and editing this fine manual.
@item Konark IA-64 Centre of Persistent Systems Private Limited
@uref{http://www.pspl.co.in/konark/}. Help with the Win64 port of the
@strong{MySQL} server.
@item Valueclick Inc.
For sponsoring the optimize section in this manual.
@end table
......@@ -38470,9 +38652,6 @@ Simple billing/license/support/copyright issues.
ODBC and VisualC++ interface questions.
@item Randy Harmon @email{rjharmon@@uptimecomputers.com}
@code{DBD}, Linux, some SQL syntax questions.
@item Konark IA-64 Centre of Persistent Systems Private Limited
@uref{http://www.pspl.co.in/konark/}. Help with the Win64 port of the
@strong{MySQL} server.
@end table
@node News, Bugs, Credits, Top
......@@ -38544,6 +38723,20 @@ though, so Version 3.23 is not released as a stable version yet.
@appendixsubsec Changes in release 3.23.28
@itemize @bullet
@item
One can now specify @code{interactive-timeout} in the option file that
is read by @code{mysql_options()}. This makes it possible to force
programs that runs for a long time (like @code{mysqlhotcopy}) to use
@code{interactive_timeout} instead of @code{wait_timeout}.
@item
We now always print when the query was made and who made it in the 'slow
query log'. If you are using @code{--log-long-format} then also queries
that are not using indexes are printed.
@item
Fixed problem in @code{LEFT JOIN} which caused all columns in reference
table to be NULL.
@item
Fixed problem when using @code{NATURAL JOIN} without keys.
@item
Fixed bug when using a multi-part keys where the first part was of type
@code{TEXT} or @code{BLOB}.
@item
......@@ -38574,9 +38767,12 @@ Fixed fatal bug in @code{CREATE TEMPORARY TABLE ...SELECT ...}.
@item
Fixed problem with @code{CREATE TABLE .. SELECT NULL}.
@item
Added status variables @code{large_file_support},@code{net_read_timeout},
Added variables @code{large_file_support},@code{net_read_timeout},
@code{net_write_timeout} and @code{query_buffer_size} to @code{SHOW VARIABLES}.
@item
Added status variables @code{created_tmp_files} and @code{sort_merge_passes}
to @code{SHOW STATUS}.
@item
Fixed bug where we didn't allow an index name after the
@code{FOREIGN KEY} definition.
@item
......@@ -41654,7 +41850,7 @@ New portable benchmark suite with @code{DBD}, with test results from
@code{mSQL} 2.0.3, @strong{MySQL}, PostgreSQL 6.2.1 and Solid server 2.2.
@item
@code{crash-me} is now included with the benchmarks; This is a Perl program
designed to find as many limits as possible in an SQL server. Tested with
designed to find as many limits as possible in a SQL server. Tested with
@code{mSQL}, PostgreSQL, Solid and @strong{MySQL}.
@item
Fixed bug in range-optimizer that crashed @strong{MySQL} on some queries.
......@@ -42920,7 +43116,7 @@ Because @strong{MySQL} allows you to work with table types that doesn't
support transactions (and thus can't @code{rollback} data) some things
behaves a little different in @strong{MySQL} than in other SQL servers:
(This is just to ensure that @strong{MySQL} never need to do a rollback
for an SQL command). This may be a little akward at times as column
for a SQL command). This may be a little akward at times as column
values must be checked in the application, but this will actually give
you a nice speed increase as it allows @strong{MySQL} to do some
optimizations that otherwice would be very hard to do.
......@@ -187,7 +187,7 @@ extern char *get_charsets_dir(char *buf);
extern ulong _my_cache_w_requests,_my_cache_write,_my_cache_r_requests,
_my_cache_read;
extern ulong _my_blocks_used,_my_blocks_changed;
extern uint my_file_opened,my_stream_opened;
extern ulong my_file_opened,my_stream_opened, my_tmp_file_created;
extern my_bool key_cache_inited;
/* Point to current my_message() */
......
......@@ -684,8 +684,8 @@ mysql_free_result(MYSQL_RES *result)
static const char *default_options[]=
{"port","socket","compress","password","pipe", "timeout", "user",
"init-command", "host", "database", "debug", "return-found-rows",
"ssl_key" ,"ssl_cert" ,"ssl_ca" ,"ssl_capath",
"character-set-dir", "default-character-set",
"ssl-key" ,"ssl-cert" ,"ssl-ca" ,"ssl-capath",
"character-set-dir", "default-character-set", "interactive-timeout",
NullS
};
......@@ -815,6 +815,9 @@ static void mysql_read_default_options(struct st_mysql_options *options,
my_free(options->charset_name,MYF(MY_ALLOW_ZERO_PTR));
options->charset_name = my_strdup(opt_arg, MYF(MY_WME));
break;
case 19: /* Interactive-timeout */
options->client_flag|=CLIENT_INTERACTIVE;
break;
default:
DBUG_PRINT("warning",("unknown option: %s",option[0]));
}
......
......@@ -170,5 +170,7 @@ File create_temp_file(char *to, const char *dir, const char *prefix,
}
}
#endif
if (file >= 0)
thread_safe_increment(my_tmp_file_created,&THR_LOCK_open);
DBUG_RETURN(file);
}
......@@ -30,7 +30,7 @@
my_string home_dir=0,my_progname=0;
char NEAR curr_dir[FN_REFLEN]= {0},
NEAR home_dir_buff[FN_REFLEN]= {0};
uint my_stream_opened=0,my_file_opened=0;
ulong my_stream_opened=0,my_file_opened=0, my_tmp_file_created=0;
int NEAR my_umask=0664, NEAR my_umask_dir=0777;
#ifndef THREAD
int NEAR my_errno=0;
......
......@@ -292,7 +292,7 @@ $dbh->do("drop table crash_q");
report("truncate","truncate_table",
"create table crash_q (a integer, b integer,c CHAR(10))",
"truncate crash_q",
"drop table crash_q1");
"drop table crash_q");
if ($dbh->do("create table crash_q (a integer, b integer,c CHAR(10))") &&
$dbh->do("create table crash_q1 (a integer, b integer,c CHAR(10) not null)"))
......
#This file is automaticly generated by crash-me 1.50
#This file is automaticly generated by crash-me 1.51
NEG=yes # update of column= -column
Need_cast_for_null=no # Need to cast NULL for arithmetic
......@@ -31,12 +31,12 @@ comment_--=yes # -- as comment (ANSI)
comment_/**/=yes # /* */ as comment
comment_//=no # // as comment (ANSI)
compute=no # Compute
connections=30 # Simultaneous connections (installation default)
connections=101 # Simultaneous connections (installation default)
constraint_check=no # Column constraints
constraint_check_table=no # Table constraints
constraint_null=yes # NULL constraint (SyBase style)
crash_me_safe=yes # crash me safe
crash_me_version=1.50 # crash me version
crash_me_version=1.51 # crash me version
create_default=yes # default value for column
create_default_func=no # default value function for column
create_if_not_exists=yes # create table if not exists
......@@ -315,7 +315,7 @@ intersect=no # intersect
intersect_all=no # intersect all
intersect_all_incompat=no # intersect all (incompatible lists)
intersect_incompat=no # intersect (incompatible lists)
join_tables=31 # tables in join
join_tables=63 # tables in join
left_outer_join=yes # left outer join
left_outer_join_using=yes # left outer join using
like_with_column=yes # column LIKE column
......@@ -327,7 +327,7 @@ max_char_size=255 # max char() size
max_column_name=64 # column name length
max_columns=3398 # Columns in table
max_conditions=85660 # OR and AND in WHERE
max_expressions=859 # simple expressions
max_expressions=1837 # simple expressions
max_index=32 # max index
max_index_length=500 # index length
max_index_name=64 # index name length
......@@ -337,7 +337,7 @@ max_index_varchar_part_length=255 # index varchar part length
max_row_length=65534 # max table row length (without blobs)
max_row_length_with_null=65502 # table row length with nulls (without blobs)
max_select_alias_name=+512 # select alias name length
max_stack_expression=859 # stacked expressions
max_stack_expression=1837 # stacked expressions
max_table_alias_name=+512 # table alias name length
max_table_name=64 # table name length
max_text_size=1048543 # max text or blob size
......@@ -361,7 +361,7 @@ null_in_index=yes # null in index
null_in_unique=yes # null in unique index
null_num_expr=yes # Is 1+NULL = NULL
odbc_left_outer_join=yes # left outer join odbc style
operating_system=Linux 2.2.14-my-SMP i686 # crash-me tested on
operating_system=Linux 2.2.13-SMP alpha # crash-me tested on
order_by=yes # Order by
order_by_alias=yes # Order by alias
order_by_function=yes # Order by function
......@@ -380,7 +380,7 @@ quote_with_"=yes # Allows ' and " as string markers
remember_end_space=no # Remembers end space in char()
remember_end_space_varchar=no # Remembers end space in varchar()
rename_table=yes # rename table
repeat_string_size=1048576 # return string size from function
repeat_string_size=1047552 # return string size from function
right_outer_join=yes # right outer join
rowid=auto_increment # Type for row id
select_constants=yes # Select constants
......@@ -389,7 +389,7 @@ select_limit2=yes # SELECT with LIMIT #,#
select_string_size=1048565 # constant string size in SELECT
select_table_update=no # Update with sub select
select_without_from=yes # SELECT without FROM
server_version=MySQL 3.23.25 beta debug # server version
server_version=MySQL 3.23.28 gamma # server version
simple_joins=yes # ANSI SQL simple joins
storage_of_float=round # Storage of float values
subqueries=no # subqueries
......@@ -398,6 +398,7 @@ table_name_case=no # case independent table names
table_wildcard=yes # Select table_name.*
tempoary_table=yes # temporary tables
transactions=no # transactions
truncate_table=yes # truncate
type_extra_abstime=no # Type abstime
type_extra_bfile=no # Type bfile
type_extra_blob=yes # Type blob
......@@ -512,5 +513,6 @@ union_all_incompat=no # union all (incompatible lists)
union_incompat=no # union (incompatible lists)
unique_in_create=yes # unique in create table
unique_null_in_create=yes # unique null in create
user_comment=Alpha DS20 2x500 MHz, 2G memory, key_buffer=16M; ccc + cxx # comment
views=no # views
where_string_size=1048540 # constant string size in where
#This file is automaticly generated by crash-me 1.50
#This file is automaticly generated by crash-me 1.51
NEG=yes # update of column= -column
Need_cast_for_null=no # Need to cast NULL for arithmetic
......@@ -31,12 +31,12 @@ comment_--=yes # -- as comment (ANSI)
comment_/**/=yes # /* */ as comment
comment_//=no # // as comment (ANSI)
compute=no # Compute
connections=30 # Simultaneous connections (installation default)
connections=101 # Simultaneous connections (installation default)
constraint_check=no # Column constraints
constraint_check_table=no # Table constraints
constraint_null=yes # NULL constraint (SyBase style)
crash_me_safe=yes # crash me safe
crash_me_version=1.50 # crash me version
crash_me_version=1.51 # crash me version
create_default=yes # default value for column
create_default_func=no # default value function for column
create_if_not_exists=yes # create table if not exists
......@@ -315,7 +315,7 @@ intersect=no # intersect
intersect_all=no # intersect all
intersect_all_incompat=no # intersect all (incompatible lists)
intersect_incompat=no # intersect (incompatible lists)
join_tables=31 # tables in join
join_tables=63 # tables in join
left_outer_join=yes # left outer join
left_outer_join_using=yes # left outer join using
like_with_column=yes # column LIKE column
......@@ -327,7 +327,7 @@ max_char_size=255 # max char() size
max_column_name=64 # column name length
max_columns=3398 # Columns in table
max_conditions=85660 # OR and AND in WHERE
max_expressions=859 # simple expressions
max_expressions=1837 # simple expressions
max_index=32 # max index
max_index_length=500 # index length
max_index_name=64 # index name length
......@@ -337,7 +337,7 @@ max_index_varchar_part_length=255 # index varchar part length
max_row_length=65534 # max table row length (without blobs)
max_row_length_with_null=65502 # table row length with nulls (without blobs)
max_select_alias_name=+512 # select alias name length
max_stack_expression=859 # stacked expressions
max_stack_expression=1837 # stacked expressions
max_table_alias_name=+512 # table alias name length
max_table_name=64 # table name length
max_text_size=1048543 # max text or blob size
......@@ -361,7 +361,7 @@ null_in_index=yes # null in index
null_in_unique=yes # null in unique index
null_num_expr=yes # Is 1+NULL = NULL
odbc_left_outer_join=yes # left outer join odbc style
operating_system=Linux 2.2.14-my-SMP i686 # crash-me tested on
operating_system=Linux 2.2.13-SMP alpha # crash-me tested on
order_by=yes # Order by
order_by_alias=yes # Order by alias
order_by_function=yes # Order by function
......@@ -380,7 +380,7 @@ quote_with_"=yes # Allows ' and " as string markers
remember_end_space=no # Remembers end space in char()
remember_end_space_varchar=no # Remembers end space in varchar()
rename_table=yes # rename table
repeat_string_size=1048576 # return string size from function
repeat_string_size=1047552 # return string size from function
right_outer_join=yes # right outer join
rowid=auto_increment # Type for row id
select_constants=yes # Select constants
......@@ -389,7 +389,7 @@ select_limit2=yes # SELECT with LIMIT #,#
select_string_size=1048565 # constant string size in SELECT
select_table_update=no # Update with sub select
select_without_from=yes # SELECT without FROM
server_version=MySQL 3.23.25 beta debug # server version
server_version=MySQL 3.23.28 gamma # server version
simple_joins=yes # ANSI SQL simple joins
storage_of_float=round # Storage of float values
subqueries=no # subqueries
......@@ -398,6 +398,7 @@ table_name_case=no # case independent table names
table_wildcard=yes # Select table_name.*
tempoary_table=yes # temporary tables
transactions=no # transactions
truncate_table=yes # truncate
type_extra_abstime=no # Type abstime
type_extra_bfile=no # Type bfile
type_extra_blob=yes # Type blob
......@@ -512,5 +513,6 @@ union_all_incompat=no # union all (incompatible lists)
union_incompat=no # union (incompatible lists)
unique_in_create=yes # unique in create table
unique_null_in_create=yes # unique null in create
user_comment=Alpha DS20 2x500 MHz, 2G memory, key_buffer=16M; ccc + cxx # comment
views=no # views
where_string_size=1048540 # constant string size in where
......@@ -716,6 +716,8 @@ static int merge_buffers(SORTPARAM *param, IO_CACHE *from_file,
volatile bool *killed= &current_thd->killed;
DBUG_ENTER("merge_buffers");
statistic_increment(filesort_merge_passes, &LOCK_status);
count=error=0;
offset=param->sort_length-param->ref_length;
maxcount=(ulong) (param->keys/((uint) (Tb-Fb) +1));
......
......@@ -160,6 +160,10 @@ void kill_one_thread(THD *thd, ulong id);
#define OPTION_QUICK OPTION_BEGIN*2
#define OPTION_QUOTE_SHOW_CREATE OPTION_QUICK*2
/* The following is set when parsing the query */
#define OPTION_NO_INDEX_USED OPTION_QUOTE_SHOW_CREATE*2
#define OPTION_NO_GOOD_INDEX_USED OPTION_NO_INDEX_USED*2
#define RAID_BLOCK_SIZE 1024
/* BINLOG_DUMP options */
......@@ -445,6 +449,7 @@ extern ulong refresh_version,flush_version, thread_id,query_id,opened_tables,
delayed_insert_threads, delayed_insert_writes,
delayed_rows_in_use,delayed_insert_errors;
extern ulong filesort_rows, filesort_range_count, filesort_scan_count;
extern ulong filesort_merge_passes;
extern ulong select_range_check_count, select_range_count, select_scan_count;
extern ulong select_full_range_join_count,select_full_join_count;
extern uint test_flags,select_errors,mysql_port,ha_open_options;
......@@ -615,6 +620,7 @@ inline bool add_group_to_list(Item *item,bool asc)
inline void mark_as_null_row(TABLE *table)
{
table->null_row=1;
table->status|=STATUS_NULL_ROW;
bfill(table->null_flags,table->null_bytes,255);
}
......
......@@ -222,6 +222,7 @@ ulong query_id=1L,long_query_count,long_query_time,aborted_threads,
delayed_queue_size,delayed_insert_threads,delayed_insert_writes,
delayed_rows_in_use,delayed_insert_errors,flush_time;
ulong filesort_rows, filesort_range_count, filesort_scan_count;
ulong filesort_merge_passes;
ulong select_range_check_count, select_range_count, select_scan_count;
ulong select_full_range_join_count,select_full_join_count;
ulong specialflag=0,opened_tables=0,created_tmp_tables=0,
......@@ -2517,6 +2518,7 @@ struct show_var_st status_vars[]= {
{"Connections", (char*) &thread_id, SHOW_LONG_CONST},
{"Created_tmp_disk_tables", (char*) &created_tmp_disk_tables,SHOW_LONG},
{"Created_tmp_tables", (char*) &created_tmp_tables, SHOW_LONG},
{"Created_tmp_files", (char*) &my_tmp_file_created, SHOW_LONG},
{"Delayed_insert_threads", (char*) &delayed_insert_threads, SHOW_LONG},
{"Delayed_writes", (char*) &delayed_insert_writes, SHOW_LONG},
{"Delayed_errors", (char*) &delayed_insert_errors, SHOW_LONG},
......@@ -2551,6 +2553,7 @@ struct show_var_st status_vars[]= {
{"Slave_running", (char*) &slave_running, SHOW_BOOL},
{"Slow_launch_threads", (char*) &slow_launch_threads, SHOW_LONG},
{"Slow_queries", (char*) &long_query_count, SHOW_LONG},
{"Sort_merge_passes", (char*) &filesort_merge_passes, SHOW_LONG},
{"Sort_range", (char*) &filesort_range_count, SHOW_LONG},
{"Sort_rows", (char*) &filesort_rows, SHOW_LONG},
{"Sort_scan", (char*) &filesort_scan_count, SHOW_LONG},
......
......@@ -1783,6 +1783,8 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds)
DBUG_RETURN(1);
tmp->fix_length_and_dec(); // Update cmp_type
tmp->const_item_cache=0;
/* Mark field used for table cache */
t1->field[i]->query_id=t2->field[j]->query_id=thd->query_id;
cond_and->list.push_back(tmp);
if ((tmp_map=t1->field[i]->part_of_key))
{
......
......@@ -173,14 +173,16 @@ int mysql_delete(THD *thd,TABLE_LIST *table_list,COND *conds,ha_rows limit,
}
/* If running in safe sql mode, don't allow updates without keys */
if ((thd->options & OPTION_SAFE_UPDATES) && !table->quick_keys &&
limit == HA_POS_ERROR)
if (!table->quick_keys)
{
thd->options|=OPTION_NO_INDEX_USED;
if ((thd->options & OPTION_SAFE_UPDATES) && limit == HA_POS_ERROR)
{
delete select;
send_error(&thd->net,ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE);
DBUG_RETURN(1);
}
}
(void) table->file->extra(HA_EXTRA_NO_READCHECK);
if (options & OPTION_QUICK)
(void) table->file->extra(HA_EXTRA_QUICK);
......
......@@ -825,7 +825,9 @@ bool do_command(THD *thd)
/* If not reading from backup and if the query took too long */
if (!thd->user_time)
{
if ((ulong) (thd->start_time - thd->time_after_lock) > long_query_time)
if ((ulong) (thd->start_time - thd->time_after_lock) > long_query_time ||
((thd->options & (OPTION_NO_INDEX_USED | OPTION_NO_GOOD_INDEX_USED)) &&
(specialflag & SPECIAL_LONG_LOG_FORMAT)))
{
long_query_count++;
mysql_slow_log.write(thd, thd->query, thd->query_length, start_of_query);
......
......@@ -2420,6 +2420,7 @@ make_join_readinfo(JOIN *join,uint options)
/* These init changes read_record */
if (tab->use_quick == 2)
{
join->thd->options|=OPTION_NO_GOOD_INDEX_USED;
tab->read_first_record= join_init_quick_read_record;
statistic_increment(select_range_check_count, &LOCK_status);
}
......@@ -2434,6 +2435,7 @@ make_join_readinfo(JOIN *join,uint options)
}
else
{
join->thd->options|=OPTION_NO_INDEX_USED;
statistic_increment(select_scan_count, &LOCK_status);
}
}
......@@ -2445,6 +2447,7 @@ make_join_readinfo(JOIN *join,uint options)
}
else
{
join->thd->options|=OPTION_NO_INDEX_USED;
statistic_increment(select_full_join_count, &LOCK_status);
}
}
......@@ -4234,7 +4237,7 @@ join_read_key(JOIN_TAB *tab)
TABLE *table= tab->table;
if (cmp_buffer_with_ref(tab) ||
(table->status & (STATUS_GARBAGE | STATUS_NO_PARENT)))
(table->status & (STATUS_GARBAGE | STATUS_NO_PARENT | STATUS_NULL_ROW)))
{
if (tab->ref.key_err)
{
......@@ -4252,6 +4255,7 @@ join_read_key(JOIN_TAB *tab)
return 1;
}
}
table->null_row=0;
return table->status ? -1 : 0;
}
......
......@@ -100,15 +100,17 @@ int mysql_update(THD *thd,TABLE_LIST *table_list,List<Item> &fields,
DBUG_RETURN(0);
}
/* If running in safe sql mode, don't allow updates without keys */
if ((thd->options & OPTION_SAFE_UPDATES) && !table->quick_keys &&
limit == HA_POS_ERROR)
if (!table->quick_keys)
{
thd->options|=OPTION_NO_INDEX_USED;
if ((thd->options & OPTION_SAFE_UPDATES) && limit == HA_POS_ERROR)
{
delete select;
table->time_stamp=save_time_stamp;
send_error(&thd->net,ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE);
DBUG_RETURN(1);
}
}
/* Check if we are modifying a key that we are used to search with */
if (select && select->quick)
used_key_is_modified= (!select->quick->unique_key_range() &&
......
......@@ -161,3 +161,4 @@ typedef struct st_lex_user {
#define STATUS_NO_PARENT 4 /* Parent record wasn't found */
#define STATUS_NOT_READ 8 /* Record isn't read */
#define STATUS_UPDATED 16 /* Record is updated by formula */
#define STATUS_NULL_ROW 32 /* table->null_row is set */
......@@ -62,3 +62,6 @@ set-variable = key_buffer=256M
set-variable = sort_buffer=256M
set-variable = read_buffer=2M
set-variable = write_buffer=2M
[mysqlhotcopy]
interactive-timeout
......@@ -62,3 +62,6 @@ set-variable = key_buffer=128M
set-variable = sort_buffer=128M
set-variable = read_buffer=2M
set-variable = write_buffer=2M
[mysqlhotcopy]
interactive-timeout
......@@ -61,3 +61,6 @@ set-variable = key_buffer=20M
set-variable = sort_buffer=20M
set-variable = read_buffer=2M
set-variable = write_buffer=2M
[mysqlhotcopy]
interactive-timeout
......@@ -55,3 +55,6 @@ set-variable = sort_buffer=8M
[myisamchk]
set-variable = key_buffer=8M
set-variable = sort_buffer=8M
[mysqlhotcopy]
interactive-timeout
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment