Loading Docs/manual.texi +111 −68 Original line number Diff line number Diff line Loading @@ -514,13 +514,13 @@ MyISAM Table Formats BDB or Berkeley_DB Tables * BDB overview:: * BDB install:: * BDB start:: * BDB characteristic:: * BDB TODO:: * BDB portability:: * BDB errors:: * BDB overview:: Overview of BDB Tables * BDB install:: Installing BDB * BDB start:: BDB startup options * BDB characteristic:: Some characteristic of @code{BDB} tables: * BDB TODO:: Some things we need to fix for BDB in the near future: * BDB portability:: Operating systems supported by @strong{BDB} * BDB errors:: Errors You May Get When Using BDB Tables GEMINI Tables Loading @@ -533,7 +533,7 @@ InnoDB Tables * InnoDB overview:: InnoDB tables overview * InnoDB start:: InnoDB startup options * Creating an InnoDB database:: Creating an InnoDB database. * Creating an InnoDB database:: Creating an InnoDB database. Creating an InnoDB database. Creating an InnoDB database. * Using InnoDB tables:: Creating InnoDB tables * Adding and removing:: Adding and removing InnoDB data and log files * Backing up:: Backing up and recovering an InnoDB database Loading Loading @@ -1088,6 +1088,7 @@ Debugging a MySQL server * Compiling for debugging:: * Making trace files:: * Using gdb on mysqld:: * Using stack trace:: * Using log files:: * Reproducable test case:: Loading Loading @@ -7395,7 +7396,7 @@ This will avoid problems with the @code{libstdc++} library and with C++ exceptions. If this doesn't help, you should compile a debug version and run it with a trace file or under @code{gdb}. @xref{Debugging server}. it with a trace file or under @code{gdb}. @xref{Using gdb on mysqld}. @node SunOS, Linux, Solaris x86, Source install system issues @subsection SunOS 4 Notes Loading Loading @@ -8888,11 +8889,10 @@ If @code{mysqld} doesn't start, please check whether or not the try to start it with @code{mysqld --standalone}; In this case you may get some useful information on the screen that may help solve this. The last option is to start @code{mysqld} with @code{--debug}. In this case @code{mysqld} will write a log file in @file{\mysqld.trace} that should contain the reason why @code{mysqld} doesn't start. If you make a bug report about this, please only send the lines to the mailing list where something seems to go wrong! The last option is to start @code{mysqld} with @code{--standalone --debug}. In this case @code{mysqld} will write a log file in @file{C:\mysqld.trace} that should contain the reason why @code{mysqld} doesn't start. @xref{Making trace files}. @node NT start, Windows running, Win95 start, Windows @subsection Starting MySQL on NT or Windows 2000 Loading Loading @@ -8974,6 +8974,7 @@ C:\mysql\bin\mysqld --standalone --debug @end example The last version gives you a debug trace in @file{C:\mysqld.trace}. @xref{Making trace files}. @node Windows running, Windows and SSH, NT start, Windows @subsection Running MySQL on Windows Loading Loading @@ -9999,15 +10000,8 @@ this: This problem occurs only on systems that don't have a working thread library and for which @strong{MySQL} must be configured to use MIT-pthreads. On Windows, you can try to start @code{mysqld} as follows: @example C:\mysql\bin\mysqld --standalone --debug @end example This will not run in the background and it should also write a trace in @file{\mysqld.trace}, which may help you determine the source of your problems. @xref{Windows}. If you can't get mysqld to start you can try to make a trace file to find the problem. @xref{Making trace files}. If you are using BDB (Berkeley DB) tables, you should familiarize yourself with the different BDB specific startup options. @xref{BDB start}. Loading Loading @@ -10140,7 +10134,7 @@ Set the default table type for tables. @xref{Table types}. @item --debug[...]= If @strong{MySQL} is configured with @code{--with-debug}, you can use this option to get a trace file of what @code{mysqld} is doing. @xref{The DBUG package}. @xref{Making trace files}. @item --delay-key-write-for-all-tables Don't flush key buffers between writes for any @code{MyISAM} table. Loading Loading @@ -13810,7 +13804,7 @@ it down and restarting it. If everything else fails, start the @code{mysqld} daemon with a debugging option (for example, @code{--debug=d,general,query}). This will print host and user information about attempted connections, as well as information about each command issued. @xref{Debugging server}. each command issued. @xref{Making trace files}. @item If you have any other problems with the @strong{MySQL} grant tables and Loading Loading @@ -24471,7 +24465,7 @@ NuSphere is working on removing these limitations. @menu * InnoDB overview:: InnoDB tables overview * InnoDB start:: InnoDB startup options * Creating an InnoDB database:: Creating an InnoDB database. * Creating an InnoDB database:: Creating an InnoDB database. Creating an InnoDB database. Creating an InnoDB database. * Using InnoDB tables:: Creating InnoDB tables * Adding and removing:: Adding and removing InnoDB data and log files * Backing up:: Backing up and recovering an InnoDB database Loading Loading @@ -31719,7 +31713,7 @@ the following configure options: @multitable @columnfractions .3 .7 @item @strong{Option} @tab @strong{Comment} @item --with-server-suffix=-Max @tab Add a suffix to the @code{mysqld} version string. @item --with-server-suffix=-max @tab Add a suffix to the @code{mysqld} version string. @item --with-bdb @tab Support for Berkeley DB (BDB) tables @item --with-innodb @tab Support for InnoDB tables. @item CFLAGS=-DUSE_SYMDIR @tab Symbolic links support for Windows. Loading Loading @@ -36124,6 +36118,7 @@ Try the following: @enumerate @item Start @code{mysqld} from @code{gdb} (or in another debugger). @xref{Using gdb on mysqld}. @item Run your test scripts. Loading Loading @@ -37947,6 +37942,20 @@ file name is given, it defaults to the name of the host machine followed by @code{-bin}. If file name is given, but it doesn't contain a path, the file is written in the data directory. You can use the following options to @code{mysqld} to affect what is logged to the binary log: @multitable @columnfractions .4 .6 @item @code{binlog-do-db=database_name} @tab Tells the master it should log updates for the specified database, and exclude all others not explicitly mentioned. (Example: @code{binlog-do-db=some_database}) @item @code{binlog-ignore-db=database_name} @tab Tells the master that updates to the given database should not be logged to the binary log (Example: @code{binlog-ignore-db=some_database}) @end multitable To the binary log filename @code{mysqld} will append an extension that is a number that is incremented each time you execute @code{mysqladmin refresh}, execute @code{mysqladmin flush-logs}, execute the @code{FLUSH LOGS} Loading Loading @@ -38283,7 +38292,7 @@ greater detail in the next section. @multitable @columnfractions .3 .7 @item @strong{mysql_affected_rows()} @tab Returns the number of rows affected by the last @code{UPDATE}, Returns the number of rows changed/deleted/inserted by the last @code{UPDATE}, @code{DELETE}, or @code{INSERT} query. @item @strong{mysql_close()} @tab Loading Loading @@ -38471,7 +38480,7 @@ expects a counted string. If the string contains binary data (which may include null bytes), you must use @code{mysql_real_query()}. For each non-@code{SELECT} query (for example, @code{INSERT}, @code{UPDATE}, @code{DELETE}), you can find out how many rows were affected (changed) @code{DELETE}), you can find out how many rows were changed (affected) by calling @code{mysql_affected_rows()}. For @code{SELECT} queries, you retrieve the selected rows as a result set. Loading Loading @@ -38647,19 +38656,19 @@ A string representation of the error may be obtained by calling @subsubheading Description Returns the number of rows affected (changed) by the last @code{UPDATE}, @code{DELETE} or @code{INSERT} query. May be called immediately after @code{mysql_query()} for @code{UPDATE}, @code{DELETE}, or @code{INSERT} statements. For @code{SELECT} statements, @code{mysql_affected_rows()} works like @code{mysql_num_rows()}. @code{mysql_affected_rows()} is currently implemented as a macro. Returns the number of rows changed by the last @code{UPDATE}, deleted by the last @code{DELETE} or inserted by the last @code{INSERT} statement. May be called immediately after @code{mysql_query()} for @code{UPDATE}, @code{DELETE}, or @code{INSERT} statements. For @code{SELECT} statements, @code{mysql_affected_rows()} works like @code{mysql_num_rows()}. @subsubheading Return Values An integer greater than zero indicates the number of rows affected or retrieved. Zero indicates that no records matched the @code{WHERE} clause in the query or that no query has yet been executed. -1 indicates that the retrieved. Zero indicates that no records where updated for an @code{UPDATE} statement, no rows matched the @code{WHERE} clause in the query or that no query has yet been executed. -1 indicates that the query returned an error or that, for a @code{SELECT} query, @code{mysql_affected_rows()} was called prior to calling @code{mysql_store_result()}. Loading @@ -38672,9 +38681,18 @@ None. @example mysql_query(&mysql,"UPDATE products SET cost=cost*1.25 WHERE group=10"); printf("%d products updated",mysql_affected_rows(&mysql)); printf("%ld products updated",(long) mysql_affected_rows(&mysql)); @end example If one specifies the flag @code{CLIENT_FOUND_ROWS} when connecting to @code{mysqld}, @code{mysql_affected_rows()} will return the number of rows matched by the @code{WHERE} statement for @code{UPDATE} statements. Note that when one uses a @code{REPLACE} command, @code{mysql_affected_rows()} will return 2 if the new row replaced and old row. This is because in this case one row was inserted and then the duplicate was deleted. @findex @code{mysql_close()} @node mysql_close, mysql_connect, mysql_affected_rows, C API functions @subsubsection @code{mysql_close()} Loading Loading @@ -40490,6 +40508,12 @@ You must call @code{mysql_store_result()} or @code{mysql_use_result()} for every query that successfully retrieves data (@code{SELECT}, @code{SHOW}, @code{DESCRIBE}, @code{EXPLAIN}). You don't have to call @code{mysql_store_result()} or @code{mysql_use_result()} for other queries, but it will not do any harm or cause any notable performance if you call @code{mysql_store_result()} in all cases. You can detect if the query didn't have a result set by checking if @code{mysql_store_result()} returns 0 (more about this later one). If you want to know if the query should return a result set or not, you can use @code{mysql_field_count()} to check for this. @xref{mysql_field_count, @code{mysql_field_count}}. Loading Loading @@ -42241,7 +42265,6 @@ with the @code{--gdb} and @code{--debug} options to @code{mysql-test-run}. If you have not compiled @strong{MySQL} for debugging you should probably do that. Just specify the @code{--with-debug} options to @code{configure}! @xref{Installing source}. @end itemize @page Loading Loading @@ -44257,8 +44280,8 @@ as root. Fixed bug when thread creation failed (could happen when doing a LOT of connections in a short time). @item Don't free the key cache on @code{FLUSH TABLES} as this will cause problems with temporary tables. Fixed some problems with @code{FLUSH TABLES} and @code{TEMPORARY} tables. (Problem with freeing the key cache and error @code{Can't reopen table...}). @item Fixed a problem in Innobase with other character sets than @code{latin1} and another problem when using many columns. Loading Loading @@ -49925,6 +49948,7 @@ problems that may be unique to your environment. @menu * Compiling for debugging:: * Making trace files:: * Using gdb on mysqld:: * Using stack trace:: * Using log files:: * Reproducable test case:: Loading @@ -49939,7 +49963,7 @@ If you have some very specific problem, you can always try to debug whether or not @strong{MySQL} was compiled with debugging by doing: @code{mysqld --help}. If the @code{--debug} flag is listed with the options then you have debugging enabled. @code{mysqladmin ver} also lists the @code{mysqld} version as @code{mysql ... -debug} in this case. lists the @code{mysqld} version as @code{mysql ... --debug} in this case. If you are using gcc or egcs, the recommended configure line is: Loading Loading @@ -49978,22 +50002,50 @@ send mail to @email{mysql@@lists.mysql.com} and ask for help. Please use the @code{mysqlbug} script for all bug reports or questions regarding the @strong{MySQL} version you are using! @node Making trace files, Using stack trace, Compiling for debugging, Debugging server @appendixsubsec Creating trace files and using gdb on mysqld In the windows @strong{MySQL} distribution @code{mysqld.exe} is by default compiled with support for trace files. @node Making trace files, Using gdb on mysqld, Compiling for debugging, Debugging server @appendixsubsec Creating trace files If you can cause the @code{mysqld} server to crash quickly, you can try to create a trace file of this: If the @code{mysqld} server doesn't start or if you can cause the @code{mysqld} server to crash quickly, you can try to create a trace file to find the problem. Start the @code{mysqld} server with a trace log in @file{/tmp/mysqld.trace}. The log file will get very @emph{BIG}. To do this you have to have a @code{mysqld} that is compiled for debugging. You can check this by executing @code{mysqld -V}. If the version number ends with @code{-debug}, it's compiled with support for trace files. @code{mysqld --debug --log} Start the @code{mysqld} server with a trace log in @file{/tmp/mysqld.trace} (or @file{C:\mysqld.trace} on windows): or you can start it with @code{mysqld --debug} @code{mysqld --debug=d,info,error,query,general,where:O,/tmp/mysql.trace} On Windows you should also use the @code{--standalone} flag to not start @code{mysqld} as a service. which only prints information with the most interesting tags. Note that the trace file will get very @emph{BIG}! If you want to have a smaller trace file, you can use something like: @code{mysqld --debug=d,info,error,query,general,where:O,/tmp/mysqld.trace} which only prints information with the most interesting tags in @file{/tmp/mysqld.trace}. If you make a bug report about this, please only send the lines from the trace file to the appropriate mailing list where something seems to go wrong! If you can't locate the wrong place, you can ftp the trace file, together with a full bug report, to @uref{ftp://support.mysql.com/pub/mysql/secret} so that a @strong{MySQL} developer can take a look a this. The trace file is made with the @strong{DBUG} package by Fred Fish. @xref{The DBUG package}. @cindex gdb, using @node Using gdb on mysqld, Using stack trace, Making trace files, Debugging server @appendixsubsec Debugging mysqld under gdb On most system you can also start @code{mysqld} from @code{gdb} to get more information if @code{mysqld} crashes. Loading @@ -50018,8 +50070,7 @@ find out why @code{mysqld} died: @example shell> gdb mysqld core gdb> backtrace gdb> info local gdb> backtrace full gdb> exit @end example Loading Loading @@ -50051,15 +50102,7 @@ Here is an example how to debug mysqld: shell> gdb /usr/local/libexec/mysqld gdb> run ... back # Do this when mysqld crashes info locals up info locals up ... (until you get some information about local variables) quit backtrace full # Do this when mysqld crashes @end example Include the above output in a mail generated with @code{mysqlbug} and Loading @@ -50082,7 +50125,7 @@ debugging information by using the @code{trace} method or by setting the @code{DBI_TRACE} environment variable. @xref{Perl DBI Class, , Perl @code{DBI} Class}. @node Using stack trace, Using log files, Making trace files, Debugging server @node Using stack trace, Using log files, Using gdb on mysqld, Debugging server @appendixsubsec Using a stack trace On some operating systems, the error log will contain a stack trace if Loading Loading @@ -50297,7 +50340,7 @@ A very common mistake is to use an old @file{mysql.h} file from an old The @strong{MySQL} server and most @strong{MySQL} clients are compiled with the DBUG package originally made by Fred Fish. When one has configured @strong{MySQL} for debugging, this package makes it possible to get a trace file of what the program is debugging. file of what the program is debugging. @xref{Making trace files}. One uses the debug package by invoking the program with the @code{--debug="..."} or the @code{-#...} option. innobase/pars/pars0grm.c +2 −1 Original line number Diff line number Diff line Loading @@ -95,9 +95,10 @@ /* The value of the semantic attribute is a pointer to a query tree node que_node_t */ #define YYSTYPE que_node_t* #define alloca mem_alloc #include "univ.i" #undef alloca #define alloca mem_alloc #include <math.h> #include "pars0pars.h" #include "mem0mem.h" Loading mysys/mf_keycache.c +6 −6 Original line number Diff line number Diff line Loading @@ -327,7 +327,7 @@ int key_cache_write(File file, my_off_t filepos, byte *buff, uint length, } #if !defined(DBUG_OFF) && defined(EXTRA_DEBUG) DBUG_EXECUTE("exec",test_key_cache("start of key_cache_write",1);); DBUG_EXECUTE("check_keycache",test_key_cache("start of key_cache_write",1);); #endif if (_my_disk_blocks > 0) { /* We have key_cacheing */ Loading Loading @@ -367,7 +367,7 @@ int key_cache_write(File file, my_off_t filepos, byte *buff, uint length, } end: #if !defined(DBUG_OFF) && defined(EXTRA_DEBUG) DBUG_EXECUTE("exec",test_key_cache("end of key_cache_write",1);); DBUG_EXECUTE("check_keycache",test_key_cache("end of key_cache_write",1);); #endif return(error); } /* key_cache_write */ Loading @@ -381,7 +381,7 @@ static SEC_LINK *find_key_block(int file, my_off_t filepos, int *error) reg1 SEC_LINK *next,**start; #if !defined(DBUG_OFF) && defined(EXTRA_DEBUG) DBUG_EXECUTE("exec",test_key_cache("start of find_key_block",0);); DBUG_EXECUTE("check_keycache",test_key_cache("start of find_key_block",0);); #endif *error=0; Loading Loading @@ -459,7 +459,7 @@ static SEC_LINK *find_key_block(int file, my_off_t filepos, int *error) } _my_used_last=next; #if !defined(DBUG_OFF) && defined(EXTRA_DEBUG) DBUG_EXECUTE("exec",test_key_cache("end of find_key_block",0);); DBUG_EXECUTE("check_keycache",test_key_cache("end of find_key_block",0);); #endif return next; } /* find_key_block */ Loading Loading @@ -529,7 +529,7 @@ int flush_key_blocks(File file, enum flush_type type) pthread_mutex_lock(&THR_LOCK_keycache); #if !defined(DBUG_OFF) && defined(EXTRA_DEBUG) DBUG_EXECUTE("exec",test_key_cache("start of flush_key_blocks",0);); DBUG_EXECUTE("check_keycache",test_key_cache("start of flush_key_blocks",0);); #endif cache=cache_buff; /* If no key cache */ if (_my_disk_blocks > 0 && Loading Loading @@ -607,7 +607,7 @@ int flush_key_blocks(File file, enum flush_type type) } } #ifndef DBUG_OFF DBUG_EXECUTE("exec",test_key_cache("end of flush_key_blocks",0);); DBUG_EXECUTE("check_keycache",test_key_cache("end of flush_key_blocks",0);); #endif pthread_mutex_unlock(&THR_LOCK_keycache); if (cache != cache_buff) Loading sql-bench/crash-me.sh +1 −1 Original line number Diff line number Diff line #!@PERL@ -w #!@PERL@ # Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB # # This library is free software; you can redistribute it and/or Loading sql/mysqld.cc +16 −0 Original line number Diff line number Diff line Loading @@ -152,6 +152,22 @@ static uint handler_count; static bool opt_console=0,start_mode=0; #endif /* Set prefix for windows binary */ #ifdef __WIN__ #undef MYSQL_SERVER_SUFFIX #ifdef __NT__ #if defined(HAVE_INNOBASE_DB) || defined(HAVE_BERKELEY_DB) #define MYSQL_SERVER_SUFFIX "-max-nt" #else #define MYSQL_SERVER_SUFFIX "-nt" #endif /* ...DB */ #elif defined(HAVE_INNOBASE_DB) || defined(HAVE_BERKELEY_DB) #define MYSQL_SERVER_SUFFIX "-max" #else #define MYSQL_SERVER_SUFFIX "" #endif /* __NT__ */ #endif #ifdef HAVE_BERKELEY_DB SHOW_COMP_OPTION have_berkeley_db=SHOW_OPTION_YES; #else Loading Loading
Docs/manual.texi +111 −68 Original line number Diff line number Diff line Loading @@ -514,13 +514,13 @@ MyISAM Table Formats BDB or Berkeley_DB Tables * BDB overview:: * BDB install:: * BDB start:: * BDB characteristic:: * BDB TODO:: * BDB portability:: * BDB errors:: * BDB overview:: Overview of BDB Tables * BDB install:: Installing BDB * BDB start:: BDB startup options * BDB characteristic:: Some characteristic of @code{BDB} tables: * BDB TODO:: Some things we need to fix for BDB in the near future: * BDB portability:: Operating systems supported by @strong{BDB} * BDB errors:: Errors You May Get When Using BDB Tables GEMINI Tables Loading @@ -533,7 +533,7 @@ InnoDB Tables * InnoDB overview:: InnoDB tables overview * InnoDB start:: InnoDB startup options * Creating an InnoDB database:: Creating an InnoDB database. * Creating an InnoDB database:: Creating an InnoDB database. Creating an InnoDB database. Creating an InnoDB database. * Using InnoDB tables:: Creating InnoDB tables * Adding and removing:: Adding and removing InnoDB data and log files * Backing up:: Backing up and recovering an InnoDB database Loading Loading @@ -1088,6 +1088,7 @@ Debugging a MySQL server * Compiling for debugging:: * Making trace files:: * Using gdb on mysqld:: * Using stack trace:: * Using log files:: * Reproducable test case:: Loading Loading @@ -7395,7 +7396,7 @@ This will avoid problems with the @code{libstdc++} library and with C++ exceptions. If this doesn't help, you should compile a debug version and run it with a trace file or under @code{gdb}. @xref{Debugging server}. it with a trace file or under @code{gdb}. @xref{Using gdb on mysqld}. @node SunOS, Linux, Solaris x86, Source install system issues @subsection SunOS 4 Notes Loading Loading @@ -8888,11 +8889,10 @@ If @code{mysqld} doesn't start, please check whether or not the try to start it with @code{mysqld --standalone}; In this case you may get some useful information on the screen that may help solve this. The last option is to start @code{mysqld} with @code{--debug}. In this case @code{mysqld} will write a log file in @file{\mysqld.trace} that should contain the reason why @code{mysqld} doesn't start. If you make a bug report about this, please only send the lines to the mailing list where something seems to go wrong! The last option is to start @code{mysqld} with @code{--standalone --debug}. In this case @code{mysqld} will write a log file in @file{C:\mysqld.trace} that should contain the reason why @code{mysqld} doesn't start. @xref{Making trace files}. @node NT start, Windows running, Win95 start, Windows @subsection Starting MySQL on NT or Windows 2000 Loading Loading @@ -8974,6 +8974,7 @@ C:\mysql\bin\mysqld --standalone --debug @end example The last version gives you a debug trace in @file{C:\mysqld.trace}. @xref{Making trace files}. @node Windows running, Windows and SSH, NT start, Windows @subsection Running MySQL on Windows Loading Loading @@ -9999,15 +10000,8 @@ this: This problem occurs only on systems that don't have a working thread library and for which @strong{MySQL} must be configured to use MIT-pthreads. On Windows, you can try to start @code{mysqld} as follows: @example C:\mysql\bin\mysqld --standalone --debug @end example This will not run in the background and it should also write a trace in @file{\mysqld.trace}, which may help you determine the source of your problems. @xref{Windows}. If you can't get mysqld to start you can try to make a trace file to find the problem. @xref{Making trace files}. If you are using BDB (Berkeley DB) tables, you should familiarize yourself with the different BDB specific startup options. @xref{BDB start}. Loading Loading @@ -10140,7 +10134,7 @@ Set the default table type for tables. @xref{Table types}. @item --debug[...]= If @strong{MySQL} is configured with @code{--with-debug}, you can use this option to get a trace file of what @code{mysqld} is doing. @xref{The DBUG package}. @xref{Making trace files}. @item --delay-key-write-for-all-tables Don't flush key buffers between writes for any @code{MyISAM} table. Loading Loading @@ -13810,7 +13804,7 @@ it down and restarting it. If everything else fails, start the @code{mysqld} daemon with a debugging option (for example, @code{--debug=d,general,query}). This will print host and user information about attempted connections, as well as information about each command issued. @xref{Debugging server}. each command issued. @xref{Making trace files}. @item If you have any other problems with the @strong{MySQL} grant tables and Loading Loading @@ -24471,7 +24465,7 @@ NuSphere is working on removing these limitations. @menu * InnoDB overview:: InnoDB tables overview * InnoDB start:: InnoDB startup options * Creating an InnoDB database:: Creating an InnoDB database. * Creating an InnoDB database:: Creating an InnoDB database. Creating an InnoDB database. Creating an InnoDB database. * Using InnoDB tables:: Creating InnoDB tables * Adding and removing:: Adding and removing InnoDB data and log files * Backing up:: Backing up and recovering an InnoDB database Loading Loading @@ -31719,7 +31713,7 @@ the following configure options: @multitable @columnfractions .3 .7 @item @strong{Option} @tab @strong{Comment} @item --with-server-suffix=-Max @tab Add a suffix to the @code{mysqld} version string. @item --with-server-suffix=-max @tab Add a suffix to the @code{mysqld} version string. @item --with-bdb @tab Support for Berkeley DB (BDB) tables @item --with-innodb @tab Support for InnoDB tables. @item CFLAGS=-DUSE_SYMDIR @tab Symbolic links support for Windows. Loading Loading @@ -36124,6 +36118,7 @@ Try the following: @enumerate @item Start @code{mysqld} from @code{gdb} (or in another debugger). @xref{Using gdb on mysqld}. @item Run your test scripts. Loading Loading @@ -37947,6 +37942,20 @@ file name is given, it defaults to the name of the host machine followed by @code{-bin}. If file name is given, but it doesn't contain a path, the file is written in the data directory. You can use the following options to @code{mysqld} to affect what is logged to the binary log: @multitable @columnfractions .4 .6 @item @code{binlog-do-db=database_name} @tab Tells the master it should log updates for the specified database, and exclude all others not explicitly mentioned. (Example: @code{binlog-do-db=some_database}) @item @code{binlog-ignore-db=database_name} @tab Tells the master that updates to the given database should not be logged to the binary log (Example: @code{binlog-ignore-db=some_database}) @end multitable To the binary log filename @code{mysqld} will append an extension that is a number that is incremented each time you execute @code{mysqladmin refresh}, execute @code{mysqladmin flush-logs}, execute the @code{FLUSH LOGS} Loading Loading @@ -38283,7 +38292,7 @@ greater detail in the next section. @multitable @columnfractions .3 .7 @item @strong{mysql_affected_rows()} @tab Returns the number of rows affected by the last @code{UPDATE}, Returns the number of rows changed/deleted/inserted by the last @code{UPDATE}, @code{DELETE}, or @code{INSERT} query. @item @strong{mysql_close()} @tab Loading Loading @@ -38471,7 +38480,7 @@ expects a counted string. If the string contains binary data (which may include null bytes), you must use @code{mysql_real_query()}. For each non-@code{SELECT} query (for example, @code{INSERT}, @code{UPDATE}, @code{DELETE}), you can find out how many rows were affected (changed) @code{DELETE}), you can find out how many rows were changed (affected) by calling @code{mysql_affected_rows()}. For @code{SELECT} queries, you retrieve the selected rows as a result set. Loading Loading @@ -38647,19 +38656,19 @@ A string representation of the error may be obtained by calling @subsubheading Description Returns the number of rows affected (changed) by the last @code{UPDATE}, @code{DELETE} or @code{INSERT} query. May be called immediately after @code{mysql_query()} for @code{UPDATE}, @code{DELETE}, or @code{INSERT} statements. For @code{SELECT} statements, @code{mysql_affected_rows()} works like @code{mysql_num_rows()}. @code{mysql_affected_rows()} is currently implemented as a macro. Returns the number of rows changed by the last @code{UPDATE}, deleted by the last @code{DELETE} or inserted by the last @code{INSERT} statement. May be called immediately after @code{mysql_query()} for @code{UPDATE}, @code{DELETE}, or @code{INSERT} statements. For @code{SELECT} statements, @code{mysql_affected_rows()} works like @code{mysql_num_rows()}. @subsubheading Return Values An integer greater than zero indicates the number of rows affected or retrieved. Zero indicates that no records matched the @code{WHERE} clause in the query or that no query has yet been executed. -1 indicates that the retrieved. Zero indicates that no records where updated for an @code{UPDATE} statement, no rows matched the @code{WHERE} clause in the query or that no query has yet been executed. -1 indicates that the query returned an error or that, for a @code{SELECT} query, @code{mysql_affected_rows()} was called prior to calling @code{mysql_store_result()}. Loading @@ -38672,9 +38681,18 @@ None. @example mysql_query(&mysql,"UPDATE products SET cost=cost*1.25 WHERE group=10"); printf("%d products updated",mysql_affected_rows(&mysql)); printf("%ld products updated",(long) mysql_affected_rows(&mysql)); @end example If one specifies the flag @code{CLIENT_FOUND_ROWS} when connecting to @code{mysqld}, @code{mysql_affected_rows()} will return the number of rows matched by the @code{WHERE} statement for @code{UPDATE} statements. Note that when one uses a @code{REPLACE} command, @code{mysql_affected_rows()} will return 2 if the new row replaced and old row. This is because in this case one row was inserted and then the duplicate was deleted. @findex @code{mysql_close()} @node mysql_close, mysql_connect, mysql_affected_rows, C API functions @subsubsection @code{mysql_close()} Loading Loading @@ -40490,6 +40508,12 @@ You must call @code{mysql_store_result()} or @code{mysql_use_result()} for every query that successfully retrieves data (@code{SELECT}, @code{SHOW}, @code{DESCRIBE}, @code{EXPLAIN}). You don't have to call @code{mysql_store_result()} or @code{mysql_use_result()} for other queries, but it will not do any harm or cause any notable performance if you call @code{mysql_store_result()} in all cases. You can detect if the query didn't have a result set by checking if @code{mysql_store_result()} returns 0 (more about this later one). If you want to know if the query should return a result set or not, you can use @code{mysql_field_count()} to check for this. @xref{mysql_field_count, @code{mysql_field_count}}. Loading Loading @@ -42241,7 +42265,6 @@ with the @code{--gdb} and @code{--debug} options to @code{mysql-test-run}. If you have not compiled @strong{MySQL} for debugging you should probably do that. Just specify the @code{--with-debug} options to @code{configure}! @xref{Installing source}. @end itemize @page Loading Loading @@ -44257,8 +44280,8 @@ as root. Fixed bug when thread creation failed (could happen when doing a LOT of connections in a short time). @item Don't free the key cache on @code{FLUSH TABLES} as this will cause problems with temporary tables. Fixed some problems with @code{FLUSH TABLES} and @code{TEMPORARY} tables. (Problem with freeing the key cache and error @code{Can't reopen table...}). @item Fixed a problem in Innobase with other character sets than @code{latin1} and another problem when using many columns. Loading Loading @@ -49925,6 +49948,7 @@ problems that may be unique to your environment. @menu * Compiling for debugging:: * Making trace files:: * Using gdb on mysqld:: * Using stack trace:: * Using log files:: * Reproducable test case:: Loading @@ -49939,7 +49963,7 @@ If you have some very specific problem, you can always try to debug whether or not @strong{MySQL} was compiled with debugging by doing: @code{mysqld --help}. If the @code{--debug} flag is listed with the options then you have debugging enabled. @code{mysqladmin ver} also lists the @code{mysqld} version as @code{mysql ... -debug} in this case. lists the @code{mysqld} version as @code{mysql ... --debug} in this case. If you are using gcc or egcs, the recommended configure line is: Loading Loading @@ -49978,22 +50002,50 @@ send mail to @email{mysql@@lists.mysql.com} and ask for help. Please use the @code{mysqlbug} script for all bug reports or questions regarding the @strong{MySQL} version you are using! @node Making trace files, Using stack trace, Compiling for debugging, Debugging server @appendixsubsec Creating trace files and using gdb on mysqld In the windows @strong{MySQL} distribution @code{mysqld.exe} is by default compiled with support for trace files. @node Making trace files, Using gdb on mysqld, Compiling for debugging, Debugging server @appendixsubsec Creating trace files If you can cause the @code{mysqld} server to crash quickly, you can try to create a trace file of this: If the @code{mysqld} server doesn't start or if you can cause the @code{mysqld} server to crash quickly, you can try to create a trace file to find the problem. Start the @code{mysqld} server with a trace log in @file{/tmp/mysqld.trace}. The log file will get very @emph{BIG}. To do this you have to have a @code{mysqld} that is compiled for debugging. You can check this by executing @code{mysqld -V}. If the version number ends with @code{-debug}, it's compiled with support for trace files. @code{mysqld --debug --log} Start the @code{mysqld} server with a trace log in @file{/tmp/mysqld.trace} (or @file{C:\mysqld.trace} on windows): or you can start it with @code{mysqld --debug} @code{mysqld --debug=d,info,error,query,general,where:O,/tmp/mysql.trace} On Windows you should also use the @code{--standalone} flag to not start @code{mysqld} as a service. which only prints information with the most interesting tags. Note that the trace file will get very @emph{BIG}! If you want to have a smaller trace file, you can use something like: @code{mysqld --debug=d,info,error,query,general,where:O,/tmp/mysqld.trace} which only prints information with the most interesting tags in @file{/tmp/mysqld.trace}. If you make a bug report about this, please only send the lines from the trace file to the appropriate mailing list where something seems to go wrong! If you can't locate the wrong place, you can ftp the trace file, together with a full bug report, to @uref{ftp://support.mysql.com/pub/mysql/secret} so that a @strong{MySQL} developer can take a look a this. The trace file is made with the @strong{DBUG} package by Fred Fish. @xref{The DBUG package}. @cindex gdb, using @node Using gdb on mysqld, Using stack trace, Making trace files, Debugging server @appendixsubsec Debugging mysqld under gdb On most system you can also start @code{mysqld} from @code{gdb} to get more information if @code{mysqld} crashes. Loading @@ -50018,8 +50070,7 @@ find out why @code{mysqld} died: @example shell> gdb mysqld core gdb> backtrace gdb> info local gdb> backtrace full gdb> exit @end example Loading Loading @@ -50051,15 +50102,7 @@ Here is an example how to debug mysqld: shell> gdb /usr/local/libexec/mysqld gdb> run ... back # Do this when mysqld crashes info locals up info locals up ... (until you get some information about local variables) quit backtrace full # Do this when mysqld crashes @end example Include the above output in a mail generated with @code{mysqlbug} and Loading @@ -50082,7 +50125,7 @@ debugging information by using the @code{trace} method or by setting the @code{DBI_TRACE} environment variable. @xref{Perl DBI Class, , Perl @code{DBI} Class}. @node Using stack trace, Using log files, Making trace files, Debugging server @node Using stack trace, Using log files, Using gdb on mysqld, Debugging server @appendixsubsec Using a stack trace On some operating systems, the error log will contain a stack trace if Loading Loading @@ -50297,7 +50340,7 @@ A very common mistake is to use an old @file{mysql.h} file from an old The @strong{MySQL} server and most @strong{MySQL} clients are compiled with the DBUG package originally made by Fred Fish. When one has configured @strong{MySQL} for debugging, this package makes it possible to get a trace file of what the program is debugging. file of what the program is debugging. @xref{Making trace files}. One uses the debug package by invoking the program with the @code{--debug="..."} or the @code{-#...} option.
innobase/pars/pars0grm.c +2 −1 Original line number Diff line number Diff line Loading @@ -95,9 +95,10 @@ /* The value of the semantic attribute is a pointer to a query tree node que_node_t */ #define YYSTYPE que_node_t* #define alloca mem_alloc #include "univ.i" #undef alloca #define alloca mem_alloc #include <math.h> #include "pars0pars.h" #include "mem0mem.h" Loading
mysys/mf_keycache.c +6 −6 Original line number Diff line number Diff line Loading @@ -327,7 +327,7 @@ int key_cache_write(File file, my_off_t filepos, byte *buff, uint length, } #if !defined(DBUG_OFF) && defined(EXTRA_DEBUG) DBUG_EXECUTE("exec",test_key_cache("start of key_cache_write",1);); DBUG_EXECUTE("check_keycache",test_key_cache("start of key_cache_write",1);); #endif if (_my_disk_blocks > 0) { /* We have key_cacheing */ Loading Loading @@ -367,7 +367,7 @@ int key_cache_write(File file, my_off_t filepos, byte *buff, uint length, } end: #if !defined(DBUG_OFF) && defined(EXTRA_DEBUG) DBUG_EXECUTE("exec",test_key_cache("end of key_cache_write",1);); DBUG_EXECUTE("check_keycache",test_key_cache("end of key_cache_write",1);); #endif return(error); } /* key_cache_write */ Loading @@ -381,7 +381,7 @@ static SEC_LINK *find_key_block(int file, my_off_t filepos, int *error) reg1 SEC_LINK *next,**start; #if !defined(DBUG_OFF) && defined(EXTRA_DEBUG) DBUG_EXECUTE("exec",test_key_cache("start of find_key_block",0);); DBUG_EXECUTE("check_keycache",test_key_cache("start of find_key_block",0);); #endif *error=0; Loading Loading @@ -459,7 +459,7 @@ static SEC_LINK *find_key_block(int file, my_off_t filepos, int *error) } _my_used_last=next; #if !defined(DBUG_OFF) && defined(EXTRA_DEBUG) DBUG_EXECUTE("exec",test_key_cache("end of find_key_block",0);); DBUG_EXECUTE("check_keycache",test_key_cache("end of find_key_block",0);); #endif return next; } /* find_key_block */ Loading Loading @@ -529,7 +529,7 @@ int flush_key_blocks(File file, enum flush_type type) pthread_mutex_lock(&THR_LOCK_keycache); #if !defined(DBUG_OFF) && defined(EXTRA_DEBUG) DBUG_EXECUTE("exec",test_key_cache("start of flush_key_blocks",0);); DBUG_EXECUTE("check_keycache",test_key_cache("start of flush_key_blocks",0);); #endif cache=cache_buff; /* If no key cache */ if (_my_disk_blocks > 0 && Loading Loading @@ -607,7 +607,7 @@ int flush_key_blocks(File file, enum flush_type type) } } #ifndef DBUG_OFF DBUG_EXECUTE("exec",test_key_cache("end of flush_key_blocks",0);); DBUG_EXECUTE("check_keycache",test_key_cache("end of flush_key_blocks",0);); #endif pthread_mutex_unlock(&THR_LOCK_keycache); if (cache != cache_buff) Loading
sql-bench/crash-me.sh +1 −1 Original line number Diff line number Diff line #!@PERL@ -w #!@PERL@ # Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB # # This library is free software; you can redistribute it and/or Loading
sql/mysqld.cc +16 −0 Original line number Diff line number Diff line Loading @@ -152,6 +152,22 @@ static uint handler_count; static bool opt_console=0,start_mode=0; #endif /* Set prefix for windows binary */ #ifdef __WIN__ #undef MYSQL_SERVER_SUFFIX #ifdef __NT__ #if defined(HAVE_INNOBASE_DB) || defined(HAVE_BERKELEY_DB) #define MYSQL_SERVER_SUFFIX "-max-nt" #else #define MYSQL_SERVER_SUFFIX "-nt" #endif /* ...DB */ #elif defined(HAVE_INNOBASE_DB) || defined(HAVE_BERKELEY_DB) #define MYSQL_SERVER_SUFFIX "-max" #else #define MYSQL_SERVER_SUFFIX "" #endif /* __NT__ */ #endif #ifdef HAVE_BERKELEY_DB SHOW_COMP_OPTION have_berkeley_db=SHOW_OPTION_YES; #else Loading