Commit 33c67369 authored by unknown's avatar unknown

merged


sql/ha_myisam.cc:
  Auto merged
sql/lex.h:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
parents c1025105 459fec40
......@@ -46,3 +46,4 @@ tonu@x153.internalnet
tonu@x3.internalnet
venu@work.mysql.com
zak@linux.local
jcole@mugatu.spaceapes.com
#!/bin/sh
needed_flags=0
needed_texi2html=0
needed_texinfo_tex=0
needed_include_texi=0
if [ -z $BROWSER ]; then
BROWSER=netscape
echo "BROWSER not set, using $BROWSER"
fi
die ()
{
echo
echo $1
cleanup
exit 1
}
cleanup ()
{
echo "Cleaning up..."
if [ $needed_flags ]; then
bk clean Flags
fi
if [ $needed_texi2html ]; then
bk clean Support/texi2html
fi
if [ $needed_texinfo_tex ]; then
bk clean Support/texinfo.tex
fi
if [ $needed_include_texi ]; then
rm -f include.texi
fi
for file in \
manual.de.aux manual.de.cp manual.de.cps manual.de.dvi \
manual.de.fn manual.de.fns manual.de.ky manual.de.html \
manual.de.pg manual.de.toc manual.de.tp manual.de.vr \
mysql.de.info manual.de_toc.html ;
do
rm -f $file
done
}
if [ -e Flags/usa.txt ]; then
echo "Good, Flags are there."
else
echo -n "Checking out Flags..."
bk edit Flags >/dev/null 2>&1
echo " Done."
needed_flags=1
fi
if [ -e Support/texi2html ]; then
echo "Good, texi2html is there."
else
echo -n "Checking out texi2html..."
bk edit Support/texi2html >/dev/null 2>&1
echo " Done."
needed_texi2html=1
fi
if [ -e Support/texinfo.tex ]; then
echo "Good, texinfo.tex is there."
else
echo -n "Checking out texinfo.tex..."
bk edit Support/texinfo.tex >/dev/null 2>&1
echo " Done."
needed_texinfo_tex=1
fi
if [ -e include.texi ]; then
echo "Good, include.texi is there."
else
echo -n "Creating include.texi..."
bk edit ../configure.in >/dev/null 2>&1
echo "@c This file was generated by test-make-manual" > include.texi
echo -n "@set mysql_version " >> include.texi
grep "AM_INIT_AUTOMAKE(mysql, " ../configure.in | \
sed -e 's;AM_INIT_AUTOMAKE(mysql, ;;' -e 's;);;' >> include.texi
echo -n "@set default_port " >> include.texi
grep "MYSQL_TCP_PORT_DEFAULT=" ../configure.in | \
sed -e 's;MYSQL_TCP_PORT_DEFAULT=;;' >> include.texi
echo " Done."
needed_include_texi=1
fi
echo -n "Running makeinfo..."
makeinfo --no-split -I . manual.de.texi
if [ $? != 0 ]; then
die "Manual has errors - fix before you commit"
else
echo " Looks good."
fi
echo -n "Running texi2html..."
/usr/bin/perl ./Support/texi2html -iso -number manual.de.texi
if [ $? != 0 ]; then
die "Manual has errors - fix before you commit"
else
echo " Looks good."
fi
echo -n "Running texi2dvi..."
texi2dvi --batch manual.de.texi > texi2dvi.out
if [ $? != 0 ]; then
die "Manual has errors - fix before you commit (saved in texi2dvi.out)"
else
rm texi2dvi.out
echo " Looks good."
fi
echo
echo
echo "Please examine your modifications in \`manual.de.html'."
echo
echo "If you would like to use a different browser, set the 'BROWSER' environment"
echo "variable."
echo
$BROWSER file:`pwd`/manual.de_toc.html
echo "-- Press Enter to Continue --"
read junk
cleanup
This diff is collapsed.
......@@ -6252,7 +6252,7 @@ shell> groupadd mysql
shell> useradd -g mysql mysql
shell> cd /usr/local
shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -
shell> ln -s mysql-VERSION-OS mysql
shell> ln -s full-path-to-mysql-VERSION-OS mysql
shell> cd mysql
shell> scripts/mysql_install_db
shell> chown -R root .
......@@ -6327,7 +6327,7 @@ Unpack the distribution and create the installation directory:
@example
shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -
shell> ln -s mysql-VERSION-OS mysql
shell> ln -s full-path-to-mysql-VERSION-OS mysql
@end example
The first command creates a directory named @file{mysql-VERSION-OS}. The
......@@ -9637,13 +9637,6 @@ client/server and don't need to access the server from other hosts.
@item
Add some nice start and shutdown icons to the MySQL installation.
@item
Create a tool to manage registry entries for the MySQL startup
options. The registry entry reading is already coded into @file{mysqld.cc},
but it should be recoded to be more parameter oriented. The tool should
also be able to update the @file{C:\my.cnf} option file if the user prefers
to use that instead of the registry.
@item
When registering @code{mysqld} as a service with @code{--install} (on NT)
it would be nice if you could also add default options on the command line.
......@@ -9670,13 +9663,9 @@ interruptible. This would make it possible to kill open threads with
@code{mysqld} always starts in the "C" locale and not in the default locale.
We would like to have @code{mysqld} use the current locale for the sort order.
@item
Implement UDF functions with @code{.DLL}s.
@item
Add macros to use the faster thread-safe increment/decrement methods
provided by Windows.
@end itemize
Other Windows-specific issues are described in the @file{README} file that
......@@ -11025,6 +11014,12 @@ make sure that @file{gmalloc.o} is included in @file{libgthreads.a} and
In FSU Pthreads, the following system calls are pthreads-aware: @code{read()},
@code{write()}, @code{getmsg()}, @code{connect()}, @code{accept()},
@code{select()}, and @code{wait()}.
@item
The CSSA-2001-SCO.35.2 (the patch is listed in custom as
erg711905-dscr_remap security patch (ver 2.0.0) breaks FSU threads and
makes mysqld instable. You have to remove this one if you want to run
mysqld on an OpenServer 5.0.6 machine.
@end itemize
If you want to install DBI on SCO, you have to edit the @file{Makefile} in
......@@ -37994,7 +37989,19 @@ you at the startup that it is creating new log files.
@subsection Backing up and Recovering an InnoDB Database
The key to safe database management is taking regular backups.
To take a 'binary' backup of your database you have to do the following:
InnoDB Hot Backup is an online backup tool you can use to
backup your InnoDB database while it is running. InnoDB
Hot Backup does not require you to shut down your database
and it does not set any locks or disturb your normal
database processing. InnoDB Hot Backup is a non-free
additional tool which is not included in the standard
MySQL distribution. See the InnoDB Hot Backup homepage
@uref{http://www.innodb.com/hotbackup.html}
for detailed information and screenshots.
If you are able to shut down your MySQL server, then to take
a 'binary' backup of your database you have to do the following:
@itemize @bullet
@item
......@@ -41037,7 +41044,7 @@ Returns the error number for the most recently invoked MySQL function.
Returns the error message for the most recently invoked MySQL function.
@item @strong{mysql_real_escape_string()} @tab
Escapes special characters in a string for use in a SQL statement taking
Escapes special characters in a string for use in a SQL statement, taking
into account the current charset of the connection.
@item @strong{mysql_escape_string()} @tab
......@@ -48708,6 +48715,8 @@ Fixed bug with indexless boolean fulltext search.
Fixed bug that sometimes appeared when fulltext search was used
with ``const'' tables.
@item
Fixed wrong error value when doing a @code{SELECT} with an empty HEAP table.
@item
Use @code{ORDER BY column DESC} now sorts @code{NULL} values first.
@item
Fixed bug in @code{SELECT DISTINCT ... ORDER BY DESC} optimization.
......@@ -49086,6 +49095,12 @@ not yet 100% confident in this code.
@node News-3.23.50, News-3.23.49, News-3.23.x, News-3.23.x
@appendixsubsec Changes in release 3.23.50
@itemize @bullet
@item
Fixed problem with @code{SHOW CREATE TABLE} and @code{PRIMARY KEY} when using
32 indexes.
@item
Fixed that one can use @code{SET PASSWORD} for the anonymous user.
@item
Fixed core-dump bug when reading client groups from option files using
@code{mysql_options()}.
@item
......@@ -51003,6 +51018,8 @@ Fixed coredump in LOAD_FILE(NULL).
@itemize @bullet
@item
Added @code{mysql_real_escape_string()} function to the MySQL C API.
@item
Fixed a bug in @code{CONCAT()} where one of the arguments was a function
that returned a modified argument.
@item
......@@ -118,7 +118,8 @@ static bool info_flag=0,ignore_errors=0,wait_flag=0,quick=0,
no_rehash=0,skip_updates=0,safe_updates=0,one_database=0,
opt_compress=0, using_opt_local_infile=0,
vertical=0,skip_line_numbers=0,skip_column_names=0,opt_html=0,
opt_xml=0,opt_nopager=1, opt_outfile=0, no_named_cmds=1;
opt_xml=0,opt_nopager=1, opt_outfile=0, no_named_cmds=1,
opt_nobeep=0;
static uint verbose=0,opt_silent=0,opt_mysql_port=0, opt_local_infile=0;
static my_string opt_mysql_unix_port=0;
static int connect_flag=CLIENT_INTERACTIVE;
......@@ -438,6 +439,7 @@ static struct option long_options[] =
{"ignore-spaces", no_argument, 0, 'i'},
{"local-infile", optional_argument, 0, OPT_LOCAL_INFILE},
{"no-auto-rehash",no_argument, 0, 'A'},
{"no-beep", no_argument, 0, 'b'},
{"no-named-commands", no_argument, 0, 'g'},
{"no-tee", no_argument, 0, OPT_NOTEE},
#ifndef __WIN__
......@@ -501,6 +503,7 @@ static void usage(int version)
-A, --no-auto-rehash No automatic rehashing. One has to use 'rehash' to\n\
get table and field completion. This gives a quicker\n\
start of mysql and disables rehashing on reconnect.\n\
-b, --no-beep Turn off beep on error.\n\
-B, --batch Print results with a tab as separator, each row on\n\
a new line. Doesn't use history file.\n\
--character-sets-dir=...\n\
......@@ -530,6 +533,7 @@ static void usage(int version)
-h, --host=... Connect to host.\n\
-H, --html Produce HTML output.\n\
-X, --xml Produce XML output.\n\
--local-infile=[1|0] Enable/disable LOAD DATA LOCAL INFILE\n\
-L, --skip-line-numbers\n\
Don't write line number for errors.\n");
#ifndef __WIN__
......@@ -604,7 +608,7 @@ static int get_options(int argc, char **argv)
set_all_changeable_vars(changeable_vars);
while ((c=getopt_long(argc,argv,
(char*) "?ABCD:LfgGHXinNoqrstTU::vVw::WEe:h:O:P:S:u:#::p::",
(char*) "?AbBCD:LfgGHXinNoqrstTU::vVw::WEe:h:O:P:S:u:#::p::",
long_options, &option_index)) != EOF)
{
switch(c) {
......@@ -615,6 +619,9 @@ static int get_options(int argc, char **argv)
strmov(mysql_charsets_dir, optarg);
charsets_dir = mysql_charsets_dir;
break;
case 'b':
opt_nobeep = 1;
break;
case OPT_TEE:
if (!opt_outfile && strlen(optarg))
{
......@@ -2441,7 +2448,8 @@ put_info(const char *str,INFO_TYPE info_type,uint error)
}
if (info_type == INFO_ERROR)
{
putchar('\007'); /* This should make a bell */
if(!opt_nobeep)
putchar('\007'); /* This should make a bell */
vidattr(A_STANDOUT);
if (error)
(void) tee_fprintf(stderr, "ERROR %d: ", error);
......
......@@ -25,7 +25,7 @@
** * *
** *************************
*/
#define IMPORT_VERSION "2.7"
#define IMPORT_VERSION "2.8"
#include "client_priv.h"
#include "mysql_version.h"
......@@ -397,6 +397,9 @@ static MYSQL *db_connect(char *host, char *database, char *user, char *passwd)
mysql_init(&mysql_connection);
if (opt_compress)
mysql_options(&mysql_connection,MYSQL_OPT_COMPRESS,NullS);
if (opt_local_file)
mysql_options(&mysql_connection,MYSQL_OPT_LOCAL_INFILE,
(char*) &opt_local_file);
#ifdef HAVE_OPENSSL
if (opt_use_ssl)
mysql_ssl_set(&mysql_connection, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
......
......@@ -563,6 +563,15 @@ EOF
F301:UNIX_System_V:*:*)
echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
exit 0 ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
if test "${UNAME_MACHINE}" = "c86pc"; then
UNAME_MACHINE=pc
fi
echo `uname -p`-${UNAME_MACHINE}-nto-qnx
exit 0;;
*:QNX:*:*)
echo i386-pc-qnx
exit 0;;
hp3[0-9][05]:NetBSD:*:*)
echo m68k-hp-netbsd${UNAME_RELEASE}
exit 0 ;;
......
......@@ -111,7 +111,7 @@ esac
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
linux-gnu*)
nto-qnx* | linux-gnu*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
......@@ -636,6 +636,20 @@ case $basic_machine in
basic_machine=i960-intel
os=-nindy
;;
ntox86)
basic_machine=i386${os:--unknown}
os=-nto-qnx
;;
nto*le | not*be)
basic_machine=${basic_machine%%be}
basic_machine=${basic_machine%%le}
basic_machine=${basic_machine##nto}${os:--unknown}
os=-nto-qnx
;;
nto*)
basic_machine=${basic_machine##nto}${os:--unknown}
os=-nto-qnx
;;
mon960)
basic_machine=i960-intel
os=-mon960
......
......@@ -606,7 +606,7 @@ AC_SUBST(MYSQLD_USER)
AC_MSG_CHECKING(if we should should enable LOAD DATA LOCAL by default)
AC_ARG_ENABLE(local-infile,
[ --enable-local-infile
If LOAD DATA LOCAL INFILE is enabled by default.],
Enable LOAD DATA LOCAL INFILE (default: disabled)],
[ ENABLED_LOCAL_INFILE=$enableval ],
[ ENABLED_LOCAL_INFILE=no ]
)
......
......@@ -21,11 +21,6 @@
int heap_rfirst(HP_INFO *info, byte *record)
{
DBUG_ENTER("heap_rfirst");
if (!(info->s->records))
{
my_errno=HA_ERR_END_OF_FILE;
DBUG_RETURN(my_errno);
}
info->current_record=0;
info->current_hash_ptr=0;
info->update=HA_STATE_PREV_FOUND;
......
......@@ -91,10 +91,10 @@ extern const char *compiled_charset_name(uint charset_number);
#define _U 01 /* Upper case */
#define _L 02 /* Lower case */
#define _N 04 /* Numeral (digit) */
#define _S 010 /* Spacing character */
#define _P 020 /* Punctuation */
#define _C 040 /* Control character */
#define _NMR 04 /* Numeral (digit) */
#define _SPC 010 /* Spacing character */
#define _PNT 020 /* Punctuation */
#define _CTR 040 /* Control character */
#define _B 0100 /* Blank */
#define _X 0200 /* heXadecimal digit */
......@@ -111,14 +111,14 @@ extern const char *compiled_charset_name(uint charset_number);
#define isalpha(c) ((my_ctype+1)[(uchar) (c)] & (_U | _L))
#define isupper(c) ((my_ctype+1)[(uchar) (c)] & _U)
#define islower(c) ((my_ctype+1)[(uchar) (c)] & _L)
#define isdigit(c) ((my_ctype+1)[(uchar) (c)] & _N)
#define isdigit(c) ((my_ctype+1)[(uchar) (c)] & _NMR)
#define isxdigit(c) ((my_ctype+1)[(uchar) (c)] & _X)
#define isalnum(c) ((my_ctype+1)[(uchar) (c)] & (_U | _L | _N))
#define isspace(c) ((my_ctype+1)[(uchar) (c)] & _S)
#define ispunct(c) ((my_ctype+1)[(uchar) (c)] & _P)
#define isprint(c) ((my_ctype+1)[(uchar) (c)] & (_P | _U | _L | _N | _B))
#define isgraph(c) ((my_ctype+1)[(uchar) (c)] & (_P | _U | _L | _N))
#define iscntrl(c) ((my_ctype+1)[(uchar) (c)] & _C)
#define isalnum(c) ((my_ctype+1)[(uchar) (c)] & (_U | _L | _NMR))
#define isspace(c) ((my_ctype+1)[(uchar) (c)] & _SPC)
#define ispunct(c) ((my_ctype+1)[(uchar) (c)] & _PNT)
#define isprint(c) ((my_ctype+1)[(uchar) (c)] & (_PNT | _U | _L | _NMR | _B))
#define isgraph(c) ((my_ctype+1)[(uchar) (c)] & (_PNT | _U | _L | _NMR))
#define iscntrl(c) ((my_ctype+1)[(uchar) (c)] & _CTR)
#define isascii(c) (!((c) & ~0177))
#define toascii(c) ((c) & 0177)
......@@ -129,14 +129,14 @@ extern const char *compiled_charset_name(uint charset_number);
#define my_isalpha(s, c) (((s)->ctype+1)[(uchar) (c)] & (_U | _L))
#define my_isupper(s, c) (((s)->ctype+1)[(uchar) (c)] & _U)
#define my_islower(s, c) (((s)->ctype+1)[(uchar) (c)] & _L)
#define my_isdigit(s, c) (((s)->ctype+1)[(uchar) (c)] & _N)
#define my_isdigit(s, c) (((s)->ctype+1)[(uchar) (c)] & _NMR)
#define my_isxdigit(s, c) (((s)->ctype+1)[(uchar) (c)] & _X)
#define my_isalnum(s, c) (((s)->ctype+1)[(uchar) (c)] & (_U | _L | _N))
#define my_isspace(s, c) (((s)->ctype+1)[(uchar) (c)] & _S)
#define my_ispunct(s, c) (((s)->ctype+1)[(uchar) (c)] & _P)
#define my_isprint(s, c) (((s)->ctype+1)[(uchar) (c)] & (_P | _U | _L | _N | _B))
#define my_isgraph(s, c) (((s)->ctype+1)[(uchar) (c)] & (_P | _U | _L | _N))
#define my_iscntrl(s, c) (((s)->ctype+1)[(uchar) (c)] & _C)
#define my_isalnum(s, c) (((s)->ctype+1)[(uchar) (c)] & (_U | _L | _NMR))
#define my_isspace(s, c) (((s)->ctype+1)[(uchar) (c)] & _SPC)
#define my_ispunct(s, c) (((s)->ctype+1)[(uchar) (c)] & _PNT)
#define my_isprint(s, c) (((s)->ctype+1)[(uchar) (c)] & (_PNT | _U | _L | _NMR | _B))
#define my_isgraph(s, c) (((s)->ctype+1)[(uchar) (c)] & (_PNT | _U | _L | _NMR))
#define my_iscntrl(s, c) (((s)->ctype+1)[(uchar) (c)] & _CTR)
#define use_strcoll(s) ((s)->strcoll != NULL)
#define MY_STRXFRM_MULTIPLY (default_charset_info->strxfrm_multiply)
......
......@@ -132,6 +132,14 @@
/* #define _AIX32_CURSES */ /* XXX: this breaks AIX 4.3.3 (others?). */
#endif
#ifdef __QNXNTO__
#define HAVE_ERRNO_AS_DEFINE
#define HAVE_FCNTL_LOCK
#undef HAVE_SYS_UN_H
#undef HAVE_FINITE
#undef HAVE_RINT
#endif
#ifdef HAVE_BROKEN_SNPRINTF /* HPUX 10.20 don't have this defined */
#undef HAVE_SNPRINTF
#endif
......@@ -314,6 +322,7 @@ typedef unsigned short ushort;
#define set_if_bigger(a,b) { if ((a) < (b)) (a)=(b); }
#define set_if_smaller(a,b) { if ((a) > (b)) (a)=(b); }
#define test_all_bits(a,b) (((a) & (b)) == (b))
#define set_bits(type, bit_count) (sizeof(type)*8 <= (bit_count) ? ~(type) 0 : ((((type) 1) << (bit_count)) - (type) 1))
#define array_elements(A) ((uint) (sizeof(A)/sizeof(A[0])))
#ifndef HAVE_RINT
#define rint(A) floor((A)+0.5)
......
......@@ -94,3 +94,43 @@ d date 0000-00-00
t time 00:00:00
dt datetime 0000-00-00 00:00:00
drop table t1,t2;
create table t1 (a int not null, b int, primary key(a), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b));
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL default '0',
`b` int(11) default NULL,
PRIMARY KEY (`a`),
KEY `b` (`b`),
KEY `b_2` (`b`),
KEY `b_3` (`b`),
KEY `b_4` (`b`),
KEY `b_5` (`b`),
KEY `b_6` (`b`),
KEY `b_7` (`b`),
KEY `b_8` (`b`),
KEY `b_9` (`b`),
KEY `b_10` (`b`),
KEY `b_11` (`b`),
KEY `b_12` (`b`),
KEY `b_13` (`b`),
KEY `b_14` (`b`),
KEY `b_15` (`b`),
KEY `b_16` (`b`),
KEY `b_17` (`b`),
KEY `b_18` (`b`),
KEY `b_19` (`b`),
KEY `b_20` (`b`),
KEY `b_21` (`b`),
KEY `b_22` (`b`),
KEY `b_23` (`b`),
KEY `b_24` (`b`),
KEY `b_25` (`b`),
KEY `b_26` (`b`),
KEY `b_27` (`b`),
KEY `b_28` (`b`),
KEY `b_29` (`b`),
KEY `b_30` (`b`),
KEY `b_31` (`b`)
) TYPE=MyISAM
drop table t1;
......@@ -197,3 +197,9 @@ a b
INSERT INTO t1 VALUES (1,3);
Duplicate entry '3' for key 1
DROP TABLE t1;
CREATE TABLE t1 (a int not null, primary key(a)) type=heap;
INSERT into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11);
DELETE from t1 where a < 100;
SELECT * from t1;
a
DROP TABLE t1;
......@@ -81,3 +81,11 @@ drop table t2;
create table t2 select CAST("2001-12-29" AS DATE) as d, CAST("20:45:11" AS TIME) as t, CAST("2001-12-29 20:45:11" AS DATETIME) as dt;
describe t2;
drop table t1,t2;
#
# Test of primary key with 32 index
#
create table t1 (a int not null, b int, primary key(a), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b));
show create table t1;
drop table t1;
......@@ -128,3 +128,13 @@ SELECT * FROM t1 WHERE b<=>NULL;
--error 1062
INSERT INTO t1 VALUES (1,3);
DROP TABLE t1;
#
# Test when deleting all rows
#
CREATE TABLE t1 (a int not null, primary key(a)) type=heap;
INSERT into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11);
DELETE from t1 where a < 100;
SELECT * from t1;
DROP TABLE t1;
......@@ -36,8 +36,7 @@ my_string my_load_path(my_string to, const char *path,
test_if_hard_path(path))
VOID(strmov(buff,path));
else if ((path[0] == FN_CURLIB && path[1] == FN_LIBCHAR) ||
(is_prefix((gptr) path,FN_PARENTDIR) &&
path[strlen(FN_PARENTDIR)] == FN_LIBCHAR) ||
(is_prefix((gptr) path,FN_PARENTDIR)) ||
! own_path_prefix)
{
if (! my_getwd(buff,(uint) (FN_REFLEN-strlen(path)),MYF(0)))
......
......@@ -14,6 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* To avoid problems with alarms in debug code, we disable DBUG here */
#define DBUG_OFF
#include <my_global.h>
#if defined(THREAD) && !defined(DONT_USE_THR_ALARM)
......
......@@ -136,7 +136,11 @@ static int rl_digit_loop1 ();
void
_rl_vi_initialize_line ()
{
#ifndef __QNXNTO__
register uint i;
#else
register unsigned int i;
#endif
for (i = 0; i < (int) sizeof (vi_mark_chars) / sizeof (int); i++)
vi_mark_chars[i] = -1;
......
......@@ -75,7 +75,7 @@ while ( defined($_ = shift @pending) or defined($_ = <>) ) {
s/^#? Time: \d{6}\s+\d+:\d+:\d+.*\n//;
my ($user,$host) = s/^#? User\@Host:\s+(\S+)\s+\@\s+(\S+).*\n// ? ($1,$2) : ('','');
s/^# Time: (\d+) Lock_time: (\d+) Rows_sent: (\d+).*\n//;
s/^# Query_time: (\d+) Lock_time: (\d+) Rows_sent: (\d+).*\n//;
my ($t, $l, $r) = ($1, $2, $3);
$t -= $l unless $opt{l};
......@@ -96,8 +96,12 @@ while ( defined($_ = shift @pending) or defined($_ = <>) ) {
unless ($opt{a}) {
s/\b\d+\b/N/g;
s/\b0x[0-9A-Fa-f]+\b/N/g;
s/'([^\\\']|\\.|\'\')+'/'S'/g;
s/"([^\\\"]|\\.|\"\")+"/"S"/g;
s/''/'S'/g;
s/""/"S"/g;
s/(\\')//g;
s/(\\")//g;
s/'[^']+'/'S'/g;
s/"[^"]+"/"S"/g;
# -n=8: turn log_20001231 into log_NNNNNNNN
s/([a-z_]+)(\d{$opt{n},})/$1.('N' x length($2))/ieg if $opt{n};
# abbreviate massive "in (...)" statements and similar
......
......@@ -37,7 +37,7 @@ WARNING: THIS PROGRAM IS STILL IN BETA. Comments/patches welcome.
# Documentation continued at end of file
my $VERSION = "1.15";
my $VERSION = "1.16";
my $opt_tmpdir = $ENV{TMPDIR} || "/tmp";
......@@ -236,9 +236,7 @@ my $num_files = 0;
foreach my $rdb ( @db_desc ) {
my $db = $rdb->{src};
eval { $dbh->do( "use $db" ); };
die "Database '$db' not accessible: $@" if ( $@ );
my @dbh_tables = $dbh->tables();
my @dbh_tables = get_list_of_tables( $db );
## generate regex for tables/files
my $t_regex;
......@@ -307,7 +305,7 @@ foreach my $rdb ( @db_desc ) {
$rdb->{files} = [ @db_files ];
$rdb->{index} = [ @index_files ];
my @hc_tables = map { "`$db.$_`" } @dbh_tables;
my @hc_tables = map { "`$db`.`$_`" } @dbh_tables;
$rdb->{tables} = [ @hc_tables ];
$rdb->{raid_dirs} = [ get_raid_dirs( $rdb->{files} ) ];
......@@ -562,14 +560,14 @@ sub copy_files {
# add recursive option for scp
push @cp, "-r" if $^O =~ /m^(solaris|linux|freebsd)$/ && $method =~ /^scp\b/;
my @non_raid = grep { ! m:/\d{2}/[^/]+$: } @$files;
my @non_raid = map { "'$_'" } grep { ! m:/\d{2}/[^/]+$: } @$files;
# add files to copy and the destination directory
safe_system( @cp, @non_raid, $target );
+ safe_system( @cp, @non_raid, "'$target'" );
foreach my $rd ( @$raid_dirs ) {
my @raid = grep { m:$rd/: } @$files;
safe_system( @cp, @raid, "$target/$rd" ) if ( @raid );
my @raid = map { "'$_'" } grep { m:$rd/: } @$files;
safe_system( @cp, @raid, "'$target'/$rd" ) if ( @raid );
}
}
else
......@@ -735,6 +733,25 @@ sub get_raid_dirs {
return sort keys %dirs;
}
sub get_list_of_tables {
my ( $db ) = @_;
# "use database" cannot cope with database names containing spaces
# so create a new connection
my $dbh = DBI->connect("dbi:mysql:${db}${dsn};mysql_read_default_group=mysqlhotcopy",
$opt{user}, $opt{password},
{
RaiseError => 1,
PrintError => 0,
AutoCommit => 1,
});
my @dbh_tables = eval { $dbh->tables() };
$dbh->disconnect();
return @dbh_tables;
}
__END__
=head1 DESCRIPTION
......@@ -975,3 +992,4 @@ Jeremy D. Zawodny - Removed depricated DBI calls. Fixed bug which
resulted in nothing being copied when a regexp was specified but no
database name(s).
Martin Waite - Fix to handle database name that contains space.
......@@ -201,7 +201,7 @@ void ha_isam::info(uint flag)
sortkey = info.sortkey;
block_size=nisam_block_size;
table->keys = min(table->keys,info.keys);
table->keys_in_use= (((key_map) 1) << table->keys)- (key_map) 1;
table->keys_in_use= set_bits(key_map,table->keys);
table->db_options_in_use= info.options;
table->db_record_offset=
(table->db_options_in_use &
......
......@@ -688,7 +688,7 @@ bool ha_myisam::activate_all_index(THD *thd)
mi_extra(file, HA_EXTRA_BULK_INSERT_END);
if (enable_activate_all_index &&
share->state.key_map != ((ulonglong) 1L << share->base.keys)-1)
share->state.key_map != set_bits(ulonglong, share->base.keys))
{
const char *save_proc_info=thd->proc_info;
thd->proc_info="Creating index";
......
......@@ -189,7 +189,7 @@ void ha_myisammrg::info(uint flag)
deleted = (ha_rows) info.deleted;
data_file_length=info.data_file_length;
errkey = info.errkey;
table->keys_in_use=(((key_map) 1) << table->keys)- (key_map) 1;
table->keys_in_use= set_bits(key_map, table->keys);
table->db_options_in_use = info.options;
table->is_view=1;
mean_rec_length=info.reclength;
......
......@@ -542,7 +542,8 @@ int handler::read_first_row(byte * buf, uint primary_key)
If there is very few deleted rows in the table, find the first row by
scanning the table.
*/
if (deleted < 10 || primary_key >= MAX_KEY)
if (deleted < 10 || primary_key >= MAX_KEY ||
!(option_flag() & HA_READ_ORDER))
{
(void) rnd_init();
while ((error= rnd_next(buf)) == HA_ERR_RECORD_DELETED) ;
......
......@@ -191,6 +191,7 @@ static SYMBOL symbols[] = {
{ "INT4", SYM(INT_SYM),0,0},
{ "INT8", SYM(BIGINT),0,0},
{ "INTO", SYM(INTO),0,0},
{ "IO_THREAD", SYM(IO_THREAD),0,0},
{ "IF", SYM(IF),0,0},
{ "IS", SYM(IS),0,0},
{ "ISOLATION", SYM(ISOLATION),0,0},
......@@ -327,6 +328,7 @@ static SYMBOL symbols[] = {
{ "SQL_SELECT_LIMIT", SYM(SQL_SELECT_LIMIT),0,0},
{ "SQL_SLAVE_SKIP_COUNTER", SYM(SQL_SLAVE_SKIP_COUNTER),0,0},
{ "SQL_SMALL_RESULT", SYM(SQL_SMALL_RESULT),0,0},
{ "SQL_THREAD", SYM(SQL_THREAD),0,0},
{ "SQL_WARNINGS", SYM(SQL_WARNINGS),0,0},
{ "SSL", SYM(SSL_SYM),0,0},
{ "STRAIGHT_JOIN", SYM(STRAIGHT_JOIN),0,0},
......
......@@ -970,8 +970,11 @@ static void server_init(void)
unireg_abort(1);
}
if (listen(ip_sock,(int) back_log) < 0)
sql_print_error("Warning: listen() on TCP/IP failed with error %d",
{
sql_print_error("Error: listen() on TCP/IP failed with error %d",
socket_errno);
unireg_abort(1);
}
}
if (mysqld_chroot)
......@@ -3386,6 +3389,7 @@ Starts the MySQL server\n");
--init-file=file Read SQL commands from this file at startup\n\
-L, --language=... Client error messages in given language. May be\n\
given as a full path\n\
--local-infile=[1|0] Enable/disable LOAD DATA LOCAL INFILE\n\
-l, --log[=file] Log connections and queries to file\n\
--log-bin[=file] Log queries in new binary format (for replication)\n\
--log-bin-index=file File that holds the names for last binary log files\n\
......
......@@ -922,14 +922,10 @@ bool acl_check_host(const char *host, const char *ip)
bool change_password(THD *thd, const char *host, const char *user,
char *new_password)
{
uint length=0;
DBUG_ENTER("change_password");
DBUG_PRINT("enter",("thd=%x, host='%s', user='%s', new_password='%s'",thd,host,user,new_password));
uint length=0;
if (!user[0])
{
send_error(&thd->net, ER_PASSWORD_ANONYMOUS_USER);
DBUG_RETURN(1);
}
if (!initialized)
{
send_error(&thd->net, ER_PASSWORD_NOT_ALLOWED); /* purecov: inspected */
......@@ -941,16 +937,21 @@ bool change_password(THD *thd, const char *host, const char *user,
length=(uint) strlen(new_password);
new_password[length & 16]=0;
if (!thd || (!thd->slave_thread && ( strcmp(thd->user,user) ||
my_strcasecmp(host,thd->host ? thd->host : thd->ip))))
if (!thd->slave_thread &&
(strcmp(thd->user,user) ||
my_strcasecmp(host,thd->host ? thd->host : thd->ip)))
{
if (check_access(thd, UPDATE_ACL, "mysql",0,1))
DBUG_RETURN(1);
}
if (!thd->slave_thread && !thd->user[0])
{
send_error(&thd->net, ER_PASSWORD_ANONYMOUS_USER);
DBUG_RETURN(1);
}
VOID(pthread_mutex_lock(&acl_cache->lock));
ACL_USER *acl_user;
DBUG_PRINT("info",("host=%s, user=%s",host,user));
if (!(acl_user= find_acl_user(host,user)) || !acl_user->user)
if (!(acl_user= find_acl_user(host,user)))
{
send_error(&thd->net, ER_PASSWORD_NO_MATCH);
VOID(pthread_mutex_unlock(&acl_cache->lock));
......@@ -958,7 +959,8 @@ bool change_password(THD *thd, const char *host, const char *user,
}
if (update_user_table(thd,
acl_user->host.hostname ? acl_user->host.hostname : "",
acl_user->user, new_password))
acl_user->user ? acl_user->user : "",
new_password))
{
VOID(pthread_mutex_unlock(&acl_cache->lock)); /* purecov: deadcode */
send_error(&thd->net,0); /* purecov: deadcode */
......@@ -978,7 +980,7 @@ bool change_password(THD *thd, const char *host, const char *user,
qinfo.q_len =
my_sprintf(buff,
(buff,"SET PASSWORD FOR \"%-.120s\"@\"%-.120s\"=\"%-.120s\"",
acl_user->user,
acl_user->user ? acl_user->user : "",
acl_user->host.hostname ? acl_user->host.hostname : "",
new_password));
mysql_update_log.write(thd,buff,qinfo.q_len);
......@@ -2743,9 +2745,9 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
}
}
}
db.append (" ON ",4);
db.append (" ON '",5);
db.append(acl_db->db);
db.append (".* TO '",7);
db.append ("'.* TO '",8);
db.append(lex_user->user.str,lex_user->user.length);
db.append ("'@'",3);
db.append(lex_user->host.str, lex_user->host.length);
......
......@@ -150,6 +150,7 @@ LEX *lex_start(THD *thd, uchar *buf,uint length)
lex->convert_set=(lex->thd=thd)->convert_set;
lex->yacc_yyss=lex->yacc_yyvs=0;
lex->ignore_space=test(thd->sql_mode & MODE_IGNORE_SPACE);
lex->slave_thd_opt=0;
return lex;
}
......
......@@ -186,7 +186,7 @@ typedef struct st_lex {
thr_lock_type lock_option;
bool drop_primary,drop_if_exists,local_file;
bool in_comment,ignore_space,verbose,simple_alter, option_type;
uint slave_thd_opt;
} LEX;
......
......@@ -562,6 +562,8 @@ int start_slave(THD* thd , MASTER_INFO* mi, bool net_report)
return 1;
lock_slave_threads(mi); // this allows us to cleanly read slave_running
init_thread_mask(&thread_mask,mi,1 /* inverse */);
if (thd->lex.slave_thd_opt)
thread_mask &= thd->lex.slave_thd_opt;
if (thread_mask)
{
if (server_id_supplied && (!mi->inited || (mi->inited && *mi->host)))
......@@ -602,6 +604,8 @@ int stop_slave(THD* thd, MASTER_INFO* mi, bool net_report )
int thread_mask;
lock_slave_threads(mi);
init_thread_mask(&thread_mask,mi,0 /* not inverse*/);
if (thd->lex.slave_thd_opt)
thread_mask &= thd->lex.slave_thd_opt;
slave_errno = (thread_mask) ?
terminate_slave_threads(mi,thread_mask,
1 /*skip lock */) : ER_SLAVE_NOT_RUNNING;
......
......@@ -123,6 +123,8 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%token RESET_SYM
%token PURGE
%token SLAVE
%token IO_THREAD
%token SQL_THREAD
%token START_SYM
%token STOP_SYM
%token TRUNCATE_SYM
......@@ -1257,20 +1259,34 @@ opt_to:
| AS {}
slave:
SLAVE START_SYM
SLAVE START_SYM slave_thread_opts
{
LEX *lex=Lex;
lex->sql_command = SQLCOM_SLAVE_START;
lex->type = 0;
}
|
SLAVE STOP_SYM
SLAVE STOP_SYM slave_thread_opts
{
LEX *lex=Lex;
lex->sql_command = SQLCOM_SLAVE_STOP;
lex->type = 0;
};
slave_thread_opts: slave_thread_opt
| slave_thread_opts ',' slave_thread_opt
slave_thread_opt:
/*empty*/ {}
| SQL_THREAD
{
Lex->slave_thd_opt|=SLAVE_SQL;
}
| IO_THREAD
{
Lex->slave_thd_opt|=SLAVE_IO;
}
restore:
RESTORE_SYM table_or_tables
{
......
......@@ -130,8 +130,8 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
VOID(my_seek(file,(ulong) uint2korr(head+6),MY_SEEK_SET,MYF(0)));
if (read_string(file,(gptr*) &disk_buff,(uint) uint2korr(head+28)))
goto err_not_open; /* purecov: inspected */
outparam->keys=keys=disk_buff[0];
outparam->keys_in_use= (((key_map) 1) << keys)- (key_map) 1;
outparam->keys=keys= disk_buff[0];
outparam->keys_in_use= set_bits(key_map, keys);
outparam->key_parts=key_parts=disk_buff[1];
n_length=keys*sizeof(KEY)+key_parts*sizeof(KEY_PART_INFO);
......
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