Commit b23a560f authored by unknown's avatar unknown

erge with 4.0 + updates for column types


sql-bench/copy-db.sh:
  Change mode to -rw-rw-r--
sql-bench/crash-me.sh:
  Change mode to -rw-rw-r--
sql-bench/server-cfg.sh:
  Change mode to -rw-rw-r--
sql-bench/test-insert.sh:
  Change mode to -rw-rw-r--
Docs/manual.texi:
  Merge with 4.0 + updates for column types
sql/mysqld.cc:
  cleanup
parent 791d4ea0
...@@ -268,7 +268,7 @@ System-specific Issues ...@@ -268,7 +268,7 @@ System-specific Issues
* HP-UX 10.20:: HP-UX 10.20 notes * HP-UX 10.20:: HP-UX 10.20 notes
* HP-UX 11.x:: HP-UX 11.x notes * HP-UX 11.x:: HP-UX 11.x notes
* Mac OS X:: Mac OS X notes * Mac OS X:: Mac OS X notes
* BEOS:: * BEOS:: BeOS Notes
Linux Notes (All Linux Versions) Linux Notes (All Linux Versions)
...@@ -279,7 +279,7 @@ Linux Notes (All Linux Versions) ...@@ -279,7 +279,7 @@ Linux Notes (All Linux Versions)
* Linux-Alpha:: Linux-Alpha notes * Linux-Alpha:: Linux-Alpha notes
* MKLinux:: MkLinux notes * MKLinux:: MkLinux notes
* Qube2:: Qube2 Linux notes * Qube2:: Qube2 Linux notes
* Linux-Ia64:: * Linux-Ia64:: Linux-Ia64 notes
BSD/OS Notes BSD/OS Notes
...@@ -510,7 +510,7 @@ Examples of Common Queries ...@@ -510,7 +510,7 @@ Examples of Common Queries
* example-Maximum-row:: The row holding the maximum of a certain column * example-Maximum-row:: The row holding the maximum of a certain column
* example-Maximum-column-group:: Maximum of column per group * example-Maximum-column-group:: Maximum of column per group
* example-Maximum-column-group-row:: The rows holding the group-wise maximum of a certain field * example-Maximum-column-group-row:: The rows holding the group-wise maximum of a certain field
* example-user-variables:: * example-user-variables:: Using user variables
* example-Foreign keys:: Using foreign keys * example-Foreign keys:: Using foreign keys
Creating and Using a Database Creating and Using a Database
...@@ -594,7 +594,7 @@ Speed of Queries that Access or Update Data ...@@ -594,7 +594,7 @@ Speed of Queries that Access or Update Data
* Estimating performance:: Estimating query performance * Estimating performance:: Estimating query performance
* SELECT speed:: Speed of @code{SELECT} queries * SELECT speed:: Speed of @code{SELECT} queries
* Where optimizations:: How MySQL optimizes @code{WHERE} clauses * Where optimizations:: How MySQL optimizes @code{WHERE} clauses
* DISTINCT optimization:: * DISTINCT optimization:: How MySQL Optimizes @code{DISTINCT}
* LEFT JOIN optimization:: How MySQL optimizes @code{LEFT JOIN} * LEFT JOIN optimization:: How MySQL optimizes @code{LEFT JOIN}
* LIMIT optimization:: How MySQL optimizes @code{LIMIT} * LIMIT optimization:: How MySQL optimizes @code{LIMIT}
* Insert speed:: Speed of @code{INSERT} queries * Insert speed:: Speed of @code{INSERT} queries
...@@ -604,7 +604,7 @@ Speed of Queries that Access or Update Data ...@@ -604,7 +604,7 @@ Speed of Queries that Access or Update Data
MySQL Utilites MySQL Utilites
* Programs:: What do the executables do? * Programs:: What do the executables do?
* safe_mysqld:: * safe_mysqld:: safe_mysqld, the wrapper around mysqld
* mysqld_multi:: Program for managing multiple @strong{MySQL} servers * mysqld_multi:: Program for managing multiple @strong{MySQL} servers
* mysql:: The command line tool * mysql:: The command line tool
* mysqladmin:: Administering a @strong{MySQL} server * mysqladmin:: Administering a @strong{MySQL} server
...@@ -705,7 +705,7 @@ Some Common Errors When Using MySQL ...@@ -705,7 +705,7 @@ Some Common Errors When Using MySQL
* Packet too large:: @code{Packet too large} error * Packet too large:: @code{Packet too large} error
* Communication errors:: Communication errors / Aborted connection * Communication errors:: Communication errors / Aborted connection
* Full table:: @code{The table is full} error * Full table:: @code{The table is full} error
* Cannot create:: * Cannot create:: @code{Can't create/write to file} Error
* Commands out of sync:: @code{Commands out of sync} error in client * Commands out of sync:: @code{Commands out of sync} error in client
* Ignoring user:: @code{Ignoring user} error * Ignoring user:: @code{Ignoring user} error
* Cannot find table:: @code{Table 'xxx' doesn't exist} error * Cannot find table:: @code{Table 'xxx' doesn't exist} error
...@@ -715,7 +715,7 @@ Solving Some Common Problems with MySQL ...@@ -715,7 +715,7 @@ Solving Some Common Problems with MySQL
* Log Replication:: Database replication with update log * Log Replication:: Database replication with update log
* Backup:: Database backups * Backup:: Database backups
* Update log:: The update log * Update log:: The update log
* Binary log:: * Binary log:: The binary log
* Slow query log:: Log of slow queries * Slow query log:: Log of slow queries
* Multiple servers:: Running multiple @strong{MySQL} servers on the same machine * Multiple servers:: Running multiple @strong{MySQL} servers on the same machine
...@@ -831,15 +831,20 @@ Credits ...@@ -831,15 +831,20 @@ Credits
MySQL change history MySQL change history
* News-4.0.x:: Changes in release 4.0 (development release)
* News-3.23.x:: Changes in release 3.23.x (Recommended; Gamma) * News-3.23.x:: Changes in release 3.23.x (Recommended; Gamma)
* News-3.22.x:: Changes in release 3.22.x (Still supported) * News-3.22.x:: Changes in release 3.22.x (Still supported)
* News-3.21.x:: Changes in release 3.21.x * News-3.21.x:: Changes in release 3.21.x
* News-3.20.x:: Changes in release 3.20.x * News-3.20.x:: Changes in release 3.20.x
* News-3.19.x:: Changes in release 3.19.x * News-3.19.x:: Changes in release 3.19.x
Changes in release 4.0 (Alpha)
* News-4.0.0:: Changes in release 4.0.0
Changes in release 3.23.x (Recommended; Gamma) Changes in release 3.23.x (Recommended; Gamma)
* News-3.23.30:: * News-3.23.30:: Changes in release 3.23.30
* News-3.23.29:: Changes in release 3.23.29 * News-3.23.29:: Changes in release 3.23.29
* News-3.23.28:: Changes in release 3.23.28 * News-3.23.28:: Changes in release 3.23.28
* News-3.23.27:: Changes in release 3.23.27 * News-3.23.27:: Changes in release 3.23.27
...@@ -983,7 +988,7 @@ Comments on porting to other systems ...@@ -983,7 +988,7 @@ Comments on porting to other systems
* Debugging server:: Debugging a @strong{MySQL} server * Debugging server:: Debugging a @strong{MySQL} server
* Debugging client:: Debugging a @strong{MySQL} client * Debugging client:: Debugging a @strong{MySQL} client
* The DBUG package:: The DBUG package * The DBUG package:: The DBUG package
* Locking methods:: * Locking methods:: Locking methods
* RTS-threads:: Comments about RTS threads * RTS-threads:: Comments about RTS threads
* Thread packages:: Differences between different thread packages * Thread packages:: Differences between different thread packages
...@@ -6557,7 +6562,7 @@ distribution. ...@@ -6557,7 +6562,7 @@ distribution.
* HP-UX 10.20:: HP-UX 10.20 notes * HP-UX 10.20:: HP-UX 10.20 notes
* HP-UX 11.x:: HP-UX 11.x notes * HP-UX 11.x:: HP-UX 11.x notes
* Mac OS X:: Mac OS X notes * Mac OS X:: Mac OS X notes
* BEOS:: * BEOS:: BeOS Notes
@end menu @end menu
...@@ -7004,7 +7009,7 @@ CC=fcc CFLAGS="-O -K fast -K lib -K omitfp -Kpreex -D_GNU_SOURCE -DCONST=const - ...@@ -7004,7 +7009,7 @@ CC=fcc CFLAGS="-O -K fast -K lib -K omitfp -Kpreex -D_GNU_SOURCE -DCONST=const -
* Linux-Alpha:: Linux-Alpha notes * Linux-Alpha:: Linux-Alpha notes
* MKLinux:: MkLinux notes * MKLinux:: MkLinux notes
* Qube2:: Qube2 Linux notes * Qube2:: Qube2 Linux notes
* Linux-Ia64:: * Linux-Ia64:: Linux-Ia64 notes
@end menu @end menu
@node Linux-x86, Linux-RedHat50, Linux, Linux @node Linux-x86, Linux-RedHat50, Linux, Linux
...@@ -13416,6 +13421,10 @@ the @code{FLOAT} and @code{DOUBLE} types described immediately below. ...@@ -13416,6 +13421,10 @@ the @code{FLOAT} and @code{DOUBLE} types described immediately below.
In @strong{MySQL} Version 3.23, this is a true floating-point value. In In @strong{MySQL} Version 3.23, this is a true floating-point value. In
earlier @strong{MySQL} versions, @code{FLOAT(precision)} always has 2 decimals. earlier @strong{MySQL} versions, @code{FLOAT(precision)} always has 2 decimals.
Note that using @code{FLOAT} may give you some unexpected problems as
all calculation in @code{MySQL} is done with double precision.
@xref{No matching rows}.
@cindex ODBC compatibility @cindex ODBC compatibility
@cindex compatibility, with ODBC @cindex compatibility, with ODBC
This syntax is provided for ODBC compatibility. This syntax is provided for ODBC compatibility.
...@@ -13455,17 +13464,18 @@ These are synonyms for @code{DOUBLE}. ...@@ -13455,17 +13464,18 @@ These are synonyms for @code{DOUBLE}.
An unpacked floating-point number. Cannot be unsigned. Behaves like a An unpacked floating-point number. Cannot be unsigned. Behaves like a
@code{CHAR} column: ``unpacked'' means the number is stored as a string, @code{CHAR} column: ``unpacked'' means the number is stored as a string,
using one character for each digit of the value. The decimal point using one character for each digit of the value. The decimal point and,
and, for negative numbers, the @samp{-} sign, are not counted in M. If for negative numbers, the @samp{-} sign, are not counted in M (but space
@code{D} is 0, values will have no decimal point or fractional part. for these are reserved). If @code{D} is 0, values will have no decimal
The maximum range of @code{DECIMAL} values is the same as for point or fractional part. The maximum range of @code{DECIMAL} values is
@code{DOUBLE}, but the actual range for a given @code{DECIMAL} column the same as for @code{DOUBLE}, but the actual range for a given
may be constrained by the choice of @code{M} and @code{D}. @code{DECIMAL} column may be constrained by the choice of @code{M} and
@code{D}.
If @code{D} is left out it's set to 0. If @code{M} is left out it's set to 10. If @code{D} is left out it's set to 0. If @code{M} is left out it's set to 10.
Note that in @strong{MySQL} Version 3.22 the @code{M} argument includes the Note that in @strong{MySQL} Version 3.22 the @code{M} argument had to
sign and the decimal point. includes the space needed for the sign and the decimal point.
@tindex NUMERIC @tindex NUMERIC
@item NUMERIC(M,D) [ZEROFILL] @item NUMERIC(M,D) [ZEROFILL]
...@@ -13478,7 +13488,7 @@ This is a synonym for @code{DECIMAL}. ...@@ -13478,7 +13488,7 @@ This is a synonym for @code{DECIMAL}.
A date. The supported range is @code{'1000-01-01'} to @code{'9999-12-31'}. A date. The supported range is @code{'1000-01-01'} to @code{'9999-12-31'}.
@strong{MySQL} displays @code{DATE} values in @code{'YYYY-MM-DD'} format, but @strong{MySQL} displays @code{DATE} values in @code{'YYYY-MM-DD'} format, but
allows you to assign values to @code{DATE} columns using either strings or allows you to assign values to @code{DATE} columns using either strings or
numbers. numbers. @xref{DATETIME}.
@tindex DATETIME @tindex DATETIME
@item DATETIME @item DATETIME
...@@ -13487,6 +13497,7 @@ A date and time combination. The supported range is @code{'1000-01-01 ...@@ -13487,6 +13497,7 @@ A date and time combination. The supported range is @code{'1000-01-01
00:00:00'} to @code{'9999-12-31 23:59:59'}. @strong{MySQL} displays 00:00:00'} to @code{'9999-12-31 23:59:59'}. @strong{MySQL} displays
@code{DATETIME} values in @code{'YYYY-MM-DD HH:MM:SS'} format, but allows you @code{DATETIME} values in @code{'YYYY-MM-DD HH:MM:SS'} format, but allows you
to assign values to @code{DATETIME} columns using either strings or numbers. to assign values to @code{DATETIME} columns using either strings or numbers.
@xref{DATETIME}.
@tindex TIMESTAMP @tindex TIMESTAMP
@item TIMESTAMP[(M)] @item TIMESTAMP[(M)]
...@@ -13510,6 +13521,7 @@ Note that @code{TIMESTAMP(X)} columns where X is 8 or 14 are reported to ...@@ -13510,6 +13521,7 @@ Note that @code{TIMESTAMP(X)} columns where X is 8 or 14 are reported to
be numbers while other @code{TIMESTAMP(X)} columns are reported to be be numbers while other @code{TIMESTAMP(X)} columns are reported to be
strings. This is just to ensure that one can reliably dump and restore strings. This is just to ensure that one can reliably dump and restore
the table with these types! the table with these types!
@xref{DATETIME}.
@tindex TIME @tindex TIME
@item TIME @item TIME
...@@ -13517,7 +13529,7 @@ the table with these types! ...@@ -13517,7 +13529,7 @@ the table with these types!
A time. The range is @code{'-838:59:59'} to @code{'838:59:59'}. A time. The range is @code{'-838:59:59'} to @code{'838:59:59'}.
@strong{MySQL} displays @code{TIME} values in @code{'HH:MM:SS'} format, but @strong{MySQL} displays @code{TIME} values in @code{'HH:MM:SS'} format, but
allows you to assign values to @code{TIME} columns using either strings or allows you to assign values to @code{TIME} columns using either strings or
numbers. numbers. @xref{TIME}.
@tindex YEAR @tindex YEAR
@item YEAR[(2|4)] @item YEAR[(2|4)]
...@@ -13527,7 +13539,7 @@ are @code{1901} to @code{2155}, @code{0000} in the 4-digit year format, ...@@ -13527,7 +13539,7 @@ are @code{1901} to @code{2155}, @code{0000} in the 4-digit year format,
and 1970-2069 if you use the 2-digit format (70-69). @strong{MySQL} displays and 1970-2069 if you use the 2-digit format (70-69). @strong{MySQL} displays
@code{YEAR} values in @code{YYYY} format, but allows you to assign values to @code{YEAR} values in @code{YYYY} format, but allows you to assign values to
@code{YEAR} columns using either strings or numbers. (The @code{YEAR} type is @code{YEAR} columns using either strings or numbers. (The @code{YEAR} type is
new in @strong{MySQL} Version 3.22.) new in @strong{MySQL} Version 3.22.). @xref{YEAR}.
@tindex NATIONAL CHAR @tindex NATIONAL CHAR
@tindex NCHAR @tindex NCHAR
...@@ -13553,7 +13565,7 @@ some old applications that depend on the existence of a column but that do not ...@@ -13553,7 +13565,7 @@ some old applications that depend on the existence of a column but that do not
actually use the value. This is also quite nice when you need a actually use the value. This is also quite nice when you need a
column that only can take 2 values: A @code{CHAR(0)}, that is not defined column that only can take 2 values: A @code{CHAR(0)}, that is not defined
as @code{NOT NULL}, will only occupy one bit and can only take 2 values: as @code{NOT NULL}, will only occupy one bit and can only take 2 values:
@code{NULL} or @code{""}. @code{NULL} or @code{""}. @xref{CHAR}.
@tindex CHARACTER VARYING @tindex CHARACTER VARYING
@tindex CHAR VARYING @tindex CHAR VARYING
...@@ -13567,6 +13579,7 @@ compared in case-insensitive fashion unless the @code{BINARY} keyword is ...@@ -13567,6 +13579,7 @@ compared in case-insensitive fashion unless the @code{BINARY} keyword is
given. @xref{Silent column changes}. given. @xref{Silent column changes}.
@code{VARCHAR} is a shorthand for @code{CHARACTER VARYING}. @code{VARCHAR} is a shorthand for @code{CHARACTER VARYING}.
@xref{CHAR}.
@tindex TINYBLOB @tindex TINYBLOB
@tindex TINYTEXT @tindex TINYTEXT
...@@ -13574,7 +13587,7 @@ given. @xref{Silent column changes}. ...@@ -13574,7 +13587,7 @@ given. @xref{Silent column changes}.
@itemx TINYTEXT @itemx TINYTEXT
A @code{BLOB} or @code{TEXT} column with a maximum length of 255 (2^8 - 1) A @code{BLOB} or @code{TEXT} column with a maximum length of 255 (2^8 - 1)
characters. @xref{Silent column changes}. characters. @xref{Silent column changes}. @xref{BLOB}.
@tindex BLOB @tindex BLOB
@tindex TEXT @tindex TEXT
...@@ -13582,7 +13595,7 @@ characters. @xref{Silent column changes}. ...@@ -13582,7 +13595,7 @@ characters. @xref{Silent column changes}.
@itemx TEXT @itemx TEXT
A @code{BLOB} or @code{TEXT} column with a maximum length of 65535 (2^16 - 1) A @code{BLOB} or @code{TEXT} column with a maximum length of 65535 (2^16 - 1)
characters. @xref{Silent column changes}. characters. @xref{Silent column changes}. @xref{BLOB}.
@tindex MEDIUMBLOB @tindex MEDIUMBLOB
@tindex MEDIUMTEXT @tindex MEDIUMTEXT
...@@ -13590,7 +13603,7 @@ characters. @xref{Silent column changes}. ...@@ -13590,7 +13603,7 @@ characters. @xref{Silent column changes}.
@itemx MEDIUMTEXT @itemx MEDIUMTEXT
A @code{BLOB} or @code{TEXT} column with a maximum length of 16777215 A @code{BLOB} or @code{TEXT} column with a maximum length of 16777215
(2^24 - 1) characters. @xref{Silent column changes}. (2^24 - 1) characters. @xref{Silent column changes}. @xref{BLOB}.
@tindex LONGBLOB @tindex LONGBLOB
@tindex LONGTEXT @tindex LONGTEXT
...@@ -13601,22 +13614,22 @@ A @code{BLOB} or @code{TEXT} column with a maximum length of 4294967295 ...@@ -13601,22 +13614,22 @@ A @code{BLOB} or @code{TEXT} column with a maximum length of 4294967295
(2^32 - 1) characters. @xref{Silent column changes}. Note that because (2^32 - 1) characters. @xref{Silent column changes}. Note that because
the server/client protocol and MyISAM tables has currently a limit of the server/client protocol and MyISAM tables has currently a limit of
16M per communication packet / table row, you can't yet use this 16M per communication packet / table row, you can't yet use this
the whole range of this type. the whole range of this type. @xref{BLOB}.
@tindex ENUM @tindex ENUM
@item ENUM('value1','value2',...) @item ENUM('value1','value2',...)
An enumeration. An enumeration. A string object that can have only one value, chosen
A string object that can have only one value, chosen from the list of values from the list of values @code{'value1'}, @code{'value2'}, @code{...},
@code{'value1'}, @code{'value2'}, @code{...}, or @code{NULL}. An @code{ENUM} @code{NULL} or the special @code{""} error value. An @code{ENUM} can
can have a maximum of 65535 distinct values. have a maximum of 65535 distinct values. @xref{ENUM}.
@tindex SET @tindex SET
@item SET('value1','value2',...) @item SET('value1','value2',...)
A set. A string object that can have zero or more values, each of which must A set. A string object that can have zero or more values, each of which must
be chosen from the list of values @code{'value1'}, @code{'value2'}, be chosen from the list of values @code{'value1'}, @code{'value2'},
@code{...} A @code{SET} can have a maximum of 64 members. @code{...} A @code{SET} can have a maximum of 64 members. @xref{SET}.
@end table @end table
@menu @menu
...@@ -13640,7 +13653,7 @@ The storage requirements for each of the column types supported by ...@@ -13640,7 +13653,7 @@ The storage requirements for each of the column types supported by
@cindex numeric types @cindex numeric types
@cindex types, numeric @cindex types, numeric
@subheading Numeric types @subheading Storage requirements for numeric types
@multitable @columnfractions .5 .5 @multitable @columnfractions .5 .5
@item @strong{Column type} @tab @strong{Storage required} @item @strong{Column type} @tab @strong{Storage required}
...@@ -13655,15 +13668,15 @@ The storage requirements for each of the column types supported by ...@@ -13655,15 +13668,15 @@ The storage requirements for each of the column types supported by
@item @code{DOUBLE} @tab 8 bytes @item @code{DOUBLE} @tab 8 bytes
@item @code{DOUBLE PRECISION} @tab 8 bytes @item @code{DOUBLE PRECISION} @tab 8 bytes
@item @code{REAL} @tab 8 bytes @item @code{REAL} @tab 8 bytes
@item @code{DECIMAL(M,D)} @tab @code{M} bytes (@code{D}+2, if @code{M < D}) @item @code{DECIMAL(M,D)} @tab @code{M+2} bytes if D > 0, @code{M+1} bytes if D = 0 (@code{D}+2, if @code{M < D})
@item @code{NUMERIC(M,D)} @tab @code{M} bytes (@code{D}+2, if @code{M < D}) @item @code{NUMERIC(M,D)} @tab @code{M+2} bytes if D > 0, @code{M+1} bytes if D = 0 (@code{D}+2, if @code{M < D})
@end multitable @end multitable
@cindex date types @cindex date types
@cindex time types @cindex time types
@cindex types, date @cindex types, date
@cindex types, time @cindex types, time
@subheading Date and time types @subheading Storage requirements for date and time types
@multitable @columnfractions .5 .5 @multitable @columnfractions .5 .5
@item @strong{Column type} @tab @strong{Storage required} @item @strong{Column type} @tab @strong{Storage required}
...@@ -13674,7 +13687,7 @@ The storage requirements for each of the column types supported by ...@@ -13674,7 +13687,7 @@ The storage requirements for each of the column types supported by
@item @code{YEAR} @tab 1 byte @item @code{YEAR} @tab 1 byte
@end multitable @end multitable
@subheading String types @subheading Storage requirements for string types
@multitable @columnfractions .5 .5 @multitable @columnfractions .5 .5
@item @strong{Column type} @tab @strong{Storage required} @item @strong{Column type} @tab @strong{Storage required}
...@@ -13695,6 +13708,9 @@ the number of enumeration values (65535 values maximum) ...@@ -13695,6 +13708,9 @@ the number of enumeration values (65535 values maximum)
on the number of set members (64 members maximum) on the number of set members (64 members maximum)
@end multitable @end multitable
@cindex BLOB, size
@cindex TEXT, size
@cindex VARCHAR, size
@code{VARCHAR} and the @code{BLOB} and @code{TEXT} types are variable-length @code{VARCHAR} and the @code{BLOB} and @code{TEXT} types are variable-length
types, for which the storage requirements depend on the actual length of types, for which the storage requirements depend on the actual length of
column values (represented by @code{L} in the preceding table), rather than column values (represented by @code{L} in the preceding table), rather than
...@@ -13706,21 +13722,24 @@ and the storage requirement is 5 bytes. ...@@ -13706,21 +13722,24 @@ and the storage requirement is 5 bytes.
The @code{BLOB} and @code{TEXT} types require 1, 2, 3, or 4 bytes to record The @code{BLOB} and @code{TEXT} types require 1, 2, 3, or 4 bytes to record
the length of the column value, depending on the maximum possible length of the length of the column value, depending on the maximum possible length of
the type. the type. @xref{BLOB}.
If a table includes any variable-length column types, the record format will If a table includes any variable-length column types, the record format will
also be variable-length. Note that when a table is created, @strong{MySQL} also be variable-length. Note that when a table is created, @strong{MySQL}
may, under certain conditions, change a column from a variable-length type to a may, under certain conditions, change a column from a variable-length type to a
fixed-length type, or vice-versa. @xref{Silent column changes}. fixed-length type, or vice-versa. @xref{Silent column changes}.
The size of an @code{ENUM} object is determined by the number of different @cindex ENUM, size
enumeration values. One byte is used for enumerations with up to 255 possible The size of an @code{ENUM} object is determined by the number of
values. Two bytes are used for enumerations with up to 65535 values. different enumeration values. One byte is used for enumerations with up
to 255 possible values. Two bytes are used for enumerations with up to
65535 values. @xref{ENUM}.
@cindex SET, size
The size of a @code{SET} object is determined by the number of different The size of a @code{SET} object is determined by the number of different
set members. If the set size is @code{N}, the object occupies @code{(N+7)/8} set members. If the set size is @code{N}, the object occupies @code{(N+7)/8}
bytes, rounded up to 1, 2, 3, 4, or 8 bytes. A @code{SET} can have a maximum bytes, rounded up to 1, 2, 3, 4, or 8 bytes. A @code{SET} can have a maximum
of 64 members. of 64 members. @xref{SET}.
@node Numeric types, Date and time types, Storage requirements, Column types @node Numeric types, Date and time types, Storage requirements, Column types
@subsection Numeric Types @subsection Numeric Types
...@@ -18535,12 +18554,27 @@ keys that compress very good. ...@@ -18535,12 +18554,27 @@ keys that compress very good.
@example @example
DELETE [LOW_PRIORITY] FROM tbl_name DELETE [LOW_PRIORITY] FROM tbl_name
[WHERE where_definition] [LIMIT rows] [WHERE where_definition]
@c [ORDER BY ...]
[LIMIT rows]
@end example @end example
@code{DELETE} deletes rows from @code{tbl_name} that satisfy the condition @code{DELETE} deletes rows from @code{tbl_name} that satisfy the condition
given by @code{where_definition}, and returns the number of records deleted. given by @code{where_definition}, and returns the number of records deleted.
@c If an @code{ORDER BY} clause is used, the rows will be deleted in that order.
@c This is really only useful in conjunction with @code{LIMIT}. For example:
@c @example
@c DELETE FROM somelog
@c WHERE user = 'jcole'
@c ORDER BY timestamp
@c LIMIT 1
@c @end example
@c This will delete the oldest entry (by @code{timestamp}) where the row matches
@c the @code{WHERE} clause.
If you issue a @code{DELETE} with no @code{WHERE} clause, all rows are If you issue a @code{DELETE} with no @code{WHERE} clause, all rows are
deleted. If you do this in @code{AUTOCOMMIT} mode, this works as deleted. If you do this in @code{AUTOCOMMIT} mode, this works as
@code{TRUNCATE}. @xref{TRUNCATE}. One problem with this is that @code{TRUNCATE}. @xref{TRUNCATE}. One problem with this is that
...@@ -19728,14 +19762,19 @@ For more information about the efficiency of @code{INSERT} versus ...@@ -19728,14 +19762,19 @@ For more information about the efficiency of @code{INSERT} versus
@section @code{UPDATE} Syntax @section @code{UPDATE} Syntax
@example @example
UPDATE [LOW_PRIORITY] [IGNORE] tbl_name SET col_name1=expr1,col_name2=expr2,... UPDATE [LOW_PRIORITY] [IGNORE] tbl_name
[WHERE where_definition] [LIMIT #] SET col_name1=expr1, [col_name2=expr2, ...]
[WHERE where_definition]
[ORDER BY ...]
[LIMIT #]
@end example @end example
@code{UPDATE} updates columns in existing table rows with new values. The @code{UPDATE} updates columns in existing table rows with new values.
@code{SET} clause indicates which columns to modify and the values they The @code{SET} clause indicates which columns to modify and the values
should be given. The @code{WHERE} clause, if given, specifies which rows they should be given. The @code{WHERE} clause, if given, specifies
should be updated. Otherwise all rows are updated. 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.
If you specify the keyword @code{LOW_PRIORITY}, execution of the If you specify the keyword @code{LOW_PRIORITY}, execution of the
@code{UPDATE} is delayed until no other clients are reading from the table. @code{UPDATE} is delayed until no other clients are reading from the table.
...@@ -20642,7 +20681,6 @@ file can be removed, or @code{IN USE} if the file is needed by the transaction ...@@ -20642,7 +20681,6 @@ file can be removed, or @code{IN USE} if the file is needed by the transaction
subsystem) subsystem)
@end itemize @end itemize
@cindex threads, display @cindex threads, display
@cindex processes, display @cindex processes, display
@findex threads @findex threads
...@@ -23123,7 +23161,7 @@ SELECT * FROM shop ...@@ -23123,7 +23161,7 @@ SELECT * FROM shop
* example-Maximum-row:: The row holding the maximum of a certain column * example-Maximum-row:: The row holding the maximum of a certain column
* example-Maximum-column-group:: Maximum of column per group * example-Maximum-column-group:: Maximum of column per group
* example-Maximum-column-group-row:: The rows holding the group-wise maximum of a certain field * example-Maximum-column-group-row:: The rows holding the group-wise maximum of a certain field
* example-user-variables:: * example-user-variables:: Using user variables
* example-Foreign keys:: Using foreign keys * example-Foreign keys:: Using foreign keys
@end menu @end menu
...@@ -24705,7 +24743,6 @@ each column reference is associated with. ...@@ -24705,7 +24743,6 @@ each column reference is associated with.
@node Getting information, Batch mode, Database use, Tutorial @node Getting information, Batch mode, Database use, Tutorial
@section Getting Information About Databases and Tables @section Getting Information About Databases and Tables
What if you forget the name of a database or table, or what the structure of What if you forget the name of a database or table, or what the structure of
a given table is (for example, what its columns are called)? @strong{MySQL} a given table is (for example, what its columns are called)? @strong{MySQL}
addresses this problem through several statements that provide information addresses this problem through several statements that provide information
...@@ -27204,7 +27241,7 @@ great tool to find out if this is a problem with your query. ...@@ -27204,7 +27241,7 @@ great tool to find out if this is a problem with your query.
* Estimating performance:: Estimating query performance * Estimating performance:: Estimating query performance
* SELECT speed:: Speed of @code{SELECT} queries * SELECT speed:: Speed of @code{SELECT} queries
* Where optimizations:: How MySQL optimizes @code{WHERE} clauses * Where optimizations:: How MySQL optimizes @code{WHERE} clauses
* DISTINCT optimization:: * DISTINCT optimization:: How MySQL Optimizes @code{DISTINCT}
* LEFT JOIN optimization:: How MySQL optimizes @code{LEFT JOIN} * LEFT JOIN optimization:: How MySQL optimizes @code{LEFT JOIN}
* LIMIT optimization:: How MySQL optimizes @code{LIMIT} * LIMIT optimization:: How MySQL optimizes @code{LIMIT}
* Insert speed:: Speed of @code{INSERT} queries * Insert speed:: Speed of @code{INSERT} queries
...@@ -28151,7 +28188,7 @@ How big a @code{VARCHAR} column can be ...@@ -28151,7 +28188,7 @@ How big a @code{VARCHAR} column can be
@menu @menu
* Programs:: What do the executables do? * Programs:: What do the executables do?
* safe_mysqld:: * safe_mysqld:: safe_mysqld, the wrapper around mysqld
* mysqld_multi:: Program for managing multiple @strong{MySQL} servers * mysqld_multi:: Program for managing multiple @strong{MySQL} servers
* mysql:: The command line tool * mysql:: The command line tool
* mysqladmin:: Administering a @strong{MySQL} server * mysqladmin:: Administering a @strong{MySQL} server
...@@ -32436,7 +32473,7 @@ sure that no other programs are using the dynamic libraries! ...@@ -32436,7 +32473,7 @@ sure that no other programs are using the dynamic libraries!
* Packet too large:: @code{Packet too large} error * Packet too large:: @code{Packet too large} error
* Communication errors:: Communication errors / Aborted connection * Communication errors:: Communication errors / Aborted connection
* Full table:: @code{The table is full} error * Full table:: @code{The table is full} error
* Cannot create:: * Cannot create:: @code{Can't create/write to file} Error
* Commands out of sync:: @code{Commands out of sync} error in client * Commands out of sync:: @code{Commands out of sync} error in client
* Ignoring user:: @code{Ignoring user} error * Ignoring user:: @code{Ignoring user} error
* Cannot find table:: @code{Table 'xxx' doesn't exist} error * Cannot find table:: @code{Table 'xxx' doesn't exist} error
...@@ -33536,7 +33573,7 @@ Drop or rename @code{old_table}. ...@@ -33536,7 +33573,7 @@ Drop or rename @code{old_table}.
* Log Replication:: Database replication with update log * Log Replication:: Database replication with update log
* Backup:: Database backups * Backup:: Database backups
* Update log:: The update log * Update log:: The update log
* Binary log:: * Binary log:: The binary log
* Slow query log:: Log of slow queries * Slow query log:: Log of slow queries
* Multiple servers:: Running multiple @strong{MySQL} servers on the same machine * Multiple servers:: Running multiple @strong{MySQL} servers on the same machine
@end menu @end menu
...@@ -37942,8 +37979,13 @@ Since Version 3.23.23, @strong{MySQL} has support for full-text indexing ...@@ -37942,8 +37979,13 @@ Since Version 3.23.23, @strong{MySQL} has support for full-text indexing
and searching. Full-text index in @strong{MySQL} is an and searching. Full-text index in @strong{MySQL} is an
index of type @code{FULLTEXT}. @code{FULLTEXT} indexes can be created from index of type @code{FULLTEXT}. @code{FULLTEXT} indexes can be created from
@code{VARCHAR} and @code{TEXT} columns at @code{CREATE TABLE} time or added @code{VARCHAR} and @code{TEXT} columns at @code{CREATE TABLE} time or added
later with @code{ALTER TABLE} or @code{CREATE INDEX}. Full-text search is later with @code{ALTER TABLE} or @code{CREATE INDEX}. For big datasets,
performed with the @code{MATCH} function: adding @code{FULLTEXT} index with @code{ALTER TABLE}
(or @code{CREATE INDEX}) would be much faster, than inserting rows into
the empty table with @code{FULLTEXT} index.
Full-text search is
performed with the @code{MATCH} function.
@example @example
mysql> CREATE TABLE t (a VARCHAR(200), b TEXT, FULLTEXT (a,b)); mysql> CREATE TABLE t (a VARCHAR(200), b TEXT, FULLTEXT (a,b));
...@@ -39765,6 +39807,7 @@ find on the ...@@ -39765,6 +39807,7 @@ find on the
this means that the version has not yet been released! this means that the version has not yet been released!
@menu @menu
* News-4.0.x:: Changes in release 4.0 (development version)
* News-3.23.x:: Changes in release 3.23.x (Recommended; Gamma) * News-3.23.x:: Changes in release 3.23.x (Recommended; Gamma)
* News-3.22.x:: Changes in release 3.22.x (Still supported) * News-3.22.x:: Changes in release 3.22.x (Still supported)
* News-3.21.x:: Changes in release 3.21.x * News-3.21.x:: Changes in release 3.21.x
...@@ -39772,7 +39815,26 @@ this means that the version has not yet been released! ...@@ -39772,7 +39815,26 @@ this means that the version has not yet been released!
* News-3.19.x:: Changes in release 3.19.x * News-3.19.x:: Changes in release 3.19.x
@end menu @end menu
@node News-3.23.x, News-3.22.x, News, News @node News-4.0.x, News-3.23.x, News, News
@appendixsec Changes in release 4.0 (Alpha)
We have now started to work on MySQL 4.0. We will update this section
as we add new features so that other can follow our development.
Our TODO section contains what we plan to have in 4.0. @xref{TODO MySQL 4.0}.
@menu
* News-4.0.0:: Changes in release 4.0
@end menu
@node News-4.0.0, , News-4.0.x, News-4.0.x
@appendixsubsec Changes in release 4.0
@itemize @bullet
@item
Added @code{ORDER BY} to @code{DELETE}.
@end itemize
@node News-3.23.x, News-3.22.x, News-4.0.x, News
@appendixsec Changes in release 3.23.x (Recommended; Gamma) @appendixsec Changes in release 3.23.x (Recommended; Gamma)
The 3.23 release has several major new features that are not The 3.23 release has several major new features that are not
...@@ -44547,6 +44609,9 @@ into Version 4.1. The @strong{MySQL} 4.0 version should only take us about ...@@ -44547,6 +44609,9 @@ into Version 4.1. The @strong{MySQL} 4.0 version should only take us about
a month to make after which we want to stabilize it and start working on a month to make after which we want to stabilize it and start working on
Version 4.1. Version 4.0 should have the following new features: Version 4.1. Version 4.0 should have the following new features:
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}.
@itemize @bullet @itemize @bullet
@item @item
New table definition file format (@code{.frm} files) This will enable us New table definition file format (@code{.frm} files) This will enable us
...@@ -44570,6 +44635,9 @@ The @code{mysqld} will support all standard @strong{MySQL} features and ...@@ -44570,6 +44635,9 @@ The @code{mysqld} will support all standard @strong{MySQL} features and
one can use it in a threaded client to run different queries in each one can use it in a threaded client to run different queries in each
thread. thread.
@item @item
@code{SHOW DATABASE} should only show the database which you have some kind
of access privilege to.
@item
Online backup with very low performance penalty. The online backup will Online backup with very low performance penalty. The online backup will
make it easy to add a new replication slave without taking down the make it easy to add a new replication slave without taking down the
master. master.
...@@ -44999,7 +45067,7 @@ will ensure that your thread installation has even a remote chance to work! ...@@ -44999,7 +45067,7 @@ will ensure that your thread installation has even a remote chance to work!
* Debugging server:: Debugging a @strong{MySQL} server * Debugging server:: Debugging a @strong{MySQL} server
* Debugging client:: Debugging a @strong{MySQL} client * Debugging client:: Debugging a @strong{MySQL} client
* The DBUG package:: The DBUG package * The DBUG package:: The DBUG package
* Locking methods:: * Locking methods:: Locking methods
* RTS-threads:: Comments about RTS threads * RTS-threads:: Comments about RTS threads
* Thread packages:: Differences between different thread packages * Thread packages:: Differences between different thread packages
@end menu @end menu
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
...@@ -187,9 +187,10 @@ I_List<i_string> replicate_do_db, replicate_ignore_db; ...@@ -187,9 +187,10 @@ I_List<i_string> replicate_do_db, replicate_ignore_db;
// allow the user to tell us which db to replicate and which to ignore // allow the user to tell us which db to replicate and which to ignore
I_List<i_string> binlog_do_db, binlog_ignore_db; I_List<i_string> binlog_do_db, binlog_ignore_db;
uint32 server_id = 0; // server id for replication /* if we guessed server_id , we need to know about it */
bool server_id_supplied = 0; // if we guessed server_id , we need to know uint32 server_id = 0;
// about it bool server_id_supplied = 0;
uint mysql_port; uint mysql_port;
uint test_flags, select_errors=0, dropping_tables=0,ha_open_options=0; uint test_flags, select_errors=0, dropping_tables=0,ha_open_options=0;
uint volatile thread_count=0, thread_running=0, kill_cached_threads=0, uint volatile thread_count=0, thread_running=0, kill_cached_threads=0,
......
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