Commit 27a17a6e authored by unknown's avatar unknown

Merge work:/home/bk/mysql into donna.mysql.com:/home/my/bk/mysql


Docs/manual.texi:
  Auto merged
parents f613c4f1 c33289a3
...@@ -162,18 +162,18 @@ General Information About MySQL ...@@ -162,18 +162,18 @@ General Information About MySQL
* General-SQL:: General SQL information and tutorials * General-SQL:: General SQL information and tutorials
* Useful Links:: Useful @strong{MySQL}-related links * Useful Links:: Useful @strong{MySQL}-related links
About this manual About This Manual
* Manual conventions:: Conventions used in this manual * Manual conventions:: Conventions used in this manual
MySQL mailing lists MySQL Mailing Lists
* Mailing-list:: The @strong{MySQL} mailing lists * Mailing-list:: The @strong{MySQL} mailing lists
* Asking questions:: Asking questions or reporting bugs * Asking questions:: Asking questions or reporting bugs
* Bug reports:: How to report bugs or problems * Bug reports:: How to report bugs or problems
* Answering questions:: Guidelines for answering questions on the mailing list * Answering questions:: Guidelines for answering questions on the mailing list
MySQL licensing and support MySQL Licensing and Support
* Licensing policy:: @strong{MySQL} licensing policy * Licensing policy:: @strong{MySQL} licensing policy
* Copyright:: Copyrights used by @strong{MySQL} * Copyright:: Copyrights used by @strong{MySQL}
...@@ -181,22 +181,22 @@ MySQL licensing and support ...@@ -181,22 +181,22 @@ MySQL licensing and support
* Cost:: @strong{MySQL} licensing and support costs * Cost:: @strong{MySQL} licensing and support costs
* Support:: Types of commercial support * Support:: Types of commercial support
Copyrights used by MySQL Copyrights Used by MySQL
* Copyright changes:: Possible future copyright changes * Copyright changes:: Possible future copyright changes
Example licensing situations Example Licensing Situations
* Products that use MySQL:: Selling products that use @strong{MySQL} * Products that use MySQL:: Selling products that use @strong{MySQL}
* ISP:: ISP @strong{MySQL} services * ISP:: ISP @strong{MySQL} services
* Web server:: Running a web server using @strong{MySQL}. * Web server:: Running a web server using @strong{MySQL}.
@strong{MySQL} licensing and support costs @strong{MySQL} Licensing and Support Costs
* Payment information:: Payment information * Payment information:: Payment information
* Contact information:: Contact information * Contact information:: Contact information
Types of commercial support Types of Commercial Support
* Basic email support:: Basic email support * Basic email support:: Basic email support
* Extended email support:: Extended email support * Extended email support:: Extended email support
...@@ -222,31 +222,31 @@ Installing MySQL ...@@ -222,31 +222,31 @@ Installing MySQL
* Post-installation:: Post-installation setup and testing * Post-installation:: Post-installation setup and testing
* Upgrade:: Is there anything special to do when upgrading/downgrading @strong{MySQL}? * Upgrade:: Is there anything special to do when upgrading/downgrading @strong{MySQL}?
Installing a MySQL binary distribution Installing a MySQL Binary Distribution
* Linux-RPM:: Linux RPM files * Linux-RPM:: Linux RPM files
* Building clients:: Building client programs * Building clients:: Building client programs
* Binary install system issues:: System-specific issues * Binary install system issues:: System-specific issues
System-specific issues System-specific Issues
* Binary notes-Linux:: Linux notes for binary distribution * Binary notes-Linux:: Linux notes for binary distribution
* Binary notes-HP-UX:: HP-UX notes for binary distribution * Binary notes-HP-UX:: HP-UX notes for binary distribution
Installing a MySQL source distribution Installing a MySQL Source Distribution
* Quick install:: Quick installation overview * Quick install:: Quick installation overview
* Applying patches:: Applying patches * Applying patches:: Applying patches
* configure options:: Typical @code{configure} options * configure options:: Typical @code{configure} options
Perl installation comments Perl Installation Comments
* Perl installation:: Installing Perl on Unix * Perl installation:: Installing Perl on Unix
* ActiveState Perl:: Installing ActiveState Perl on Windows * ActiveState Perl:: Installing ActiveState Perl on Windows
* Windows Perl:: Installing the @strong{MySQL} Perl distribution on Windows * Windows Perl:: Installing the @strong{MySQL} Perl distribution on Windows
* Perl support problems:: Problems using the Perl @code{DBI}/@code{DBD} interface * Perl support problems:: Problems using the Perl @code{DBI}/@code{DBD} interface
System-specific issues System-specific Issues
* Solaris:: Solaris notes * Solaris:: Solaris notes
* Solaris 2.7:: Solaris 2.7 / 2.8 notes * Solaris 2.7:: Solaris 2.7 / 2.8 notes
...@@ -268,7 +268,7 @@ System-specific issues ...@@ -268,7 +268,7 @@ System-specific issues
* Mac OS X:: Mac OS X notes * Mac OS X:: Mac OS X notes
* BEOS:: * BEOS::
Linux notes (all Linux versions) Linux Notes (All Linux Versions)
* Linux-x86:: Linux-x86 notes * Linux-x86:: Linux-x86 notes
* Linux-RedHat50:: RedHat 5.0 notes * Linux-RedHat50:: RedHat 5.0 notes
...@@ -279,13 +279,13 @@ Linux notes (all Linux versions) ...@@ -279,13 +279,13 @@ Linux notes (all Linux versions)
* Qube2:: Qube2 Linux notes * Qube2:: Qube2 Linux notes
* Linux-Ia64:: * Linux-Ia64::
BSD/OS notes BSD/OS Notes
* BSDI2:: BSD/OS 2.x notes * BSDI2:: BSD/OS 2.x notes
* BSDI3:: BSD/OS 3.x notes * BSDI3:: BSD/OS 3.x notes
* BSDI4:: BSD/OS 4.x notes * BSDI4:: BSD/OS 4.x notes
Windows notes Windows Notes
* Windows installation:: Installing @strong{MySQL} on Windows * Windows installation:: Installing @strong{MySQL} on Windows
* Win95 start:: Starting @strong{MySQL} on Win95 / Win98 * Win95 start:: Starting @strong{MySQL} on Win95 / Win98
...@@ -297,7 +297,7 @@ Windows notes ...@@ -297,7 +297,7 @@ Windows notes
* Windows and BDB tables.:: * Windows and BDB tables.::
* Windows vs Unix:: @strong{MySQL}-Windows compared to Unix @strong{MySQL} * Windows vs Unix:: @strong{MySQL}-Windows compared to Unix @strong{MySQL}
Post-installation setup and testing Post-installation Setup and Testing
* mysql_install_db:: Problems running @code{mysql_install_db} * mysql_install_db:: Problems running @code{mysql_install_db}
* Starting server:: Problems starting the @strong{MySQL} server * Starting server:: Problems starting the @strong{MySQL} server
...@@ -367,10 +367,10 @@ MySQL language reference ...@@ -367,10 +367,10 @@ MySQL language reference
* DROP TABLE:: @code{DROP TABLE} syntax * DROP TABLE:: @code{DROP TABLE} syntax
* OPTIMIZE TABLE:: @code{OPTIMIZE TABLE} syntax * OPTIMIZE TABLE:: @code{OPTIMIZE TABLE} syntax
* CHECK TABLE:: @code{CHECK TABLE} syntax * CHECK TABLE:: @code{CHECK TABLE} syntax
* ANALYZE TABLE:: @code{ANALYZE TABLE} syntax
* REPAIR TABLE:: @code{REPAIR TABLE} syntax
* BACKUP TABLE:: @code{BACKUP TABLE} syntax * BACKUP TABLE:: @code{BACKUP TABLE} syntax
* RESTORE TABLE:: @code{RESTORE TABLE} syntax * RESTORE TABLE:: @code{RESTORE TABLE} syntax
* ANALYZE TABLE:: @code{ANALYZE TABLE} syntax
* REPAIR TABLE:: @code{REPAIR TABLE} syntax
* DELETE:: @code{DELETE} syntax * DELETE:: @code{DELETE} syntax
* SELECT:: @code{SELECT} syntax * SELECT:: @code{SELECT} syntax
* JOIN:: @code{JOIN} syntax * JOIN:: @code{JOIN} syntax
...@@ -464,7 +464,7 @@ Functions for use in @code{SELECT} and @code{WHERE} clauses ...@@ -464,7 +464,7 @@ Functions for use in @code{SELECT} and @code{WHERE} clauses
MySQL table types MySQL table types
* MyISAM:: MyISAM tables * MyISAM:: MyISAM tables
* MERGE:: MERGE tables * MERGE::
* ISAM:: ISAM tables * ISAM:: ISAM tables
* HEAP:: HEAP tables * HEAP:: HEAP tables
* BDB:: BDB or Berkeley_db tables * BDB:: BDB or Berkeley_db tables
...@@ -543,7 +543,7 @@ Replication in MySQL ...@@ -543,7 +543,7 @@ Replication in MySQL
* Replication Features:: Replication Features * Replication Features:: Replication Features
* Replication Options:: Replication Options in my.cnf * Replication Options:: Replication Options in my.cnf
* Replication SQL:: SQL Commands related to replication * Replication SQL:: SQL Commands related to replication
* Replication FAQ:: Frequently asked questions about replication * Replication FAQ:: Frequently Asked Questions about replication
Getting maximum performance from MySQL Getting maximum performance from MySQL
...@@ -580,7 +580,7 @@ Speed of queries that access or update data ...@@ -580,7 +580,7 @@ Speed of queries that access or update data
* Estimating performance:: Estimating query performance * Estimating performance:: Estimating query performance
* SELECT speed:: Speed of @code{SELECT} queries * SELECT speed:: Speed of @code{SELECT} queries
* Where optimizations:: How MySQL optimizes @code{WHERE} clauses * Where optimizations:: How MySQL optimizes @code{WHERE} clauses
* LEFT JOIN optimization:: How MySQL optimizes @code{LEFT JOIN} and @code{RIGHT JOIN} * LEFT JOIN optimization:: How MySQL optimizes @code{LEFT JOIN}
* LIMIT optimization:: How MySQL optimizes @code{LIMIT} * LIMIT optimization:: How MySQL optimizes @code{LIMIT}
* Insert speed:: Speed of @code{INSERT} queries * Insert speed:: Speed of @code{INSERT} queries
* Update speed:: Speed of @code{UPDATE} queries * Update speed:: Speed of @code{UPDATE} queries
...@@ -811,6 +811,7 @@ MySQL change history ...@@ -811,6 +811,7 @@ MySQL change history
Changes in release 3.23.x (Recommended; beta) Changes in release 3.23.x (Recommended; beta)
* News-3.23.26:: Changes in release 3.23.26
* News-3.23.25:: Changes in release 3.23.25 * News-3.23.25:: Changes in release 3.23.25
* News-3.23.24:: Changes in release 3.23.24 * News-3.23.24:: Changes in release 3.23.24
* News-3.23.23:: Changes in release 3.23.23 * News-3.23.23:: Changes in release 3.23.23
...@@ -938,7 +939,7 @@ Changes in release 3.19.x ...@@ -938,7 +939,7 @@ Changes in release 3.19.x
* News-3.19.4:: Changes in release 3.19.4 * News-3.19.4:: Changes in release 3.19.4
* News-3.19.3:: Changes in release 3.19.3 * News-3.19.3:: Changes in release 3.19.3
List of things we want to add to MySQL in the future (The TODO) MySQL and the future (The TODO)
* TODO future:: Things that must done in the very near future * TODO future:: Things that must done in the very near future
* TODO sometime:: Things that have to be done sometime * TODO sometime:: Things that have to be done sometime
...@@ -6473,8 +6474,8 @@ table. @xref{Crashing}. ...@@ -6473,8 +6474,8 @@ table. @xref{Crashing}.
To get a core dump on Linux if mysqld dies with a SIGSEGV To get a core dump on Linux if mysqld dies with a SIGSEGV
signal, you can start mysqld with the @code{--core-file} option. Note signal, you can start mysqld with the @code{--core-file} option. Note
that you also probably need to raise the @code{core file size} with that you also probably need to raise the @code{core file size} by adding
@code{ulimit}! @code{ulimit -c 1000000} to @code{safe_mysqld}.
If you are using LinuxThreads and @code{mysqladmin shutdown} doesn't work, If you are using LinuxThreads and @code{mysqladmin shutdown} doesn't work,
you must upgrade to LinuxThreads Version 0.7.1 or newer. you must upgrade to LinuxThreads Version 0.7.1 or newer.
...@@ -12373,10 +12374,10 @@ to restart @code{mysqld} with @code{--skip-grant-tables} to run ...@@ -12373,10 +12374,10 @@ to restart @code{mysqld} with @code{--skip-grant-tables} to run
* DROP TABLE:: @code{DROP TABLE} syntax * DROP TABLE:: @code{DROP TABLE} syntax
* OPTIMIZE TABLE:: @code{OPTIMIZE TABLE} syntax * OPTIMIZE TABLE:: @code{OPTIMIZE TABLE} syntax
* CHECK TABLE:: @code{CHECK TABLE} syntax * CHECK TABLE:: @code{CHECK TABLE} syntax
* ANALYZE TABLE:: @code{ANALYZE TABLE} syntax
* REPAIR TABLE:: @code{REPAIR TABLE} syntax
* BACKUP TABLE:: @code{BACKUP TABLE} syntax * BACKUP TABLE:: @code{BACKUP TABLE} syntax
* RESTORE TABLE:: @code{RESTORE TABLE} syntax * RESTORE TABLE:: @code{RESTORE TABLE} syntax
* ANALYZE TABLE:: @code{ANALYZE TABLE} syntax
* REPAIR TABLE:: @code{REPAIR TABLE} syntax
* DELETE:: @code{DELETE} syntax * DELETE:: @code{DELETE} syntax
* SELECT:: @code{SELECT} syntax * SELECT:: @code{SELECT} syntax
* JOIN:: @code{JOIN} syntax * JOIN:: @code{JOIN} syntax
...@@ -17761,7 +17762,7 @@ The different check types stand for the following: ...@@ -17761,7 +17762,7 @@ The different check types stand for the following:
@end multitable @end multitable
@findex BACKUP TABLE @findex BACKUP TABLE
@node BACKUP TABLE, RESTORE TABLE, CHECK TABLE, Reference @node BACKUP TABLE, RESTORE TABLE, CHECK TABLE, Reference
@section @code{BACKUP TABLE} syntax @section @code{BACKUP TABLE} syntax
@example @example
...@@ -17936,6 +17937,7 @@ the @code{LIMIT} value. ...@@ -17936,6 +17937,7 @@ the @code{LIMIT} value.
@node SELECT, JOIN, DELETE, Reference @node SELECT, JOIN, DELETE, Reference
@section @code{SELECT} syntax @section @code{SELECT} syntax
@c help SELECT
@example @example
SELECT [STRAIGHT_JOIN] [SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT] SELECT [STRAIGHT_JOIN] [SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT]
[HIGH_PRIORITY] [HIGH_PRIORITY]
...@@ -17950,6 +17952,7 @@ SELECT [STRAIGHT_JOIN] [SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT] ...@@ -17950,6 +17952,7 @@ SELECT [STRAIGHT_JOIN] [SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT]
[LIMIT [offset,] rows] [LIMIT [offset,] rows]
[PROCEDURE procedure_name] ] [PROCEDURE procedure_name] ]
@end example @end example
@c help end
@code{SELECT} is used to retrieve rows selected from one or more tables. @code{SELECT} is used to retrieve rows selected from one or more tables.
@code{select_expression} indicates the columns you want to retrieve. @code{select_expression} indicates the columns you want to retrieve.
...@@ -24686,7 +24689,7 @@ command line. (Slave) ...@@ -24686,7 +24689,7 @@ command line. (Slave)
@end multitable @end multitable
@node Replication FAQ, , Replication SQL, Replication @node Replication FAQ, , Replication SQL, Replication
@section Replication FAQ @section Replication FAQ
@cindex Binlog_Dump @cindex Binlog_Dump
...@@ -36509,7 +36512,6 @@ The twz driver: A type 4 JDBC driver by Terrence W. Zellers ...@@ -36509,7 +36512,6 @@ The twz driver: A type 4 JDBC driver by Terrence W. Zellers
private and educational use. (not supported anymore) private and educational use. (not supported anymore)
@c no answer from server 990830 @c no answer from server 990830
@c You can always find the latest driver at @uref{http://www.voicenet.com/~zellert/tjFM/}. @c You can always find the latest driver at @uref{http://www.voicenet.com/~zellert/tjFM/}.
@item
@item @uref{http://www.mysql.com/Downloads/Contrib/pmdamysql.tgz,pmdamysql.tgz} @item @uref{http://www.mysql.com/Downloads/Contrib/pmdamysql.tgz,pmdamysql.tgz}
A @strong{MySQL} PMDA. Provides @strong{MySQL} server status and configuration A @strong{MySQL} PMDA. Provides @strong{MySQL} server status and configuration
variables. variables.
...@@ -36611,6 +36613,11 @@ By Terry Jones ...@@ -36611,6 +36613,11 @@ By Terry Jones
@item @uref{http://www.mysql.com/Downloads/Contrib/eiffel-wrapper-1.0.tar.gz,eiffel-wrapper-1.0.tar.gz}. @item @uref{http://www.mysql.com/Downloads/Contrib/eiffel-wrapper-1.0.tar.gz,eiffel-wrapper-1.0.tar.gz}.
Eiffel wrapper by Michael Ravits. Eiffel wrapper by Michael Ravits.
@item @uref{http://www.mysql.com/Downloads/Contrib/SQLmy0.06.tgz,SQLmy0.06.tgz}.
FlagShip Replaceable Database Driver (RDD) for MySQL. By Alejandro
Fernandez Herrero.
@uref{http://www.fship.com/rdds.html, Flagship RDD home page}
@end itemize @end itemize
@appendixsec Clients @appendixsec Clients
...@@ -37054,7 +37061,6 @@ Previous versions of things found here that you probably won't be ...@@ -37054,7 +37061,6 @@ Previous versions of things found here that you probably won't be
interested in. interested in.
@end itemize @end itemize
@page @page
@node Credits, News, Contrib, Top @node Credits, News, Contrib, Top
@appendix Contributors to MySQL @appendix Contributors to MySQL
...@@ -37343,16 +37349,6 @@ ODBC and VisualC++ interface questions. ...@@ -37343,16 +37349,6 @@ ODBC and VisualC++ interface questions.
@strong{MySQL} server. @strong{MySQL} server.
@end table @end table
@c we don't want the entire change history in the nusphere manual
@ifset nusphere
@node News, Bugs, Credits, Top
@appendix MySQL change history
The MySQL change history can be found in the latest version of the mysql
manual at @url{http://www.mysql.com/documentation/manual/}
@end ifset
@ifclear nusphere
@node News, Bugs, Credits, Top @node News, Bugs, Credits, Top
@appendix MySQL change history @appendix MySQL change history
...@@ -37387,6 +37383,7 @@ version. The replication and BerkeleyDB code is still under development, ...@@ -37387,6 +37383,7 @@ version. The replication and BerkeleyDB code is still under development,
though, so 3.23 is not released as a stable version yet. though, so 3.23 is not released as a stable version yet.
@menu @menu
* News-3.23.26:: Changes in release 3.23.26
* News-3.23.25:: Changes in release 3.23.25 * News-3.23.25:: Changes in release 3.23.25
* News-3.23.24:: Changes in release 3.23.24 * News-3.23.24:: Changes in release 3.23.24
* News-3.23.23:: Changes in release 3.23.23 * News-3.23.23:: Changes in release 3.23.23
...@@ -37415,7 +37412,16 @@ though, so 3.23 is not released as a stable version yet. ...@@ -37415,7 +37412,16 @@ though, so 3.23 is not released as a stable version yet.
* News-3.23.0:: Changes in release 3.23.0 * News-3.23.0:: Changes in release 3.23.0
@end menu @end menu
@node News-3.23.25, News-3.23.24, News-3.23.x, News-3.23.x @node News-3.23.26, News-3.23.25, News-3.23.x, News-3.23.x
@appendixsubsec Changes in release 3.23.26
@itemize @bullet
@item
Fixed bug in @code{FULLTEXT} index when inserting a NULL column.
@item
Changed to use @code{mkstemp()} instead of @code{tempnam()}.
@end itemize
@node News-3.23.25, News-3.23.24, News-3.23.26, News-3.23.x
@appendixsubsec Changes in release 3.23.25 @appendixsubsec Changes in release 3.23.25
@itemize @bullet @itemize @bullet
@item @item
...@@ -41551,7 +41557,6 @@ fields, the @code{BLOB} was garbage on output. ...@@ -41551,7 +41557,6 @@ fields, the @code{BLOB} was garbage on output.
@item @item
Fixed @code{DISTINCT} with calculated columns. Fixed @code{DISTINCT} with calculated columns.
@end itemize @end itemize
@end ifclear
@node Bugs, TODO, News, Top @node Bugs, TODO, News, Top
@appendix Known errors and design deficiencies in MySQL @appendix Known errors and design deficiencies in MySQL
...@@ -42911,15 +42916,6 @@ All new development is concentrated to @strong{MySQL}. ...@@ -42911,15 +42916,6 @@ All new development is concentrated to @strong{MySQL}.
@page @page
@c This node name is special @c This node name is special
@ifset nusphere
@node GPL license, LGPL license, Unireg, Top
@appendix GNU General Public License
The GPL License can be found at ...
@end ifset
@ifclear nusphere
@node GPL license, LGPL license, Unireg, Top @node GPL license, LGPL license, Unireg, Top
@appendix GNU General Public License @appendix GNU General Public License
...@@ -43265,19 +43261,9 @@ library. If this is what you want to do, use the GNU Library General ...@@ -43265,19 +43261,9 @@ library. If this is what you want to do, use the GNU Library General
Public License instead of this License. Public License instead of this License.
@end example @end example
@end ifclear
@page @page
@ifset nusphere
@node LGPL license, Function Index, GPL license, Top
@appendix GNU Library General Public License
The LGPL License can be found at ...
@end ifset
@ifclear nusphere
@node LGPL license, Function Index, GPL license, Top @node LGPL license, Function Index, GPL license, Top
@appendix GNU Library General Public License @appendix GNU Library General Public License
...@@ -43764,7 +43750,6 @@ necessary. Here is a sample; alter the names: ...@@ -43764,7 +43750,6 @@ necessary. Here is a sample; alter the names:
That's all there is to it! That's all there is to it!
@end example @end example
@end ifclear
@node Function Index, Concept Index, LGPL license, Top @node Function Index, Concept Index, LGPL license, Top
@unnumbered SQL command, type and function index @unnumbered SQL command, type and function index
...@@ -62,6 +62,7 @@ char *argv[]; ...@@ -62,6 +62,7 @@ char *argv[];
HP_KEYSEG keyseg[MAX_KEYS*5]; HP_KEYSEG keyseg[MAX_KEYS*5];
HEAP_PTR position; HEAP_PTR position;
MY_INIT(argv[0]); /* init my_sys library & pthreads */ MY_INIT(argv[0]); /* init my_sys library & pthreads */
LINT_INIT(position);
filename= "test2"; filename= "test2";
filename2= "test2_2"; filename2= "test2_2";
......
...@@ -574,9 +574,9 @@ static int compress(MRG_INFO *mrg,char *result_table) ...@@ -574,9 +574,9 @@ static int compress(MRG_INFO *mrg,char *result_table)
end_file_buffer(); end_file_buffer();
if (verbose && mrg->records) if (verbose && mrg->records)
printf("Min record length: %6d Max length: %6d Mean total length: %6d\n", printf("Min record length: %6d Max length: %6d Mean total length: %6lu\n",
mrg->min_pack_length,mrg->max_pack_length, mrg->min_pack_length,mrg->max_pack_length,
(long) new_length/mrg->records); (ulong) new_length/mrg->records);
if (!test_only) if (!test_only)
{ {
...@@ -763,11 +763,11 @@ static int get_statistic(MRG_INFO *mrg,HUFF_COUNTS *huff_counts) ...@@ -763,11 +763,11 @@ static int get_statistic(MRG_INFO *mrg,HUFF_COUNTS *huff_counts)
{ {
global_count=count; global_count=count;
if (!(element=tree_insert(&count->int_tree,pos,0)) || if (!(element=tree_insert(&count->int_tree,pos,0)) ||
element->count == 1 && (element->count == 1 &&
count->tree_buff + tree_buff_length < count->tree_buff + tree_buff_length <
count->tree_pos + count->field_length || count->tree_pos + count->field_length ||
count->field_length == 1 && count->field_length == 1 &&
count->int_tree.elements_in_tree > 1) count->int_tree.elements_in_tree > 1))
{ {
delete_tree(&count->int_tree); delete_tree(&count->int_tree);
my_free(count->tree_buff,MYF(0)); my_free(count->tree_buff,MYF(0));
...@@ -1760,8 +1760,8 @@ static int compress_isam_file(MRG_INFO *mrg, HUFF_COUNTS *huff_counts) ...@@ -1760,8 +1760,8 @@ static int compress_isam_file(MRG_INFO *mrg, HUFF_COUNTS *huff_counts)
if (max_record_length >= max_allowed_length) if (max_record_length >= max_allowed_length)
{ {
fprintf(stderr, fprintf(stderr,
"Error: Found record with packed-length: %d, max is: %d\n", "Error: Found record with packed-length: %d, max is: %lu\n",
max_record_length,max_allowed_length); max_record_length, (ulong) max_allowed_length);
error=1; error=1;
break; break;
} }
......
...@@ -31,6 +31,7 @@ int nisam_update(register N_INFO *info, const byte *oldrec, const byte *newrec) ...@@ -31,6 +31,7 @@ int nisam_update(register N_INFO *info, const byte *oldrec, const byte *newrec)
uchar old_key[N_MAX_KEY_BUFF],*new_key; uchar old_key[N_MAX_KEY_BUFF],*new_key;
DBUG_ENTER("nisam_update"); DBUG_ENTER("nisam_update");
LINT_INIT(save_errno);
if (!(info->update & HA_STATE_AKTIV)) if (!(info->update & HA_STATE_AKTIV))
{ {
my_errno=HA_ERR_KEY_NOT_FOUND; my_errno=HA_ERR_KEY_NOT_FOUND;
...@@ -54,7 +55,7 @@ int nisam_update(register N_INFO *info, const byte *oldrec, const byte *newrec) ...@@ -54,7 +55,7 @@ int nisam_update(register N_INFO *info, const byte *oldrec, const byte *newrec)
info->s->base.max_key_file_length - info->s->base.max_key_file_length -
info->s->blocksize* INDEX_BLOCK_MARGIN *info->s->state.keys) info->s->blocksize* INDEX_BLOCK_MARGIN *info->s->state.keys)
{ {
my_errno=HA_ERR_INDEX_FILE_FULL; save_errno=HA_ERR_INDEX_FILE_FULL;
goto err_end; goto err_end;
} }
...@@ -108,12 +109,9 @@ int nisam_update(register N_INFO *info, const byte *oldrec, const byte *newrec) ...@@ -108,12 +109,9 @@ int nisam_update(register N_INFO *info, const byte *oldrec, const byte *newrec)
info->update= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED | HA_STATE_AKTIV | info->update= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED | HA_STATE_AKTIV |
key_changed); key_changed);
err_end: err_end:
nisam_log_record(LOG_UPDATE,info,newrec,info->lastpos,my_errno); nisam_log_record(LOG_UPDATE,info,newrec,info->lastpos,save_errno);
VOID(_nisam_writeinfo(info,1)); VOID(_nisam_writeinfo(info,1));
allow_break(); /* Allow SIGHUP & SIGINT */ allow_break(); /* Allow SIGHUP & SIGINT */
if (save_errno == HA_ERR_KEY_NOT_FOUND) my_errno=(save_errno == HA_ERR_KEY_NOT_FOUND) ? HA_ERR_CRASHED : save_errno;
my_errno=HA_ERR_CRASHED;
else
my_errno=save_errno;
DBUG_RETURN(-1); DBUG_RETURN(-1);
} /* nisam_update */ } /* nisam_update */
...@@ -87,7 +87,7 @@ FT_WORD * ft_linearize(MI_INFO *info, uint keynr, byte *keybuf, TREE *wtree) ...@@ -87,7 +87,7 @@ FT_WORD * ft_linearize(MI_INFO *info, uint keynr, byte *keybuf, TREE *wtree)
} }
delete_tree(wtree); delete_tree(wtree);
my_free((char*) wtree,MYF(0)); my_free((char*) wtree,MYF(0));
if (wlist==NULL) if (!wlist)
return NULL; return NULL;
docstat.list->pos=NULL; docstat.list->pos=NULL;
......
...@@ -37,9 +37,8 @@ static FT_WORD * _mi_ft_parserecord(MI_INFO *info, uint keynr, byte *keybuf, ...@@ -37,9 +37,8 @@ static FT_WORD * _mi_ft_parserecord(MI_INFO *info, uint keynr, byte *keybuf,
byte *pos; byte *pos;
uint i; uint i;
i=info->s->keyinfo[keynr].keysegs-FT_SEGS;
keyseg=info->s->keyinfo[keynr].seg; keyseg=info->s->keyinfo[keynr].seg;
while(i--) for (i=info->s->keyinfo[keynr].keysegs-FT_SEGS ; i-- ; )
{ {
uint len; uint len;
...@@ -61,10 +60,12 @@ static FT_WORD * _mi_ft_parserecord(MI_INFO *info, uint keynr, byte *keybuf, ...@@ -61,10 +60,12 @@ static FT_WORD * _mi_ft_parserecord(MI_INFO *info, uint keynr, byte *keybuf,
} }
else else
len=keyseg->length; len=keyseg->length;
if (!(parsed=ft_parse(parsed, pos, len)))
parsed=ft_parse(parsed, pos, len); return NULL;
if (parsed==NULL) return NULL;
} }
/* Handle the case where all columns are NULL */
if (!parsed && !(parsed=ft_parse(0, "", 0)))
return NULL;
return ft_linearize(info, keynr, keybuf, parsed); return ft_linearize(info, keynr, keybuf, parsed);
} }
......
...@@ -314,7 +314,7 @@ int chk_size(MI_CHECK *param, register MI_INFO *info) ...@@ -314,7 +314,7 @@ int chk_size(MI_CHECK *param, register MI_INFO *info)
int chk_key(MI_CHECK *param, register MI_INFO *info) int chk_key(MI_CHECK *param, register MI_INFO *info)
{ {
uint key,found_keys=0,full_text_keys=0; uint key,found_keys=0,full_text_keys=0,result=0;
ha_rows keys; ha_rows keys;
ha_checksum old_record_checksum,init_checksum; ha_checksum old_record_checksum,init_checksum;
my_off_t all_keydata,all_totaldata,key_totlength,length; my_off_t all_keydata,all_totaldata,key_totlength,length;
...@@ -361,7 +361,10 @@ int chk_key(MI_CHECK *param, register MI_INFO *info) ...@@ -361,7 +361,10 @@ int chk_key(MI_CHECK *param, register MI_INFO *info)
{ {
mi_check_print_error(param,"Can't read indexpage from filepos: %s", mi_check_print_error(param,"Can't read indexpage from filepos: %s",
llstr(share->state.key_root[key],buff)); llstr(share->state.key_root[key],buff));
DBUG_RETURN(-1); if (!(param->testflag & T_INFO))
DBUG_RETURN(-1);
result= -1;
continue;
} }
param->key_file_blocks+=keyinfo->block_length; param->key_file_blocks+=keyinfo->block_length;
keys=0; keys=0;
...@@ -377,7 +380,10 @@ int chk_key(MI_CHECK *param, register MI_INFO *info) ...@@ -377,7 +380,10 @@ int chk_key(MI_CHECK *param, register MI_INFO *info)
{ {
mi_check_print_error(param,"Found %s keys of %s",llstr(keys,buff), mi_check_print_error(param,"Found %s keys of %s",llstr(keys,buff),
llstr(info->state->records,buff2)); llstr(info->state->records,buff2));
if (!(param->testflag & T_INFO))
DBUG_RETURN(-1); DBUG_RETURN(-1);
result= -1;
continue;
} }
if (found_keys - full_text_keys == 1 && if (found_keys - full_text_keys == 1 &&
((share->options & ((share->options &
...@@ -391,7 +397,10 @@ int chk_key(MI_CHECK *param, register MI_INFO *info) ...@@ -391,7 +397,10 @@ int chk_key(MI_CHECK *param, register MI_INFO *info)
key+1); key+1);
else else
mi_check_print_error(param,"Key 1 doesn't point at all records"); mi_check_print_error(param,"Key 1 doesn't point at all records");
DBUG_RETURN(-1); if (!(param->testflag & T_INFO))
DBUG_RETURN(-1);
result= -1;
continue;
} }
} }
else else
......
...@@ -39,13 +39,13 @@ int _mi_rkey(MI_INFO *info, byte *buf, int inx, const byte *key, uint key_len, ...@@ -39,13 +39,13 @@ int _mi_rkey(MI_INFO *info, byte *buf, int inx, const byte *key, uint key_len,
if (raw_key) if (raw_key)
{ {
if (key_len == 0) if (key_len == 0)
key_len=USE_WHOLE_KEY; key_len=USE_WHOLE_KEY;
key_buff=info->lastkey+info->s->base.max_key_length; key_buff=info->lastkey+info->s->base.max_key_length;
pack_key_length=_mi_pack_key(info,(uint) inx,key_buff,(uchar*) key,key_len); pack_key_length=_mi_pack_key(info,(uint) inx,key_buff,(uchar*) key,key_len);
info->last_rkey_length=pack_key_length; info->last_rkey_length=pack_key_length;
DBUG_EXECUTE("key",_mi_print_key(DBUG_FILE,share->keyinfo[inx].seg, DBUG_EXECUTE("key",_mi_print_key(DBUG_FILE,share->keyinfo[inx].seg,
key_buff,pack_key_length);); key_buff,pack_key_length););
} }
else else
{ {
......
...@@ -193,7 +193,7 @@ static struct option long_options[] = ...@@ -193,7 +193,7 @@ static struct option long_options[] =
static void print_version(void) static void print_version(void)
{ {
printf("%s Ver 1.31 for %s at %s\n",my_progname,SYSTEM_TYPE, printf("%s Ver 1.32 for %s at %s\n",my_progname,SYSTEM_TYPE,
MACHINE_TYPE); MACHINE_TYPE);
} }
......
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
struct file_info { struct file_info {
long process; long process;
int filenr,id; int filenr,id;
uint rnd;
my_string name,show_name,record; my_string name,show_name,record;
MI_INFO *isam; MI_INFO *isam;
bool closed,used; bool closed,used;
...@@ -70,13 +71,14 @@ static void printf_log(const char *str,...); ...@@ -70,13 +71,14 @@ static void printf_log(const char *str,...);
static bool cmp_filename(struct file_info *file_info,my_string name); static bool cmp_filename(struct file_info *file_info,my_string name);
static uint verbose=0,update=0,test_info=0,max_files=0,re_open_count=0, static uint verbose=0,update=0,test_info=0,max_files=0,re_open_count=0,
recover=0,prefix_remove=0,opt_processes=0; recover=0,prefix_remove=0,opt_processes=0,opt_myisam_with_debug=0;
static my_string log_filename=0,filepath=0,write_filename=0,record_pos_file=0; static my_string log_filename=0,filepath=0,write_filename=0,record_pos_file=0;
static ulong com_count[10][3],number_of_commands=(ulong) ~0L, static ulong com_count[10][3],number_of_commands=(ulong) ~0L,
isamlog_process; isamlog_process;
static my_off_t isamlog_filepos,start_offset=0,record_pos= HA_OFFSET_ERROR; static my_off_t isamlog_filepos,start_offset=0,record_pos= HA_OFFSET_ERROR;
static const char *command_name[]= static const char *command_name[]=
{"open","write","update","delete","close","extra","lock","re-open","delete-all", NullS}; {"open","write","update","delete","close","extra","lock","re-open",
"delete-all", NullS};
int main(int argc, char **argv) int main(int argc, char **argv)
...@@ -91,11 +93,11 @@ int main(int argc, char **argv) ...@@ -91,11 +93,11 @@ int main(int argc, char **argv)
max_files=(set_maximum_open_files(min(max_files,8))-6)/2; max_files=(set_maximum_open_files(min(max_files,8))-6)/2;
if (update) if (update)
printf("Trying to %s isamfiles according to log '%s'\n", printf("Trying to %s MyISAM files according to log '%s'\n",
(recover ? "recover" : "update"),log_filename); (recover ? "recover" : "update"),log_filename);
error= examine_log(log_filename,argv); error= examine_log(log_filename,argv);
if (update && ! error) if (update && ! error)
puts("isamfile:s updated successfully"); puts("Tables updated successfully");
total_count=total_error=total_recover=0; total_count=total_error=total_recover=0;
for (i=first=0 ; command_name[i] ; i++) for (i=first=0 ; command_name[i] ; i++)
{ {
...@@ -134,7 +136,7 @@ static void get_options(register int *argc, register char ***argv) ...@@ -134,7 +136,7 @@ static void get_options(register int *argc, register char ***argv)
char option; char option;
help=0; help=0;
usage="Usage: %s [-?iruvIV] [-c #] [-f #] [-F filepath/] [-o #] [-R file recordpos] [-w write_file] [log-filename [table ...]] \n"; usage="Usage: %s [-?iruvDIV] [-c #] [-f #] [-F filepath/] [-o #] [-R file recordpos] [-w write_file] [log-filename [table ...]] \n";
pos=""; pos="";
while (--*argc > 0 && *(pos = *(++*argv)) == '-' ) { while (--*argc > 0 && *(pos = *(++*argv)) == '-' ) {
...@@ -199,6 +201,9 @@ static void get_options(register int *argc, register char ***argv) ...@@ -199,6 +201,9 @@ static void get_options(register int *argc, register char ***argv)
update=1; update=1;
recover++; recover++;
break; break;
case 'D':
opt_myisam_with_debug=1;
break;
case 'P': case 'P':
opt_processes=1; opt_processes=1;
break; break;
...@@ -246,7 +251,7 @@ static void get_options(register int *argc, register char ***argv) ...@@ -246,7 +251,7 @@ static void get_options(register int *argc, register char ***argv)
/* Fall through */ /* Fall through */
case 'I': case 'I':
case '?': case '?':
printf("%s Ver 1.2 for %s at %s\n",my_progname,SYSTEM_TYPE, printf("%s Ver 1.3 for %s at %s\n",my_progname,SYSTEM_TYPE,
MACHINE_TYPE); MACHINE_TYPE);
puts("By Monty, for your professional use\n"); puts("By Monty, for your professional use\n");
if (version) if (version)
...@@ -261,7 +266,7 @@ static void get_options(register int *argc, register char ***argv) ...@@ -261,7 +266,7 @@ static void get_options(register int *argc, register char ***argv)
puts(" -o \"offset\" -p # \"remove # components from path\""); puts(" -o \"offset\" -p # \"remove # components from path\"");
puts(" -r \"recover\" -R \"file recordposition\""); puts(" -r \"recover\" -R \"file recordposition\"");
puts(" -u \"update\" -v \"verbose\" -w \"write file\""); puts(" -u \"update\" -v \"verbose\" -w \"write file\"");
puts(" -P \"processes\""); puts(" -D \"myisam compileled with DBUG\" -P \"processes\"");
puts("\nOne can give a second and a third '-v' for more verbose."); puts("\nOne can give a second and a third '-v' for more verbose.");
puts("Normaly one does a update (-u)."); puts("Normaly one does a update (-u).");
puts("If a recover is done all writes and all possibly updates and deletes is done\nand errors are only counted."); puts("If a recover is done all writes and all possibly updates and deletes is done\nand errors are only counted.");
...@@ -365,14 +370,16 @@ static int examine_log(my_string file_name, char **table_names) ...@@ -365,14 +370,16 @@ static int examine_log(my_string file_name, char **table_names)
case MI_LOG_OPEN: case MI_LOG_OPEN:
if (!table_names[0]) if (!table_names[0])
{ {
com_count[command][0]--; /* Must be counted explicite */ com_count[command][0]--; /* Must be counted explicite */
if (result) if (result)
com_count[command][1]--; com_count[command][1]--;
} }
if (curr_file_info) if (curr_file_info)
printf("\nWarning: %s is opened twice with same process and filenumber\n", {
printf("\nWarning: %s is opened with same process and filenumber\nMaybe you should use the -P option ?\n",
curr_file_info->show_name); curr_file_info->show_name);
}
if (my_b_read(&cache,(byte*) head,2)) if (my_b_read(&cache,(byte*) head,2))
goto err; goto err;
file_info.name=0; file_info.name=0;
...@@ -389,7 +396,7 @@ static int examine_log(my_string file_name, char **table_names) ...@@ -389,7 +396,7 @@ static int examine_log(my_string file_name, char **table_names)
for (pos=file_info.name; pos=strchr(pos,'\\') ; pos++) for (pos=file_info.name; pos=strchr(pos,'\\') ; pos++)
*pos= '/'; *pos= '/';
pos=file_info.name; pos=file_info.name;
for (i=0 ; i < prefix_remove ; i++) for (i=0 ; i < prefix_remove ; i++)
{ {
char *next; char *next;
...@@ -446,6 +453,10 @@ static int examine_log(my_string file_name, char **table_names) ...@@ -446,6 +453,10 @@ static int examine_log(my_string file_name, char **table_names)
goto end; goto end;
files_open++; files_open++;
file_info.closed=0; file_info.closed=0;
if (opt_myisam_with_debug)
file_info.isam->s->rnd= 0;
else
file_info.isam->s->rnd= isamlog_process;
} }
VOID(tree_insert(&tree,(gptr) &file_info,0)); VOID(tree_insert(&tree,(gptr) &file_info,0));
if (file_info.used) if (file_info.used)
...@@ -482,10 +493,12 @@ static int examine_log(my_string file_name, char **table_names) ...@@ -482,10 +493,12 @@ static int examine_log(my_string file_name, char **table_names)
if (mi_extra(curr_file_info->isam, if (mi_extra(curr_file_info->isam,
(int) extra_command) != (int) result) (int) extra_command) != (int) result)
{ {
fflush(stdout);
VOID(fprintf(stderr, VOID(fprintf(stderr,
"Warning: error %d, expected %d on command %s at %s\n", "Warning: error %d, expected %d on command %s at %s\n",
my_errno,result,command_name[command], my_errno,result,command_name[command],
llstr(isamlog_filepos,llbuff))); llstr(isamlog_filepos,llbuff)));
fflush(stderr);
} }
} }
break; break;
...@@ -628,9 +641,11 @@ static int examine_log(my_string file_name, char **table_names) ...@@ -628,9 +641,11 @@ static int examine_log(my_string file_name, char **table_names)
command_name[command],result); command_name[command],result);
break; break;
default: default:
fflush(stdout);
VOID(fprintf(stderr, VOID(fprintf(stderr,
"Error: found unknown command %d in logfile, aborted\n", "Error: found unknown command %d in logfile, aborted\n",
command)); command));
fflush(stderr);
goto end; goto end;
} }
} }
...@@ -643,12 +658,16 @@ static int examine_log(my_string file_name, char **table_names) ...@@ -643,12 +658,16 @@ static int examine_log(my_string file_name, char **table_names)
DBUG_RETURN(0); DBUG_RETURN(0);
err: err:
fflush(stdout);
VOID(fprintf(stderr,"Got error %d when reading from logfile\n",my_errno)); VOID(fprintf(stderr,"Got error %d when reading from logfile\n",my_errno));
fflush(stderr);
goto end; goto end;
com_err: com_err:
fflush(stdout);
VOID(fprintf(stderr,"Got error %d, expected %d on command %s at %s\n", VOID(fprintf(stderr,"Got error %d, expected %d on command %s at %s\n",
my_errno,result,command_name[command], my_errno,result,command_name[command],
llstr(isamlog_filepos,llbuff))); llstr(isamlog_filepos,llbuff)));
fflush(stderr);
end: end:
end_key_cache(); end_key_cache();
delete_tree(&tree); delete_tree(&tree);
...@@ -792,6 +811,7 @@ static int close_some_file(TREE *tree) ...@@ -792,6 +811,7 @@ static int close_some_file(TREE *tree)
(void*) &access_param,left_root_right)); (void*) &access_param,left_root_right));
if (!access_param.found) if (!access_param.found)
return 1; /* No open file that is possibly to close */ return 1; /* No open file that is possibly to close */
access_param.found->rnd=access_param.found->isam->s->rnd;
if (mi_close(access_param.found->isam)) if (mi_close(access_param.found->isam))
return 1; return 1;
access_param.found->closed=1; access_param.found->closed=1;
...@@ -811,6 +831,7 @@ static int reopen_closed_file(TREE *tree, struct file_info *fileinfo) ...@@ -811,6 +831,7 @@ static int reopen_closed_file(TREE *tree, struct file_info *fileinfo)
if (!(fileinfo->isam= mi_open(name,O_RDWR,HA_OPEN_WAIT_IF_LOCKED))) if (!(fileinfo->isam= mi_open(name,O_RDWR,HA_OPEN_WAIT_IF_LOCKED)))
return 1; return 1;
fileinfo->closed=0; fileinfo->closed=0;
fileinfo->isam->s->rnd=fileinfo->rnd;
re_open_count++; re_open_count++;
return 0; return 0;
} }
......
...@@ -45,6 +45,7 @@ int myrg_rkey(MYRG_INFO *info,byte *record,int inx, const byte *key, ...@@ -45,6 +45,7 @@ int myrg_rkey(MYRG_INFO *info,byte *record,int inx, const byte *key,
MI_INFO *mi; MI_INFO *mi;
int err; int err;
byte *buf=((search_flag == HA_READ_KEY_EXACT) ? record: 0); byte *buf=((search_flag == HA_READ_KEY_EXACT) ? record: 0);
LINT_INIT(key_buff);
if (_myrg_init_queue(info,inx,search_flag)) if (_myrg_init_queue(info,inx,search_flag))
return my_errno; return my_errno;
......
...@@ -30,10 +30,9 @@ static my_string NEAR_F expand_tilde(my_string *path); ...@@ -30,10 +30,9 @@ static my_string NEAR_F expand_tilde(my_string *path);
/* Pack a dirname ; Changes HOME to ~/ and current dev to ./ */ /* Pack a dirname ; Changes HOME to ~/ and current dev to ./ */
/* from is a dirname (from dirname() ?) ending with FN_LIBCHAR */ /* from is a dirname (from dirname() ?) ending with FN_LIBCHAR */
/* to may be == from */
void pack_dirname(my_string to, const char *from) void pack_dirname(my_string to, const char *from)
/* to may be == from */
{ {
int cwd_err; int cwd_err;
uint d_length,length,buff_length; uint d_length,length,buff_length;
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "mysys_priv.h" #include "mysys_priv.h"
#include "mysys_err.h" #include "mysys_err.h"
#include <errno.h> #include <errno.h>
#include <stdio.h>
#ifdef HAVE_FSEEKO #ifdef HAVE_FSEEKO
#undef ftell #undef ftell
......
...@@ -388,7 +388,6 @@ int ha_berkeley::close(void) ...@@ -388,7 +388,6 @@ int ha_berkeley::close(void)
bool ha_berkeley::fix_rec_buff_for_blob(ulong length) bool ha_berkeley::fix_rec_buff_for_blob(ulong length)
{ {
uint extra;
if (! rec_buff || length > alloced_rec_buff_length) if (! rec_buff || length > alloced_rec_buff_length)
{ {
byte *newptr; byte *newptr;
...@@ -663,7 +662,7 @@ int ha_berkeley::update_primary_key(DB_TXN *trans, bool primary_key_changed, ...@@ -663,7 +662,7 @@ int ha_berkeley::update_primary_key(DB_TXN *trans, bool primary_key_changed,
const byte * new_row, DBT *prim_key) const byte * new_row, DBT *prim_key)
{ {
DBT row, old_key; DBT row, old_key;
int error,new_error; int error;
DBUG_ENTER("update_primary_key"); DBUG_ENTER("update_primary_key");
if (primary_key_changed) if (primary_key_changed)
...@@ -705,9 +704,8 @@ int ha_berkeley::update_primary_key(DB_TXN *trans, bool primary_key_changed, ...@@ -705,9 +704,8 @@ int ha_berkeley::update_primary_key(DB_TXN *trans, bool primary_key_changed,
int ha_berkeley::update_row(const byte * old_row, byte * new_row) int ha_berkeley::update_row(const byte * old_row, byte * new_row)
{ {
DBT row, prim_key, key, old_prim_key; DBT prim_key, key, old_prim_key;
int error; int error;
uint keynr;
DB_TXN *sub_trans; DB_TXN *sub_trans;
bool primary_key_changed; bool primary_key_changed;
DBUG_ENTER("update_row"); DBUG_ENTER("update_row");
...@@ -1242,7 +1240,7 @@ THR_LOCK_DATA **ha_berkeley::store_lock(THD *thd, THR_LOCK_DATA **to, ...@@ -1242,7 +1240,7 @@ THR_LOCK_DATA **ha_berkeley::store_lock(THD *thd, THR_LOCK_DATA **to,
static int create_sub_table(const char *table_name, const char *sub_name, static int create_sub_table(const char *table_name, const char *sub_name,
DBTYPE type, int flags) DBTYPE type, int flags)
{ {
int error,error2; int error;
DB *file; DB *file;
DBUG_ENTER("create_sub_table"); DBUG_ENTER("create_sub_table");
DBUG_PRINT("enter",("sub_name: %s",sub_name)); DBUG_PRINT("enter",("sub_name: %s",sub_name));
......
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
/* static functions defined in this file */ /* static functions defined in this file */
static void NEAR_F set_form_timestamp(TABLE *table, byte *record);
static int NEAR_F delete_file(const char *name,const char *ext,int extflag); static int NEAR_F delete_file(const char *name,const char *ext,int extflag);
ulong ha_read_count, ha_write_count, ha_delete_count, ha_update_count, ulong ha_read_count, ha_write_count, ha_delete_count, ha_update_count,
......
...@@ -775,7 +775,10 @@ longlong Item_func_locate::val_int() ...@@ -775,7 +775,10 @@ longlong Item_func_locate::val_int()
return 0; /* purecov: inspected */ return 0; /* purecov: inspected */
} }
null_value=0; null_value=0;
uint start=0,start0=0; uint start=0;
#ifdef USE_MB
uint start0=0;
#endif
if (arg_count == 3) if (arg_count == 3)
{ {
start=(uint) args[2]->val_int()-1; start=(uint) args[2]->val_int()-1;
......
...@@ -843,7 +843,7 @@ class Item_func_match :public Item_real_func ...@@ -843,7 +843,7 @@ class Item_func_match :public Item_real_func
FT_DOCLIST *ft_handler; FT_DOCLIST *ft_handler;
Item_func_match(List<Item> &a, Item *b): Item_real_func(b), Item_func_match(List<Item> &a, Item *b): Item_real_func(b),
fields(a), table(0), ft_handler(0), master(0) {} fields(a), table(0), master(0), ft_handler(0) {}
~Item_func_match() ~Item_func_match()
{ {
if (!master) if (!master)
......
...@@ -412,7 +412,6 @@ net_real_write(NET *net,const char *packet,ulong len) ...@@ -412,7 +412,6 @@ net_real_write(NET *net,const char *packet,ulong len)
static void my_net_skip_rest(NET *net, ulong remain, thr_alarm_t *alarmed) static void my_net_skip_rest(NET *net, ulong remain, thr_alarm_t *alarmed)
{ {
char buff[1024];
ALARM alarm_buff; ALARM alarm_buff;
uint retry_count=0; uint retry_count=0;
if (!thr_alarm_in_use(alarmed)) if (!thr_alarm_in_use(alarmed))
......
...@@ -516,7 +516,6 @@ command"); ...@@ -516,7 +516,6 @@ command");
static uint read_event(MYSQL* mysql, MASTER_INFO *mi) static uint read_event(MYSQL* mysql, MASTER_INFO *mi)
{ {
uint len = packet_error; uint len = packet_error;
NET* net = &mysql->net;
int read_errno = EINTR; // for convinience lets think we start by int read_errno = EINTR; // for convinience lets think we start by
// being in the interrupted state :-) // being in the interrupted state :-)
// my_real_read() will time us out // my_real_read() will time us out
...@@ -543,251 +542,250 @@ static uint read_event(MYSQL* mysql, MASTER_INFO *mi) ...@@ -543,251 +542,250 @@ static uint read_event(MYSQL* mysql, MASTER_INFO *mi)
} }
DBUG_PRINT("info",( "len=%u, net->read_pos[4] = %d\n", DBUG_PRINT("info",( "len=%u, net->read_pos[4] = %d\n",
len, net->read_pos[4])); len, mysql->net.read_pos[4]));
return len - 1; return len - 1;
} }
static int exec_event(THD* thd, NET* net, MASTER_INFO* mi, int event_len) static int exec_event(THD* thd, NET* net, MASTER_INFO* mi, int event_len)
{ {
Log_event * ev = Log_event::read_log_event((const char*)net->read_pos + 1 , event_len); Log_event * ev = Log_event::read_log_event((const char*)net->read_pos + 1,
if(ev) event_len);
{ if (ev)
switch(ev->get_type_code()) {
switch(ev->get_type_code())
{
case QUERY_EVENT:
{
Query_log_event* qev = (Query_log_event*)ev;
int q_len = qev->q_len;
init_sql_alloc(&thd->mem_root, 8192,0);
thd->db = (char*)qev->db;
if(db_ok(thd->db, replicate_do_db, replicate_ignore_db))
{
thd->query = (char*)qev->query;
thd->set_time((time_t)qev->when);
thd->current_tablenr = 0;
VOID(pthread_mutex_lock(&LOCK_thread_count));
thd->query_id = query_id++;
VOID(pthread_mutex_unlock(&LOCK_thread_count));
thd->last_nx_table = thd->last_nx_db = 0;
for(;;)
{ {
case QUERY_EVENT: thd->query_error = 0; // clear error
thd->last_nx_table = thd->last_nx_db = 0;
thd->net.last_errno = 0;
thd->net.last_error[0] = 0;
mysql_parse(thd, thd->query, q_len); // try query
if(!thd->query_error || slave_killed(thd)) // break if ok
break;
// if not ok
if(thd->last_nx_table && thd->last_nx_db)
{ {
Query_log_event* qev = (Query_log_event*)ev; // for now, let's just fail if the table is not
int q_len = qev->q_len; // there, and not try to be a smart alec...
init_sql_alloc(&thd->mem_root, 8192,0);
thd->db = (char*)qev->db;
if(db_ok(thd->db, replicate_do_db, replicate_ignore_db))
{
thd->query = (char*)qev->query;
thd->set_time((time_t)qev->when);
thd->current_tablenr = 0;
VOID(pthread_mutex_lock(&LOCK_thread_count));
thd->query_id = query_id++;
VOID(pthread_mutex_unlock(&LOCK_thread_count));
thd->last_nx_table = thd->last_nx_db = 0;
for(;;)
{
thd->query_error = 0; // clear error
thd->last_nx_table = thd->last_nx_db = 0;
thd->net.last_errno = 0;
thd->net.last_error[0] = 0;
mysql_parse(thd, thd->query, q_len); // try query
if(!thd->query_error || slave_killed(thd)) // break if ok
break;
// if not ok
if(thd->last_nx_table && thd->last_nx_db)
{
// for now, let's just fail if the table is not
// there, and not try to be a smart alec...
// if table was not there // if table was not there
//if(fetch_nx_table(thd,&glob_mi)) //if(fetch_nx_table(thd,&glob_mi))
// try to to fetch from master // try to to fetch from master
break; // if we can't, just break break; // if we can't, just break
}
else
break; // if failed for some other reason, bail out
// if fetched the table from master successfully
// we need to restore query info in thd because
// fetch_nx_table executes create table
thd->query = (char*)qev->query;
thd->set_time((time_t)qev->when);
thd->current_tablenr = 0;
}
}
thd->db = 0;// prevent db from being freed
thd->query = 0; // just to be sure
close_thread_tables(thd);
free_root(&thd->mem_root,0);
if (thd->query_error)
{
sql_print_error("Slave: error running query '%s' ",
qev->query);
return 1;
}
delete ev;
if(thd->fatal_error)
{
sql_print_error("Slave: Fatal error running query '%s' ",
thd->query);
return 1;
}
mi->inc_pos(event_len);
flush_master_info(mi);
break;
} }
else
break; // if failed for some other reason, bail out
// if fetched the table from master successfully
// we need to restore query info in thd because
// fetch_nx_table executes create table
thd->query = (char*)qev->query;
thd->set_time((time_t)qev->when);
thd->current_tablenr = 0;
}
}
thd->db = 0;// prevent db from being freed
thd->query = 0; // just to be sure
close_thread_tables(thd);
free_root(&thd->mem_root,0);
if (thd->query_error)
{
sql_print_error("Slave: error running query '%s' ",
qev->query);
return 1;
}
delete ev;
if(thd->fatal_error)
{
sql_print_error("Slave: Fatal error running query '%s' ",
thd->query);
return 1;
}
mi->inc_pos(event_len);
flush_master_info(mi);
break;
}
case LOAD_EVENT: case LOAD_EVENT:
{ {
Load_log_event* lev = (Load_log_event*)ev; Load_log_event* lev = (Load_log_event*)ev;
init_sql_alloc(&thd->mem_root, 8192,0); init_sql_alloc(&thd->mem_root, 8192,0);
thd->db = (char*)lev->db; thd->db = (char*)lev->db;
thd->query = 0; thd->query = 0;
thd->query_error = 0; thd->query_error = 0;
if(db_ok(thd->db, replicate_do_db, replicate_ignore_db)) if(db_ok(thd->db, replicate_do_db, replicate_ignore_db))
{ {
thd->set_time((time_t)lev->when); thd->set_time((time_t)lev->when);
thd->current_tablenr = 0; thd->current_tablenr = 0;
VOID(pthread_mutex_lock(&LOCK_thread_count)); VOID(pthread_mutex_lock(&LOCK_thread_count));
thd->query_id = query_id++; thd->query_id = query_id++;
VOID(pthread_mutex_unlock(&LOCK_thread_count)); VOID(pthread_mutex_unlock(&LOCK_thread_count));
enum enum_duplicates handle_dup = DUP_IGNORE; enum enum_duplicates handle_dup = DUP_IGNORE;
if(lev->sql_ex.opt_flags && REPLACE_FLAG) if(lev->sql_ex.opt_flags && REPLACE_FLAG)
handle_dup = DUP_REPLACE; handle_dup = DUP_REPLACE;
sql_exchange ex((char*)lev->fname, lev->sql_ex.opt_flags && DUMPFILE_FLAG ); sql_exchange ex((char*)lev->fname, lev->sql_ex.opt_flags && DUMPFILE_FLAG );
String field_term(&lev->sql_ex.field_term, 1), String field_term(&lev->sql_ex.field_term, 1),
enclosed(&lev->sql_ex.enclosed, 1), line_term(&lev->sql_ex.line_term,1), enclosed(&lev->sql_ex.enclosed, 1), line_term(&lev->sql_ex.line_term,1),
escaped(&lev->sql_ex.escaped, 1), line_start(&lev->sql_ex.line_start, 1); escaped(&lev->sql_ex.escaped, 1), line_start(&lev->sql_ex.line_start, 1);
ex.field_term = &field_term; ex.field_term = &field_term;
if(lev->sql_ex.empty_flags & FIELD_TERM_EMPTY) if(lev->sql_ex.empty_flags & FIELD_TERM_EMPTY)
ex.field_term->length(0); ex.field_term->length(0);
ex.enclosed = &enclosed; ex.enclosed = &enclosed;
if(lev->sql_ex.empty_flags & ENCLOSED_EMPTY) if(lev->sql_ex.empty_flags & ENCLOSED_EMPTY)
ex.enclosed->length(0); ex.enclosed->length(0);
ex.line_term = &line_term; ex.line_term = &line_term;
if(lev->sql_ex.empty_flags & LINE_TERM_EMPTY) if(lev->sql_ex.empty_flags & LINE_TERM_EMPTY)
ex.line_term->length(0); ex.line_term->length(0);
ex.line_start = &line_start; ex.line_start = &line_start;
if(lev->sql_ex.empty_flags & LINE_START_EMPTY) if(lev->sql_ex.empty_flags & LINE_START_EMPTY)
ex.line_start->length(0); ex.line_start->length(0);
ex.escaped = &escaped; ex.escaped = &escaped;
if(lev->sql_ex.empty_flags & ESCAPED_EMPTY) if(lev->sql_ex.empty_flags & ESCAPED_EMPTY)
ex.escaped->length(0); ex.escaped->length(0);
ex.opt_enclosed = (lev->sql_ex.opt_flags & OPT_ENCLOSED_FLAG); ex.opt_enclosed = (lev->sql_ex.opt_flags & OPT_ENCLOSED_FLAG);
if(lev->sql_ex.empty_flags & FIELD_TERM_EMPTY) if(lev->sql_ex.empty_flags & FIELD_TERM_EMPTY)
ex.field_term->length(0); ex.field_term->length(0);
ex.skip_lines = lev->skip_lines; ex.skip_lines = lev->skip_lines;
TABLE_LIST tables; TABLE_LIST tables;
bzero((char*) &tables,sizeof(tables)); bzero((char*) &tables,sizeof(tables));
tables.db = thd->db; tables.db = thd->db;
tables.name = tables.real_name = (char*)lev->table_name; tables.name = tables.real_name = (char*)lev->table_name;
tables.lock_type = TL_WRITE; tables.lock_type = TL_WRITE;
if (open_tables(thd, &tables)) if (open_tables(thd, &tables))
{ {
sql_print_error("Slave: error opening table %s ", sql_print_error("Slave: error opening table %s ",
tables.name); tables.name);
delete ev; delete ev;
return 1; return 1;
} }
List<Item> fields; List<Item> fields;
lev->set_fields(fields); lev->set_fields(fields);
thd->net.vio = net->vio; thd->net.vio = net->vio;
// mysql_load will use thd->net to read the file // mysql_load will use thd->net to read the file
thd->net.pkt_nr = net->pkt_nr; thd->net.pkt_nr = net->pkt_nr;
// make sure the client does get confused // make sure the client does get confused
// about the packet sequence // about the packet sequence
if(mysql_load(thd, &ex, &tables, fields, handle_dup, 1, if(mysql_load(thd, &ex, &tables, fields, handle_dup, 1,
TL_WRITE)) TL_WRITE))
thd->query_error = 1; thd->query_error = 1;
net->pkt_nr = thd->net.pkt_nr; net->pkt_nr = thd->net.pkt_nr;
} }
else // we will just ask the master to send us /dev/null if we do not want to else // we will just ask the master to send us /dev/null if we do not want to
// load the data :-) // load the data :-)
{ {
(void)my_net_write(net, "\xfb/dev/null", 10); (void)my_net_write(net, "\xfb/dev/null", 10);
(void)net_flush(net); (void)net_flush(net);
(void)my_net_read(net); // discard response (void)my_net_read(net); // discard response
send_ok(net); // the master expects it send_ok(net); // the master expects it
} }
thd->net.vio = 0; thd->net.vio = 0;
thd->db = 0;// prevent db from being freed thd->db = 0;// prevent db from being freed
close_thread_tables(thd); close_thread_tables(thd);
if(thd->query_error) if(thd->query_error)
{ {
int sql_error = thd->net.last_errno; int sql_error = thd->net.last_errno;
if(!sql_error) if(!sql_error)
sql_error = ER_UNKNOWN_ERROR; sql_error = ER_UNKNOWN_ERROR;
sql_print_error("Slave: error '%s' running load data infile ", sql_print_error("Slave: error '%s' running load data infile ",
ER(sql_error)); ER(sql_error));
delete ev; delete ev;
return 1; return 1;
} }
delete ev; delete ev;
if(thd->fatal_error) if(thd->fatal_error)
{ {
sql_print_error("Slave: Fatal error running query '%s' ", sql_print_error("Slave: Fatal error running query '%s' ",
thd->query); thd->query);
return 1; return 1;
} }
mi->inc_pos(event_len); mi->inc_pos(event_len);
flush_master_info(mi); flush_master_info(mi);
break; break;
} }
case START_EVENT: case START_EVENT:
mi->inc_pos(event_len); mi->inc_pos(event_len);
flush_master_info(mi); flush_master_info(mi);
break; break;
case STOP_EVENT: case STOP_EVENT:
mi->inc_pos(event_len); mi->inc_pos(event_len);
flush_master_info(mi); flush_master_info(mi);
break; break;
case ROTATE_EVENT: case ROTATE_EVENT:
{ {
Rotate_log_event* rev = (Rotate_log_event*)ev; Rotate_log_event* rev = (Rotate_log_event*)ev;
int ident_len = rev->ident_len; int ident_len = rev->ident_len;
memcpy(mi->log_file_name, rev->new_log_ident,ident_len ); memcpy(mi->log_file_name, rev->new_log_ident,ident_len );
mi->log_file_name[ident_len] = 0; mi->log_file_name[ident_len] = 0;
mi->pos = 0; mi->pos = 0;
break; break;
} }
case INTVAR_EVENT: case INTVAR_EVENT:
{ {
Intvar_log_event* iev = (Intvar_log_event*)ev; Intvar_log_event* iev = (Intvar_log_event*)ev;
switch(iev->type) switch(iev->type)
{ {
case LAST_INSERT_ID_EVENT: case LAST_INSERT_ID_EVENT:
thd->last_insert_id_used = 1; thd->last_insert_id_used = 1;
thd->last_insert_id = iev->val; thd->last_insert_id = iev->val;
break; break;
case INSERT_ID_EVENT: case INSERT_ID_EVENT:
thd->next_insert_id = iev->val; thd->next_insert_id = iev->val;
break; break;
} }
mi->inc_pos(event_len); mi->inc_pos(event_len);
flush_master_info(mi); flush_master_info(mi);
break; break;
} }
}
} }
}
else else
{ {
sql_print_error("Could not parse log event entry, check the master for binlog corruption\ sql_print_error("Could not parse log event entry, check the master for binlog corruption\n\
This may also be a network problem, or just a bug in the master or slave code"); This may also be a network problem, or just a bug in the master or slave code");
return 1; return 1;
} }
return 0;
return 0;
} }
// slave thread // slave thread
......
...@@ -553,11 +553,11 @@ bool select_dump::send_data(List<Item> &items) ...@@ -553,11 +553,11 @@ bool select_dump::send_data(List<Item> &items)
} }
while ((item=li++)) while ((item=li++))
{ {
Item_result result_type=item->result_type();
res=item->str_result(&tmp); res=item->str_result(&tmp);
if (!res) if (!res) // If NULL
{ {
if (my_b_write(&cache,(byte*) "",1)) goto err; // NULL if (my_b_write(&cache,(byte*) "",1))
goto err;
} }
else if (my_b_write(&cache,(byte*) res->ptr(),res->length())) else if (my_b_write(&cache,(byte*) res->ptr(),res->length()))
{ {
......
...@@ -753,13 +753,11 @@ store_create_info(THD *thd, TABLE *table, String* packet) ...@@ -753,13 +753,11 @@ store_create_info(THD *thd, TABLE *table, String* packet)
for (uint j=0 ; j < key_info->key_parts ; j++,key_part++) for (uint j=0 ; j < key_info->key_parts ; j++,key_part++)
{ {
if(j) if (j)
packet->append(','); packet->append(',');
if(key_part->field) if (key_part->field)
packet->append(key_part->field->field_name); packet->append(key_part->field->field_name);
KEY *key=table->key_info+i;
if (!key_part->field || if (!key_part->field ||
(key_part->length != (key_part->length !=
table->field[key_part->fieldnr-1]->key_length() && table->field[key_part->fieldnr-1]->key_length() &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment