1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-09 22:24:09 +03:00
This commit is contained in:
serg@serg.mysql.com
2000-12-30 16:02:38 +01:00
308 changed files with 10726 additions and 1841 deletions

View File

@@ -181,3 +181,7 @@ mysql-test/mysql-test-run
BitKeeper/tmp/gone
mysqld.S
mysqld.sym
.snprj/*
sql-bench/output/*
sql-bench/Results-linux/ATIS-mysql_bdb-Linux_2.2.14_my_SMP_i686
Docs/my_sys.doc

View File

@@ -7,4 +7,10 @@ extra_flags="$pentium_cflags $fast_cflags"
extra_configs="$pentium_configs"
strip=yes
# Use the optimized version if it exists
if test -d /usr/local/BerkeleyDB-opt/
then
extra_configs="$extra_configs --with-berkeley-db=/usr/local/BerkeleyDB-opt/"
fi
. "$path/FINISH.sh"

View File

@@ -8,4 +8,10 @@ c_warnings="$c_warnings $debug_extra_warnings"
cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$pentium_configs $debug_configs"
# Use the debug version if it exists
if test -d /usr/local/BerkeleyDB-dbug/
then
extra_configs="$extra_configs --with-berkeley-db=/usr/local/BerkeleyDB-dbug/"
fi
. "$path/FINISH.sh"

15
BUILD/compile-pentium-symbols Executable file
View File

@@ -0,0 +1,15 @@
#! /bin/sh
path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$pentium_cflags $fast_cflags -g"
extra_configs="$pentium_configs"
# Use the optimized version if it exists
if test -d /usr/local/BerkeleyDB-opt/
then
extra_configs="$extra_configs --with-berkeley-db=/usr/local/BerkeleyDB-opt/"
fi
. "$path/FINISH.sh"

View File

@@ -289,6 +289,151 @@ Use pointers rather than array indexing when operating on strings.
@end itemize
@node mysys functions
@chapter mysys functions
Functions i mysys: (For flags se my_sys.h)
int my_copy _A((const char *from,const char *to,myf MyFlags));
- Copy file
int my_delete _A((const char *name,myf MyFlags));
- Delete file
int my_getwd _A((string buf,uint size,myf MyFlags));
int my_setwd _A((const char *dir,myf MyFlags));
- Get and set working directory
string my_tempnam _A((const char *pfx,myf MyFlags));
- Make a uniq temp file name by using dir and adding something after
pfx to make name uniq. Name is made by adding a uniq 6 length-string
and TMP_EXT after pfx.
Returns pointer to malloced area for filename. Should be freed by
free().
File my_open _A((const char *FileName,int Flags,myf MyFlags));
File my_create _A((const char *FileName,int CreateFlags,
int AccsesFlags, myf MyFlags));
int my_close _A((File Filedes,myf MyFlags));
uint my_read _A((File Filedes,byte *Buffer,uint Count,myf MyFlags));
uint my_write _A((File Filedes,const byte *Buffer,uint Count,
myf MyFlags));
ulong my_seek _A((File fd,ulong pos,int whence,myf MyFlags));
ulong my_tell _A((File fd,myf MyFlags));
- Use instead of open,open-with-create-flag, close read and write
to get automatic error-messages (flag: MYF_WME) and only have
to test for != 0 if error (flag: MY_NABP).
int my_rename _A((const char *from,const char *to,myf MyFlags));
- Rename file
FILE *my_fopen _A((const char *FileName,int Flags,myf MyFlags));
FILE *my_fdopen _A((File Filedes,int Flags,myf MyFlags));
int my_fclose _A((FILE *fd,myf MyFlags));
uint my_fread _A((FILE *stream,byte *Buffer,uint Count,myf MyFlags));
uint my_fwrite _A((FILE *stream,const byte *Buffer,uint Count,
myf MyFlags));
ulong my_fseek _A((FILE *stream,ulong pos,int whence,myf MyFlags));
ulong my_ftell _A((FILE *stream,myf MyFlags));
- Same read-interface for streams as for files
gptr _mymalloc _A((uint uSize,const char *sFile,
uint uLine, myf MyFlag));
gptr _myrealloc _A((string pPtr,uint uSize,const char *sFile,
uint uLine, myf MyFlag));
void _myfree _A((gptr pPtr,const char *sFile,uint uLine));
int _sanity _A((const char *sFile,unsigned int uLine));
gptr _myget_copy_of_memory _A((const byte *from,uint length,
const char *sFile, uint uLine,
myf MyFlag));
- malloc(size,myflag) is mapped to this functions if not compiled
with -DSAFEMALLOC
void TERMINATE _A((void));
- Writes malloc-info on stdout if compiled with -DSAFEMALLOC.
int my_chsize _A((File fd,ulong newlength,myf MyFlags));
- Change size of file
void my_error _D((int nr,myf MyFlags, ...));
- Writes message using error number (se mysys/errors.h) on
stdout or curses if MYSYS_PROGRAM_USES_CURSES() is called.
void my_message _A((const char *str,myf MyFlags));
- Writes message-string on
stdout or curses if MYSYS_PROGRAM_USES_CURSES() is called.
void my_init _A((void ));
- Start each program (in main) with this.
void my_end _A((int infoflag));
- Gives info about program.
- If infoflag & MY_CHECK_ERROR prints if some files are left open
- If infoflag & MY_GIVE_INFO prints timing info and malloc info
about prog.
int my_redel _A((const char *from, const char *to, int MyFlags));
- Delete from before rename of to to from. Copyes state from old
file to new file. If MY_COPY_TIME is set sets old time.
int my_copystat _A((const char *from, const char *to, int MyFlags));
- Copye state from old file to new file.
If MY_COPY_TIME is set sets copy also time.
string my_filename _A((File fd));
- Give filename of open file.
int dirname _A((string to,const char *name));
- Copy name of directory from filename.
int test_if_hard_path _A((const char *dir_name));
- Test if dirname is a hard path (Starts from root)
void convert_dirname _A((string name));
- Convert dirname acording to system.
- In MSDOS changes all caracters to capitals and changes '/' to
'\'
string fn_ext _A((const char *name));
- Returns pointer to extension in filename
string fn_format _A((string to,const char *name,const char *dsk,
const char *form,int flag));
format a filename with replace of library and extension and
converts between different systems.
params to and name may be identicall
function dosn't change name if name != to
Flag may be: 1 force replace filnames library with 'dsk'
2 force replace extension with 'form' */
4 force Unpack filename (replace ~ with home)
8 Pack filename as short as possibly for output to
user.
All open requests should allways use at least:
"open(fn_format(temp_buffe,name,"","",4),...)" to unpack home and
convert filename to system-form.
string fn_same _A((string toname,const char *name,int flag));
- Copys directory and extension from name to toname if neaded.
copy can be forced by same flags that in fn_format.
int wild_compare _A((const char *str,const char *wildstr));
- Compare if str matches wildstr. Wildstr can contain "*" and "?"
as match-characters.
Returns 0 if match.
void get_date _A((string to,int timeflag));
- Get current date in a form ready for printing.
void soundex _A((string out_pntr, string in_pntr))
- Makes in_pntr to a 5 chars long string. All words that sounds
alike have the same string.
int init_key_cache _A((ulong use_mem,ulong leave_this_much_mem));
- Use cacheing of keys in MISAM, PISAM, and ISAM.
KEY_CACHE_SIZE is a good size.
- Remember to lock databases for optimal cacheing
void end_key_cache _A((void));
- End key-cacheing.
@c The Index was empty, and ugly, so I removed it. (jcole, Sep 7, 2000)
@c @node Index

View File

