Commit 450d98e3 authored by monty@donna.mysql.com's avatar monty@donna.mysql.com

Changed --replace to --replace_result in mysqltest

Changed errmsg -> my_errmsg (portability issue)
Fixed that mysqlbinlog writes SET TIMESTAMP before all queries
Fixed comments in default my.cnf files
parent 7de40020
......@@ -284,6 +284,11 @@ Linux Notes (All Linux Versions)
* Qube2:: Qube2 Linux notes
* Linux-Ia64:: Linux-Ia64 notes
OpenBSD Notes
* OpenBSD 2.5:: OpenBSD 2.5 Notes
* OpenBSD 2.8:: OpenBSD 2.8 Notes
BSD/OS Notes
* BSDI2:: BSD/OS 2.x notes
......@@ -555,7 +560,7 @@ What Languages Are Supported by MySQL?
* Character sets:: The character set used for data and sorting
* Adding character set:: Adding a new character set
* Character arrays::
* Character arrays:: The character definition arrays
* String collating:: String collating support
* Multi-byte characters:: Multi-byte character support
......@@ -568,7 +573,7 @@ Replication in MySQL
* Replication Options:: Replication Options in my.cnf
* Replication SQL:: SQL Commands related to replication
* Replication FAQ:: Frequently Asked Questions about replication
* Troubleshooting Replication:: Troubleshooting Replication. Troubleshooting Replication. Troubleshooting Replication. Troubleshooting Replication. Troubleshooting Replication. Troubleshooting Replication. Troubleshooting Replication. Troubleshooting Replication. Troubleshooting Replication. Troubleshooting Replication. Troubleshooting Replication
* Troubleshooting Replication:: Troubleshooting Replication. Troubleshooting Replication. Troubleshooting Replication. Troubleshooting Replication. Troubleshooting Replication. Troubleshooting Replication.
Getting Maximum Performance from MySQL
......@@ -723,6 +728,7 @@ Some Common Errors When Using MySQL
* Commands out of sync:: @code{Commands out of sync} error in client
* Ignoring user:: @code{Ignoring user} error
* Cannot find table:: @code{Table 'xxx' doesn't exist} error
* Cannot initialize character set::
Solving Some Common Problems with MySQL
......@@ -866,6 +872,7 @@ Changes in release 4.0.x (Development; Alpha)
Changes in release 3.23.x (Stable)
* News-3.23.34:: Changes in release 3.23.34
* News-3.23.33:: Changes in release 3.23.33
* News-3.23.32:: Changes in release 3.23.32
* News-3.23.31:: Changes in release 3.23.31
......@@ -7632,7 +7639,7 @@ when @code{make} tries to run @code{lint} on C++ files.
* OpenBSD 2.8:: OpenBSD 2.8 Notes
@end menu
@node OpenBSD 2.5
@node OpenBSD 2.5, OpenBSD 2.8, OpenBSD, OpenBSD
@subsubsection OpenBSD 2.5 Notes
On OpenBSD Version 2.5, you can compile @strong{MySQL} with native threads
with the following options:
......@@ -7641,7 +7648,7 @@ with the following options:
CFLAGS=-pthread CXXFLAGS=-pthread ./configure --with-mit-threads=no
@end example
@node OpenBSD 2.8
@node OpenBSD 2.8, , OpenBSD 2.5, OpenBSD
@subsubsection OpenBSD 2.8 Notes
Our users have reported that OpenBSD 2.8 has a threading bug which causes
problems with MySQL. The OpenBSD Developers have fixed the problem, but as
......@@ -7994,6 +8001,17 @@ the DCE libraries while you compile @code{gcc} 2.95!
For HPUX Version 11.x we recommend @strong{MySQL} Version 3.23.15 or later.
Because of some critical bugs in the standard HPUX libraries, one should
install the following patches before trying to run MySQL on HPUX 11.0:
@example
PHKL_22840 Streams cumulative
PHNE_22397 ARPA cumulative
@end example
This will solve a problem that one gets @code{EWOULDBLOCK} from @code{recv()}
and @code{EBADF} from @code{accept()} in threaded applications.
If you are using @code{gcc} 2.95.1 on a unpatched HPUX 11.x system,
you will get the error:
......@@ -9462,7 +9480,9 @@ Don't flush key buffers between writes for any @code{MyISAM} table.
@xref{Server parameters}.
@item --enable-locking
Enable system locking.
Enable system locking. Note that if you use this option on a system
which a not fully working lockd() (as on Linux) you will easily get
mysqld to deadlock.
@item -T, --exit-info
This is a bit mask of different flags one can use for debugging the
......@@ -10391,6 +10411,9 @@ This gives better performance for some very specific, but quite normal
queries.
@xref{Group by functions}.
@item
One can specify @code{ASC} and @code{DESC} with @code{GROUP BY}.
@item
To make it easier for users who come from other SQL environments,
@strong{MySQL} supports aliases for many functions. For example, all
......@@ -17858,7 +17881,7 @@ or PACK_KEYS = @{0 | 1@}
or PASSWORD = "string"
or DELAY_KEY_WRITE = @{0 | 1@}
or ROW_FORMAT= @{ default | dynamic | static | compressed @}
or RAID_TYPE= @{1 | STRIPED | RAID0 @} RAID_CHUNKS=# RAID_CHUNKSIZE=#;
or RAID_TYPE= @{1 | STRIPED | RAID0 @} RAID_CHUNKS=# RAID_CHUNKSIZE=#
or UNION = (table_name,[table_name...])
select_statement:
......@@ -18906,7 +18929,7 @@ SELECT [STRAIGHT_JOIN] [SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT]
[INTO @{OUTFILE | DUMPFILE@} 'file_name' export_options]
[FROM table_references
[WHERE where_definition]
[GROUP BY @{unsigned_integer | col_name | formula@}]
[GROUP BY @{unsigned_integer | col_name | formula@} [ASC | DESC], ...]
[HAVING where_definition]
[ORDER BY @{unsigned_integer | col_name | formula@} [ASC | DESC] ,...]
[LIMIT [offset,] rows]
......@@ -19039,6 +19062,16 @@ to tell the optimizer that the result set will have many rows. In this case,
@strong{MySQL} will also, in this case, prefer sorting to doing a
temporary table with a key on the @code{GROUP BY} elements.
@item
If you use @code{GROUP BY}, the output rows will be sorted according to the
@code{GROUP BY} as if you would have had an @code{ORDER BY} over all the fields
in the @code{GROUP BY}. @code{MySQL} has extended the @code{GROUP BY} so that
you can also specify @code{ASC} and @code{DESC} to @code{GROUP BY}:
@example
SELECT a,COUNT(b) FROM test_table GROUP BY a DESC
@end example
@item
@code{SQL_BUFFER_RESULT} will force the result to be put into a temporary
table. This will help @strong{MySQL} free the table locks early and will help
......@@ -25562,7 +25595,7 @@ your changes with the new @file{errmsg.txt} file.
@menu
* Character sets:: The character set used for data and sorting
* Adding character set:: Adding a new character set
* Character arrays::
* Character arrays:: The character definition arrays
* String collating:: String collating support
* Multi-byte characters:: Multi-byte character support
@end menu
......@@ -25576,6 +25609,12 @@ your changes with the new @file{errmsg.txt} file.
By default, @strong{MySQL} uses the ISO-8859-1 (Latin1) character
set. This is the character set used in the USA and western Europe.
All standard @strong{MySQL} binaries are compiled with
@code{--with-extra-charsets=complex}. This will add code to all
standard programs to be able to handle @code{latin1} and all multi-byte
character sets within the binary. Other character sets will be
loaded from a character-set definition file when needed.
The character set determines what characters are allowed in names and how
things are sorted by the @code{ORDER BY} and @code{GROUP BY} clauses of
the @code{SELECT} statement.
......@@ -25606,7 +25645,7 @@ One can specify this by putting in a @strong{MySQL} option file:
@example
[client]
default-set-dir=/usr/local/mysql/share/mysql/charsets
character-sets-dir=/usr/local/mysql/share/mysql/charsets
@end example
where the path points to where the dynamic @strong{MySQL} character sets
......@@ -25895,7 +25934,7 @@ tables}.
* Replication Options:: Replication Options in my.cnf
* Replication SQL:: SQL Commands related to replication
* Replication FAQ:: Frequently Asked Questions about replication
* Troubleshooting Replication:: Troubleshooting Replication. Troubleshooting Replication. Troubleshooting Replication. Troubleshooting Replication. Troubleshooting Replication. Troubleshooting Replication. Troubleshooting Replication. Troubleshooting Replication. Troubleshooting Replication. Troubleshooting Replication. Troubleshooting Replication
* Troubleshooting Replication:: Troubleshooting Replication. Troubleshooting Replication. Troubleshooting Replication. Troubleshooting Replication. Troubleshooting Replication. Troubleshooting Replication.
@end menu
@node Replication Intro, Replication Implementation, Replication, Replication
......@@ -26040,6 +26079,7 @@ Add the following to @code{my.cnf} on the slave(s):
master-host=<hostname of the master>
master-user=<replication user name>
master-password=<replication user password>
master-port=<TCP/IP port for master>
server-id=<some unique number between 2 and 2^32-1>
@end example
......@@ -26936,12 +26976,13 @@ case.
The @code{--skip-locking} option is on by default when compiling with
MIT-pthreads, because @code{flock()} isn't fully supported by
MIT-pthreads on all platforms.
MIT-pthreads on all platforms. It's also on default for Linux
as Linux file locking are not yet safe.
The only case when you can't use @code{--skip-locking} is if you run
multiple @strong{MySQL} @emph{servers} (not clients) on the same data, or run
@code{myisamchk} on the table without first flushing and locking the
@code{mysqld} server tables first.
multiple @strong{MySQL} @emph{servers} (not clients) on the same data,
or run @code{myisamchk} on the table without first flushing and locking
the @code{mysqld} server tables first.
You can still use @code{LOCK TABLES}/@code{UNLOCK TABLES} even if you
are using @code{--skip-locking}
......@@ -32620,10 +32661,11 @@ To make Access work:
@item
If you are using Access 2000, you should get and install the newest
Microsoft MDAC (@code{Microsoft Data Access Components}) from
@uref{http://www.microsoft.com/data}. This will fix the following bug in Access: when you export data to @strong{MySQL}, the table and column names
aren't specified. Another way to around this bug is to upgrade to
MyODBC Version 2.50.33 and @strong{MySQL} Version 3.23.x, which together provide a
workaround for this bug!
@uref{http://www.microsoft.com/data}. This will fix the following bug
in Access: when you export data to @strong{MySQL}, the table and column
names aren't specified. Another way to around this bug is to upgrade to
MyODBC Version 2.50.33 and @strong{MySQL} Version 3.23.x, which together
provide a workaround for this bug!
Note that if you are using @strong{MySQL} Version 3.22, you must to apply the
MDAC patch and use MyODBC 2.50.32 or 2.50.34 and above to go around
......@@ -33397,6 +33439,7 @@ sure that no other programs are using the dynamic libraries!
* Commands out of sync:: @code{Commands out of sync} error in client
* Ignoring user:: @code{Ignoring user} error
* Cannot find table:: @code{Table 'xxx' doesn't exist} error
* Cannot initialize character set::
@end menu
@node Gone away, Can not connect to server, Common errors, Common errors
......@@ -33806,7 +33849,7 @@ mysql> update user set password=PASSWORD('your password')
@end example
@end itemize
@node Cannot find table, , Ignoring user, Common errors
@node Cannot find table, Cannot initialize character set, Ignoring user, Common errors
@subsection @code{Table 'xxx' doesn't exist} Error
If you get the error @code{Table 'xxx' doesn't exist} or @code{Can't
......@@ -33821,6 +33864,52 @@ references to a given table within a query must use the same case!)
You can check which tables you have in the current database with
@code{SHOW TABLES}. @xref{SHOW, , @code{SHOW}}.
@cindex multibyte character sets
@node Cannot initialize character set, , Cannot find table, Common errors
@subsection @code{Can't initialize character set 'xxx'} error.
If you get an error like:
@example
MySQL Connection Failed: Can't initialize character set xx
@end example
This means one of the following things:
@itemize @bullet
@item
The character set is a multi-byte character set and you have not support
for the character set in the client.
In this case you need to recompile the client with
@code{--with-charset=xxx} or with @code{--with-extra-charsets=xxx}.
@xref{configure options}.
All standard @strong{MySQL} binaries are compiled with
@code{--with-extra-character-sets=complex} which will enable support for
all multi-byte character sets. @xref{Character sets}.
@item
The character set is a simple character set which is not compiled into
@code{mysqld} and the character set definition files is not in the place
where the client expect to find them.
In this case you need to:
@itemize @bullet
@item
Recompile the client with support for the character set.
@xref{configure options}.
@item
Specify to the client where the character set definition files are. For many
client you can do this with the
@code{--character-sets-dir=path-to-charset-dir} option.
@item
Copy the character definition files to the path where the client expect them
to be.
@end itemize
@end itemize
@cindex full disk
@cindex disk full
@node Full disk, Multiple sql commands, Common errors, Problems
......@@ -39208,7 +39297,7 @@ index operations (querying/dumping/statistics).
@end itemize
@node Fulltext TODO, ,Fulltext features to appear in MySQL 4.0, MySQL full-text search
@node Fulltext TODO, , Fulltext features to appear in MySQL 4.0, MySQL full-text search
@subsection Full-text Search TODO
@itemize @bullet
......@@ -39223,12 +39312,11 @@ the user wants to treat as words, examples are "C++", "AS/400", "TCP/IP", etc.
@item Generic user-supplyable UDF (?) preparser.
@item Make the model more flexible (by adding some adjustable
parameters to @code{FULLTEXT} in @code{CREATE/ALTER TABLE}).
@end itemize
@node MySQL test suite, , MySQL full-text search, MySQL internals
@cindex mysqltest, MySQL Test Suite
@cindex testing mysqld, mysqltest
@node MySQL test suite, , MySQL full-text search, MySQL internals
@section MySQL Test Suite
Until recently, our main full-coverage test suite was based on proprietary
......@@ -39357,7 +39445,6 @@ attachemnts, you should ftp all the relevant files to:
@end itemize
@page
@cindex environment variables, list of
@node Environment variables, Users, MySQL internals, Top
......@@ -40133,6 +40220,11 @@ of several databases simultaneously. By Innovative-IT Development AB.
@item @uref{http://www.mysql.com/downloads/gui-clients.html, MySQLGUI}
The @strong{MySQL} GUI client homepage. By Sinisa at MySQL AB.
@item @uref{http://www.mysql.com/Downloads/Win32/secman.zip, MySQL Security GUI}
A user and security management GUI for MySQL on Windows. By Martin Jeremic.
@uref{http://jsoft.webjump.com/, Home page for MySQL Security GUI}.
@item @uref{http://www.mysql.com/Downloads/Contrib/kmysqladmin-0.4.1.tar.gz, kmysqladmin-0.4.1.tar.gz}.
@item @uref{http://www.mysql.com/Downloads/Contrib/kmysqladmin-0.4.1-1.src.rpm, kmysqladmin-0.4.1-1.src.rpm}.
@item @uref{http://www.mysql.com/Downloads/Contrib/kmysqladmin-0.4.1-1.i386.rpm, kmysqladmin-0.4.1-1.i386.rpm}
......@@ -40172,7 +40264,7 @@ New version of netadmin. See above for details.
Home page for this can be found at: @uref{http://www.artronic.hr}.
@item @uref{http://www.mysql.com/Downloads/Win32/mysqlfront.zip, mysqlfront}
Home page: @uref{http://my.anse.de/}.
Home page: @uref{http://my.mysqlfront.de/}.
Win32-Client for accessing and managing dbs, tables, table-data, indexes,
import-/export-files. (Freeware). By Ansgar Becker.
......@@ -41123,6 +41215,7 @@ users uses this code as the rest of the code and because of this we are
not yet 100 % confident in this code.
@menu
* News-3.23.34:: Changes in release 3.23.34
* News-3.23.33:: Changes in release 3.23.33
* News-3.23.32:: Changes in release 3.23.32
* News-3.23.31:: Changes in release 3.23.31
......@@ -41159,10 +41252,32 @@ not yet 100 % confident in this code.
* News-3.23.0:: Changes in release 3.23.0
@end menu
@node News-3.23.33, News-3.23.32, News-3.23.x, News-3.23.x
@node News-3.23.34, News-3.23.33, News-3.23.x, News-3.23.x
@appendixsubsec Changes in release 3.23.34
@itemize @bullet
@item
Fixed bug in @code{BDB} tables when using index on multi-part key where a
key part may be @code{NULL}.
@item
Fixed that @code{mysqlbinlog} writes the timestamp value for each query.
This ensures that on gets same values for date functions like @code{NOW()}
when using @code{mysqlbinlog} to pipe the queries to another server.
@item
Allow one to use @code{--skip-gemeni}, @code{--skip-bdb} and
@code{--skip-innobase} to mysqld even if these databases are not compiled
in @code{mysqld}.
@item
One can now do @code{GROUP BY ... DESC}.
@end itemize
@node News-3.23.33, News-3.23.32, News-3.23.34, News-3.23.x
@appendixsubsec Changes in release 3.23.33
@itemize @bullet
@item
Fixed that DNS lookups are not using the same mutex as the hostname
cache. This will enable known hosts to be quickly resolved even if a
DNS lookup takes a long time.
@item
Added @code{--character-sets-dir} to @code{myisampack}.
@item
Removed warnings when running @code{REPAIR TABLE .. EXTENDED}.
......@@ -46149,6 +46264,10 @@ fast execution one should use @code{TRUNCATE table_name}.
Multi-table @code{DELETE} (cascading @code{DELETE} and multi-table
@code{DELETE}.
@item
Allow @code{DELETE} on @code{MyISAM} tables to use the record cache.
To do this, we need to update the threads record cache when we update
the @code{.MYD} file.
@item
Better replication.
@item
More functions for full-text search.
......@@ -28,7 +28,7 @@
#include <my_pthread.h> /* because of signal() */
#endif
#define ADMIN_VERSION "8.15"
#define ADMIN_VERSION "8.16"
#define MAX_MYSQL_VAR 64
#define MAX_TIME_TO_WAIT 3600 /* Wait for shutdown */
#define MAX_TRUNC_LENGTH 3
......@@ -853,6 +853,8 @@ static void usage(void)
refresh Flush all tables and close and open logfiles\n\
shutdown Take server down\n\
status Gives a short status message from the server\n\
start-slave Start slave\n\
stop-slave Stop slave\n\
variables Prints variables available\n\
version Get version info from server");
}
......
......@@ -157,7 +157,7 @@ struct st_query
const char *command_names[] = {
"connection", "query","connect","sleep","inc","dec","source","disconnect",
"let","echo","while","end","system","result", "require", "save_master_pos",
"sync_with_master", "error", "send", "reap", "dirty_close", "replace", 0
"sync_with_master", "error", "send", "reap", "dirty_close", "replace_result", 0
};
TYPELIB command_typelib= {array_elements(command_names),"",
......@@ -723,22 +723,22 @@ static void get_replace(struct st_query *q)
{
uint i;
char *from=q->first_argument;
char *buff=my_malloc(strlen(from),MYF(MY_WME | MY_FAE));
char *buff,*start;
char word_end_chars[256],*pos;
POINTER_ARRAY to_array,from_array;
DBUG_ENTER("get_replace");
bzero((char*) &to_array,sizeof(to_array));
bzero((char*) &from_array,sizeof(from_array));
if (!*from)
die("Missing argument in %s\n", q->query);
start=buff=my_malloc(strlen(from)+1,MYF(MY_WME | MY_FAE));
while (*from)
{
char *to=buff;
get_string(&buff, &from, q);
if (!*from)
die("Wrong number of arguments in %s\n", q->query);
die("Wrong number of arguments to replace in %s\n", q->query);
insert_pointer_name(&from_array,to);
to=buff;
get_string(&buff, &from, q);
......@@ -747,6 +747,7 @@ static void get_replace(struct st_query *q)
for (i=1,pos=word_end_chars ; i < 256 ; i++)
if (isspace(i))
*pos++=i;
*pos=0; /* End pointer */
if (!(glob_replace=init_replace((char**) from_array.typelib.type_names,
(char**) to_array.typelib.type_names,
(uint) from_array.typelib.count,
......@@ -755,13 +756,16 @@ static void get_replace(struct st_query *q)
die("Can't initialize replace from %s\n", q->query);
free_pointer_array(&from_array);
free_pointer_array(&to_array);
my_free(buff, MYF(0));
my_free(start, MYF(0));
}
void free_replace()
{
DBUG_ENTER("free_replace");
my_free((char*) glob_replace,MYF(0));
glob_replace=0;
free_replace_buffer();
DBUG_VOID_RETURN;
}
......@@ -1270,7 +1274,7 @@ int parse_args(int argc, char **argv)
{
switch(c) {
case '#':
DBUG_PUSH(optarg ? optarg : "d:t:o,/tmp/mysqltest.trace");
DBUG_PUSH(optarg ? optarg : "d:t:O,/tmp/mysqltest.trace");
break;
case 'v':
verbose = 1;
......@@ -1530,7 +1534,7 @@ void get_query_type(struct st_query* q)
save=q->query[q->first_word_len];
q->query[q->first_word_len]=0;
type=find_type(q->query, &command_typelib, 1);
type=find_type(q->query, &command_typelib, 1+2);
q->query[q->first_word_len]=save;
if (type > 0)
q->type=type; /* Found command */
......@@ -1541,7 +1545,7 @@ int main(int argc, char** argv)
{
int error = 0;
struct st_query* q;
my_bool require_file=0;
my_bool require_file=0,q_send_flag=0;
char save_file[FN_REFLEN];
MY_INIT(argv[0]);
......@@ -1579,7 +1583,7 @@ int main(int argc, char** argv)
0))
die("Failed in mysql_real_connect(): %s", mysql_error(&cur_con->mysql));
for(;!read_query(&q);)
while (!read_query(&q))
{
int current_line_inc = 1, processed = 0;
if (q->type == Q_UNKNOWN || q->type == Q_COMMENT_WITH_COMMAND)
......@@ -1604,9 +1608,13 @@ int main(int argc, char** argv)
case Q_REAP:
{
int flags = QUERY_REAP;
if(q->type == Q_QUERY)
if (q->type == Q_QUERY)
flags |= QUERY_SEND;
if (q_send_flag)
{
flags=QUERY_SEND;
q_send_flag=0;
}
if (save_file[0])
{
strmov(q->record_file,save_file);
......@@ -1617,8 +1625,7 @@ int main(int argc, char** argv)
break;
}
case Q_SEND:
q->query += q->first_word_len;
error |= run_query(&cur_con->mysql, q, QUERY_SEND);
q_send_flag=1;
break;
case Q_RESULT:
get_file_name(save_file,q);
......@@ -1673,8 +1680,8 @@ int main(int argc, char** argv)
}
free_used_memory();
exit(error);
return error;
exit(error ? 1 : 0);
return error ? 1 : 0; /* Keep compiler happy */
}
......@@ -1789,7 +1796,6 @@ void free_pointer_array(POINTER_ARRAY *pa)
pa->typelib.type_names=0;
my_free((gptr) pa->str,MYF(0));
}
return;
} /* free_pointer_array */
......
......@@ -162,7 +162,7 @@ void __CDECL hfree(void *ptr);
#else
extern int errno; /* declare errno */
#endif
extern const char ** NEAR errmsg[];
extern const char ** NEAR my_errmsg[];
extern char NEAR errbuff[NRERRBUFFS][ERRMSGSIZE];
extern char *home_dir; /* Home directory for user */
extern char *my_progname; /* program-name (printed in errors) */
......
......@@ -78,5 +78,5 @@ const char *client_errors[]=
void init_client_errs(void)
{
errmsg[CLIENT_ERRMAP] = &client_errors[0];
my_errmsg[CLIENT_ERRMAP] = &client_errors[0];
}
......@@ -18,8 +18,6 @@
/* Used instead of my_b_read() to allow for no-cacheed seeks */
#include "myisamdef.h"
#define READING_NEXT 1
#define READING_HEADER 2
/* Copy block from cache if it`s in it. If re_read_if_possibly is */
/* set read to cache (if after current file-position) else read to */
......@@ -39,8 +37,7 @@ int _mi_read_cache(IO_CACHE *info, byte *buff, my_off_t pos, uint length,
if ((my_off_t) read_length > (my_off_t) (info->pos_in_file-pos))
read_length=(uint) (info->pos_in_file-pos);
info->seek_not_done=1;
VOID(my_seek(info->file,pos,MY_SEEK_SET,MYF(0)));
if (my_read(info->file,buff,read_length,MYF(MY_NABP)))
if (my_pread(info->file,buff,read_length,pos,MYF(MY_NABP)))
DBUG_RETURN(1);
if (!(length-=read_length))
DBUG_RETURN(0);
......@@ -85,8 +82,7 @@ int _mi_read_cache(IO_CACHE *info, byte *buff, my_off_t pos, uint length,
DBUG_RETURN(0);
}
info->seek_not_done=1;
VOID(my_seek(info->file,pos,MY_SEEK_SET,MYF(0)));
if ((read_length=my_read(info->file,buff,length,MYF(0))) == length)
if ((read_length=my_pread(info->file,buff,length,pos,MYF(0))) == length)
DBUG_RETURN(0);
if (!(flag & READING_HEADER) || (int) read_length == -1 ||
read_length+in_buff_length < 3)
......
......@@ -746,11 +746,13 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
{
if (_mi_read_cache(&param->read_cache,(byte*) block_info.header,
(start_block=block_info.next_filepos),
sizeof(block_info.header),test(! flag) | 2))
sizeof(block_info.header),
(flag ? 0 : READING_NEXT) | READING_HEADER))
goto err;
if (start_block & (MI_DYN_ALIGN_SIZE-1))
{
mi_check_print_error(param,"Wrong aligned block at %s",llstr(start_block,llbuff));
mi_check_print_error(param,"Wrong aligned block at %s",
llstr(start_block,llbuff));
goto err2;
}
b_type=_mi_get_block_info(&block_info,-1,start_block);
......@@ -841,7 +843,8 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
got_error=1; break;
}
if (_mi_read_cache(&param->read_cache,(byte*) to,block_info.filepos,
(uint) block_info.data_len, test(flag == 1)))
(uint) block_info.data_len,
flag == 1 ? READING_NEXT : 0))
goto err;
to+=block_info.data_len;
link_used+= block_info.filepos-start_block;
......@@ -895,7 +898,7 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
break;
case COMPRESSED_RECORD:
if (_mi_read_cache(&param->read_cache,(byte*) block_info.header, pos,
info->s->pack.ref_length, 1))
info->s->pack.ref_length, READING_NEXT))
goto err;
start_recpos=pos;
splits++;
......@@ -910,7 +913,7 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
break;
}
if (_mi_read_cache(&param->read_cache,(byte*) info->rec_buff,
block_info.filepos, block_info.rec_len,1))
block_info.filepos, block_info.rec_len, READING_NEXT))
goto err;
if (_mi_pack_rec_unpack(info,record,info->rec_buff,block_info.rec_len))
{
......@@ -2112,6 +2115,7 @@ static int sort_get_next_record(SORT_INFO *sort_info)
{
pos=MY_ALIGN(pos,MI_DYN_ALIGN_SIZE);
param->retry_without_quick=1;
sort_info->start_recpos=pos;
}
do
{
......@@ -2131,7 +2135,8 @@ static int sort_get_next_record(SORT_INFO *sort_info)
llstr(sort_info->start_recpos,llbuff2));
if (_mi_read_cache(&param->read_cache,(byte*) block_info.header,pos,
MI_BLOCK_INFO_HEADER_LENGTH,
test(! found_record) | 2))
(! found_record ? READING_NEXT : 0) |
READING_HEADER))
{
if (found_record)
{
......@@ -2172,6 +2177,7 @@ static int sort_get_next_record(SORT_INFO *sort_info)
block_info.header[i] <= MI_MAX_DYN_HEADER_BYTE)
break;
pos+=(ulong) i;
sort_info->start_recpos=pos;
continue;
}
if (b_type & BLOCK_DELETED)
......@@ -2206,7 +2212,8 @@ static int sort_get_next_record(SORT_INFO *sort_info)
if (found_record)
goto try_next;
searching=1;
pos++;
pos+= MI_DYN_ALIGN_SIZE;
sort_info->start_recpos=pos;
block_info.second_read=0;
continue;
}
......@@ -2226,7 +2233,8 @@ static int sort_get_next_record(SORT_INFO *sort_info)
if (found_record)
goto try_next;
searching=1;
pos++;
pos+= MI_DYN_ALIGN_SIZE;
sort_info->start_recpos=pos;
block_info.second_read=0;
continue;
}
......@@ -2242,7 +2250,10 @@ static int sort_get_next_record(SORT_INFO *sort_info)
if (found_record)
goto try_next;
if (searching)
pos++;
{
pos+=MI_DYN_ALIGN_SIZE;
sort_info->start_recpos=pos;
}
else
pos=block_info.filepos+block_info.block_len;
block_info.second_read=0;
......@@ -2286,9 +2297,11 @@ static int sort_get_next_record(SORT_INFO *sort_info)
goto try_next;
}
if (_mi_read_cache(&param->read_cache,to,block_info.filepos,
block_info.data_len, test(found_record == 1)))
block_info.data_len,
(found_record == 1 ? READING_NEXT : 0)))
{
mi_check_print_info(param,"Read error for block at: %s (error: %d); Skipped",
mi_check_print_info(param,
"Read error for block at: %s (error: %d); Skipped",
llstr(block_info.filepos,llbuff),my_errno);
goto try_next;
}
......@@ -2335,8 +2348,9 @@ static int sort_get_next_record(SORT_INFO *sort_info)
case COMPRESSED_RECORD:
for (searching=0 ;; searching=1, sort_info->pos++)
{
if (_mi_read_cache(&param->read_cache,(byte*) block_info.header,sort_info->pos,
share->pack.ref_length,1))
if (_mi_read_cache(&param->read_cache,(byte*) block_info.header,
sort_info->pos,
share->pack.ref_length,READING_NEXT))
DBUG_RETURN(-1);
if (searching && ! sort_info->fix_datafile)
{
......@@ -2361,10 +2375,11 @@ static int sort_get_next_record(SORT_INFO *sort_info)
continue;
}
if (_mi_read_cache(&param->read_cache,(byte*) info->rec_buff,
block_info.filepos, block_info.rec_len,1))
block_info.filepos, block_info.rec_len,
READING_NEXT))
{
if (! searching)
mi_check_print_info(param,"Couldn't read hole record from %s",
mi_check_print_info(param,"Couldn't read whole record from %s",
llstr(sort_info->pos,llbuff));
continue;
}
......
......@@ -1295,7 +1295,8 @@ int _mi_read_rnd_dynamic_record(MI_INFO *info, byte *buf,
{
if (_mi_read_cache(&info->rec_cache,(byte*) block_info.header,filepos,
sizeof(block_info.header),
test(!flag && skipp_deleted_blocks) | 2))
(!flag && skipp_deleted_blocks ? READING_NEXT : 0) |
READING_HEADER))
goto panic;
b_type=_mi_get_block_info(&block_info,-1,filepos);
}
......@@ -1368,7 +1369,7 @@ int _mi_read_rnd_dynamic_record(MI_INFO *info, byte *buf,
{
if (_mi_read_cache(&info->rec_cache,(byte*) to,filepos,
block_info.data_len,
test(!flag && skipp_deleted_blocks)))
(!flag && skipp_deleted_blocks) ? READING_NEXT :0))
goto panic;
}
else
......
......@@ -201,7 +201,7 @@ static struct option long_options[] =
static void print_version(void)
{
printf("%s Ver 1.42 for %s at %s\n",my_progname,SYSTEM_TYPE,
printf("%s Ver 1.44 for %s at %s\n",my_progname,SYSTEM_TYPE,
MACHINE_TYPE);
}
......@@ -952,7 +952,8 @@ static void descript(MI_CHECK *param, register MI_INFO *info, my_string name)
share->base.raid_chunksize);
}
if (share->options & HA_OPTION_CHECKSUM)
printf("Using checksums\n");
printf("Checksum: %23s\n",llstr(info->s->state.checksum,llbuff));
;
if (share->options & HA_OPTION_DELAY_KEY_WRITE)
printf("Keys are only flushed at close\n");
......
......@@ -290,6 +290,10 @@ struct st_myisam_info {
#define STATE_NOT_OPTIMIZED_KEYS 16
#define STATE_NOT_SORTED_PAGES 32
/* options to mi_read_cache */
#define READING_NEXT 1
#define READING_HEADER 2
#define mi_getint(x) ((uint) mi_uint2korr(x) & 32767)
#define mi_putint(x,y,nod) { uint16 boh=(nod ? (uint16) 32768 : 0) + (uint16) (y);\
......
Table Op Msg_type Msg_text
t1 backup error Failed copying .frm file: errno = 2
t1 backup error Failed copying .frm file: errno = X
test.t1 backup status Operation failed
Table Op Msg_type Msg_text
test.t1 backup status OK
......
......@@ -477,3 +477,7 @@ Table Op Msg_type Msg_text
test.t1 optimize status OK
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Comment
t1 0 PRIMARY 1 a A 2 NULL NULL
i j
1 2
i j
1 2
......@@ -17,6 +17,6 @@ Table Create Table
t2 CREATE TABLE `t2` (
`ticket` int(11) default NULL,
`inhalt` text,
KEY `tig`(`ticket`),
FULLTEXT KEY `tix`(`inhalt`)
KEY `tig` (`ticket`),
FULLTEXT KEY `tix` (`inhalt`)
) TYPE=MyISAM
......@@ -4,7 +4,7 @@ connection con1;
set SQL_LOG_BIN=0;
drop table if exists t1;
create table t1(n int);
--replace "errno = 2" "errno = X" "errno = 22" "errno = X"
--replace_result "errno = 2" "errno = X" "errno = 22" "errno = X"
backup table t1 to '../bogus';
backup table t1 to '../tmp';
drop table t1;
......@@ -29,9 +29,11 @@ select k from t3;
drop table t1,t2,t3;
restore table t1 from '../tmp';
connection con2;
send lock tables t1 write;
--send
lock tables t1 write;
connection con1;
send backup table t1 to '../tmp';
--send
backup table t1 to '../tmp';
connection con2;
reap;
unlock tables;
......
......@@ -419,3 +419,13 @@ select * from t1 order by b desc;
optimize table t1;
show keys from t1;
drop table t1;
#
# Test of bug in create index with NULL columns
#
create table t1 (i int, j int )TYPE=BDB;
insert into t1 values (1,2);
select * from t1 where i=1 and j=2;
create index ax1 on t1 (i,j);
select * from t1 where i=1 and j=2;
drop table t1;
......@@ -13,7 +13,8 @@ lock tables t1 read;
unlock tables;
lock tables t1 read;
connection con1;
send update t1 set n = 3;
--send
update t1 set n = 3;
connection con2;
sleep 0.5;
unlock tables;
......
......@@ -50,14 +50,14 @@ const char * NEAR globerrs[GLOBERRS]=
void init_glob_errs(void)
{
errmsg[GLOB] = & globerrs[0];
my_errmsg[GLOB] = & globerrs[0];
} /* init_glob_errs */
#else
void init_glob_errs()
{
errmsg[GLOB] = & globerrs[0];
my_errmsg[GLOB] = & globerrs[0];
EE(EE_FILENOTFOUND) = "File '%s' not found (Errcode: %d)";
EE(EE_CANTCREATEFILE) = "Can't create/write to file '%s' (Errcode: %d)";
......
......@@ -23,7 +23,7 @@
/* Define some external variables for error handling */
const char ** NEAR errmsg[MAXMAPS]={0,0,0,0};
const char ** NEAR my_errmsg[MAXMAPS]={0,0,0,0};
char NEAR errbuff[NRERRBUFFS][ERRMSGSIZE];
/* Error message to user */
......@@ -42,10 +42,10 @@ int my_error(int nr,myf MyFlags, ...)
va_start(ap,MyFlags);
DBUG_PRINT("my", ("nr: %d MyFlags: %d errno: %d", nr, MyFlags, errno));
if (nr / ERRMOD == GLOB && errmsg[GLOB] == 0)
if (nr / ERRMOD == GLOB && my_errmsg[GLOB] == 0)
init_glob_errs();
olen=(uint) strlen(tpos=errmsg[nr / ERRMOD][nr % ERRMOD]);
olen=(uint) strlen(tpos=my_errmsg[nr / ERRMOD][nr % ERRMOD]);
endpos=ebuff;
while (*tpos)
......
......@@ -56,7 +56,7 @@ int find_type(my_string x, TYPELIB *typelib, uint full_name)
if (! *i)
DBUG_RETURN(pos+1);
}
if (! *i)
if (! *i && (!*j || !(full_name & 1)))
{
find++;
findpos=pos;
......
......@@ -30,8 +30,8 @@ void init_errmessage(void)
{
DBUG_ENTER("init_errmessage");
read_texts(ERRMSG_FILE,&errmsg[ERRMAPP],ER_ERROR_MESSAGES);
errmesg=errmsg[ERRMAPP]; /* Init global variabel */
read_texts(ERRMSG_FILE,&my_errmsg[ERRMAPP],ER_ERROR_MESSAGES);
errmesg=my_errmsg[ERRMAPP]; /* Init global variabel */
init_myfunc_errs(); /* Init myfunc messages */
DBUG_VOID_RETURN;
}
......
......@@ -779,6 +779,7 @@ DBT *ha_berkeley::pack_key(DBT *key, uint keynr, char *buff,
for (; key_part != end && (int) key_length > 0 ; key_part++)
{
uint offset=0;
if (key_part->null_bit)
{
if (!(*buff++ = (*key_ptr == 0))) // Store 0 if NULL
......@@ -788,9 +789,9 @@ DBT *ha_berkeley::pack_key(DBT *key, uint keynr, char *buff,
key->flags|=DB_DBT_DUPOK;
continue;
}
key_ptr++;
offset=1; // Data is at key_ptr+1
}
buff=key_part->field->pack_key_from_key_image(buff,key_ptr,
buff=key_part->field->pack_key_from_key_image(buff,key_ptr+offset,
key_part->length);
key_ptr+=key_part->store_length;
key_length-=key_part->store_length;
......
......@@ -442,6 +442,7 @@ Query_log_event::Query_log_event(const char* buf, int event_len):
void Query_log_event::print(FILE* file, bool short_form)
{
char buff[40],*end; // Enough for SET TIMESTAMP
if (!short_form)
{
print_header(file);
......@@ -449,8 +450,12 @@ void Query_log_event::print(FILE* file, bool short_form)
(ulong) thread_id, (ulong) exec_time, error_code);
}
if(db && db[0])
if (db && db[0])
fprintf(file, "use %s;\n", db);
end=int10_to_str((long) when, strmov(buff,"SET TIMESTAMP="),10);
*end++=';';
*end++='\n';
my_fwrite(file, (byte*) buff, (uint) (end-buff),MYF(MY_NABP | MY_WME));
my_fwrite(file, (byte*) query, q_len, MYF(MY_NABP | MY_WME));
fprintf(file, ";\n");
}
......
......@@ -106,7 +106,7 @@ static void die(const char* fmt, ...)
static void print_version()
{
printf("%s Ver 1.1 for %s at %s\n",my_progname,SYSTEM_TYPE, MACHINE_TYPE);
printf("%s Ver 1.2 for %s at %s\n",my_progname,SYSTEM_TYPE, MACHINE_TYPE);
}
......@@ -377,7 +377,7 @@ static void dump_local_log_entries(const char* logname)
die("Bad magic number; The file is probably not a MySQL binary log");
}
while(1)
for (;;)
{
char llbuff[21];
my_off_t old_off = my_b_tell(file);
......
......@@ -642,7 +642,7 @@ void clean_up(void)
#ifdef USE_RAID
end_raid();
#endif
x_free((gptr) errmsg[ERRMAPP]); /* Free messages */
x_free((gptr) my_errmsg[ERRMAPP]); /* Free messages */
free_defaults(defaults_argv);
my_free(mysql_tmpdir,MYF(0));
x_free(opt_bin_logname);
......@@ -1677,7 +1677,7 @@ int main(int argc, char **argv)
case 1:
sql_print_error("\
Warning: one should set server-id to a non-0 value if log-bin is enabled.\n\
Will log updates to binary log, but will not accept connections from slaves.");
mysqld log updates to binary log, but will not accept connections from slaves.");
break;
#endif
case 2:
......@@ -2409,7 +2409,7 @@ enum options {
OPT_INNOBASE_LOG_GROUP_HOME_DIR,
OPT_INNOBASE_LOG_ARCH_DIR, OPT_INNOBASE_LOG_ARCHIVE,
OPT_INNOBASE_FLUSH_LOG_AT_TRX_COMMIT, OPT_SAFE_SHOW_DB,
OPT_GEMINI_SKIP,
OPT_GEMINI_SKIP, OPT_INNOBASE_SKIP,
OPT_TEMP_POOL
};
......@@ -2516,15 +2516,9 @@ static struct option long_options[] = {
{"socket", required_argument, 0, (int) OPT_SOCKET},
{"server-id", required_argument, 0, (int) OPT_SERVER_ID},
{"set-variable", required_argument, 0, 'O'},
#ifdef HAVE_BERKELEY_DB
{"skip-bdb", no_argument, 0, (int) OPT_BDB_SKIP},
#endif
#ifdef HAVE_INNOBASE_DB
{"skip-innobase", no_argument, 0, (int) OPT_INNOBASE_SKIP},
#endif
#ifdef HAVE_GEMINI_DB
{"skip-gemini", no_argument, 0, (int) OPT_GEMINI_SKIP},
#endif
{"skip-concurrent-insert", no_argument, 0, (int) OPT_SKIP_CONCURRENT_INSERT},
{"skip-delay-key-write", no_argument, 0, (int) OPT_SKIP_DELAY_KEY_WRITE},
{"skip-grant-tables", no_argument, 0, (int) OPT_SKIP_GRANT},
......@@ -3459,22 +3453,26 @@ static void get_options(int argc,char **argv)
berkeley_init_flags&= ~(DB_PRIVATE);
berkeley_shared_data=1;
break;
#endif /* HAVE_BERKELEY_DB */
case OPT_BDB_SKIP:
#ifdef HAVE_BERKELEY_DB
berkeley_skip=1;
have_berkeley_db=SHOW_OPTION_DISABLED;
break;
#endif
#ifdef HAVE_GEMINI_DB
break;
case OPT_GEMINI_SKIP:
#ifdef HAVE_GEMINI_DB
gemini_skip=1;
have_gemini_db=SHOW_OPTION_DISABLED;
break;
#endif
#ifdef HAVE_INNOBASE_DB
break;
case OPT_INNOBASE_SKIP:
#ifdef HAVE_INNOBASE_DB
innobase_skip=1;
have_innobase_db=SHOW_HAVE_DISABLED;
#endif
break;
#ifdef HAVE_INNOBASE_DB
case OPT_INNOBASE_DATA_HOME_DIR:
innobase_data_home_dir=optarg;
break;
......@@ -3493,7 +3491,7 @@ static void get_options(int argc,char **argv)
case OPT_INNOBASE_FLUSH_LOG_AT_TRX_COMMIT:
innobase_flush_log_at_trx_commit= optarg ? test(atoi(optarg)) : 1;
break;
#endif
#endif /* HAVE_INNOBASE_DB */
case OPT_MYISAM_RECOVER:
{
if (!optarg || !optarg[0])
......
......@@ -1250,8 +1250,10 @@ reconnecting to retry, log '%s' position %ld", RPL_LOG_NAME,
thd->proc_info = "processing master log event";
if(exec_event(thd, &mysql->net, &glob_mi, event_len))
{
sql_print_error("Error running query, slave aborted. Fix the problem, and re-start\
the slave thread with mysqladmin start-slave - log '%s' position %ld",
sql_print_error("\
Error running query, slave aborted. Fix the problem, and re-start \
the slave thread with \"mysqladmin start-slave\". We stopped at log \
'%s' position %ld",
RPL_LOG_NAME, glob_mi.pos);
goto err;
// there was an error running the query
......
......@@ -1784,7 +1784,7 @@ static key_map get_key_map_from_key_list(THD *thd, TABLE *table,
uint pos;
while ((name=it++))
{
if ((pos=find_type(name->c_ptr(), &table->keynames, 1)) <= 0)
if ((pos=find_type(name->c_ptr(), &table->keynames, 1+2)) <= 0)
{
my_error(ER_KEY_COLUMN_DOES_NOT_EXITS, MYF(0), name->c_ptr(),
table->real_name);
......
......@@ -187,7 +187,7 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *org_path,
}
continue;
}
if (find_type(fn_ext(file->name),&deletable_extentions,1) <= 0)
if (find_type(fn_ext(file->name),&deletable_extentions,1+2) <= 0)
{
found_other_files++;
continue;
......
......@@ -32,7 +32,8 @@ set-variable = table_cache=512
set-variable = sort_buffer=2M
set-variable = record_buffer=2M
set-variable = thread_cache=8
set-variable = thread_concurrency=8 # Try number of CPU's*2
# Try number of CPU's*2 for thread_concurrency
set-variable = thread_concurrency=8
set-variable = myisam_sort_buffer_size=64M
log-bin
server-id = 1
......@@ -51,7 +52,8 @@ set-variable = max_allowed_packet=16M
[mysql]
no-auto-rehash
#safe-updates # Remove the comment character if you are not familiar with SQL
# Remove the next comment character if you are not familiar with SQL
#safe-updates
[isamchk]
set-variable = key_buffer=256M
......
......@@ -33,7 +33,8 @@ set-variable = sort_buffer=1M
set-variable = record_buffer=1M
set-variable = myisam_sort_buffer_size=64M
set-variable = thread_cache=8
set-variable = thread_concurrency=8 # Try number of CPU's*2
# Try number of CPU's*2 for thread_concurrency
set-variable = thread_concurrency=8
log-bin
server-id = 1
......@@ -51,7 +52,8 @@ set-variable = max_allowed_packet=16M
[mysql]
no-auto-rehash
#safe-updates # Remove the comment character if you are not familiar with SQL
# Remove the next comment character if you are not familiar with SQL
#safe-updates
[isamchk]
set-variable = key_buffer=128M
......
......@@ -50,7 +50,8 @@ set-variable = max_allowed_packet=16M
[mysql]
no-auto-rehash
#safe-updates # Remove the comment character if you are not familiar with SQL
# Remove the next comment character if you are not familiar with SQL
#safe-updates
[isamchk]
set-variable = key_buffer=20M
......
......@@ -47,7 +47,8 @@ set-variable = max_allowed_packet=16M
[mysql]
no-auto-rehash
#safe-updates # Remove the comment character if you are not familiar with SQL
# Remove the next comment character if you are not familiar with SQL
#safe-updates
[isamchk]
set-variable = key_buffer=8M
......
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