mSQLThis section has been written by the MySQL developers, so it should be read with that in mind. But there are NO factual errors that we know of.
For a list of all supported limits, functions and types, see the
crash-me web page.
mSQL should be quicker at:
INSERT operations into very simple tables with few columns and keys.
CREATE TABLE and DROP TABLE.
SELECT on something that isn't an index. (A table scan is very
easy.)
mSQL (and
most other SQL implementions) on the following:
SELECT operations.
VARCHAR columns.
SELECT with many expressions.
SELECT on large tables.
mSQL, once one connection
is established, all others must wait until the first has finished, regardless
of whether the connection is running a query that is short or long. When the
first connection terminates, the next can be served, while all the others wait
again, etc.
mSQL can become pathologically slow if you change the order of tables
in a SELECT. In the benchmark suite, a time more than 15000 times
slower than MySQL was seen. This is due to mSQL's lack of a
join optimizer to order tables in the optimal order. However, if you put the
tables in exactly the right order in mSQL2 and the WHERE is
simple and uses index columns, the join will be relatively fast!
See section 10.8 Using your own benchmarks.
ORDER BY and GROUP BY.
DISTINCT.
TEXT or BLOB columns.
GROUP BY and HAVING.
mSQL does not support GROUP BY at all.
MySQL supports a full GROUP BY with both HAVING and
the following functions: COUNT(), AVG(), MIN(),
MAX(), SUM() and STD(). COUNT(*) is optimized to
return very quickly if the SELECT retrieves from one table, no other
columns are retrieved and there is no WHERE clause. MIN() and
MAX() may take string arguments.
INSERT and UPDATE with calculations.
MySQL can do calculations in an INSERT or UPDATE.
For example:
mysql> UPDATE SET x=x*10+y WHERE x<20;
SELECT with functions.
MySQL has many functions (too many to list here; see section 7.4 Functions for use in SELECT and WHERE clauses).
MEDIUMINT that is 3 bytes long. If you have 100,000,000 records,
saving even one byte per record is very important.
mSQL2 has a more limited set of column types, so it is
more difficult to get small tables.
mSQL stability, so we cannot say
anything about that.
mSQL, and is also less expensive than
mSQL. Whichever product you choose to use, remember to at least
consider paying for a license or email support. (You are required to get
a license if you include MySQL with a product that you sell,
of course.)
mSQL with
some added features.
mSQL has a JDBC driver, but we have too little experience
with it to compare.
GROUP BY and so
on are still not implemented in mSQL, it has a lot of catching up
to do. To get some perspective on this, you can view the mSQL
'HISTORY' file for the last year and compare it with the News
section of the MySQL Reference Manual (see section D MySQL change history). It should be
pretty obvious which one has developed most rapidly.
mSQL and MySQL have many interesting third-party
tools. Since it is very easy to port upward (from mSQL to
MySQL), almost all the interesting applications that are available for
mSQL are also available for MySQL.
MySQL comes with a simple msql2mysql program that fixes
differences in spelling between mSQL and MySQL for the
most-used C API functions.
For example, it changes instances of msqlConnect() to
mysql_connect(). Converting a client program from mSQL to
MySQL usually takes a couple of minutes.
mSQL tools for MySQL
According to our experience, it would just take a few hours to convert tools
such as msql-tcl and msqljava that use the
mSQL C API so that they work with the MySQL C API.
The conversion procedure is:
msql2mysql on the source. This requires the
replace program, which is distributed with MySQL.
Differences between the mSQL C API and the MySQL C API are:
MYSQL structure as a connection type (mSQL
uses an int).
mysql_connect() takes a pointer to a MYSQL structure as a
parameter. It is easy to define one globally or to use malloc() to get
one.
mysql_connect() also takes 2 parameters for specifying the user and
password. You may set these to NULL, NULL for default use.
mysql_error() takes the MYSQL structure as a parameter. Just add
the parameter to your old msql_error() code if you are porting old code.
mSQL returns only a text error message.
mSQL and MySQL client/server communications protocols differThere 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 mSQL protocol are listed below:
mSQL 2.0 SQL syntax differs from MySQLColumn types
MySQL
CREATE TABLE syntax):
ENUM type for one of a set of strings.
SET type for many of a set of strings.
BIGINT type for 64-bit integers.
UNSIGNED option for integer columns.
ZEROFILL option for integer columns.
AUTO_INCREMENT option for integer columns that are a
PRIMARY KEY.
See section 20.4.29 mysql_insert_id().
DEFAULT value for all columns.
mSQL2
mSQL column types correspond to the MySQL types shown below:
mSQL type | Corresponding MySQL type |
CHAR(len) | CHAR(len)
|
TEXT(len) | TEXT(len). len is the maximal length.
And LIKE works.
|
INT | INT. With many more options!
|
REAL | REAL. Or FLOAT. Both 4- and 8-byte versions are available.
|
UINT | INT UNSIGNED
|
DATE | DATE. Uses ANSI SQL format rather than mSQL's own.
|
TIME | TIME
|
MONEY | DECIMAL(12,2). A fixed-point value with two decimals.
|
Index creation
MySQL
CREATE TABLE
statement.
mSQL
CREATE INDEX statements.
To insert a unique identifier into a table
MySQL
AUTO_INCREMENT as a column type
specifier.
See section 20.4.29 mysql_insert_id().
mSQL
SEQUENCE on a table and select the _seq column.
To obtain a unique identifier for a row
MySQL
PRIMARY KEY or UNIQUE key to the table.
mSQL
_rowid column. Observe that _rowid may change over time
depending on many factors.
To get the time a column was last modified
MySQL
TIMESTAMP column to the table. This column is automatically set
to the current date and time for INSERT or UPDATE statements if
you don't give the column a value or if you give it a NULL value.
mSQL
_timestamp column.
NULL value comparisons
MySQL
NULL is always NULL.
mSQL
mSQL, NULL = NULL is TRUE. You
must change =NULL to IS NULL and <>NULL to
IS NOT NULL when porting old code from mSQL to MySQL.
String comparisons
MySQL
BINARY attribute, which causes comparisons to be done according to the
ASCII order used on the MySQL server host.
mSQL
Case-insensitive searching
MySQL
LIKE is a case-insensitive or case-sensitive operator, depending on
the columns involved. If possible, MySQL uses indexes if the
LIKE argument doesn't start with a wildcard character.
mSQL
CLIKE.
Handling of trailing spaces
MySQL
CHAR and VARCHAR
columns. Use a TEXT column if this behavior is not desired.
mSQL
WHERE clauses
MySQL
AND is evaluated
before OR). To get mSQL behavior in MySQL, use
parentheses (as shown below).
mSQL
mSQL query:
mysql> SELECT * FROM table WHERE a=1 AND b=2 OR a=3 AND b=4;To make MySQL evaluate this the way that
mSQL would,
you must add parentheses:
mysql> SELECT * FROM table WHERE (a=1 AND (b=2 OR (a=3 AND (b=4))));
Access control
MySQL
mSQL
PostgreSQL has some more advanced features like user-defined
types, triggers, rules and some transaction support. However, PostgreSQL lacks
many of the standard types and functions from ANSI SQL and ODBC. See the
crash-me web page
for a complete list of limits and which types and functions are supported
or unsupported.
Normally, PostgreSQL is a magnitude slower than
MySQL. See section 10.8 Using your own benchmarks. This is due largely to their
transactions system. If you really need transactions or the rich type
system PostgreSQL offers and you can afford the speed penalty, you
should take a look at PostgreSQL.
PHP and MySQLSend any additions to this list to webmaster@mysql.com.
Many users of MySQL have contributed very useful support tools and addons.
A list of what is available at http://www.mysql.com/Contrib
(or any mirror) is shown below.
If you want to build MySQL support for the Perl DBI/DBD
interface, you should fetch the Data-Dumper, DBI, and
Msql-Mysql-modules files and install them.
See section 4.10 Perl installation comments.
00-README This listing.
Data-Dumper module. Useful with DBI/DBD support.
DBI module.
DBD module to access mSQL and MySQL databases..
Data-ShowTable module. Useful with DBI/DBD support.
libmysql.dll, by Blestan Tabakov,
libmysql.dll, by bsilva@umesd.k12.or.us
guile that allows guile to interact with SQL
databases. By Hal Roberts.
user, db and
host tables. By Tim Sailer, modified by Atif Ghaffar
DBI 1.06.
BLOB/TEXT columns by Daniel Koch.
mod_auth_mysql. This is a little tool that allows you
to add/change user records storing group and/or password entries in
MySQL tables. By Harry Brueckner, brueckner@respublica.de.
mod_auth_mysql. This is a two-part system for use with
mod_auth_mysql.
pam, using MySQL.
mysqldump output to a C header file. By Harry Brueckner,
access_to_mysql.txt, except that this
one is fully configurable, has better type conversion (including
detection of TIMESTAMP fields), provides warnings and suggestions
while converting, quotes all special characters in text and
binary data, and so on. It will also convert to mSQL v1 and v2,
and is free of charge for anyone. See
http://www.cynergi.net/prod/exportsql/ for latest version. By
Pedro Freire, support@cynergi.net. Note: Doesn't work with
Access2!
exportsql. By Brian Andrews.
Note: Doesn't work with Access2!
exportsql.txt. That is,
it imports data from MySQL into an Access database via
ODBC. This is very handy when combined with exportSQL, since it lets you
use Access for all DB design and administration, and synchronize with
your actual MySQL server either way. Free of charge. See
http://www.netdive.com/freebies/importsql/ for any updates.
Created by Laurent Bossavit of NetDIVE.
Note: Doesn't work with Access2!
mSQL to MySQL. By alfred@sb.net
mysqldump and pipe it to
the sqlconv.pl script and the script will parse through the
mysqldump output and will rearrange the fields so they can be
inserted into a new table. An example is when you want to create a new
table for a different site you are working on, but the table is just a
bit different (ie - fields in different order, etc.).
By Steve Shreeve.
radiusd to make it support MySQL. By Wim Bonis,
hylafax outgoing faxes in a MySQL database. By Sinisa
Milivojevic, sinisa@coresinc.com.
Contributors to the MySQL distribution are listed below, in somewhat random order:
mysqld.
mysys library.
ISAM and MyISAM libraries (B-tree index file
handlers with index compression and different record formats).
heap library. A memory table system with our superior full dynamic
hashing. In use since 1981 and published around 1984.
replace program (look into it, it's COOL!).
mSQL tools like msqlperl, DBD/DBI and
DB2mysql.
texi2html. Also automatic website updating from
this manual.
libtool support.
mysys are left.
mysqlshutdown.exe and
mysqlwatch.exe
mSQL, but found that it couldn't satisfy our purposes so instead we
wrote a SQL interface to our application builder Unireg. mysqladmin
and mysql are programs that were largely influenced by their
mSQL counterparts. We have put a lot of effort into making the
MySQL syntax a superset of mSQL. Many of the APIs ideas are
borrowed from mSQL to make it easy to port free mSQL programs
to MySQL. MySQL doesn't contain any code from mSQL.
Two files in the distribution ('client/insert_test.c' and
'client/select_test.c') are based on the corresponding (non-copyrighted)
files in the mSQL distribution, but are modified as examples showing
the changes necessary to convert code from mSQL to MySQL.
(mSQL is copyrighted David J. Hughes.)
WHERE column REGEXP regexp.
gcc), the libc library
(from which we have borrowed 'strto.c' to get some code working in Linux)
and the readline library (for the mysql client).
mysqldump (previously msqldump, but ported and enhanced by
Monty).
DBD (Perl) interface.
_MB character set macros and the ujis and sjis character sets.
mysqlaccess, a program to show the access rights for a user.
xmysql, a graphical X client for MySQL.
DBD::mysql module.
FROM_UNIXTIME() time formatting, ENCRYPT() functions, and
bison adviser.
Active mailing list member.
DBI/DBD. Have
been of great help with crash-me and running benchmarks. Some new
date functions. The mysql_setpermissions script.
DBI/DBD section in the manual.
CREATE FUNCTION and
DROP FUNCTION.
AGGREGATE extension to UDF functions.
zlib) to the client/server protocol.
Perfect hashing for the lexical analyzer phase.
Other contributors, bugfinders and testers: James H. Thompson, Maurizio Menghini, Wojciech Tryc, Luca Berra, Zarko Mocnik, Wim Bonis, Elmar Haneke, jehamby@lightside, psmith@BayNetworks.COM, Mike Simons, Jaakko Hyv@"atti.
And lots of bug report/patches from the folks on the mailing list.
And a big tribute to those that help us answer questions on the
mysql@lists.mysql.com mailing list:
DBD-mysql questions.
xmysql-releated questions and basic installation questions.
mysqlbug.
DBD, Linux, some SQL syntax questions.
Note that we tend to update the manual at the same time we implement new things to MySQL. If you find a version listed below that you can't find on the MySQL download page, this means that the version has not yet been released!
The major difference between release 3.23 and releases 3.22 and 3.21 is that 3.23 contains a new ISAM library (MyISAM), which is more tuned for SQL than the old ISAM was.
The 3.23 release is under development, and things will be added at a fast pace to it. For the moment we recommend this version only for users that desperately need a new feature that is found only in this release (like big file support and machine-independent tables). (Note that all new functionality in MySQL 3.23 is extensively tested, but as this release involves much new code, it's difficult to test everything). This version should start to stabilize as soon as we get subselects included in it.
NISAM.
ISAM when doing some ORDER BY .. DESC queries.
--delay-key-write didn't enable delayed key writing.
TEXT column which only involved case changes.
INSERT DELAYED doesn't update timestamps that are given.
YEARWEEK() and options x, X, v and
V to DATE_FORMAT().
MAX(indexed_column) and HEAP tables.
BLOB NULL keys and LIKE "prefix%".
MyISAM and fixed length rows < 5 bytes.
GROUP BY queries.
ENUM field value
was too big.
pthread_mutex_timedwait,
which is used with INSERT DELAYED. See section 4.11.5 Linux notes (all Linux versions).
MyISAM with keys > 250 characters.
MyISAM one can now do an INSERT at the same time as other
threads are reading from the table.
max_write_lock_count to mysqld to force a
READ lock after a certain number of WRITE locks.
delayed_key_write on show variables.
concurrency to thread_concurrency.
LOCATE(substr,str), POSITION(substr IN str),
LOCATE(substr,str,pos), INSTR(str,substr),
LEFT(str,len), RIGHT(str,len),
SUBSTRING(str,pos,len), SUBSTRING(str FROM pos FOR len),
MID(str,pos,len), SUBSTRING(str,pos), SUBSTRING(str
FROM pos), SUBSTRING_INDEX(str,delim,count), RTRIM(str),
TRIM([[BOTH | TRAILING] [remstr] FROM] str),
REPLACE(str,from_str,to_str), REVERSE(str),
INSERT(str,pos,len,newstr), LCASE(str), LOWER(str),
UCASE(str) and UPPER(str); Patch by Wei He.
FULL to SHOW PROCESSLIST.
--verbose to mysqladmin.
REPLACE() and LOAD DATA INFILE.
mysqld variable interactive_timeout.
mysql_data_seek() from ulong to
ulonglong.
mysqld option -O lower_case_table_names={0|1} to allow
users to force table names to lower case.
SELECT ... INTO DUMPFILE.
--ansi to make some functions ANSI SQL
compatible.
#sql.
' (" in --ansi mode).
[floor() overflow safe on FREEBSD.
--quote-names to mysqldump
PRIMARY KEY NOT NULL.
encrypt() to be thread safe and not reuse buffer.
mysql_odbc_escape_string() function to support big5 characters in
MyOBC.
FLOAT and DOUBLE (without any length modifiers) are
not anymore fixed decimal point numbers.
FLOAT(X): Now this is the same as FLOAT if
X <= 24 and a DOUBLE if 24 < X <= 53.
DECIMAL(X) is now an alias for DECIMAL(X,0) and DECIMAL
is now an alias for DECIMAL(10,0). The same goes for NUMERIC.
ROW_FORMAT={default | dynamic | static | compressed} to
CREATE_TABLE.
DELETE FROM table_name didn't work on temporary tables.
CHAR_LENGTH() to be multi-byte character safe.
ORD(string).
SELECT DISTINCT ... ORDER BY RAND().
ALTER TABLE + adding a column after the last field didn't work.
CREATE TABLE foo (a int not null auto_increment, b char(5), primary key (b,a))
NULL.
AS on fieldname with CREATE TABLE table_name SELECT ... didn't
work.
NATIONAL and NCHAR when defining character columns.
This is the same as not using BINARY.
NULL columns in a PRIMARY KEY (only in UNIQUE
keys).
LAST_INSERT_ID if in uses this in ODBC:
WHERE auto_increment_column IS NULL. This seams to fix some problems
with Access.
SET SQL_AUTO_IS_NULL=0|1 now turns off/on the handling of
searching after the last inserted row with WHERE
auto_increment_column IS NULL.
mysqld variable concurrency for Solaris.
--relative to mysqladmin to make
extended-status more useful to monitor changes.
COUNT(DISTINCT..) on an empty table.
LOAD DATA INFILE and BLOB columns.
~ (negation).
UDF functions.
DATETIME into a TIME column will not anymore
try to store 'days' in it.
SUM().)
LIKE "%" on a index that may have NULL values.
REVOKE ALL PRIVILEGES didn't revoke all privileges.
SHOW GRANTS FOR user (by Sinisa).
date_add syntax: date/datetime + INTERVAL # interval_type.
By Joshua Chamas.
LOAD DATA REPLACE.
REGEXP is now case insensitive if you use not binary strings.
ASC is now the default again for ORDER BY.
LIMIT to UPDATE.
mysql_change_user().
SHOW VARIABLES.
--[whitespace] comments.
INSERT into tbl_name VALUES (), that is, you may now specify
an empty value list to insert a row in which each column is set to its
default value.
SUBSTRING(text FROM pos) to conform to ANSI SQL. (Before this
construct returned the rightmost 'pos' characters).
SUM(..) with GROUP BY returned 0 on some systems.
SHOW TABLE STATUS.
DELAY_KEY_WRITE option to CREATE TABLE.
AUTO_INCREMENT on any key part.
YEAR(NOW()) and YEAR(CURDATE()).
CASE construct.
COALESCE().
SELECT * FROM table_name WHERE
key_part1 >= const AND (key_part2 = const OR key_part2 = const). The
bug was that some rows could be duplicated in the result.
myisamchk without -a updated the index
distribution wrong.
SET SQL_LOW_PRIORITY_UPDATES=1 gave parse error before.
WHERE clause.
UPDATE tbl_name SET KEY=KEY+1 WHERE KEY > 100
SELECT ... WHERE key_part1=const1 AND
key_part_2=const2 AND key_part1=const4 AND key_part2=const4 ; Indextype
should be range instead of ref.
egcs 1.1.2 optimizer bug (when using BLOBs) on Linux Alpha.
LOCK TABLES combined with DELETE FROM table.
NULL and BLOB/TEXT columns.
SELECT ... FROM t1 LEFT JOIN t2 ON ... WHERE t2.not_null_column IS NULL.
ORDER BY and GROUP BY can be done on functions.
ORDER BY RAND().
WHERE key_column = function.
WHERE key_column = column_name even if
the columns are not identically packed.
WHERE column_name IS NULL.
--init-file=file_name to mysqld.
COUNT(DISTINCT value,[value,...])
CREATE TEMPORARY TABLE now creates a temporary table, in its own
namespace, that is automatically deleted if connection is dropped.
CASE): CASE, THEN, WHEN, ELSE and END.
EXPORT_SET() and MD5().
MyISAM) with a lot of new features.
See section 9.4 MySQL table types.
HEAP tables which are extremely fast for
lookups.
LOAD_FILE(filename) to get the contents of a file as a
string value.
<=> which will act as = but will return TRUE
if both arguments are NULL. This is useful for comparing changes
between tables.
EXTRACT(interval FROM datetime) function.
FLOAT(X) is not rounded on storage and may be
in scientific notation (1.0 E+10) when retrieved.
REPLACE is now faster than before.
LIKE character comparison to behave as =;
This means that 'e' LIKE "e' is now true.
SHOW TABLE STATUS returns a lot of information about the tables.
LIKE to the SHOW STATUS command.
SHOW COLUMNS.
packed and comment to SHOW INDEX.
CREATE TABLE ... COMMENT "xxx").
UNIQUE, as in
CREATE TABLE table_name (col int not null UNIQUE)
CREATE TABLE table_name SELECT ....
CREATE TABLE IF NOT EXISTS ...
CHAR(0) columns.
DATE_FORMAT() now requires '%' before any format character.
DELAYED is now a reserved word (sorry about that :( ).
analyse, file: 'sql_analyse.c'.
This will describe the data in your query. Try the following:
SELECT ... FROM ... WHERE ... PROCEDURE ANALYSE([max elements,[max memory]])This procedure is extremely useful when you want to check the data in your table!
BINARY cast to force a string to be compared case sensitively.
--skip-show-database to mysqld.
UPDATE now also works with
BLOB/TEXT columns.
INNER join syntax. NOTE: This made INNER
an reserved word!
IP/NETMASK syntax.
NOT NULL DATE/DATETIME column with IS
NULL, this is changed to a compare against 0 to satisfy some ODBC
applications. (By shreeve@uci.edu).
NULL IN (...) now returns NULL instead of 0. This will
ensure that null_column NOT IN (...) doesn't match
NULL values.
TIME columns.
TIME strings to be more strict. Now the
fractional second part is detected (and currently skipped). The
following formats are supported:
[[DAYS] [H]H:]MM:]SS[.fraction]
[[[[[H]H]H]H]MM]SS[.fraction]
DATETIME.
LOW_PRIORITY attribute to LOAD DATA INFILE.
LOAD DATA INFILE.
DECIMAL(x,y) now works according to ANSI SQL.
LAST_INSERT_ID() is now updated for INSERT INTO ... SELECT.
SELECT DISTINCT is much faster; It uses the new UNIQUE
functionality in MyISAM. One difference compared to MySQL 3.22
is that the output of DISTINCT is not sorted anymore.
mysql_num_fields() on
a MYSQL object, you must use mysql_field_count() instead.
LIBEWRAP; Patch by Henning P . Schmiedehausen.
AUTO_INCREMENT for other than numerical columns.
AUTO_INCREMENT will now automatically make the column
NOT NULL.
NULL as the default value for AUTO_INCREMENT columns.
SQL_BIG_RESULT; SQL_SMALL_RESULT is now default.
--enable-large-files/--disable-large-files switch to
configure. See 'configure.in' for some systems where this is
automatically turned off because of broken implementations.
readline to 4.0.
CREATE TABLE options: PACK_KEYS and CHECKSUM.
mysqld option --default-table-type.
The 3.22 version has faster and safer connect code and a lot of new nice enhancements. The reason for not including these changes in the 3.21 version is mainly that we are trying to avoid big changes to 3.21 to keep it as stable as possible. As there aren't really any MAJOR changes, upgrading to 3.22 should be very easy and painless. See section 4.16.2 Upgrading from a 3.21 version to 3.22.
3.22 should also be used with the new DBD-mysql (1.20xx) driver
that can use the new connect protocol!
GROUP BY queries.
ENUM field value
was too big.
mysqlshutdown.exe and mysqlwatch.exe to the Windows
distribution.
ORDER BY on a reference key.
INSERT DELAYED doesn't update timestamps that are given.
LEFT JOIN and COUNT() on a column which
was declared NULL + and it had a DEFAULT value.
CONCAT() in a WHERE clause.
AVG() and STD() with NULL values.
ROUND() will now work on Win32.
BLOB/TEXT column to REVERSE().
/*! */ with version numbers.
SUBSTRING(text FROM pos) to conform to ANSI SQL. (Before this
construct returned the rightmost 'pos' characters).
LOCK TABLES combined with DELETE FROM table
SET SQL_LOW_PRIORITY_UPDATES=# didn't work.
GRANT ... IDENTIFIED BY
SELECT * FROM table_name WHERE key_part1 >= const AND (key_part2 = const OR key_part2 = const)
DATA is not a reserved word anymore.
LOCK TABLES table_name READ; FLUSH TABLES;
isamchk should now work on Win32.
libtool 1.3.2.
configure.
--defaults-file=### to option file handling to force use
of only one specific option file.
CREATE syntax to ignore MySQL 3.23 keywords.
INSERT DELAYED on a table locked with
LOCK TABLES.
DROP TABLE on a table that was
locked by another thread.
GRANT/REVOKE commands in the update log.
isamchk to detect a new error condition.
NATURAL LEFT JOIN.
mysql_close() directly after
mysql_init().
delayed_insert_thread counting when you couldn't create a new
delayed_insert thread.
CONCAT() with many arguments.
DELETE FROM TABLE when table was locked by
another thread.
LEFT JOIN involving empty tables.
mysql.db column from char(32) to char(60).
MODIFY and DELAYED are not reserved words anymore.
TIME column.
Host '..' is not allowed to connect to this MySQL
server after one had inserted a new MySQL user with a GRANT
command.
TCP_NODELAY also on Linux (Should give faster TCP/IP
connections).
STD() for big tables when result should be 0.
INSERT DELAYED had some garbage at end in the update log.
mysql_install_db (from 3.22.17).
BLOB
columns.
shutdown
all threads didn't die properly.
-O flush-time=# to mysqld. This is mostly
useful on Win32 and tells how often MySQL should close all
unused tables and flush all updated tables to disk.
VARCHAR column compared with CHAR column
didn't use keys efficiently.
--log-update and connecting
without a default database.
configure and portability problems.
LEFT JOIN on tables that had circular dependencies caused
mysqld to hang forever.
mysqladmin processlist could kill the server if a new user logged in.
DELETE FROM tbl_name WHERE key_column=col_name didn't find any matching
rows. Fixed.
DATE_ADD(column,...) didn't work.
INSERT DELAYED could deadlock with status 'upgrading lock'
ENCRYPT() to take longer salt strings than 2 characters.
longlong2str is now much faster than before. For Intel x86
platforms, this function is written in optimized assembler.
MODIFY keyword to ALTER TABLE.
GRANT used with IDENTIFIED BY didn't take effect until privileges
were flushed.
SHOW STATUS.
ORDER BY with 'only index' optimzation when there
were multiple key definitions for a used column.
DATE and DATETIME columns are now up to 5 times faster than
before.
INSERT DELAYED can be used to let the client do other things while the
server inserts rows into a table.
LEFT JOIN USING (col1,col2) didn't work if one used it with tables
from 2 different databases.
LOAD DATA LOCAL INFILE didn't work in the Unix version because of
a missing file.
VARCHAR/BLOB on very short rows (< 4 bytes);
error 127 could occur when deleting rows.
BLOB/TEXT through formulas didn't work for short (< 256 char)
strings.
GRANT on a new host, mysqld could die on the first
connect from this host.
ORDER BY on column name that was the same
name as an alias.
BENCHMARK(loop_count,expression) function to time expressions.
mysqld to make it easier to start from shell
scripts.
TIMESTAMP column to NULL didn't record the timestamp
value in the update log.
INSERT INTO TABLE ... SELECT ... GROUP BY.
localtime_r() on Win32 so that it will not crash
anymore if your date is > 2039, but instead will return a time of all zero.
^Z (ASCII 26) to \Z as ^Z doesn't
work with pipes on Win32.
mysql_fix_privileges adds a new column to the mysql.func to
support aggregate UDF functions in future MySQL releases.
NOW(), CURDATE() or CURTIME() directly in a
column didn't work.
SELECT COUNT(*) ... LEFT JOIN ... didn't work with no WHERE part.
pthread_cond() on the Win32 version.
get_lock() now correctly times out on Win32!
DATE_ADD() and DATE_SUB() in a
WHERE clause.
GRANT ... TO user
IDENTIFIED BY 'password' syntax.
GRANT checking with SELECT on many tables.
mysql_fix_privilege_tables to the RPM
distribution. This is not run by default since it relies on the client
package.
SQL_SMALL_RESULT to SELECT to force use of
fast temporary tables when you know that the result set will be small.
DATE_ADD/DATE_SUB() doesn't have enough days.
GRANT compares columns in case-insensitive fashion.
ALTER TABLE dump core in
some contexts.
user@hostname can now include '.' and '-'
without quotes in the context of the GRANT, REVOKE and
SET PASSWORD FOR ... statements.
isamchk for tables which need big temporary files.
mysql_fix_privilege_tables script
when you upgrade to this version! This is needed because of the new
GRANT system. If you don't do this, you will get Access
denied when you try to use ALTER TABLE, CREATE INDEX or
DROP INDEX.
GRANT to allow/deny users table and column access.
USER() to return user@host
PASSWORD for another user.
FLUSH STATUS that sets most status variables to zero.
aborted_threads, aborted_connects.
connection_timeout.
SET SQL_WARNINGS=1 to get a warning count also for simple
inserts.
SIGTERM instead of SIGQUIT with
shutdown to work better on FreeBSD.
\G (print vertically) to mysql.
SELECT HIGH_PRIORITY ... killed mysqld.
IS NULL on a AUTO_INCREMENT column in a LEFT JOIN didn't
work as expected.
MAKE_SET().
mysql_install_db no longer starts the MySQL server! You
should start mysqld with safe_mysqld after installing it! The
MySQL RPM will however start the server as before.
--bootstrap option to mysqld and recoded
mysql_install_db to use it. This will make it easier to install
MySQL with RPMs.
+, - (sign and minus), *, /, %,
ABS() and MOD() to be BIGINT aware (64-bit safe).
ALTER TABLE that caused mysqld to crash.
INSERT).
INSERT INTO tbl_name SET col_name=value,col_name=value,...
MYSQL_INIT_COMMAND to mysql_options() to make
a query on connect or reconnect.
MYSQL_READ_DEFAULT_FILE and
MYSQL_READ_DEFAULT_GROUP to mysql_options() to read the
following parameters from the MySQL option files: port,
socket, compress, password, pipe, timeout,
user, init-command, host and database.
maybe_null to the UDF structure.
IGNORE to INSERT statemants with many rows.
isamchk -rq on each table that has an index on
a CHAR or VARCHAR column.
mysql_setpermission, by Luuk de Boer, allows one
to easily create new users with permissions for specific databases.
LOAD DATA INFILE).
SHOW STATUS and changed format of output to
be like SHOW VARIABLES.
extended-status command to mysqladmin which will show the
new status variables.
SET SQL_LOG_UPDATE=0 caused a lockup of the server.
FLUSH [ TABLES | HOSTS | LOGS | PRIVILEGES ] [, ...]
KILL thread_id.
ALTER TABLE from a INT
to a short CHAR() column.
SELECT HIGH_PRIORITY; This will get a lock for the
SELECT even if there is a thread waiting for another
SELECT to get a WRITE LOCK.
LIKE on
BLOB/TEXT columns with \0.
ESCAPE option to LIKE.
mysqladmin debug.
mysqld on Win32 with the --flush option.
This will flush all tables to disk after each update. This makes things
much safer on NT/Win98 but also MUCH slower.
my_strcoll()! The patch should always be safe to install (for any system),
but as this patch changes ISAM internals it's not yet in the default
distribution.
DATE_ADD() and DATE_SUB() didn't work with group functions.
mysql will now also try to reconnect on USE DATABASE commands.
ORDER BY and LEFT JOIN and const tables.
ORDER BY if the first ORDER BY column
was a key and the rest of the ORDER BY columns wasn't part of the key.
OPTIMIZE TABLE.
DROP TABLE and mysqladmin shutdown on Win32
(a fatal bug from 3.22.6).
TIME columns and negative strings.
LIMIT clause for the DELETE statement.
/*! ... */ syntax to hide MySQL-specific
keywords when you write portable code. MySQL will parse the code
inside the comments as if the surrounding /*! and */ comment
characters didn't exist.
OPTIMIZE TABLE tbl_name can now be used to reclaim disk space
after many deletes. Currently, this uses ALTER TABLE to
re-generate the table, but in the future it will use an integrated
isamchk for more speed.
libtool to get the configure more portable.
UPDATE and DELETE operations when using
DATETIME or DATE keys.
mysqladmin proc to display information about your own
threads. Only users with the Process_priv privilege can get
information about all threads.
YYMMDD, YYYYMMDD,
YYMMDDHHMMSS for numbers when using DATETIME and
TIMESTAMP types. (Formerly these formats only worked with strings.)
CLIENT_IGNORE_SPACE to allow use of spaces
after function names and before '(' (Powerbuilder requires this).
This will make all function names reserved words.
--log-long-format option to mysqld to enable timestamps
and INSERT_ID's in the update log.
--where option to mysqldump (patch by Jim Faucette).
mysqldump.
LOAD DATA INFILE statement, you can now use the new LOCAL
keyword to read the file from the client. mysqlimport will
automatically use LOCAL when importing with the TCP/IP protocol.
DROP TABLE, ALTER TABLE, DELETE FROM
TABLE and mysqladmin flush-tables under heavy usage.
Changed locking code to get better handling of locks of different types.
DBI to 1.00 and DBD to 1.2.0.
mysqld. (To avoid errors if you accidentally
try to use an old error message file.)
affected_rows(),
insert_id(),...) are now of type BIGINT to allow 64-bit values
to be used.
This required a minor change in the MySQL protocol which should affect
only old clients when using tables with AUTO_INCREMENT values > 24M.
mysql_fetch_lengths() has changed from uint *
to ulong *. This may give a warning for old clients but should work
on most machines.
mysys and dbug libraries to allocate all thread variables
in one struct. This makes it easier to make a threaded 'libmysql.dll'
library.
gethostname() (instead of uname()) when
constructing '.pid' file names.
COUNT(), STD() and AVG() are extended to handle more than
4G rows.
-838:59:59 <= x <=
838:59:59 in a TIME column.
TIME column to too short a value, MySQL now
assumes the value is given as: [[[D ]HH:]MM:]SS instead of
HH[:MM[:SS]].
TIME_TO_SEC() and SEC_TO_TIME() can now handle negative times
and hours up to 32767.
SET OPTION SQL_LOG_UPDATE={0|1} to allow users with
the process privilege to bypass the update log.
(Modified patch from Sergey A Mukhin violet@rosnet.net.)
LPAD().
BLOB reading from
pipes safer.
-O max_connect_errors=# option to mysqld.
Connect errors are now reset for each correct connection.
max_allowed_packet to 1M in
mysqld.
--low-priority-updates option to mysqld, to give
table-modifying operations (INSERT, REPLACE, UPDATE,
DELETE) lower priority than retrievals. You can now use
{INSERT | REPLACE | UPDATE | DELETE} LOW_PRIORITY ... You can
also use SET OPTION SQL_LOW_PRIORITY_UPDATES={0|1} to change
the priority for one thread. One side effect is that LOW_PRIORITY
is now a reserved word. :(
INSERT INTO table ... VALUES(...),(...),(...),
to allow inserting multiple rows with a single statement.
INSERT INTO tbl_name is now also cached when used with LOCK TABLES.
(Previously only INSERT ... SELECT and LOAD DATA INFILE were
cached.)
GROUP BY functions with HAVING:
mysql> SELECT col FROM table GROUP BY col HAVING COUNT(*)>0;
mysqld will now ignore trailing ';' characters in queries. This
is to make it easier to migrate from some other SQL servers that require the
trailing ';'.
SELECT INTO OUTFILE.
GREATEST() and LEAST() functions. You must now use
these instead of the MAX() and MIN() functions to get the
largest/smallest value from a list of values. These can now handle REAL,
BIGINT and string (CHAR or VARCHAR) values.
DAYOFWEEK() had offset 0 for Sunday. Changed the offset to 1.
GROUP BY columns and fields when
there is no GROUP BY specification.
--vertical option to mysql, for printing results in
vertical mode.
--tmpdir option to mysqld, for specifying the location
of the temporary file directory.
SELECT ... FROM table WHERE auto_increment_column IS NULLto:
SELECT ... FROM table WHERE auto_increment_column == LAST_INSERT_ID()This allows some ODBC programs (Delphi, Access) to retrieve the newly inserted row to fetch the
AUTO_INCREMENT id.
DROP TABLE now waits for all users to free a table before deleting it.
BIN(), OCT(), HEX() and CONV() for
converting between different number bases.
SUBSTRING() with 2 arguments.
ORDER BY and
GROUP BY.
mysqld now automatically disables system locking on Linux and Win32,
and for systems that use MIT-pthreads. You can force the use of locking
with the --enable-locking option.
--console option to mysqld, to force a console window
(for error messages) when using Win32.
DATE_ADD() and DATE_SUB() functions.
mysql_ping() to the client library.
--compress option to all MySQL clients.
byte to char in 'mysql.h' and 'mysql_com.h'.
<<, >>, RPAD() and LPAD().
ORDER BY to work when no records are found
when using fields that are not in GROUP BY (MySQL extension).
--chroot option to mysqld, to start mysqld in
a chroot environment (by Nikki Chumakov nikkic@cityline.ru).
--one-thread option to mysqld, for debugging with
LinuxThreads (or glibc). (This replaces the -T32 flag)
DROP TABLE IF EXISTS to prevent an error from occurring if the
table doesn't exist.
IF and EXISTS are now reserved words (they would have to
be sooner or later).
mysqldump.
mysql_ping().
mysql_init() and mysql_options().
You now MUST call mysql_init() before you call
mysql_real_connect().
You don't have to call mysql_init() if you only use
mysql_connect().
mysql_options(...,MYSQL_OPT_CONNECT_TIMEOUT,...) so you can set a
timeout for connecting to a server.
--timeout option to mysqladmin, as a test of
mysql_options().
AFTER column and FIRST options to
ALTER TABLE ... ADD columns.
This makes it possible to add a new column at some specific location
within a row in an existing table.
WEEK() now takes an optional argument to allow handling of weeks when
the week starts on Monday (some European countries). By default,
WEEK() assumes the week starts on Sunday.
TIME columns weren't stored properly (bug in MySQL 3.22.0).
UPDATE now returns information about how many rows were
matched and updated, and how many "warnings" occurred when doing the update.
FORMAT(-100,2).
ENUM and SET columns were compared in binary (case-sensitive)
fashion; changed to be case insensitive.
mysql_real_connect() call is changed to:
mysql_real_connect(MYSQL *mysql, const char *host,
const char *user,
const char *passwd,
const char *db, uint port,
const char *unix_socket,
uint client_flag)
accept() thread. This fixes permanently the telnet bug
that was a topic on the mail list some time ago.
mysqld now has a local hostname
resolver cache so connections should actually be faster than before,
even with this feature.
tbl_name@db_name or db_name.tbl_name. This makes it possible to
give a user read access to some tables and write access to others simply by
keeping them in different databases!
--user option to mysqld, to allow it to run
as another Unix user (if it is started as the Unix root user).
mysqladmin password 'new_password'. This uses encrypted passwords
that are not logged in the normal MySQL log!