@@ -135,6 +135,7 @@ version see the relevant distribution.
* MySQL internals:: @strong{MySQL} internals
* Environment variables:: @strong{MySQL} environment variables
* Users:: Some @strong{MySQL} users
* MySQL customer usage::
* Contrib:: Contributed programs
* Credits:: Contributors to @strong{MySQL}
* News:: @strong{MySQL} change history
@@ -192,7 +193,7 @@ Example Licensing Situations
* ISP:: ISP @strong{MySQL} services
* Web server:: Running a web server using @strong{MySQL}.
@strong{MySQL} Licensing and Support Costs
MySQL Licensing and Support Costs
* Payment information:: Payment information
* Contact information:: Contact information
@@ -222,7 +223,7 @@ Installing MySQL
* OS/2:: OS/2 notes
* MySQL binaries:: MySQL binaries
* Post-installation:: Post-installation setup and testing
* Upgrade:: Upgrading/downgrading @strong{MySQL}
* Upgrade:: Upgrading/Downgrading MySQL
Installing a MySQL Binary Distribution
@@ -828,6 +829,7 @@ Credits
* Developers::
* Contributors::
* Supporters::
MySQL change history
@@ -876,7 +878,7 @@ Changes in release 3.23.x (Recommended; Gamma)
* News-3.23.1:: Changes in release 3.23.1
* News-3.23.0:: Changes in release 3.23.0
Changes in release 3.22.x
Changes in release 3.22.x (Older; Still supported)
* News-3.22.35:: Changes in release 3.22.35
* News-3.22.34:: Changes in release 3.22.34
@@ -1814,7 +1816,8 @@ In-memory hash tables which are used as temporary tables.
@item
Handles large databases. We are using @strong{MySQL} with some
databases that contain 50,000,000 records.
databases that contain 50,000,000 records and we know of users that
uses @code{MySQL} with 60,000 tables and about 5,000,000,000 rows
@item
All columns have default values. You can use @code{INSERT} to insert a
@@ -2568,7 +2571,7 @@ PMP Computer Solutions. Database developers using @strong{MySQL} and
@item @uref{http://www.aewa.org/}@*
Airborne Early Warning Association.
@item @uref{http://21ccs.com/~gboersm/y2kmatrix/}@*
@item @uref{http://www.dedserius.com/y2kmatrix/}@*
Y2K tester.
@end itemize
@@ -4490,9 +4493,15 @@ China [linuxforum.net] @
@item
@c EMAIL: Vincent_Fong@innovator.com.hk (Vincent Fong)
@c @image{Flags/china}
China [Hong Kong] @
China [ISL/Hong Kong] @
@uref{http://mysql.islnet.net, WWW}
@item
@c EMAIL: marquischan@hotmail.com (Marquis Chan)
@c @image{Flags/china}
China [TraLand.com/Hong Kong] @
@uref{http://www.traland.com/mysql/, WWW}
@c @item
@c Not ok 20000919; Non-existent (Matt)
@c EMAIL: george@netfirm.net (Hongsheng Zhu)
@@ -9465,16 +9474,13 @@ section in this manual. @xref{SHOW VARIABLES}.
The tuning server parameters section includes information of how to optimize
these. @xref{Server parameters}.
@item -Sg, --skip-grant-tables
This option causes the server not to use the privilege system at all. This
gives everyone @emph{full access} to all databases! (You can tell a running
server to start using the grant tables again by executing @code{mysqladmin
flush-privileges} or @code{mysqladmin reload}.)
@item --safe-mode
Skip some optimize stages.
Implies @code{--skip-delay-key-write}.
@item --safe-show-database
Don't show databases for which the user doesn't have any privileges.
@item --secure
IP numbers returned by the @code{gethostbyname()} system call are
checked to make sure they resolve back to the original hostname. This
@@ -9494,6 +9500,12 @@ in this feature).
Ignore the @code{delay_key_write} option for all tables.
@xref{Server parameters}.
@item -Sg, --skip-grant-tables
This option causes the server not to use the privilege system at all. This
gives everyone @emph{full access} to all databases! (You can tell a running
server to start using the grant tables again by executing @code{mysqladmin
flush-privileges} or @code{mysqladmin reload}.)
@item --skip-locking
Don't use system locking. To use @code{isamchk} or @code{myisamchk} you must
shut down the server. @xref{Stability}. Note that in @strong{MySQL} Version
@@ -20242,72 +20254,85 @@ The output resembles that shown below, though the format and numbers may
differ somewhat:
@example
+-------------------------+---------------------------------+
| Variable_name | Value |
+-------------------------+---------------------------------+
| ansi_mode | OFF |
| back_log | 50 |
| basedir | /usr/local/mysql/ |
| bdb_cache_size | 1048540 |
| bdb_home | /usr/local/mysql/data/ |
| bdb_logdir | |
| bdb_tmpdir | /tmp/ |
| binlog_cache_size | 32768 |
| character_set | latin1 |
| character_sets | latin1 |
| connect_timeout | 5 |
| concurrent_insert | ON |
| datadir | /usr/local/mysql/data/ |
| delay_key_write | ON |
| delayed_insert_limit | 100 |
| delayed_insert_timeout | 300 |
| delayed_queue_size | 1000 |
| join_buffer_size | 131072 |
| flush | OFF |
| flush_time | 0 |
| init_file | |
| interactive_timeout | 28800 |
| key_buffer_size | 16776192 |
| language | /usr/local/mysql/share/english/ |
| log | OFF |
| log_update | OFF |
| log_bin | OFF |
| log_slave_updates | OFF |
| long_query_time | 10 |
| low_priority_updates | OFF |
| lower_case_table_names | 0 |
| max_allowed_packet | 1047552 |
| max_connections | 100 |
| max_connect_errors | 10 |
| max_delayed_threads | 20 |
| max_heap_table_size | 16777216 |
| max_join_size | 4294967295 |
| max_sort_length | 1024 |
| max_tmp_tables | 32 |
| max_write_lock_count | 4294967295 |
| myisam_sort_buffer_size | 8388608 |
| net_buffer_length | 16384 |
| net_retry_count | 10 |
| open_files_limit | 0 |
| pid_file | /usr/local/mysql/data/tik.pid |
| port | 3306 |
| protocol_version | 10 |
| record_buffer | 131072 |
| skip_locking | ON |
| skip_networking | OFF |
| skip_show_database | OFF |
| slow_launch_time | 2 |
| socket | /tmp/mysql.sock |
| sort_buffer | 2097116 |
| table_cache | 64 |
| table_type | MYISAM |
| thread_stack | 131072 |
| thread_cache_size | 3 |
| tmp_table_size | 1048576 |
| tmpdir | /tmp/ |
| version | 3.23.21-beta-debug |
| wait_timeout | 28800 |
+-------------------------+---------------------------------+
+-------------------------+---------------------------+
| Variable_name | Value |
+-------------------------+---------------------------+
| ansi_mode | OFF |
| back_log | 50 |
| basedir | /my/monty/ |
| bdb_cache_size | 16777216 |
| bdb_home | /my/monty/data/ |
| bdb_max_lock | 10000 |
| bdb_logdir | |
| bdb_shared_data | OFF |
| bdb_tmpdir | /tmp/ |
| binlog_cache_size | 32768 |
| concurrent_insert | ON |
| connect_timeout | 5 |
| datadir | /my/monty/data/ |
| delay_key_write | ON |
| delayed_insert_limit | 100 |
| delayed_insert_timeout | 300 |
| delayed_queue_size | 1000 |
| flush | OFF |
| flush_time | 0 |
| have_bdb | YES |
| have_gemini | NO |
| have_innobase | YES |
| have_raid | YES |
| have_ssl | NO |
| init_file | |
| interactive_timeout | 28800 |
| join_buffer_size | 131072 |
| key_buffer_size | 16776192 |
| language | /my/monty/share/english/ |
| large_files_support | ON |
| log | OFF |
| log_update | OFF |
| log_bin | OFF |
| log_slave_updates | OFF |
| long_query_time | 10 |
| low_priority_updates | OFF |
| lower_case_table_names | 0 |
| max_allowed_packet | 1048576 |
| max_binlog_cache_size | 4294967295 |
| max_connections | 100 |
| max_connect_errors | 10 |
| max_delayed_threads | 20 |
| max_heap_table_size | 16777216 |
| max_join_size | 4294967295 |
| max_sort_length | 1024 |
| max_tmp_tables | 32 |
| max_write_lock_count | 4294967295 |
| myisam_recover_options | DEFAULT |
| myisam_sort_buffer_size | 8388608 |
| net_buffer_length | 16384 |
| net_read_timeout | 30 |
| net_retry_count | 10 |
| net_write_timeout | 60 |
| open_files_limit | 0 |
| pid_file | /my/monty/data/donna.pid |
| port | 3306 |
| protocol_version | 10 |
| record_buffer | 131072 |
| query_buffer_size | 0 |
| safe_show_database | OFF |
| server_id | 0 |
| skip_locking | ON |
| skip_networking | OFF |
| skip_show_database | OFF |
| slow_launch_time | 2 |
| socket | /tmp/mysql.sock |
| sort_buffer | 2097116 |
| table_cache | 64 |
| table_type | MYISAM |
| thread_cache_size | 4 |
| thread_stack | 65536 |
| tmp_table_size | 1048576 |
| tmpdir | /tmp/ |
| version | 3.23.29a-gamma-debug |
| wait_timeout | 28800 |
+-------------------------+---------------------------+
@end example
Each option is described below. Values for buffer sizes, lengths, and stack
@@ -20427,6 +20452,21 @@ tables will be closed (to free up resources and sync things to disk). We
only recommend this option on Win95, Win98, or on systems where you have
very little resources.
@item @code{have_bdb}
@code{YES} if @code{mysqld} supports Berkeley DB tables. @code{DISABLED}
if @code{--skip-bdb} is used.
@item @code{have_gemini}
@code{YES} if @code{mysqld} supports Gemini tables. @code{DISABLED}
if @code{--skip-gemini} is used.
@item @code{have_innobase}
@code{YES} if @code{mysqld} supports Innobase tables. @code{DISABLED}
if @code{--skip-innobase} is used.
@item @code{have_raid}
@code{YES} if @code{mysqld} supports the @code{RAID} option.
@item @code{have_ssl}
@code{YES} if @code{mysqld} supports SSL (encryption) on the client/server
protocol.
@item @code{init_file}
The name of the file specified with the @code{--init-file} option when
you start the server. This is a file of SQL statements you want the
@@ -20606,6 +20646,12 @@ want to increase this value.
The initial allocation of the query buffer. If most of your queries are
long (like when inserting blobs), you should increase this!
@item @code{safe_show_databases}
Don't show databases for which the user doesn't have any database or
table privileges. This can improve security if you're concerned about
people being able to see what databases other users have. See also
@code{skip_show_databases}.
@item @code{server_id}
The value of the @code{--server-id} option.
@@ -20616,10 +20662,10 @@ Is OFF if @code{mysqld} uses external locking.
Is ON if we only allow local (socket) connections.
@item @code{skip_show_databases}
This prevents people from doing @code{SHOW DATABASES} if they don't
have the @code{PROCESS_PRIV} privilege. This can improve security if
you're concerned about people being able to see what databases and
tables other users have.
This prevents people from doing @code{SHOW DATABASES} if they don't have
the @code{PROCESS_PRIV} privilege. This can improve security if you're
concerned about people being able to see what databases other users
have. See also @code{safe_show_databases}.
@item @code{slow_launch_time}
If creating the thread takes longer than this value (in seconds), the
@@ -28399,20 +28445,20 @@ Most of the options to @code{safe_mysqld} are the same as the options to
@table @code
@item --basedir=path
@item --core-file-size=#
@item --datadir=path
@item --defaults-extra-file=path
@item --defaults-file=path
@item --open-files=#
Size of the core file @code{mysqld} should be able to create. Passed to
@code{ulimit -c}.
@item --datadir=path
@item --err-log=path
@item --ledir=path
Path to @code{mysqld}
@item --log=path
@item --mysqld=mysqld-version
Name of the mysqld version in the @code{ledir} directory you want to start.
@item --no-defaults
@item --open-files=#
Number of files @code{mysqld} should be able to open. Passed to
@code{ulimit -n}.
Number of files @code{mysqld} should be able to open. Passed to @code{ulimit -n}.
@item --open-files=#
Size of the core file @code{mysqld} should be able to create. Passed to @code{ulimit -c}.
@item --pid-file=path
@item --port=#
@item --socket=path
@@ -38243,10 +38289,11 @@ To be consistent with our setup, you should put your result files in
test produces more than one result, you should use @code{test_name.a.result},
@code{test_name.b.result}, etc
@item
Failed test results are put in a file with the same name as the result file
followed by @code{.reject} extenstion. If your test case is failing, you
should do a diff on the two files. If you cannot see how they are different,
examine both with @code{od -c} and also check their lengths.
Failed test results are put in a file with the same base name as the
result file with the @code{.reject} extenstion. If your test case is
failing, you should do a diff on the two files. If you cannot see how
they are different, examine both with @code{od -c} and also check their
lengths.
@item
You can prefix a query with @code{!} if the test can continue after that query
returns an error.
@@ -38284,9 +38331,6 @@ you should ftp all the relevant files to
@end itemize
@page
@cindex environment variables, list of
@node Environment variables, Users, MySQL internals, Top
@@ -38371,7 +38415,7 @@ variables to modify the behavior of @strong{MySQL}. @xref{Option files}.
@page
@cindex users, of MySQL
@cindex news sites
@node Users, Contrib, Environment variables, Top
@node Users, MySQL customer usage, Environment variables, Top
@appendix Some MySQL Users
@appendixsec General News Sites
@@ -38519,6 +38563,8 @@ support @strong{MySQL}}
@c @item @uref{http://dynodns.net, Free dynamic DNS implementation}
@c EMAIL: A Moore <amoore@mooresystems.com>
@item @uref{http://www.hn.org/, Hammernode; Public DNS Servers}
@item @uref{http://www.fdns.net/, Free 3rd level domains}
@item @uref{http://worldcommunity.com/, Online Database}
@@ -38773,10 +38819,44 @@ Washington's Eastside residents and businesses}
Send any additions to this list to @email{webmaster@@mysql.com}.
@page
@cindex MySQL usage
@node MySQL customer usage, Contrib, Users, Top
@appendix MySQL customer usage
The section 'Some MySQL Users' contains a lot of different links to
@strong{MySQL} users but doesn't provide that much information about how
they are using @strong{MySQL}. @xref{Users}. This manual section is to
give you an idea of how other @strong{MySQL} users are using
@strong{MySQL} to solve their problems.
This manual section is very new and we plan to add more stories here
shortly. If you are interested in contributing of how you use
@code{MySQL} in a unique environment or have success store about how you
use @code{MySQL}, you can write to @code{docs@@lists.mysql.com} with
subject @code{Success:}. Note that as we are very busy it may take some
time before you get some feedback for your story.
@itemize @bullet
@item
I think you might be interested in my database size. The whole database
is currently on 15 servers and I think it's about 60.000 of tables
containing about 5.000.000.000 of rows. My mostly loaded server
currently holds about 10.000 of tables with 1.000.000.000 of rows in it.
Hugest tables have about 50.000.000 of rows, and this value will raise
as soon as I'll move to 2.4 kernel with large files. Currently I have to
delete much of logs for large sites to hold table sizes in 2Gb.
Peter Zaitsev, Spylog.ru.
@item
Texas Instrument is using MySQL for handling tables that contains up
o 2,000 million rows in a validation regression database.
@end itemize
@page
@cindex contributed programs
@cindex programs, contributed
@node Contrib, Credits, Users, Top
@node Contrib, Credits, MySQL customer usage, Top
@appendix Contributed Programs
Many users of @strong{MySQL} have contributed @emph{very} useful support
@@ -38967,6 +39047,9 @@ applications. By Miguel Angel Sol
@item @uref{http://www.mysql.com/Downloads/Contrib/MySQL-ADA95_API.zip, MySQL-ADA95_API.zip}
An ADA95 interface to the MySQL API. By Francois Fabien.
@item @uref{http://www.mysql.com/Downloads/Contrib/MyTool-DLL_for_VB_and_MySQL.zip, MyTool-DLL_for_VB_and_MySQL.zip}
A DLL with MySQL C API for Visual Basic. By Ken Menzel @email{kenm@@icarz.com}.
@end itemize
@appendixsec Clients
@@ -39445,12 +39528,14 @@ interested in.
@node Credits, News, Contrib, Top
@appendix Credits
The following persons have helped us make MySQL what it is today
The following persons and companies have helped us make MySQL what it is
today:
@cindex developers, list of
@menu
* Developers::
* Contributors::
* Supporters::
@end menu
@node Developers, Contributors, Credits, Credits
@@ -39632,7 +39717,7 @@ Allan Larsson (The BOSS for TCX DataKonsult AB).
@end table
@cindex contributors, list of
@node Contributors, , Developers, Credits
@node Contributors, Supporters, Developers, Credits
@appendixsubsec Contributors to MySQL
Contributors to the @strong{MySQL} distribution are listed below, in
@@ -39702,6 +39787,12 @@ For porting PHP to @strong{MySQL}.
For the first @strong{MySQL} manual. And a lot of spelling/language
fixes for the FAQ (that turned into the @strong{MySQL} manual a long
time ago).
@item Yan Cailin
First translator of the MySQL Reference Manual into simplified chinese
in early 2000 on which the Big5 and HK coded
(@uref{http://mysql.hitstar.com, mysql.hitstar.com}) versions were
based. @uref{http://linuxdb.yeah.net, Personal home page at
linuxdb.yeah.net}.
@item Giovanni Maruzzelli @email{maruzz@@matrice.it}
For porting iODBC (Unix ODBC).
@item Chris Provenzano
@@ -39857,6 +39948,24 @@ ODBC and VisualC++ interface questions.
@code{DBD}, Linux, some SQL syntax questions.
@end table
@cindex contributing companies, list of
@node Supporters, , Contributors, Credits
@appendixsubsec Supporters to MySQL
The following companies has helped us finance development of
@strong{MySQL} by either paying us for developing a new feature,
developed a @strong{MySQL} feature themself or by giving us hardware for
@strong{MySQL} development.
@multitable @columnfractions .3 .7
@item Va Linux / Andover.net @tab Replication
@item NuSphere @tab Editing of the @strong{MySQL} manual.
@item Intel @tab Contributed to development on Windows and Linux platforms
@item Compaq @tab Contributed to Development on Linux-alpha
@item SWSoft @tab Development on the embedded @code{mysqld} version.
@item FutureQuest @tab @code{--skip-show-variables}
@end multitable
@node News, Bugs, Credits, Top
@appendix MySQL change history
@@ -39948,6 +40057,18 @@ though, so Version 3.23 is not released as a stable version yet.
@appendixsubsec Changes in release 3.23.30
@itemize @bullet
@item
Added option @code{--mysqld=#} to @code{safe_mysqld}
@item
Allow hex constants in the @code{--fields-*-by} and
@code{--lines-terminated-by} options to @code{mysqldump} and
@code{mysqlimport}. By Paul DuBois.
@item
Added option @code{--safe-show-databases}.
@item
Added @code{have_bdb}, @code{have_gemini}, @code{have_innobase},
@code{have_raid} and @code{have_ssl} to @code{SHOW VARIABLES} to make it
easy to test for supported extensions.
@item
Added option @code{open-files-limit} to @code{mysqld}.
@item
Changed option @code{open-files} to @code{open-files-limit} in

View File

@@ -26,6 +26,7 @@ typedef struct st_line_buffer
uint bufread; /* Number of bytes to get with each read(). */
uint eof;
ulong max_size;
ulong read_length; /* Length of last read string */
} LINE_BUFFER;
extern LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file);

View File

@@ -39,7 +39,7 @@
#include "my_readline.h"
#include <signal.h>
const char *VER="11.9";
const char *VER="11.10";
gptr sql_alloc(unsigned size); // Don't use mysqld alloc for these
void sql_element_free(void *ptr);
@@ -903,7 +903,6 @@ static bool add_line(String &buffer,char *line,char *in_string)
continue;
#ifdef USE_MB
int l;
/* if ((l = ismbchar(pos, pos+MBMAXLEN))) { Wei He: I think it's wrong! */
if (use_mb(default_charset_info) &&
(l = my_ismbchar(default_charset_info, pos, strend))) {
while (l--)
@@ -2163,7 +2162,9 @@ com_status(String *buffer __attribute__((unused)),
tee_fprintf(stdout, "Server version:\t\t%s\n", mysql_get_server_info(&mysql));
tee_fprintf(stdout, "Protocol version:\t%d\n", mysql_get_proto_info(&mysql));
tee_fprintf(stdout, "Connection:\t\t%s\n", mysql_get_host_info(&mysql));
tee_fprintf(stdout, "Language:\t\t%s\n", mysql.charset->name);
tee_fprintf(stdout, "Client characterset:\t%s\n",
default_charset_info->name);
tee_fprintf(stdout, "Server characterset:\t%s\n", mysql.charset->name);
if (strstr(mysql_get_host_info(&mysql),"TCP/IP") || ! mysql.unix_socket)
tee_fprintf(stdout, "TCP port:\t\t%d\n", mysql.port);
else

View File

@@ -122,7 +122,6 @@ static struct option long_options[] = {
{"socket", required_argument, 0, 'S'},
{"sleep", required_argument, 0, 'i'},
#include "sslopt-longopts.h"
{"connect-timeout", required_argument, 0, 't'},
#ifndef DONT_ALLOW_USER_CHANGE
{"user", required_argument, 0, 'u'},
#endif

View File

@@ -37,7 +37,7 @@
** T<>nu Samuel <tonu@please.do.not.remove.this.spam.ee>
**/
#define DUMP_VERSION "8.11"
#define DUMP_VERSION "8.12"
#include <global.h>
#include <my_sys.h>
@@ -863,9 +863,14 @@ static char *add_load_option(char *ptr,const char *object,
{
if (object)
{
ptr= strxmov(ptr," ",statement," '",NullS);
ptr= field_escape(ptr,object,(uint) strlen(object));
*ptr++= '\'';
if (!strncasecmp(object,"0x",2)) /* hex constant; don't escape */
ptr= strxmov(ptr," ",statement," ",object,NullS);
else /* char constant; escape */
{
ptr= strxmov(ptr," ",statement," '",NullS);
ptr= field_escape(ptr,object,(uint) strlen(object));
*ptr++= '\'';
}
}
return ptr;
} /* add_load_option */

View File

@@ -25,7 +25,7 @@
** * *
** *************************
*/
#define IMPORT_VERSION "2.6"
#define IMPORT_VERSION "2.7"
#include <global.h>
#include <my_sys.h>
@@ -456,9 +456,14 @@ static char *add_load_option(char *ptr,const char *object,const char *statement)
{
if (object)
{
ptr= strxmov(ptr," ",statement," '",NullS);
ptr= field_escape(ptr,object,(uint) strlen(object));
*ptr++= '\'';
if (!strncasecmp(object,"0x",2)) /* hex constant; don't escape */
ptr= strxmov(ptr," ",statement," ",object,NullS);
else /* char constant; escape */
{
ptr= strxmov(ptr," ",statement," '",NullS);
ptr= field_escape(ptr,object,(uint) strlen(object));
*ptr++= '\'';
}
}
return ptr;
}

File diff suppressed because it is too large Load Diff

View File

@@ -26,7 +26,7 @@ static bool init_line_buffer(LINE_BUFFER *buffer,File file,ulong size,
ulong max_size);
static bool init_line_buffer_from_string(LINE_BUFFER *buffer,my_string str);
static uint fill_buffer(LINE_BUFFER *buffer);
static char *intern_read_line(LINE_BUFFER *buffer,uint *out_length);
static char *intern_read_line(LINE_BUFFER *buffer,ulong *out_length);
LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file)
@@ -46,12 +46,13 @@ LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file)
char *batch_readline(LINE_BUFFER *line_buff)
{
char *pos;
uint out_length;
ulong out_length;
if (!(pos=intern_read_line(line_buff,&out_length)))
return 0;
if (out_length && pos[out_length-1] == '\n')
out_length--; /* Remove '\n' */
line_buff->read_length=out_length;
pos[out_length]=0;
return pos;
}
@@ -187,7 +188,7 @@ static uint fill_buffer(LINE_BUFFER *buffer)
char *intern_read_line(LINE_BUFFER *buffer,uint *out_length)
char *intern_read_line(LINE_BUFFER *buffer,ulong *out_length)
{
char *pos;
uint length;
@@ -210,7 +211,7 @@ char *intern_read_line(LINE_BUFFER *buffer,uint *out_length)
pos--; /* break line here */
}
buffer->end_of_line=pos+1;
*out_length=(uint) (pos + 1 - buffer->eof - buffer->start_of_line);
*out_length=(ulong) (pos + 1 - buffer->eof - buffer->start_of_line);
DBUG_RETURN(buffer->start_of_line);
}
}

View File

@@ -4,7 +4,7 @@ dnl Process this file with autoconf to produce a configure script.
AC_INIT(sql/mysqld.cc)
AC_CANONICAL_SYSTEM
# The Docs Makefile.am parses this line!
AM_INIT_AUTOMAKE(mysql, 3.23.29a-gamma)
AM_INIT_AUTOMAKE(mysql, 3.23.30-gamma)
AM_CONFIG_HEADER(config.h)
PROTOCOL_VERSION=10
@@ -436,10 +436,16 @@ AM_CONDITIONAL(ASSEMBLER, test ASSEMBLER_x86 = "" -o ASSEMBLER_x86 = "")
AC_MSG_CHECKING(whether to use RAID)
AC_ARG_WITH(raid,
[ --with-raid Enable RAID Support],
[ AC_DEFINE(USE_RAID)
AC_MSG_RESULT(yes) ],
[ AC_MSG_RESULT(no) ]
[ USE_RAID=$withval ],
[ USE_RAID=no ]
)
if test "$USE_RAID" = "yes"
then
AC_MSG_RESULT([yes])
AC_DEFINE([USE_RAID])
else
AC_MSG_RESULT([no])
fi
# Use this to set the place used for unix socket used to local communication.
AC_ARG_WITH(unix-socket-path,

View File

@@ -18,11 +18,12 @@
#include "heapdef.h"
static int check_one_key(HP_KEYDEF *keydef,ulong records,ulong blength);
static int check_one_key(HP_KEYDEF *keydef, uint keynr, ulong records,
ulong blength, my_bool print_status);
/* Returns 0 if the HEAP is ok */
int heap_check_heap(HP_INFO *info)
int heap_check_heap(HP_INFO *info,my_bool print_status)
{
int error;
uint key;
@@ -30,13 +31,15 @@ int heap_check_heap(HP_INFO *info)
DBUG_ENTER("heap_check_keys");
for (error=key=0 ; key < share->keys ; key++)
error|=check_one_key(share->keydef+key,share->records,share->blength);
error|=check_one_key(share->keydef+key,key, share->records,share->blength,
print_status);
DBUG_RETURN(error);
}
static int check_one_key(HP_KEYDEF *keydef, ulong records, ulong blength)
static int check_one_key(HP_KEYDEF *keydef, uint keynr, ulong records,
ulong blength, my_bool print_status)
{
int error;
uint i,found,max_links,seek,links;
@@ -76,6 +79,9 @@ static int check_one_key(HP_KEYDEF *keydef, ulong records, ulong blength)
}
DBUG_PRINT("info",
("records: %ld seeks: %d max links: %d hitrate: %.2f",
records,seek,max_links,(float) seek / (float) records));
records,seek,max_links,(float) seek / (float) (records ? records : 1)));
if (print_status)
printf("Key: %d records: %ld seeks: %d max links: %d hitrate: %.2f\n",
keynr, records, seek, max_links, (float) seek / (float) records);
return error;
}

View File

@@ -37,7 +37,7 @@ int _hp_close(register HP_INFO *info)
int error=0;
DBUG_ENTER("_hp_close");
#ifndef DBUG_OFF
if (info->s->changed && heap_check_heap(info))
if (info->s->changed && heap_check_heap(info,0))
{
error=my_errno=HA_ERR_CRASHED;
}

View File

@@ -145,6 +145,7 @@ void _hp_movelink(HASH_INFO *pos, HASH_INFO *next_link, HASH_INFO *newlink)
return;
}
#ifndef NEW_HASH_FUNCTION
/* Calc hashvalue for a key */
@@ -152,13 +153,14 @@ ulong _hp_hashnr(register HP_KEYDEF *keydef, register const byte *key)
{
register ulong nr=1, nr2=4;
HP_KEYSEG *seg,*endseg;
uchar *pos;
for (seg=keydef->seg,endseg=seg+keydef->keysegs ; seg < endseg ; seg++)
{
uchar *pos=(uchar*) key;
key+=seg->length;
if (seg->type == HA_KEYTYPE_TEXT)
{
for (pos=(uchar*) key,key+=seg->length ; pos < (uchar*) key ; pos++)
for (; pos < (uchar*) key ; pos++)
{
nr^=(ulong) ((((uint) nr & 63)+nr2)*((uint) my_sort_order[(uint) *pos]))+ (nr << 8);
nr2+=3;
@@ -166,7 +168,7 @@ ulong _hp_hashnr(register HP_KEYDEF *keydef, register const byte *key)
}
else
{
for (pos=(uchar*) key,key+=seg->length ; pos < (uchar*) key ; pos++)
for (; pos < (uchar*) key ; pos++)
{
nr^=(ulong) ((((uint) nr & 63)+nr2)*((uint) *pos))+ (nr << 8);
nr2+=3;
@@ -182,13 +184,13 @@ ulong _hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec)
{
register ulong nr=1, nr2=4;
HP_KEYSEG *seg,*endseg;
uchar *pos,*end;
for (seg=keydef->seg,endseg=seg+keydef->keysegs ; seg < endseg ; seg++)
{
uchar *pos=(uchar*) rec+seg->start,*end=pos+seg->length;
if (seg->type == HA_KEYTYPE_TEXT)
{
for (pos=(uchar*) rec+seg->start,end=pos+seg->length ; pos < end ; pos++)
for (; pos < end ; pos++)
{
nr^=(ulong) ((((uint) nr & 63)+nr2)*((uint) my_sort_order[(uint) *pos]))+ (nr << 8);
nr2+=3;
@@ -196,7 +198,7 @@ ulong _hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec)
}
else
{
for (pos=(uchar*) rec+seg->start,end=pos+seg->length ; pos < end ; pos++)
for (; pos < end ; pos++)
{
nr^=(ulong) ((((uint) nr & 63)+nr2)*((uint) *pos))+ (nr << 8);
nr2+=3;
@@ -206,6 +208,85 @@ ulong _hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec)
return((ulong) nr);
}
#else
/*
* Fowler/Noll/Vo hash
*
* The basis of the hash algorithm was taken from an idea sent by email to the
* IEEE Posix P1003.2 mailing list from Phong Vo (kpv@research.att.com) and
* Glenn Fowler (gsf@research.att.com). Landon Curt Noll (chongo@toad.com)
* later improved on their algorithm.
*
* The magic is in the interesting relationship between the special prime
* 16777619 (2^24 + 403) and 2^32 and 2^8.
*
* This hash produces the fewest collisions of any function that we've seen so
* far, and works well on both numbers and strings.
*/
ulong _hp_hashnr(register HP_KEYDEF *keydef, register const byte *key)
{
register ulong nr=0;
HP_KEYSEG *seg,*endseg;
for (seg=keydef->seg,endseg=seg+keydef->keysegs ; seg < endseg ; seg++)
{
uchar *pos=(uchar*) key;
key+=seg->length;
if (seg->type == HA_KEYTYPE_TEXT)
{
for (; pos < (uchar*) key ; pos++)
{
nr *=16777619;
nr ^=((uint) my_sort_order[(uint) *pos]);
}
}
else
{
for ( ; pos < (uchar*) key ; pos++)
{
nr *=16777619;
nr ^=(uint) *pos;
}
}
}
return((ulong) nr);
}
/* Calc hashvalue for a key in a record */
ulong _hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec)
{
register ulong nr=0;
HP_KEYSEG *seg,*endseg;
for (seg=keydef->seg,endseg=seg+keydef->keysegs ; seg < endseg ; seg++)
{
uchar *pos=(uchar*) rec+seg->start,*end=pos+seg->length;
if (seg->type == HA_KEYTYPE_TEXT)
{
for ( ; pos < end ; pos++)
{
nr *=16777619;
nr ^=(uint) my_sort_order[(uint) *pos];
}
}
else
{
for ( ; pos < end ; pos++)
{
nr *=16777619;
nr ^=(uint) *pos;
}
}
}
return((ulong) nr);
}
#endif
/* Compare keys for two records. Returns 0 if they are identical */
int _hp_rec_key_cmp(HP_KEYDEF *keydef, const byte *rec1, const byte *rec2)

View File

@@ -38,6 +38,7 @@ HP_INFO *heap_open(const char *name, int mode, uint keys, HP_KEYDEF *keydef,
pthread_mutex_lock(&THR_LOCK_heap);
if (!(share=_hp_find_named_heap(name)))
{
DBUG_PRINT("info",("Initializing new table"));
for (i=key_segs=max_length=0 ; i < keys ; i++)
{
key_segs+= keydef[i].keysegs;

View File

@@ -65,7 +65,7 @@ int main(int argc, char **argv)
sprintf(key,"%6d",j);
bmove(record+1,key,6);
error=heap_write(file,record);
if (heap_check_heap(file))
if (heap_check_heap(file,0))
{
puts("Heap keys crashed");
goto err;
@@ -100,7 +100,7 @@ int main(int argc, char **argv)
if (! error)
deleted++;
}
if (heap_check_heap(file))
if (heap_check_heap(file,0))
{
puts("Heap keys crashed");
goto err;

View File

@@ -133,7 +133,7 @@ char *argv[];
write_count++; key1[n1]++; key3[n3]=1;
key_check+=n1;
}
if (testflag == 1 && heap_check_heap(file))
if (testflag == 1 && heap_check_heap(file,0))
{
puts("Heap keys crashed");
goto err;
@@ -141,7 +141,7 @@ char *argv[];
}
if (testflag == 1)
goto end;
if (heap_check_heap(file))
if (heap_check_heap(file,0))
{
puts("Heap keys crashed");
goto err;
@@ -173,7 +173,7 @@ char *argv[];
key1[atoi(record+keyinfo[0].seg[0].start)]--;
key3[atoi(record+keyinfo[2].seg[0].start)]=0;
key_check-=atoi(record);
if (testflag == 2 && heap_check_heap(file))
if (testflag == 2 && heap_check_heap(file,0))
{
puts("Heap keys crashed");
goto err;
@@ -183,7 +183,7 @@ char *argv[];
puts("Warning: Skipping delete test because no dupplicate keys");
}
if (testflag==2) goto end;
if (heap_check_heap(file))
if (heap_check_heap(file,0))
{
puts("Heap keys crashed");
goto err;
@@ -239,14 +239,14 @@ char *argv[];
update++;
key_check=key_check-atoi(record)+n1;
}
if (testflag == 3 && heap_check_heap(file))
if (testflag == 3 && heap_check_heap(file,0))
{
puts("Heap keys crashed");
goto err;
}
}
if (testflag == 3) goto end;
if (heap_check_heap(file))
if (heap_check_heap(file,0))
{
puts("Heap keys crashed");
goto err;
@@ -284,7 +284,7 @@ char *argv[];
goto end;
}
dupp_keys--;
if (heap_check_heap(file))
if (heap_check_heap(file,0))
{
puts("Heap keys crashed");
goto err;
@@ -320,7 +320,7 @@ char *argv[];
goto end;
}
dupp_keys-=2;
if (heap_check_heap(file))
if (heap_check_heap(file,0))
{
puts("Heap keys crashed");
goto err;
@@ -353,7 +353,7 @@ char *argv[];
printf("next: Found: %d records of %d\n",ant,write_count-delete);
goto end;
}
if (heap_check_heap(file))
if (heap_check_heap(file,0))
{
puts("Heap keys crashed");
goto err;
@@ -556,7 +556,8 @@ char *argv[];
}
pos++;
}
if (heap_check_heap(file) || heap_check_heap(file2))
printf("- Checking heap tables\n");
if (heap_check_heap(file,1) || heap_check_heap(file2,1))
{
puts("Heap keys crashed");
goto err;

View File

@@ -156,7 +156,7 @@ extern int heap_rlast(HP_INFO *info,byte *record);
extern void heap_clear(HP_INFO *info);
extern int heap_rkey(HP_INFO *info,byte *record,int inx,const byte *key);
extern gptr heap_find(HP_INFO *info,int inx,const byte *key);
extern int heap_check_heap(HP_INFO *info);
extern int heap_check_heap(HP_INFO *info, my_bool print_status);
extern byte *heap_position(HP_INFO *info);
/* The following is for programs that uses the old HEAP interface where

View File

@@ -82,7 +82,7 @@ int mrg_rrnd(MRG_INFO *info,byte *buf,mrg_off_t filepos)
}
}
info->current_table=find_table(info->open_tables,
info->end_table,filepos);
info->end_table-1,filepos);
isam_info=info->current_table->table;
isam_info->update&= HA_STATE_CHANGED;
return ((*isam_info->s->read_rnd)(isam_info,(byte*) buf,

View File

@@ -393,7 +393,7 @@ static int examine_log(my_string file_name, char **table_names)
char *pos,*to;
/* Fix if old DOS files to new format */
for (pos=file_info.name; pos=strchr(pos,'\\') ; pos++)
for (pos=file_info.name; (pos=strchr(pos,'\\')) ; pos++)
*pos= '/';
pos=file_info.name;

View File

@@ -0,0 +1,2 @@
-- require r/have_bdb.require
show variables like "have_bdb";

View File

@@ -0,0 +1,2 @@
-- require r/have_isam.require
show variables like "have_isam";

View File

@@ -17,16 +17,16 @@ else
fix_bin=.
fi
vardir=var
logdir=$vardir/log
if [ x$1 = x"-slave" ]
then
shift 1
data=var/slave-data
ldata=$fix_bin/var/slave-data
logdir=var/log
else
data=var/lib
ldata=$fix_bin/var/lib
logdir=var/log
fi
mdata=$data/mysql
@@ -45,9 +45,13 @@ hostname=`hostname` # Install this too in the user table
resolved=127.0.0.1
#create the directories
[ -d $vardir ] || mkdir $vardir
[ -d $logdir ] || mkdir $logdir
# Create database directories mysql & test
if [ -d $data ] ; then rm -rf $data ; fi
mkdir -p $data $data/mysql $data/test
mkdir $data $data/mysql $data/test
#for error messages
if [ x$BINARY_DIST = x1 ] ; then
@@ -59,9 +63,6 @@ mkdir share
ln -sf ../../sql/share share/mysql
fi
#create the directory for logs
mkdir -p $logdir
# Initialize variables
c_d="" i_d=""
c_h="" i_h=""

View File

@@ -2,6 +2,7 @@
# mysql-test-run - originally written by Matt Wagner <matt@mysql.com>
# modified by Sasha Pachev <sasha@mysql.com>
# Sligtly updated by Monty
# Cleaned up again by Matt
#++
# Access Definitions
@@ -9,6 +10,7 @@
DB=test
DBUSER=test
DBPASSWD=
VERBOSE=""
# Are we on source or binary distribution?
@@ -24,15 +26,12 @@ else
if [ -f ./mysql-test-run ] && [ -d ../sql ] ; then
SOURCE_DIST=1
else
echo "If you are using binary distribution, run me from install root as"
echo "scripts/mysql-test-run. On source distribution run me from source root"
echo "as mysql-test/mysql-test-run or from mysql-test as ./mysql-test-run"
$ECHO "If you are using binary distribution, run from install root as"
$ECHO "scripts/mysql-test-run. On source distribution run from source root"
$ECHO "as mysql-test/mysql-test-run or from mysql-test as ./mysql-test-run"
exit 1
fi
fi
#++
# Misc. Definitions
@@ -55,35 +54,32 @@ TOT_TEST=0
USERT=0
SYST=0
REALT=0
MY_TMP_DIR=$MYSQL_TEST_DIR/var/tmp
TIMEFILE="$MYSQL_TEST_DIR/var/tmp/mysqltest-time"
MYSQL_TMP_DIR=$MYSQL_TEST_DIR/var/tmp
TIMEFILE="$MYSQL_TMP_DIR/mysqltest-time"
RES_SPACE=" "
MYSQLD_SRC_DIRS="strings mysys include extra regex isam merge myisam \
myisammrg heap sql"
GCOV_MSG=/tmp/mysqld-gcov.out
GCOV_ERR=/tmp/mysqld-gcov.err
GCOV_MSG=$MYSQL_TMP_DIR/mysqld-gcov.out
GCOV_ERR=$MYSQL_TMP_DIR/mysqld-gcov.err
MASTER_RUNNING=0
SLAVE_RUNNING=0
[ -d $MY_TMP_DIR ] || mkdir -p $MY_TMP_DIR
#++
# mysqld Environment Parameters
#--
MYRUN_DIR=var/run
MYRUN_DIR=$MYSQL_TEST_DIR/var/run
MASTER_MYPORT=9306
MASTER_MYDDIR="$MYSQL_TEST_DIR/var/lib"
MASTER_MYSOCK="$MYSQL_TEST_DIR/var/tmp/mysql.sock"
MASTER_MYPID="$MYSQL_TEST_DIR/var/run/mysqld.pid"
MASTER_MYSOCK="$MYSQL_TMP_DIR/mysql.sock"
MASTER_MYPID="$MYRUN_DIR/mysqld.pid"
MASTER_MYLOG="$MYSQL_TEST_DIR/var/log/mysqld.log"
MASTER_MYERR="$MYSQL_TEST_DIR/var/log/mysqld.err"
SLAVE_MYPORT=9307
SLAVE_MYDDIR="$MYSQL_TEST_DIR/var/slave-data"
SLAVE_MYSOCK="$MYSQL_TEST_DIR/var/tmp/mysql-slave.sock"
SLAVE_MYPID="$MYSQL_TEST_DIR/var/run/mysqld-slave.pid"
SLAVE_MYSOCK="$MYSQL_TMP_DIR/mysql-slave.sock"
SLAVE_MYPID="$MYRUN_DIR/mysqld-slave.pid"
SLAVE_MYLOG="$MYSQL_TEST_DIR/var/log/mysqld-slave.log"
SLAVE_MYERR="$MYSQL_TEST_DIR/var/log/mysqld-slave.err"
@@ -93,6 +89,15 @@ else
MY_BASEDIR=$BASEDIR
fi
# Create the directories
# This should be fixed to be not be dependent on the contence of MYSQL_TMP_DIR
# or MYRUN_DIR
# (mkdir -p is not portable)
[ -d $MYSQL_TEST_DIR/var ] || mkdir $MYSQL_TEST_DIR/var
[ -d $MYSQL_TEST_DIR/var/tmp ] || mkdir $MYSQL_TEST_DIR/var/tmp
[ -d $MYSQL_TEST_DIR/var/run ] || mkdir $MYSQL_TEST_DIR/var/run
#++
# Program Definitions
#--
@@ -111,8 +116,8 @@ XARGS=`which xargs | head -1`
[ -z "$COLUMNS" ] && COLUMNS=80
E=`$EXPR $COLUMNS - 8`
#DASH72=`expr substr '________________________________________________________________________' 1 $E`
DASH72=`$ECHO '________________________________________________________________________'|$CUT -c 1-$E`
#DASH72=`expr substr '------------------------------------------------------------------------' 1 $E`
DASH72=`$ECHO '------------------------------------------------------------------------'|$CUT -c 1-$E`
# on source dist, we pick up freshly build executables
# on binary, use what is installed
@@ -125,16 +130,15 @@ else
MYSQLD="$BASEDIR/bin/mysqld"
MYSQL_TEST="$BASEDIR/bin/mysqltest"
MYSQLADMIN="$BASEDIR/bin/mysqladmin"
INSTALL_DB="../scripts/install_test_db -bin"
INSTALL_DB="./install_test_db -bin"
fi
SLAVE_MYSQLD=$MYSQLD #this will be changed later if we are doing gcov
MYSQL_TEST="$MYSQL_TEST --no-defaults --socket=$MASTER_MYSOCK --database=$DB --user=$DBUSER --password=$DBPASSWD --silent"
GDB_MASTER_INIT=/tmp/gdbinit.master
GDB_SLAVE_INIT=/tmp/gdbinit.slave
MYSQL_TEST="$MYSQL_TEST --no-defaults --socket=$MASTER_MYSOCK --database=$DB --user=$DBUSER --password=$DBPASSWD --silent -v"
GDB_MASTER_INIT=$MYSQL_TMP_DIR/gdbinit.master
GDB_SLAVE_INIT=$MYSQL_TMP_DIR/gdbinit.slave
while test $# -gt 0; do
case "$1" in
@@ -142,19 +146,29 @@ while test $# -gt 0; do
--record ) RECORD=1 ;;
--gcov )
if [ x$BINARY_DIST = x1 ] ; then
echo "Cannot do coverage test without the source - please use source dist"
$ECHO "Cannot do coverage test without the source - please use source dist"
exit 1
fi
DO_GCOV=1
;;
--gdb )
if [ x$BINARY_DIST = x1 ] ; then
echo "Note: you will get more meaningful output on a source distribution compiled with debugging option when running tests with -gdb option"
$ECHO "Note: you will get more meaningful output on a source distribution compiled with debugging option when running tests with -gdb option"
fi
DO_GDB=1
;;
--ddd )
if [ x$BINARY_DIST = x1 ] ; then
$ECHO "Note: you will get more meaningful output on a source distribution compiled with debugging option when running tests with -gdb option"
fi
DO_DDD=1
;;
--debug)
EXTRA_MASTER_MYSQLD_OPT=--debug=d:t:O,$MYSQL_TMP_DIR/master.trace
EXTRA_SLAVE_MYSQLD_OPT=--debug=d:t:O,$MYSQL_TMP_DIR/slave.trace
;;
-- ) shift; break ;;
--* ) echo "Unrecognized option: $1"; exit 1 ;;
--* ) $ECHO "Unrecognized option: $1"; exit 1 ;;
* ) break ;;
esac
shift
@@ -166,19 +180,22 @@ done
prompt_user ()
{
echo $1
$ECHO $1
read unused
}
error () {
$ECHO "Error: $1"
exit 1
}
error_is () {
$ECHO `$CAT $TIMEFILE` | $SED -e 's/.* At line \(.*\)\: \(.*\)Command .*$/ \>\> Error at line \1: \2<\</'
}
prefix_to_8() {
echo " $1" | $SED -e 's:.*\(........\)$:\1:'
$ECHO " $1" | $SED -e 's:.*\(........\)$:\1:'
}
pass_inc () {
@@ -189,13 +206,17 @@ fail_inc () {
TOT_FAIL=`$EXPR $TOT_FAIL + 1`
}
skip_inc () {
TOT_SKIP=`$EXPR $TOT_SKIP + 1`
}
total_inc () {
TOT_TEST=`$EXPR $TOT_TEST + 1`
}
report_stats () {
if [ $TOT_FAIL = 0 ]; then
$ECHO "All tests successful."
$ECHO "All $TOT_TEST tests were successful."
else
xten=`$EXPR $TOT_PASS \* 10000`
raw=`$EXPR $xten / $TOT_TEST`
@@ -203,22 +224,21 @@ report_stats () {
whole=`$PRINTF %.2s $raw`
xwhole=`$EXPR $whole \* 100`
deci=`$EXPR $raw - $xwhole`
$ECHO "Failed ${TOT_FAIL}/${TOT_TEST} tests ${whole}.${deci}% successful."
$ECHO "Failed ${TOT_FAIL}/${TOT_TEST} tests, ${whole}.${deci}% successful."
fi
}
mysql_install_db () {
echo "Removing stale files from previous run"
$ECHO "Removing Stale Files"
$RM -rf $MASTER_MYDDIR $SLAVE_MYDDIR $SLAVE_MYLOG $MASTER_MYLOG \
$SLAVE_MYERR $MASTER_MYERR
[ -d $MYRUN_DIR ] || mkdir -p $MYRUN_DIR
echo "installing master databases"
$ECHO "Installing Master Databases"
$INSTALL_DB
if [ $? != 0 ]; then
error "Could not install master test DBs"
exit 1
fi
echo "Installing slave databases"
$ECHO "Installing Slave Databases"
$INSTALL_DB -slave
if [ $? != 0 ]; then
error "Could not install slave test DBs"
@@ -244,13 +264,15 @@ gcov_collect () {
cd $MYSQL_TEST_DIR
done
$ECHO "gcov info in $GCOV_MSG, errors in $GCOV_ERR"
$ECHO "gcov info in $GCOV_MSG, errors in $GCOV_ERR"
}
start_master()
{
[ x$MASTER_RUNNING = 1 ] && return
cd $BASEDIR # for gcov
# Remove old berkeley db log files that can confuse the server
$RM -f $MASTER_MYDDIR/log.*
#start master
master_args="--no-defaults --log-bin=master-bin \
--server-id=1 \
@@ -261,10 +283,15 @@ start_master()
--pid-file=$MASTER_MYPID \
--socket=$MASTER_MYSOCK \
--log=$MASTER_MYLOG \
--language=english $EXTRA_MASTER_OPT"
if [ x$DO_GDB = x1 ]
--language=english $EXTRA_MASTER_OPT $EXTRA_MASTER_MYSQLD_OPT"
if [ x$DO_DDD = x1 ]
then
echo "set args $master_args" > $GDB_MASTER_INIT
$ECHO "set args $master_args" > $GDB_MASTER_INIT
ddd --debugger "gdb -x $GDB_MASTER_INIT" $MYSQLD &
prompt_user "Hit enter to continue after you've started the master"
elif [ x$DO_GDB = x1 ]
then
$ECHO "set args $master_args" > $GDB_MASTER_INIT
xterm -title "Master" -e gdb -x $GDB_MASTER_INIT $MYSQLD &
prompt_user "Hit enter to continue after you've started the master"
else
@@ -287,6 +314,7 @@ start_slave()
master_info=$SLAVE_MASTER_INFO
fi
$RM -f $SLAVE_MYDDIR/log.*
slave_args="--no-defaults $master_info \
--exit-info=256 \
--log-bin=slave-bin --log-slave-updates \
@@ -296,10 +324,15 @@ start_slave()
--port=$SLAVE_MYPORT \
--socket=$SLAVE_MYSOCK \
--log=$SLAVE_MYLOG \
--language=english $EXTRA_SLAVE_OPT"
if [ x$DO_GDB = x1 ]
--language=english $EXTRA_SLAVE_OPT $EXTRA_SLAVE_MYSQLD_OPT"
if [ x$DO_DDD = x1 ]
then
echo "set args $slave_args" > $GDB_SLAVE_INIT
$ECHO "set args $master_args" > $GDB_SLAVE_INIT
ddd --debugger "gdb -x $GDB_SLAVE_INIT" $MYSQLD &
prompt_user "Hit enter to continue after you've started the master"
elif [ x$DO_GDB = x1 ]
then
$ECHO "set args $slave_args" > $GDB_SLAVE_INIT
xterm -title "Slave" -e gdb -x $GDB_SLAVE_INIT $SLAVE_MYSQLD &
prompt_user "Hit enter to continue after you've started the slave"
else
@@ -309,6 +342,7 @@ start_slave()
}
mysql_start () {
$ECHO "Starting MySQL daemon"
start_master
start_slave
cd $MYSQL_TEST_DIR
@@ -321,15 +355,15 @@ stop_slave ()
then
$MYSQLADMIN --no-defaults --socket=$SLAVE_MYSOCK -u root shutdown
if [ $? != 0 ] ; then # try harder!
echo "slave not cooperating with mysqladmin, will try manual kill"
$ECHO "slave not cooperating with mysqladmin, will try manual kill"
kill `cat $SLAVE_MYPID`
sleep 2
if [ -f $SLAVE_MYPID ] ; then
echo "slave refused to die, resorting to SIGKILL murder"
$ECHO "slave refused to die, resorting to SIGKILL murder"
kill -9 `cat $SLAVE_MYPID`
$RM -f $SLAVE_MYPID
else
echo "slave responded to SIGTERM "
$ECHO "slave responded to SIGTERM "
fi
fi
SLAVE_RUNNING=0
@@ -342,15 +376,15 @@ stop_master ()
then
$MYSQLADMIN --no-defaults --socket=$MASTER_MYSOCK -u root shutdown
if [ $? != 0 ] ; then # try harder!
echo "master not cooperating with mysqladmin, will try manual kill"
$ECHO "master not cooperating with mysqladmin, will try manual kill"
kill `cat $MASTER_MYPID`
sleep 2
if [ -f $MASTER_MYPID ] ; then
echo "master refused to die, resorting to SIGKILL murder"
$ECHO "master refused to die, resorting to SIGKILL murder"
kill -9 `cat $MASTER_MYPID`
$RM -f $MASTER_MYPID
else
echo "master responded to SIGTERM "
$ECHO "master responded to SIGTERM "
fi
fi
MASTER_RUNNING=0
@@ -359,6 +393,9 @@ stop_master ()
mysql_stop ()
{
$ECHO "Ending Tests"
$ECHO "Shutting-down MySQL daemon"
$ECHO
stop_master
stop_slave
return 1
@@ -438,12 +475,12 @@ run_testcase ()
cd $MYSQL_TEST_DIR
if [ -f $tf ] ; then
$RM -f r/$tname.*.reject
$RM -f r/$tname.*reject
mytime=`$TIME -p $MYSQL_TEST -R r/$tname.result $extra_flags \
< $tf 2> $TIMEFILE`
res=$?
if [ $res != 1 ]; then
if [ $res = 0 ]; then
mytime=`$CAT $TIMEFILE | $TR '\n' '-'`
USERT=`$ECHO $mytime | $CUT -d - -f 2 | $CUT -d ' ' -f 2`
@@ -460,55 +497,67 @@ run_testcase ()
timestr="$USERT $SYST $REALT"
pname=`$ECHO "$tname "|$CUT -c 1-16`
$SETCOLOR_NORMAL && $ECHO -n "$pname $timestr"
$ECHO -n "$pname $timestr"
if [ $res = 0 ]; then
total_inc
pass_inc
$ECHO "$RES_SPACE [ pass ]"
else
if [ $res = 1 ]; then
total_inc
if [ $res != 0 ]; then
fail_inc
echo "$RES_SPACE [ fail ]"
$ECHO "failed output"
$CAT $TIMEFILE
$ECHO
$ECHO "$RES_SPACE [ fail ]"
$ECHO
error_is
$ECHO
if [ x$FORCE != x1 ] ; then
echo "Aborting, if you want to continue, re-run with --force"
$ECHO "Aborting. To continue, re-run with '--force'."
$ECHO
mysql_stop
exit 1
fi
echo "Restarting mysqld"
mysql_restart
echo "Resuming Tests"
else
pass_inc
echo "$RES_SPACE [ pass ]"
$ECHO "Resuming Tests"
$ECHO
else
pass_inc
$ECHO "$RES_SPACE [ skipped ]"
fi
fi
fi
}
######################################################################
# Main script starts here
######################################################################
[ "$DO_GCOV" -a ! -x "$GCOV" ] && error "No gcov found"
[ "$DO_GCOV" ] && gcov_prepare
echo "Installing test databases"
# Ensure that no old mysqld test servers are running
$MYSQLADMIN --no-defaults --socket=$MASTER_MYSOCK -u root -O connect_timeout=5 shutdown > /dev/null 2>&1
$MYSQLADMIN --no-defaults --socket=$SLAVE_MYSOCK -u root -O connect_timeout=5 shutdown > /dev/null 2>&1
$ECHO "Installing Test Databases"
mysql_install_db
#do not automagically start deamons if we are in gdb or running only one test
#case
if [ -z "$DO_GDB" ] && [ -z "$1" ]
if [ -z "$DO_GDB" ] && [ -z "$1" ] && [ -z "$DO_DDD" ]
then
$ECHO "Starting mysqld for Testing"
mysql_start
fi
$ECHO "Loading Standard Test Database"
$ECHO "Loading Standard Test Databases"
mysql_loadstd
$ECHO "Starting Tests for MySQL daemon"
$ECHO "Starting Tests"
$ECHO
$ECHO " TEST USER SYSTEM ELAPSED RESULT"
@@ -517,7 +566,7 @@ $ECHO $DASH72
if [ -z "$1" ] ;
then
if [ x$RECORD = x1 ]; then
echo "Will not run in record mode without a specific test case"
$ECHO "Will not run in record mode without a specific test case."
else
for tf in $TESTDIR/*.$TESTSUFFIX
do
@@ -525,27 +574,25 @@ then
done
fi
else
tf=$TESTDIR/$1.$TESTSUFFIX
tname=`$BASENAME $1 .test`
tf=$TESTDIR/$tname.$TESTSUFFIX
if [ -f $tf ] ; then
run_testcase $tf
else
echo "Test case $tf does not exist"
$ECHO "Test case $tf does not exist."
fi
fi
$ECHO $DASH72
$ECHO
$ECHO "Ending Tests for MySQL daemon"
$RM $TIMEFILE
if [ -z "$DO_GDB" ] ;
$RM -f $TIMEFILE
if [ -z "$DO_GDB" ] && [ -z "$DO_DDD" ]
then
$ECHO "Shutdown mysqld"
mysql_stop
fi
$ECHO
report_stats
$ECHO

View File

@@ -1,5 +0,0 @@
n
3
9
10
12

View File

@@ -0,0 +1,27 @@
bandID payoutID new_col
6 1 NULL
3 4 NULL
1 6 NULL
2 6 NULL
4 9 NULL
5 10 NULL
7 12 NULL
8 12 NULL
bandID payoutID new_col
1 6 NULL
2 6 NULL
3 4 NULL
4 9 NULL
5 10 NULL
6 1 NULL
7 12 NULL
8 12 NULL
Field Type Null Key Default Extra Privileges
GROUP_ID int(10) unsigned PRI 0 select,insert,update,references
LANG_ID smallint(5) unsigned PRI 0 select,insert,update,references
NAME char(80) MUL select,insert,update,references
n
3
9
10
12

View File

@@ -0,0 +1,6 @@
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
t1.i 1 7 1 1 0 0 4.0000 2.2361 ENUM('1','3','5','7') NOT NULL
t1.j 2 8 1 1 0 0 5.0000 2.2361 ENUM('2','4','6','8') NOT NULL
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
t1.i 1 7 1 1 0 0 4.0000 2.2361 ENUM('1','3','5','7') NOT NULL
t1.j 2 8 1 1 0 0 5.0000 2.2361 ENUM('2','4','6','8') NOT NULL

View File

@@ -0,0 +1,57 @@
a b
1 1
3 3
5 5
6 6
a b c
1 1 NULL
3 3 3
5 5 NULL
8 8 8
9 9 9
a b
1 1
5 5
3 3
4 4
6 6
a b c
1 1 NULL
5 5 NULL
3 3 NULL
4 4 NULL
6 6 6
skey sval
1 hello
2 hey
_rowid _rowid skey sval
1 1 1 hello
2 2 2 hey
a b
a 1
a 2
a 3
a 4
a 5
b 2
b 3
b 4
c 1
c 2
c 3
d 1
d 2
d 5
e 1
k 1
ordid ord
1 sdj
2 sdj
ordid ord
1 abc
2 abc
3 abc
1 sdj
2 sdj
3 sdj
1 zzz

404
mysql-test/r/bdb.result Normal file
View File

@@ -0,0 +1,404 @@
id code name
1 1 Tim
2 1 Monty
3 2 David
4 2 Erik
5 3 Sasha
6 3 Jeremy
7 4 Matt
id code name
2 1 Monty
3 2 David
4 2 Erik
5 3 Sasha
6 3 Jeremy
7 4 Matt
8 1 Sinisa
id code name
3 2 David
4 2 Erik
5 3 Sasha
6 3 Jeremy
7 4 Matt
8 1 Sinisa
12 1 Ralph
id parent_id level
8 102 2
9 102 2
15 102 2
id parent_id level
1001 100 0
1002 101 1
1003 101 1
1004 101 1
1005 101 1
1006 101 1
1007 101 1
1008 102 2
1009 102 2
1015 102 2
1016 103 2
1017 103 2
1018 103 2
1019 103 2
1020 103 2
1021 104 2
1022 104 2
1024 104 2
1025 105 2
1026 105 2
1027 105 2
1028 105 2
1029 105 2
1030 105 2
1031 106 2
1032 106 2
1033 106 2
1034 106 2
1035 106 2
1036 107 2
1037 107 2
1038 107 2
1040 107 2
1157 100 0
1179 105 2
1183 104 2
1193 105 2
1202 107 2
1203 107 2
id parent_id level
1001 100 0
1002 101 1
1003 101 1
1004 101 1
1005 101 1
1006 101 1
1007 101 1
1008 102 2
1010 102 2
1015 102 2
1016 103 2
1017 103 2
1018 103 2
1019 103 2
1020 103 2
1021 104 2
1023 104 2
1024 104 2
1025 105 2
1026 105 2
1027 105 2
1028 105 2
1029 105 2
1030 105 2
1031 106 2
1032 106 2
1033 106 2
1034 106 2
1035 106 2
1036 107 2
1037 107 2
1039 107 2
1041 107 2
1158 100 0
1180 105 2
1184 104 2
1194 105 2
1202 107 2
1204 107 2
id parent_id level
1008 102 2
1015 102 2
1010 102 2
table type possible_keys key key_len ref rows Extra
t1 ref level level 1 const 1 where used; Using index
table type possible_keys key key_len ref rows Extra
t1 ref level level 1 const 1 where used; Using index
table type possible_keys key key_len ref rows Extra
t1 ref level level 1 const 1 where used
level id
1 1002
1 1003
1 1004
1 1005
1 1006
1 1007
level id parent_id
1 1002 101
1 1003 101
1 1004 101
1 1005 101
1 1006 101
1 1007 101
gesuchnr benutzer_id
1 1
2 1
a
2
a b
a 1
a 2
a 3
a 4
a 5
b 2
b 3
b 4
c 1
c 2
c 3
d 1
d 2
d 5
e 1
k 1
n after rollback
n after commit
4 after commit
n after commit
4 after commit
5 after commit
n
4
5
6
afterbegin_id afterbegin_nom
1 hamdouni
afterrollback_id afterrollback_nom
afterautocommit0_id afterautocommit0_nom
2 mysql
afterrollback_id afterrollback_nom
id val
id val
pippo 12
id val
ID NAME
1 Jochen
_userid
marc@anyware.co.uk
_userid
marc@anyware.co.uk
user_id name phone ref_email detail
10292 sanjeev 29153373 sansh777@hotmail.com xxx
10292 shirish 2333604 shirish@yahoo.com ddsds
10292 sonali 323232 sonali@bolly.com filmstar
user_id name phone ref_email detail
10292 sanjeev 29153373 sansh777@hotmail.com xxx
10292 shirish 2333604 shirish@yahoo.com ddsds
10292 sonali 323232 sonali@bolly.com filmstar
user_id name phone ref_email detail
10292 sanjeev 29153373 sansh777@hotmail.com xxx
10292 shirish 2333604 shirish@yahoo.com ddsds
10292 sonali 323232 sonali@bolly.com filmstar
10293 shirish 2333604 shirish@yahoo.com ddsds
user_id name phone ref_email detail
10293 shirish 2333604 shirish@yahoo.com ddsds
user_id name phone ref_email detail
10291 sanjeev 29153373 sansh777@hotmail.com xxx
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Comment
t1 0 PRIMARY 1 a A NULL NULL NULL
t1 0 PRIMARY 2 b A 0 NULL NULL
t1 0 b 1 b A 0 NULL NULL
t1 0 c 1 c A 0 NULL NULL
t1 1 a 1 a A NULL NULL NULL
t1 1 a_2 1 a A NULL NULL NULL
col1 col2
1 1
2 3
3 4
4 4
5 2
col1 col2
1 1
2 3
3 4
4 7
5 2
col1 col2 co3
1 1 0
2 3 0
3 4 0
4 7 0
5 2 0
col1 col2 co3
1 1 0
2 9 0
3 4 0
4 7 0
5 2 0
a b
1 3
2 3
3 3
a b
1 3
2 3
3 3
a b
a b
1 3
2 3
3 3
a b
1 3
2 3
3 3
id ggid email passwd
1 test1 xxx
id ggid email passwd
1 test1 xxx
id ggid email passwd
2 test2 yyy
user_name password subscribed user_id quota weight access_date access_time approved dummy_primary_key
user_0 somepassword N 0 0 0 2000-09-07 23:06:59 2000-09-07 23:06:59 1
user_1 somepassword Y 1 1 1 2000-09-07 23:06:59 2000-09-07 23:06:59 2
user_2 somepassword N 2 2 1.4142135623731 2000-09-07 23:06:59 2000-09-07 23:06:59 3
user_3 somepassword Y 3 3 1.7320508075689 2000-09-07 23:06:59 2000-09-07 23:06:59 4
user_4 somepassword N 4 4 2 2000-09-07 23:06:59 2000-09-07 23:06:59 5
id parent_id level
8 102 2
9 102 2
15 102 2
id parent_id level
1001 100 0
1003 101 1
1004 101 1
1008 102 2
1024 102 2
1017 103 2
1022 104 2
1024 104 2
1028 105 2
1029 105 2
1030 105 2
1031 106 2
1032 106 2
1033 106 2
1203 107 2
1202 107 2
1020 103 2
1157 100 0
1193 105 2
1040 107 2
1002 101 1
1015 102 2
1006 101 1
1034 106 2
1035 106 2
1016 103 2
1007 101 1
1036 107 2
1018 103 2
1026 105 2
1027 105 2
1183 104 2
1038 107 2
1025 105 2
1037 107 2
1021 104 2
1019 103 2
1005 101 1
1179 105 2
id parent_id level
1002 100 0
1004 101 1
1005 101 1
1009 102 2
1025 102 2
1018 103 2
1023 104 2
1025 104 2
1029 105 2
1030 105 2
1031 105 2
1032 106 2
1033 106 2
1034 106 2
1204 107 2
1203 107 2
1021 103 2
1158 100 0
1194 105 2
1041 107 2
1003 101 1
1016 102 2
1007 101 1
1035 106 2
1036 106 2
1017 103 2
1008 101 1
1037 107 2
1019 103 2
1027 105 2
1028 105 2
1184 104 2
1039 107 2
1026 105 2
1038 107 2
1022 104 2
1020 103 2
1006 101 1
1180 105 2
id parent_id level
1009 102 2
1025 102 2
1016 102 2
table type possible_keys key key_len ref rows Extra
t1 ref level level 1 const 1 where used; Using index
level id
1 1004
1 1005
1 1003
1 1007
1 1008
1 1006
level id parent_id
1 1004 101
1 1005 101
1 1003 101
1 1007 101
1 1008 101
1 1006 101
level id
1 1003
1 1004
1 1005
1 1006
1 1007
1 1008
id parent_id level
1002 100 0
1009 102 2
1025 102 2
1018 103 2
1023 104 2
1025 104 2
1029 105 2
1030 105 2
1031 105 2
1032 106 2
1033 106 2
1034 106 2
1204 107 2
1203 107 2
1021 103 2
1158 100 0
1194 105 2
1041 107 2
1016 102 2
1035 106 2
1036 106 2
1017 103 2
1037 107 2
1019 103 2
1027 105 2
1028 105 2
1184 104 2
1039 107 2
1026 105 2
1038 107 2
1022 104 2
1020 103 2
1180 105 2
count(*)
1

View File

@@ -0,0 +1,13 @@
0 256 00000000000000065536 2147483647 -2147483648 2147483648 +4294967296
0 256 65536 2147483647 -2147483648 2147483648 4294967296
922337203685477580 92233720368547758000
922337203685477580 92233720368547758080
-922337203685477580 -92233720368547758000
-922337203685477580 -92233720368547758080
9223372036854775807 -009223372036854775808
9223372036854775807 -9223372036854775808
+9999999999999999999 -9999999999999999999
10000000000000000000 -10000000000000000000
a
18446744073709551615
18446744073709551615

View File

@@ -0,0 +1,33 @@
name
<EFBFBD>
<EFBFBD>
<EFBFBD>
concat("*",name,"*")
*<2A>*
*<2A>*
*<2A>*
min(name) min(concat("*",name,"*")) max(name) max(concat("*",name,"*"))
<EFBFBD> *<2A>* <09> *<2A>*
name
<EFBFBD>
<EFBFBD>
<EFBFBD>
concat("*",name,"*")
*<2A>*
*<2A>*
*<2A>*
min(name) min(concat("*",name,"*")) max(name) max(concat("*",name,"*"))
<EFBFBD> *<2A>* <09> *<2A>*
name
<EFBFBD>
<EFBFBD>
name
<EFBFBD>
<EFBFBD>
<EFBFBD>
name
a b
hello hello
a b
a b
hello hello

34
mysql-test/r/case.result Normal file
View File

@@ -0,0 +1,34 @@
CASE "b" when "a" then 1 when "b" then 2 END
2
CASE "c" when "a" then 1 when "b" then 2 END
NULL
CASE "c" when "a" then 1 when "b" then 2 ELSE 3 END
3
CASE BINARY "b" when "a" then 1 when "B" then 2 WHEN "b" then "ok" END
ok
CASE "b" when "a" then 1 when binary "B" then 2 WHEN "b" then "ok" END
ok
CASE concat("a","b") when concat("ab","") then "a" when "b" then "b" end
a
CASE when 1=0 then "true" else "false" END
false
CASE 1 when 1 then "one" WHEN 2 then "two" ELSE "more" END
one
CASE 2.0 when 1 then "one" WHEN 2.0 then "two" ELSE "more" END
two
(CASE "two" when "one" then "1" WHEN "two" then "2" END) | 0
2
(CASE "two" when "one" then 1.00 WHEN "two" then 2.00 END) +0.0
2.00
case 1/0 when "a" then "true" else "false" END
false
case 1/0 when "a" then "true" END
NULL
(case 1/0 when "a" then "true" END) | 0
NULL
(case 1/0 when "a" then "true" END) + 0.0
NULL
case when 1>0 then "TRUE" else "FALSE" END
TRUE
case when 1<0 then "TRUE" else "FALSE" END
FALSE

View File

@@ -0,0 +1,15 @@
1+2/*hello*/+3
6
1
1
1 /*!32301 +1
2
1
1
1--1
2
1 --2
+1
4
1
1

View File

@@ -0,0 +1,6 @@
table type possible_keys key key_len ref rows Extra
t1 index PRIMARY PRIMARY 12 NULL 2 where used; Using index
id
000000000001
id
000000000001

View File

@@ -0,0 +1,9 @@
isbn city libname a
007 Berkeley Berkeley Public1 1
007 Berkeley Berkeley Public2 1
000 New York New York Public Libra 6
001 New York NYC Lib 1
006 San Fran San Fransisco Public 1
isbn city libname a
007 Berkeley Berkeley Public1 2
000 New York New York Public Libra 2

View File

@@ -0,0 +1,10 @@
b
NULL
b
1a20 1e+ 1e+10
1 10000000001
a$1 $b c$
1 2 3

View File

@@ -1,2 +0,0 @@
encrypt('foo', 'ff')
ffTU0fyIP09Z.

View File

@@ -0,0 +1,5 @@
a tmsp
a tmsp
5 19711006010203
6 19711006010203
8 19711006010203

View File

@@ -0,0 +1,155 @@
id
NULL
-1
0
1
2
3
4
5
6
7
8
9
10
id facility
NULL NULL
-1
0
1 /L
2 A01
3 ANC
4 F01
5 FBX
6 MT
7 P
8 RV
9 SRV
10 VMT
id-5 facility
NULL NULL
-6
-5
-4 /L
-3 A01
-2 ANC
-1 F01
0 FBX
1 MT
2 P
3 RV
4 SRV
5 VMT
id concat(facility)
NULL NULL
-1
0
1 /L
2 A01
3 ANC
4 F01
5 FBX
6 MT
7 P
8 RV
9 SRV
10 VMT
a max(id) b
10 10 VMT
9 9 SRV
8 8 RV
7 7 P
6 6 MT
5 5 FBX
4 4 F01
3 3 ANC
2 2 A01
1 1 /L
-1 -1
0 0
NULL NULL NULL
grp count(*)
0 7
1 6
FACILITY
NULL
/L
A01
ANC
F01
FBX
MT
P
RV
SRV
VMT
FACILITY
NULL
/L
A01
ANC
F01
FBX
MT
P
RV
SRV
VMT
count(*)
12
count(facility)
12
count(*)
13
count(*)
1
count(*)
0
count(*)
12
count(*)
1
count(*)
12
UserId
UserId
UserId
UserId
b
1
table type possible_keys key key_len ref rows Extra
t3 index a a 4 NULL 6 Using index; Using temporary
t2 index a a 4 NULL 5 Using index; Distinct
t1 eq_ref PRIMARY PRIMARY 4 t2.a 1 where used; Distinct
a
1
table type possible_keys key key_len ref rows Extra
t1 index PRIMARY PRIMARY 4 NULL 2 Using index; Using temporary
t3 ref a a 5 t1.a 12 Using index; Distinct
a
1
2
1
1
name
aa
ab
name
aa
ab
1
1
key_link_id link
NULL NULL
table type possible_keys key key_len ref rows Extra
t1 index id id 4 NULL 2 Using index; Using temporary
t2 index id id 8 NULL 1 Using index; Distinct
t3 index id id 8 NULL 1 Using index; Distinct
j_lj_t2 index id id 4 NULL 2 where used; Using index; Distinct
t2_lj index id id 8 NULL 1 where used; Using index; Distinct
j_lj_t3 index id id 4 NULL 2 where used; Using index; Distinct
t3_lj index id id 8 NULL 1 where used; Using index; Distinct
id
2

View File

@@ -0,0 +1,4 @@
count(*)
0
nr b str
nr b str

View File

@@ -1,15 +0,0 @@
0<=>0 0.0<=>0.0 "A"<=>"A" NULL<=>NULL
1 1 1 1
1<=>0 0<=>NULL NULL<=>0
0 0 0
1.0<=>0.0 0.0<=>NULL NULL<=>0.0
0 0 0
"A"<=>"B" "A"<=>NULL NULL<=>"A"
0 0 0
id value id value t1.value<=>t2.value
1 NULL 1 NULL 1
id value
1 NULL
id value
1 NULL
id value

View File

@@ -0,0 +1,15 @@
id str
1 NULL
2 NULL
id str
3 foo
table type possible_keys key key_len ref rows Extra
t1 ref str str 11 const 1 where used
table type possible_keys key key_len ref rows Extra
t1 const str str 11 const 1
table type possible_keys key key_len ref rows Extra
t1 ALL str NULL NULL NULL 4 where used
table type possible_keys key key_len ref rows Extra
t1 const str str 11 const 1
Comment
No tables used

View File

@@ -1,3 +1,3 @@
a MATCH (message) AGAINST ('steve')
4 0.90587321329654
7 0.89568988462614
a MATCH (message) AGAINST ('steve')
4 0.90587321329654
7 0.89568988462614

View File

@@ -1,3 +1,3 @@
a MATCH (message) AGAINST ('steve')
4 0.90587321329654
7 0.89568988462614
a MATCH (message) AGAINST ('steve')
4 0.90587321329654
7 0.89568988462614

View File

@@ -1,3 +1,3 @@
a MATCH (message) AGAINST ('steve')
7 0.89568988462614
4 0.90587321329654
a MATCH (message) AGAINST ('steve')
7 0.89568988462614
4 0.90587321329654

View File

@@ -1,2 +1,2 @@
a MATCH (message) AGAINST ('steve')
7 0.89568988462614
a MATCH (message) AGAINST ('steve')
7 0.89568988462614

View File

@@ -1,8 +1,8 @@
a rel
1 0
2 0
3 0
5 0
6 0
7 0.89568988462614
4 0.90587321329654
a rel
1 0
2 0
3 0
5 0
6 0
7 0.89568988462614
4 0.90587321329654

View File

@@ -1,4 +1,4 @@
a MATCH b AGAINST ('lala lkjh')
1 0.67003110026735
2 0
3 0
a MATCH b AGAINST ('lala lkjh')
1 0.67003110026735
2 0
3 0

View File

@@ -1,4 +1,4 @@
a MATCH c AGAINST ('lala lkjh')
1 0
2 0.67756324121582
3 0
a MATCH c AGAINST ('lala lkjh')
1 0
2 0.67756324121582
3 0

View File

@@ -1,4 +1,4 @@
a MATCH b,c AGAINST ('lala lkjh')
1 0.64840710366884
2 0.66266459031789
3 0
a MATCH b,c AGAINST ('lala lkjh')
1 0.64840710366884
2 0.66266459031789
3 0

View File

@@ -0,0 +1,8 @@
a b
Only MyISAM tables support collections
Full-text indexes are called collections
a b
Full-text indexes are called collections
a b
Full-text indexes are called collections
Only MyISAM tables support collections

View File

@@ -0,0 +1,2 @@
encrypt('foo', 'ff')
ffTU0fyIP09Z.

View File

@@ -0,0 +1,12 @@
visitor_id mts
48985536 20000319013932
173865424 20000318233615
357917728 20000319145027
465931136 20000318160953
1092858576 20000319013445
visitor_id mts
48985536 20000319013932
173865424 20000318233615
357917728 20000319145027
465931136 20000318160953
1092858576 20000319013445

View File

@@ -0,0 +1,15 @@
0<=>0 0.0<=>0.0 "A"<=>"A" NULL<=>NULL
1 1 1 1
1<=>0 0<=>NULL NULL<=>0
0 0 0
1.0<=>0.0 0.0<=>NULL NULL<=>0.0
0 0 0
"A"<=>"B" "A"<=>NULL NULL<=>"A"
0 0 0
id value id value t1.value<=>t2.value
1 NULL 1 NULL 1
id value
1 NULL
id value
1 NULL
id value

View File

@@ -0,0 +1,86 @@
a c sum(a)
1 a 1
2 b 2
3 c 3
4 E 4
5 C 5
6 D 6
a c sum(a)
sum(a)
NULL
a
1
3
6
5
2
4
a
1
3
6
5
2
4
count(distinct a) count(distinct grp)
6 3
count(distinct a) count(distinct grp)
6 3
sum(a) count(a) avg(a) std(a) bit_or(a) bit_and(a) min(a) max(a) min(c) max(c)
21 6 3.5000 1.7078 7 0 1 6 E
grp sum(a) count(a) avg(a) std(a) bit_or(a) bit_and(a) min(a) max(a) min(c) max(c)
NULL 0 0 NULL NULL 0 0 NULL NULL
1 1 1 1.0000 0.0000 1 1 1 1 a a
2 5 2 2.5000 0.5000 3 2 2 3 b c
3 15 3 5.0000 0.8165 7 4 4 6 C E
grp sum
NULL NULL
1 7
2 20
3 44.816496580928
grp a c
NULL NULL
1 2 a
2 5 c
3 9 E
2 3 c
id avg(value1) std(value1)
1 1.000000 0.816497
2 11.000000 0.816497
name avg(value1) std(value1)
Set One 1.000000 0.816497
Set Two 11.000000 0.816497
id avg(rating)
1 3.0000
2 NULL
3 2.0000
count(*)
3
count(*)
1
count(*)
0
count(*)
0
count(a)
1
count(a)
0
count(a)
0
count(b)
2
count(b)
0
count(c)
0
COUNT(i) i COUNT(i)*i
1 1 1
COUNT(i) (i+0) COUNT(i)*(i+0)
1 1 1
sum(num)
147.58
sum(num)
50.15
45.63
51.80

View File

@@ -0,0 +1,14 @@
field
field
A
field
A
field
A
NULL
field
NULL
id
2
5
9

View File

@@ -0,0 +1,7 @@
a
abc
abcd
a
test
a
test

View File

@@ -0,0 +1,22 @@
floor(5.5) floor(-5.5)
5 -6
ceiling(5.5) ceiling(-5.5)
6 -5
truncate(52.64,1) truncate(52.64,2) truncate(52.64,-1) truncate(52.64,-2)
52.6 52.64 50 0
round(5.5) round(-5.5)
6 -6
round(5.64,1) round(5.64,2) round(5.64,-1) round(5.64,-2)
5.6 5.64 10 0
abs(-10) sign(-5) sign(5) sign(0)
10 -1 1 0
log(exp(10)) exp(log(sqrt(10))*2)
10.000000 10.000000
pow(10,log10(10)) power(2,4)
10.000000 16.000000
rand(999999) rand()
0.18435012473199 0.76373626176616
PI() sin(pi()/2) cos(pi()/2) tan(pi()) cot(1) asin(1) acos(0) atan(1)
3.141593 1.000000 0.000000 -0.000000 0.64209262 1.570796 1.570796 0.785398
degrees(pi()) radians(360)
180 6.2831853071796

View File

@@ -0,0 +1,8 @@
format(1.5555,0) format(123.5555,1) format(1234.5555,2) format(12345.5555,3) format(123456.5555,4) format(1234567.5555,5) format("12345.2399",2)
2 123.6 1,234.56 12,345.556 123,456.5555 1,234,567.55550 12,345.24
inet_ntoa(inet_aton("255.255.255.255.255.255.255.255"))
255.255.255.255.255.255.255.255
inet_aton("255.255.255.255.255") inet_aton("255.255.1.255") inet_aton("0.1.255")
1099511627775 4294902271 511
inet_ntoa(1099511627775) inet_ntoa(4294902271) inet_ntoa(511)
255.255.255.255.255 255.255.1.255 0.0.1.255

View File

@@ -0,0 +1,6 @@
1+1 1-1 1+1*2 8/5 8%5 mod(8,5) mod(8,5)|0 -(1+1)*-2
2 0 3 1.60 3 3 3 4
1 | (1+1) 5 & 3 bit_count(7)
3 1 3
1 << 32 1 << 63 1 << 64 4 >> 2 4 >> 63 1<< 63 >> 60
4294967296 -9223372036854775808 0 1 0 8

View File

@@ -0,0 +1,15 @@
s1 regexp s2
1
1
1
1
1
1
1
0
0
0
NULL
NULL
NULL
NULL

View File

@@ -0,0 +1,18 @@
interval(55,10,20,30,40,50,60,70,80,90,100) interval(3,1,1+1,1+1+1+1) field("IBM","NCA","ICL","SUN","IBM","DIGITAL") field("A","B","C") elt(2,"ONE","TWO","THREE") interval(0,1,2,3,4) elt(1,1,2,3)|0 elt(1,1.1,1.2,1.3)+0
5 2 4 0 TWO 0 1 1.1
find_in_set("b","a,b,c") find_in_set("c","a,b,c") find_in_set("dd","a,bbb,dd") find_in_set("bbb","a,bbb,dd")
2 3 3 2
find_in_set("d","a,b,c") find_in_set("dd","a,bbb,d") find_in_set("bb","a,bbb,dd")
0 0 0
make_set(0,'a','b','c') make_set(-1,'a','b','c') make_set(1,'a','b','c') make_set(2,'a','b','c') make_set(1+2,concat('a','b'),'c')
a,b,c a b ab,c
make_set(NULL,'a','b','c') make_set(1|4,'a',NULL,'c') make_set(1+2,'a',NULL,'c')
NULL a,c a
export_set(9,"Y","N","-",5) export_set(9,"Y","N") export_set(9,"Y","N","")
Y-N-N-Y-N Y,N,N,Y,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N YNNYNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
elt(2,1) field(NULL,"a","b","c")
NULL 0
find_in_set("","a,b,c") find_in_set("","a,b,c,") find_in_set("",",a,b,c")
0 4 1
find_in_set("abc","abc") find_in_set("ab","abc") find_in_set("abcd","abc")
1 0 0

View File

@@ -60,3 +60,40 @@ rpad('abcd',1,'ab') lpad('abcd',1,'ab')
a a
LEAST(NULL,'HARRY','HARRIOT',NULL,'HAROLD') GREATEST(NULL,'HARRY','HARRIOT',NULL,'HAROLD')
HAROLD HARRY
least(1,2,3) | greatest(16,32,8) least(5,4)*1 greatest(-1.0,1.0)*1 least(3,2,1)*1.0 greatest(1,1.1,1.0) least("10",9) greatest("A","B","0")
33 4 1.0 1.0 1.1 9 B
decode(encode(repeat("a",100000),"monty"),"monty")=repeat("a",100000)
1
decode(encode("abcdef","monty"),"monty")="abcdef"
1
reverse("")
insert("aa",100,1,"b") insert("aa",1,3,"b") left("aa",-1) substring("a",1,2)
aa b a
elt(2,1) field(NULL,"a","b","c") reverse("")
NULL 0
locate("a","b",2) locate("","a",1)
0 1
ltrim("a") rtrim("a") trim(BOTH "" from "a") trim(BOTH " " from "a")
a a a a
concat("1","2")|0 concat("1",".5")+0.0
12 1.5
substring_index("www.tcx.se","",3)
length(repeat("a",100000000)) length(repeat("a",1000*64))
NULL 64000
position("0" in "baaa" in (1)) position("0" in "1" in (1,2,3)) position("sql" in ("mysql"))
1 0 3
position(("1" in (1,2,3)) in "01")
2
length(repeat("a",65500)) length(concat(repeat("a",32000),repeat("a",32000))) length(replace("aaaaa","a",concat(repeat("a",10000)))) length(insert(repeat("a",40000),1,30000,repeat("b",50000)))
65500 64000 50000 60000
length(repeat("a",1000000)) length(concat(repeat("a",32000),repeat("a",32000),repeat("a",32000))) length(replace("aaaaa","a",concat(repeat("a",32000)))) length(insert(repeat("a",48000),1,1000,repeat("a",48000)))
1000000 96000 160000 95000
Date Unix
1998-9-16 09:26:00 905927160
1998-9-16 09:26:00 905927160
domain
hello.de
domain
test.de

View File

@@ -0,0 +1,4 @@
database() user()
test test@localhost
version()>="3.23.29"
1

View File

@@ -0,0 +1,36 @@
0=0 1>0 1>=1 1<0 1<=0 1!=0 strcmp("abc","abcd") strcmp("b","a") strcmp("a","a")
1 1 1 0 0 1 -1 1 0
"a"<"b" "a"<="b" "b">="a" "b">"a" "a"="A" "a"<>"b"
1 1 1 1 1 1
"a "="A" "A "="a" "a " <= "A b"
1 1 1
"abc" like "a%" "abc" not like "%d%" "a%" like "a\%" "abc%" like "a%\%" "abcd" like "a%b_%d" "a" like "%%a" "abcde" like "a%_e" "abc" like "abc%"
1 1 1 1 1 1 1 1
"a" like "%%b" "a" like "%%ab" "ab" like "a\%" "ab" like "_" "ab" like "ab_" "abc" like "%_d" "abc" like "abc%d"
0 0 0 0 0 0 0
'?' like '|%' '?' like '|%' ESCAPE '|' '%' like '|%' '%' like '|%' ESCAPE '|' '%' like '%'
0 0 0 1 1
'abc' like '%c' 'abcabc' like '%c' "ab" like "" "ab" like "a" "ab" like "ab"
1 1 0 0 1
"Det h<>r <20>r svenska" regexp "h[[:alpha:]]+r" "aba" regexp "^(a|b)*$"
1 1
"aba" regexp concat("^","a")
1
!0 NOT 0=1 !(0=0) 1 AND 1 1 && 0 0 OR 1 1 || NULL 1=1 or 1=1 and 1=0
1 1 0 1 0 1 1 1
IF(0,"ERROR","this") IF(1,"is","ERROR") IF(NULL,"ERROR","a") IF(1,2,3)|0 IF(1,2.0,3.0)+0
this is a 2 2.0
2 between 1 and 3 "monty" between "max" and "my" 2=2 and "monty" between "max" and "my" and 3=3
1 1 1
'b' between 'a' and 'c' 'B' between 'a' and 'c'
1 1
2 in (3,2,5,9,5,1) "monty" in ("david","monty","allan") 1.2 in (1.4,1.2,1.0)
1 1 1
-1.49 or -1.49 0.6 or 0.6
1 1
5 between 0 and 10 between 0 and 1 (5 between 0 and 10) between 0 and 1
0 1
1 and 2 between 2 and 10 2 between 2 and 10 and 1
1 1
1 and 0 or 2 2 or 1 and 0
1 1

View File

@@ -0,0 +1,186 @@
from_days(to_days("960101")) to_days(960201)-to_days("19960101") to_days(date_add(curdate(), interval 1 day))-to_days(curdate()) weekday("1997-11-29")
1996-01-01 31 1 5
period_add("9602",-12) period_diff(199505,"9404")
199502 13
now()-now() weekday(curdate())-weekday(now()) unix_timestamp()-unix_timestamp(now())
0 0 0
from_unixtime(unix_timestamp("1994-03-02 10:11:12")) from_unixtime(unix_timestamp("1994-03-02 10:11:12"),"%Y-%m-%d %h:%i:%s") from_unixtime(unix_timestamp("1994-03-02 10:11:12"))+0
1994-03-02 10:11:12 1994-03-02 10:11:12 19940302101112
sec_to_time(9001) sec_to_time(9001)+0 time_to_sec("15:12:22")
02:30:01 23001 54742
now()-curdate()*1000000-curtime()
0
strcmp(current_timestamp(),concat(current_date()," ",current_time()))
0
date_format("1997-01-02 03:04:05", "%M %W %D %Y %y %m %d %h %i %s %w")
January Thursday 2nd 1997 97 01 02 03 04 05 4
date_format("1997-01-02", concat("%M %W %D ","%Y %y %m %d %h %i %s %w"))
January Thursday 2nd 1997 97 01 02 12 00 00 4
dayofmonth("1997-01-02") dayofmonth(19970323)
2 23
month("1997-01-02") year("98-02-03") dayofyear("1997-12-31")
1 1998 365
DAYOFYEAR("1997-03-03") WEEK("1998-03-03") QUARTER(980303)
62 9 1
HOUR("1997-03-03 23:03:22") MINUTE("23:03:22") SECOND(230322)
23 3 22
week(19980101) week(19970101) week(19980101,1) week(19970101,1)
0 1 1 1
week(19981231) week(19971231) week(19981231,1) week(19971231,1)
52 53 53 53
week(19950101) week(19950101,1)
1 0
yearweek('1981-12-31',1) yearweek('1982-01-01',1) yearweek('1982-12-31',1) yearweek('1983-01-01',1)
198153 198153 198252 198252
date_format('1998-12-31','%x-%v') date_format('1999-01-01','%x-%v')
1998-53 1998-53
date_format('1999-12-31','%x-%v') date_format('2000-01-01','%x-%v')
1999-52 1999-52
yearweek('1987-01-01',1) yearweek('1987-01-01')
198701 198653
dayname("1962-03-03") dayname("1962-03-03")+0
Saturday 5
monthname("1972-03-04") monthname("1972-03-04")+0
March 3
time_format(19980131000000,'%H|%I|%k|%l|%i|%p|%r|%S|%T')
00|12|0|12|00|AM|12:00:00 AM|00|00:00:00
time_format(19980131010203,'%H|%I|%k|%l|%i|%p|%r|%S|%T')
01|01|1|1|02|AM|01:02:03 AM|03|01:02:03
time_format(19980131131415,'%H|%I|%k|%l|%i|%p|%r|%S|%T')
13|01|13|1|14|PM|01:14:15 PM|15|13:14:15
time_format(19980131010015,'%H|%I|%k|%l|%i|%p|%r|%S|%T')
01|01|1|1|00|AM|01:00:15 AM|15|01:00:15
date_format(concat('19980131',131415),'%H|%I|%k|%l|%i|%p|%r|%S|%T| %M|%W|%D|%Y|%y|%a|%b|%j|%m|%d|%h|%s|%w')
13|01|13|1|14|PM|01:14:15 PM|15|13:14:15| January|Saturday|31st|1998|98|Sat|Jan|031|01|31|01|15|6
date_format(19980021000000,'%H|%I|%k|%l|%i|%p|%r|%S|%T| %M|%W|%D|%Y|%y|%a|%b|%j|%m|%d|%h|%s|%w')
NULL
date_add("1997-12-31 23:59:59",INTERVAL 1 SECOND)
1998-01-01 00:00:00
date_add("1997-12-31 23:59:59",INTERVAL 1 MINUTE)
1998-01-01 00:00:59
date_add("1997-12-31 23:59:59",INTERVAL 1 HOUR)
1998-01-01 00:59:59
date_add("1997-12-31 23:59:59",INTERVAL 1 DAY)
1998-01-01 23:59:59
date_add("1997-12-31 23:59:59",INTERVAL 1 MONTH)
1998-01-31 23:59:59
date_add("1997-12-31 23:59:59",INTERVAL 1 YEAR)
1998-12-31 23:59:59
date_add("1997-12-31 23:59:59",INTERVAL "1:1" MINUTE_SECOND)
1998-01-01 00:01:00
date_add("1997-12-31 23:59:59",INTERVAL "1:1" HOUR_MINUTE)
1998-01-01 01:00:59
date_add("1997-12-31 23:59:59",INTERVAL "1:1" DAY_HOUR)
1998-01-02 00:59:59
date_add("1997-12-31 23:59:59",INTERVAL "1 1" YEAR_MONTH)
1999-01-31 23:59:59
date_add("1997-12-31 23:59:59",INTERVAL "1:1:1" HOUR_SECOND)
1998-01-01 01:01:00
date_add("1997-12-31 23:59:59",INTERVAL "1 1:1" DAY_MINUTE)
1998-01-02 01:00:59
date_add("1997-12-31 23:59:59",INTERVAL "1 1:1:1" DAY_SECOND)
1998-01-02 01:01:00
date_sub("1998-01-01 00:00:00",INTERVAL 1 SECOND)
1997-12-31 23:59:59
date_sub("1998-01-01 00:00:00",INTERVAL 1 MINUTE)
1997-12-31 23:59:00
date_sub("1998-01-01 00:00:00",INTERVAL 1 HOUR)
1997-12-31 23:00:00
date_sub("1998-01-01 00:00:00",INTERVAL 1 DAY)
1997-12-31 00:00:00
date_sub("1998-01-01 00:00:00",INTERVAL 1 MONTH)
1997-12-01 00:00:00
date_sub("1998-01-01 00:00:00",INTERVAL 1 YEAR)
1997-01-01 00:00:00
date_sub("1998-01-01 00:00:00",INTERVAL "1:1" MINUTE_SECOND)
1997-12-31 23:58:59
date_sub("1998-01-01 00:00:00",INTERVAL "1:1" HOUR_MINUTE)
1997-12-31 22:59:00
date_sub("1998-01-01 00:00:00",INTERVAL "1:1" DAY_HOUR)
1997-12-30 23:00:00
date_sub("1998-01-01 00:00:00",INTERVAL "1 1" YEAR_MONTH)
1996-12-01 00:00:00
date_sub("1998-01-01 00:00:00",INTERVAL "1:1:1" HOUR_SECOND)
1997-12-31 22:58:59
date_sub("1998-01-01 00:00:00",INTERVAL "1 1:1" DAY_MINUTE)
1997-12-30 22:59:00
date_sub("1998-01-01 00:00:00",INTERVAL "1 1:1:1" DAY_SECOND)
1997-12-30 22:58:59
date_add("1997-12-31 23:59:59",INTERVAL 100000 SECOND)
1998-01-02 03:46:39
date_add("1997-12-31 23:59:59",INTERVAL -100000 MINUTE)
1997-10-23 13:19:59
date_add("1997-12-31 23:59:59",INTERVAL 100000 HOUR)
2009-05-29 15:59:59
date_add("1997-12-31 23:59:59",INTERVAL -100000 DAY)
1724-03-17 23:59:59
date_add("1997-12-31 23:59:59",INTERVAL 100000 MONTH)
NULL
date_add("1997-12-31 23:59:59",INTERVAL -100000 YEAR)
NULL
date_add("1997-12-31 23:59:59",INTERVAL "10000:1" MINUTE_SECOND)
1998-01-07 22:40:00
date_add("1997-12-31 23:59:59",INTERVAL "-10000:1" HOUR_MINUTE)
1996-11-10 07:58:59
date_add("1997-12-31 23:59:59",INTERVAL "10000:1" DAY_HOUR)
2025-05-19 00:59:59
date_add("1997-12-31 23:59:59",INTERVAL "-100 1" YEAR_MONTH)
1897-11-30 23:59:59
date_add("1997-12-31 23:59:59",INTERVAL "10000:99:99" HOUR_SECOND)
1999-02-21 17:40:38
date_add("1997-12-31 23:59:59",INTERVAL " -10000 99:99" DAY_MINUTE)
1970-08-11 19:20:59
date_add("1997-12-31 23:59:59",INTERVAL "10000 99:99:99" DAY_SECOND)
2025-05-23 04:40:38
"1997-12-31 23:59:59" + INTERVAL 1 SECOND
1998-01-01 00:00:00
INTERVAL 1 DAY + "1997-12-31"
1998-01-01
"1998-01-01 00:00:00" - INTERVAL 1 SECOND
1997-12-31 23:59:59
date_sub("1998-01-02",INTERVAL 31 DAY)
1997-12-02
date_add("1997-12-31",INTERVAL 1 SECOND)
1997-12-31 00:00:01
date_add("1997-12-31",INTERVAL 1 DAY)
1998-01-01
date_add(NULL,INTERVAL 100000 SECOND)
NULL
date_add("1997-12-31 23:59:59",INTERVAL NULL SECOND)
NULL
date_add("1997-12-31 23:59:59",INTERVAL NULL MINUTE_SECOND)
NULL
date_add("9999-12-31 23:59:59",INTERVAL 1 SECOND)
NULL
date_sub("0000-00-00 00:00:00",INTERVAL 1 SECOND)
NULL
date_add('1998-01-30',Interval 1 month)
1998-02-28
date_add('1998-01-30',Interval '2:1' year_month)
2000-02-29
date_add('1996-02-29',Interval '1' year)
1997-02-28
extract(YEAR FROM "1999-01-02 10:11:12")
1999
extract(YEAR_MONTH FROM "1999-01-02")
199901
extract(DAY FROM "1999-01-02")
2
extract(DAY_HOUR FROM "1999-01-02 10:11:12")
210
extract(DAY_MINUTE FROM "02 10:11:12")
21011
extract(DAY_SECOND FROM "225 10:11:12")
225101112
extract(HOUR FROM "1999-01-02 10:11:12")
10
extract(HOUR_MINUTE FROM "10:11:12")
1011
extract(HOUR_SECOND FROM "10:11:12")
101112
extract(MINUTE FROM "10:11:12")
11
extract(MINUTE_SECOND FROM "10:11:12")
1112
extract(SECOND FROM "1999-01-02 10:11:12")
12

View File

@@ -0,0 +1,32 @@
userid MIN(t1.score)
1 1
2 2
3 3
userid MIN(t1.score)
1 1
2 2
userid MIN(t1.score+0.0)
1 1.0
2 2.0
cid CONCAT(firstname, ' ', surname) COUNT(call_id)
cid CONCAT(firstname, ' ', surname) COUNT(call_id)
value description bug_id
BBBBBBBBBBBBB - conversion 9
BBBBBBBBBBBBB - conversion 10
BBBBBBBBBBBBB - generic 7
BBBBBBBBBBBBB - generic 14
BBBBBBBBBBBBB - eeeeeeeee NULL
kkkkkkkkkkk lllllllllll 6
kkkkkkkkkkk lllllllllll 8
kkkkkkkkkkk lllllllllll 12
Test Procedures NULL
Documentation NULL
Host communication NULL
value description COUNT(bug_id)
BBBBBBBBBBBBB - conversion 2
BBBBBBBBBBBBB - eeeeeeeee 0
BBBBBBBBBBBBB - generic 2
Documentation 0
Host communication 0
kkkkkkkkkkk lllllllllll 3
Test Procedures 0

View File

@@ -0,0 +1,2 @@
Variable_name Value
have_bdb YES

View File

@@ -0,0 +1,2 @@
Variable_name Value
have_isam YES

View File

@@ -0,0 +1,2 @@
Variable_name Value
have_raid YES

80
mysql-test/r/heap.result Normal file
View File

@@ -0,0 +1,80 @@
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Comment
t1 0 PRIMARY 1 a NULL NULL NULL NULL
a b
2 2
3 3
4 4
a b
4 4
a b
2 2
3 3
4 6
a b
1 1
2 2
3 3
4 4
a
869751
802616
a
869751
802616
a
736494
a
736494
869751
a
226312
736494
802616
869751
table type possible_keys key key_len ref rows Extra
t1 range uniq_id uniq_id 4 NULL 4 where used; Using index
x y
1 3
1 1
x y x y
1 1 1 1
2 2 2 2
1 3 1 1
2 4 2 2
2 5 2 2
2 6 2 2
table type possible_keys key key_len ref rows Extra
t1 ALL x NULL NULL NULL 6
t2 eq_ref y y 4 t1.x 1
max(a)
1
a b
1 6
1 5
1 4
1 3
1 2
1 1
a b
1 6
1 5
1 4
1 3
1 2
1 1
1 6
1 5
1 4
1 3
1 2
1 1
max(id)
1
max(id)
2
f1 f2
16 ted
12 ted
12 ted
12 ted
12 ted

View File

@@ -1,4 +1,4 @@
id domain
1 mysql.com
2 hotmail.com
3 aol.com
id t2
1 mysql.com
2 hotmail.com
3 aol.com

View File

@@ -0,0 +1,6 @@
a
1
2
3
4
5

View File

@@ -0,0 +1,13 @@
payoutID
1
4
6
9
10
11
12
14
16
19
20
22

9
mysql-test/r/join.result Normal file
View File

@@ -0,0 +1,9 @@
id id
107 107
75 75
id count(t2.id)
75 1
107 1
id count(t2.id)
75 1
107 1

View File

@@ -0,0 +1,315 @@
grp a c id a c d
1 1 a 1 1 a 1
3 4 E 3 4 A 4
3 5 C 3 5 B 5
3 6 D 3 6 C 6
grp a c id a c d
NULL NULL NULL NULL NULL NULL
1 1 a 1 1 a 1
2 2 b NULL NULL NULL NULL
2 3 c NULL NULL NULL NULL
3 4 E 3 4 A 4
3 5 C 3 5 B 5
3 6 D 3 6 C 6
grp a c id a c d
1 1 a 1 1 a 1
3 4 E 3 4 A 4
3 5 C 3 5 B 5
3 6 D 3 6 C 6
NULL NULL NULL 4 7 D 7
grp a c id a c d
1 1 a 1 1 a 1
3 4 E 3 4 A 4
3 5 C 3 5 B 5
3 6 D 3 6 C 6
NULL NULL NULL 4 7 D 7
grp a c id a c d
1 1 a 1 1 a 1
2 2 b NULL NULL NULL NULL
2 3 c NULL NULL NULL NULL
3 4 E 3 4 A 4
3 5 C 3 5 B 5
3 6 D 3 6 C 6
NULL NULL NULL NULL NULL NULL
grp a c id a c d
1 1 a 1 1 a 1
2 2 b NULL NULL NULL NULL
2 3 c NULL NULL NULL NULL
3 4 E NULL NULL NULL NULL
3 5 C NULL NULL NULL NULL
3 6 D NULL NULL NULL NULL
NULL NULL NULL NULL NULL NULL
grp a c id a c d
1 1 a 1 1 a 1
1 1 a 3 4 A 4
2 2 b 3 5 B 5
2 3 c 3 6 C 6
3 4 E NULL NULL NULL NULL
3 5 C 3 6 C 6
3 6 D 4 7 D 7
NULL NULL NULL NULL NULL NULL
grp a c id a c d
1 1 a 1 1 a 1
2 2 b NULL NULL NULL NULL
2 3 c NULL NULL NULL NULL
3 4 E NULL NULL NULL NULL
3 5 C NULL NULL NULL NULL
3 6 D NULL NULL NULL NULL
NULL NULL NULL NULL NULL NULL
grp a c id a c d
3 4 E 3 4 A 4
3 5 C 3 5 B 5
3 6 D 3 6 C 6
grp a c id a c d
2 2 b NULL NULL NULL NULL
2 3 c NULL NULL NULL NULL
NULL NULL NULL NULL NULL NULL
Comment
Impossible WHERE noticed after reading const tables
table type possible_keys key key_len ref rows Extra
t1 ALL NULL NULL NULL NULL 7
t2 eq_ref PRIMARY PRIMARY 8 t1.a 1 where used
grp a c id a c d a
1 1 a 1 1 a 1 1
2 2 b NULL NULL NULL NULL NULL
2 3 c NULL NULL NULL NULL NULL
3 4 E 3 4 A 4 4
3 5 C 3 5 B 5 5
3 6 D 3 6 C 6 6
NULL NULL NULL NULL NULL NULL NULL
grp a c id a c d
1 1 a 1 1 a 1
3 4 E 3 4 A 4
3 5 C 3 5 B 5
3 6 D 3 6 C 6
grp a c id a c d
1 1 a 1 1 a 1
3 4 E 3 4 A 4
3 5 C 3 5 B 5
3 6 D 3 6 C 6
grp a c id a c d
1 1 a 1 1 a 1
usr_id uniq_id increment usr2_id c_amount max
3 4 84676 NULL NULL NULL
usr_id uniq_id increment usr2_id c_amount max
3 4 84676 NULL NULL NULL
usr_id uniq_id increment usr2_id c_amount max
3 4 84676 NULL NULL NULL
usr_id uniq_id increment usr2_id c_amount max
3 4 84676 NULL NULL NULL
usr_id uniq_id increment usr2_id c_amount max
3 4 84676 NULL NULL NULL
fill desc_larga_cat cred_total Grup Places PlacesOcupades
10360 asdfggfg 6.0 0 55 0
10360 asdfggfg 6.0 12 333 0
10360 asdfggfg 6.0 33 8 0
10360 asdfggfg 6.0 45 10 0
10360 asdfggfg 6.0 55 2 0
10360 asdfggfg 6.0 7887 85 0
10360 asdfggfg 6.0 32767 7 0
10361 Components i Circuits Electronics I 6.0 30 2 0
10361 Components i Circuits Electronics I 6.0 40 3 0
10362 Laboratori d`Ordinadors 4.5 10 12 0
10362 Laboratori d`Ordinadors 4.5 11 111 0
fill idPla
10360 NULL
10361 NULL
10362 NULL
fill idPla
10360 1
10361 NULL
10362 NULL
name name id
Antonio Paz El Gato 1
Antonio Paz Perrito 2
Lilliana Angelovska NULL NULL
Thimble Smith Happy 3
name name id
Lilliana Angelovska NULL NULL
table type possible_keys key key_len ref rows Extra
t1 ALL NULL NULL NULL NULL 3
t2 ALL NULL NULL NULL NULL 3 where used; Not exists
table type possible_keys key key_len ref rows Extra
t1 ALL NULL NULL NULL NULL 3
t2 ALL NULL NULL NULL NULL 3 where used
count(*)
4
name name id
Antonio Paz El Gato 1
Antonio Paz Perrito 2
Lilliana Angelovska NULL NULL
Thimble Smith Happy 3
name name id
Lilliana Angelovska NULL NULL
table type possible_keys key key_len ref rows Extra
t1 ALL NULL NULL NULL NULL 3
t2 ALL NULL NULL NULL NULL 3 where used; Not exists
table type possible_keys key key_len ref rows Extra
t1 ALL NULL NULL NULL NULL 3
t2 ALL NULL NULL NULL NULL 3 where used
count(*)
4
name name id id
Antonio Paz El Gato 1 1
Antonio Paz Perrito 2 1
Lilliana Angelovska NULL NULL NULL
Thimble Smith Happy 3 3
name name id id
Antonio Paz El Gato 1 1
Antonio Paz Perrito 2 1
NULL Happy 3 1
NULL El Gato 1 2
NULL Perrito 2 2
NULL Happy 3 2
NULL El Gato 1 3
NULL Perrito 2 3
Thimble Smith Happy 3 3
name name id owner id
Antonio Paz El Gato 1 1 1
Antonio Paz Perrito 2 1 1
Lilliana Angelovska NULL NULL NULL 1
Thimble Smith NULL NULL NULL 1
Antonio Paz NULL NULL NULL 2
Lilliana Angelovska NULL NULL NULL 2
Thimble Smith NULL NULL NULL 2
Antonio Paz NULL NULL NULL 3
Lilliana Angelovska NULL NULL NULL 3
Thimble Smith Happy 3 3 3
id str
4 bar
3 foo
id str
1 NULL
2 NULL
n m o n m o
1 2 11 1 2 3
1 2 7 1 2 3
1 2 9 1 2 3
1 3 9 NULL NULL NULL
n m o n m o
1 2 7 1 2 3
1 2 9 1 2 3
1 3 9 NULL NULL NULL
1 2 11 1 2 3
id2
3
id2
3
color name
red apple
yellow banana
green lime
black grape
blue blueberry
count color
10 green
5 black
15 white
7 green
count color color name
10 green green lime
7 green green lime
5 black black grape
count name
10 lime
7 lime
5 grape
count name
10 lime
7 lime
5 grape
pcode count
kld2000 1
klw1000 0
klw1020 0
klw1500 0
klw2000 0
klw2001 0
klw2002 0
klw2500 0
kmw1000 0
kmw1500 0
kmw2000 0
kmw2001 0
kmw2100 0
kmw3000 0
kmw3200 0
kvw2000 26
kvw2001 0
kvw3000 36
kvw3001 0
kvw3002 0
kvw3500 26
kvw3501 0
kvw3502 0
kvw3800 0
kvw3801 0
kvw3802 0
kvw3900 0
kvw3901 0
kvw3902 0
kvw4000 0
kvw4001 0
kvw4002 0
kvw4200 0
kvw4500 0
kvw5000 0
kvw5001 0
kvw5500 0
kvw5510 0
kvw5600 0
kvw5601 0
kvw6000 2
pcode count
kld2000 1
klw1000 0
klw1020 0
klw1500 0
klw2000 0
klw2001 0
klw2002 0
klw2500 0
kmw1000 0
kmw1500 0
kmw2000 0
kmw2001 0
kmw2100 0
kmw3000 0
kmw3200 0
kvw2000 26
kvw2001 0
kvw3000 36
kvw3001 0
kvw3002 0
kvw3500 26
kvw3501 0
kvw3502 0
kvw3800 0
kvw3801 0
kvw3802 0
kvw3900 0
kvw3901 0
kvw3902 0
kvw4000 0
kvw4001 0
kvw4002 0
kvw4200 0
kvw4500 0
kvw5000 0
kvw5001 0
kvw5500 0
kvw5510 0
kvw5600 0
kvw5601 0
kvw6000 2
id pid rep_del id pid rep_del
1 NULL NULL 2 1 NULL
2 1 NULL NULL NULL NULL
id pid rep_del id pid rep_del
1 NULL NULL 2 1 NULL
2 1 NULL NULL NULL NULL
table type possible_keys key key_len ref rows Extra
t1 ALL NULL NULL NULL NULL 2
t2 index id id 8 NULL 1 where used; Using index; Not exists
id name id idx
2 no NULL NULL

12
mysql-test/r/key.result Normal file
View File

@@ -0,0 +1,12 @@
value
personal employee company
price area type transityes shopsyes schoolsyes petsyes
name author category email password proxy bitmap msg urlscol urlhttp timeout nbcnx creation livinguntil lang type subcat subtype reg scs capacity userISP CCident
patnom patauteur 0 p.favre@cryo-networks.fr NULL NULL #p2sndnq6ae5g1u6t essai
salut scol://195.242.78.119:patauteur.patnom NULL NULL NULL 950036174 -882087474 NULL 3 0 3 1 Pub/patnom/futur_divers.scs NULL pat CC1
name_id name
name_id name
2 [T,U]_axpby
name_id name
name_id name
2 [T,U]_axpby

View File

@@ -0,0 +1,39 @@
a b a b
A B A B
b A A B
C c A B
D E A B
a a A B
A B b A
b A b A
C c b A
D E b A
a a b A
A B C c
b A C c
C c C c
D E C c
a a C c
A B D E
b A D E
C c D E
D E D E
a a D E
A B a a
b A a a
C c a a
D E a a
a a a a
table type possible_keys key key_len ref rows Extra
t1 ALL a NULL NULL NULL 5
t2 ALL b NULL NULL NULL 5 where used
a b a b
A B a a
A B b A
C c C c
a a a a
a a b A
b A A B
a b
A B
a a

View File

@@ -0,0 +1,9 @@
t1
ABC
t1
t1
AB%
table type possible_keys key key_len ref rows Extra
t1 const PRIMARY PRIMARY 3 const 1
Comment
Impossible WHERE noticed after reading const tables

View File

@@ -0,0 +1,4 @@
time date timestamp
12:22:22 1997-02-03 19970102000000
t1.time+0 t1.date+0 t1.timestamp+0 concat(date," ",time)
122222 19970203 19970102000000 1997-02-03 12:22:22

22
mysql-test/r/limit.result Normal file
View File

@@ -0,0 +1,22 @@
a b
0 0
4 1
2 1
3 1
a b
0 0
4 2
2 2
3 1
a b
0 0
4 2
2 2
3 4
a b
0 0
2 2
3 4
a b
2 2
3 4

109
mysql-test/r/merge.result Normal file
View File

@@ -0,0 +1,109 @@
a b
1 Testing
2 table
3 t1
1 Testing
2 table
3 t2
a b
3 t1
3 t2
2 table
2 table
1 Testing
1 Testing
table type possible_keys key key_len ref rows Extra
t3 range a a 4 NULL 10 where used
table type possible_keys key key_len ref rows Extra
t3 range a a 4 NULL 10 where used
a b
10 Testing
10 Testing
a b
1 Testing
1 Testing
2 table
2 table
3 t1
3 t2
4 Testing
4 Testing
5 table
5 table
6 t1
6 t2
7 Testing
7 Testing
8 table
8 table
9 t2
9 t2
a b
11 table
11 table
12 t1
12 t1
13 Testing
13 Testing
14 table
14 table
15 t2
15 t2
16 Testing
16 Testing
17 table
17 table
18 t2
18 t2
19 Testing
19 Testing
table type possible_keys key key_len ref rows Extra
t3 index NULL a 4 NULL 1131 Using index
a
699
698
697
696
695
694
693
692
691
690
a
416
415
415
414
414
413
413
412
412
411
c
test1
test1
test1
test2
test2
test2
c
test1
test1
test1
test2
test2
test2
c
c
test1
test1
test1
incr othr
incr othr
1 10
2 24
4 33
3 53
c

View File

@@ -1 +0,0 @@
incr othr

View File

@@ -1,5 +0,0 @@
incr othr
1 10
2 24
4 33
3 53

View File

@@ -1 +0,0 @@
c

25
mysql-test/r/null.result Normal file
View File

@@ -0,0 +1,25 @@
NULL NULL isnull(null) isnull(1/0) isnull(1/0 = null) ifnull(null,1) ifnull(null,"TRUE") ifnull("TRUE","ERROR") 1/0 is null 1 is not null
NULL NULL 1 1 1 1 TRUE TRUE 1 1
1 | NULL 1 & NULL 1+NULL 1-NULL
NULL NULL NULL NULL
NULL=NULL NULL<>NULL IFNULL(NULL,1.1)+0 IFNULL(NULL,1) | 0
NULL NULL 1.1 1
strcmp("a",NULL) (1<NULL)+0.0 NULL regexp "a" null like "a%" "a%" like null
NULL NULL NULL NULL NULL
concat("a",NULL) replace(NULL,"a","b") replace("string","i",NULL) replace("string",NULL,"i") insert("abc",1,1,NULL) left(NULL,1)
NULL NULL NULL NULL NULL NULL
repeat("a",0) repeat("ab",5+5) repeat("ab",-1) reverse(NULL)
abababababababababab NULL
field(NULL,"a","b","c")
0
2 between null and 1 2 between 3 AND NULL NULL between 1 and 2 2 between NULL and 3 2 between 1 AND null
0 0 NULL NULL NULL
NULL AND NULL 1 AND NULL NULL AND 1 NULL OR NULL 0 OR NULL NULL OR 0
NULL NULL NULL NULL NULL NULL
(NULL OR NULL) IS NULL
1
NULL AND 0 0 and NULL
NULL 0
inet_ntoa(null) inet_aton(null) inet_aton("122.256") inet_aton("122.226.") inet_aton("")
NULL NULL NULL NULL NULL
x

View File

@@ -0,0 +1,94 @@
table type possible_keys key key_len ref rows Extra
t1 ref a a 5 const 3 where used; Using index
table type possible_keys key key_len ref rows Extra
t1 ref a,b a 9 const,const 1 where used; Using index
table type possible_keys key key_len ref rows Extra
t1 ref a,b a 9 const,const 1 where used; Using index
table type possible_keys key key_len ref rows Extra
t1 const a,b a 9 const,const 1
table type possible_keys key key_len ref rows Extra
t1 index NULL a 8 NULL 12 where used; Using index
table type possible_keys key key_len ref rows Extra
t1 range a,b a 9 NULL 3 where used; Using index
table type possible_keys key key_len ref rows Extra
t1 ref a,b b 4 const 2 where used
table type possible_keys key key_len ref rows Extra
t1 ref a,b a 5 const 3 where used; Using index
table type possible_keys key key_len ref rows Extra
t1 range a,b a 9 NULL 2 where used; Using index
table type possible_keys key key_len ref rows Extra
t1 range a a 5 NULL 1 where used; Using index
table type possible_keys key key_len ref rows Extra
t1 range a a 5 NULL 1 where used; Using index
a b
NULL 7
NULL 9
NULL 9
a b
NULL 7
a b
1 1
2 2
a b
1 1
2 2
a b
NULL 9
NULL 9
a b
NULL 7
7 7
a b
NULL 7
NULL 9
NULL 9
table type possible_keys key key_len ref rows Extra
t1 ref a,b a 5 const 3 where used
table type possible_keys key key_len ref rows Extra
t1 ref a,b a 5 const 3 where used
table type possible_keys key key_len ref rows Extra
t1 ref a,b a 5 const 3 where used
table type possible_keys key key_len ref rows Extra
t1 ref a,b a 5 const 1 where used
table type possible_keys key key_len ref rows Extra
t1 ALL NULL NULL NULL NULL 12 where used
table type possible_keys key key_len ref rows Extra
t1 range a,b a 5 NULL 12 where used
table type possible_keys key key_len ref rows Extra
t1 range a,b a 5 NULL 4 where used
table type possible_keys key key_len ref rows Extra
t1 ref a,b a 5 const 3 where used
table type possible_keys key key_len ref rows Extra
t1 ref a,b a 5 const 3 where used
table type possible_keys key key_len ref rows Extra
t1 range a a 5 NULL 1 where used
table type possible_keys key key_len ref rows Extra
t1 range a,b a 5 NULL 4 where used
table type possible_keys key key_len ref rows Extra
t1 range a a 5 NULL 1 where used
table type possible_keys key key_len ref rows Extra
t1 range b b 12 NULL 1 where used
a b c
NULL 7 0
NULL 9 0
NULL 9 0
a b c
NULL 7 0
a b c
1 1 0
2 2 0
a b c
1 1 0
2 2 0
a b c
NULL 9 0
NULL 9 0
a b c
NULL 7 0
7 7 0
a b c
NULL 7 0
NULL 9 0
NULL 9 0
a b c
6 6 0

7
mysql-test/r/odbc.result Normal file
View File

@@ -0,0 +1,7 @@
{fn length("hello")} 1997-10-20
5 1997-10-20
a b
2 2
a b
Comment
Impossible WHERE noticed after reading const tables

View File

@@ -0,0 +1,110 @@
id idservice ordre description
2 1 10 Emettre un appel d'offres
2 3 40000 Cr<43>er une fiche de client
2 4 40010 Modifier des clients
2 5 40020 Effacer des clients
2 6 51050 Ajouter un service
2 7 51060 Liste des t2
name
Allan Larsson
David Axmark
Michael Widenius
name
Axmark David
Larsson Allan
Widenius Michael
i
1
2
3
i
1
3
2
i
3
2
1
i
3
2
1
i
2
1
3
id col1 col2
4 1 1
3 1 2
5 1 4
2 2 1
1 2 2
6 2 3
8 2 4
7 3 1
col1
2
2
1
1
1
2
3
2
id
1
1
1
2
2
2
2
3
id
2
2
1
1
1
2
3
2
test
1
2
3
7
a b if(b = 1,i,if(b = 2,v,''))
1 1 50
2 1 25
3 2 123 Park Place
4 2 453 Boardwalk
a b if(b = 1,i,if(b = 2,v,''))
1 1 50
2 1 25
3 2 123 Park Place
4 2 453 Boardwalk
DateOfAction TransactionID
1999-07-18 486
1999-07-19 87
1999-07-19 89
1999-07-19 92
1999-07-19 94
1999-07-27 828
1999-07-27 832
1999-07-27 834
1999-07-27 840
2000-03-27 490
2000-03-28 753
DateOfAction TransactionID
1999-07-19 87
1999-07-19 89
1999-07-19 92
1999-07-19 94
1999-07-18 486
2000-03-27 490
2000-03-28 753
1999-07-27 828
1999-07-27 832
1999-07-27 834
1999-07-27 840

8
mysql-test/r/raid.result Normal file
View File

@@ -0,0 +1,8 @@
count(*)
450
count(*)
450
count(*)
450
count(*)
450

57
mysql-test/r/range.result Normal file
View File

@@ -0,0 +1,57 @@
event_date type event_id
1999-07-10 100100 24
1999-07-11 100100 25
1999-07-13 100600 0
1999-07-13 100600 4
1999-07-13 100600 26
1999-07-14 100600 10
Comment
Impossible WHERE
event_date type event_id
1999-07-10 100100 24
1999-07-11 100100 25
1999-07-13 100600 0
1999-07-13 100600 4
1999-07-13 100600 26
1999-07-14 100600 10
1999-07-15 100600 16
YEAR ISSUE
1999 29
1999 30
1999 31
1999 32
1999 33
1999 34
1999 35
Table Op Msg_type Msg_text
test.t1 check status OK
Table Op Msg_type Msg_text
test.t1 repair status OK
id parent_id level
3 1 1
4 1 1
2 1 1
6 1 1
7 1 1
5 1 1
id parent_id level
2 1 1
3 1 1
4 1 1
5 1 1
6 1 1
7 1 1
Satellite SensorMode FullImageCornersUpperLeftLongitude FullImageCornersUpperRightLongitude FullImageCornersUpperRightLatitude FullImageCornersLowerRightLatitude
OV-3 PAN1 91 -92 40 50
aString
baaa
believe
believe in love
aString
believe in myself
aString
baaa
believe
believe in love
aString
believe in myself

View File

@@ -0,0 +1,14 @@
3 table 3
3 table 3
1 table 1
1 table 1
Tables_in_test (t_)
t1
t2
t3
1 table 1
1 table 1
2 table 2
2 table 2
3 table 3
3 table 3

View File

@@ -0,0 +1,3 @@
n
4
5

View File

@@ -1,3 +1,3 @@
n
1
2
n
1
2

View File

@@ -1,2 +1,2 @@
sum(length(word))
71
sum(length(word))
71

Some files were not shown because too many files have changed in this diff Show More