Merge work:/home/bk/mysql-4.0 into hundin.mysql.fi:/my/bk/mysql-4.0

Docs/manual.texi:
  Auto merged
This commit is contained in:
unknown 2002-04-26 08:57:49 +03:00
commit eeef54d938
92 changed files with 1403 additions and 519 deletions

View file

@ -6,6 +6,7 @@ Sinisa@sinisa.nasamreza.org
ahlentz@co3064164-a.rochd1.qld.optusnet.com.au ahlentz@co3064164-a.rochd1.qld.optusnet.com.au
arjen@co3064164-a.bitbike.com arjen@co3064164-a.bitbike.com
arjen@fred.bitbike.com arjen@fred.bitbike.com
arjen@george.bitbike.com
bell@sanja.is.com.ua bell@sanja.is.com.ua
davida@isil.mysql.com davida@isil.mysql.com
heikki@donna.mysql.fi heikki@donna.mysql.fi
@ -20,6 +21,7 @@ jcole@sarvik.tfr.cafe.ee
jcole@tetra.spaceapes.com jcole@tetra.spaceapes.com
jorge@linux.jorge.mysql.com jorge@linux.jorge.mysql.com
kaj@work.mysql.com kaj@work.mysql.com
lenz@kallisto.mysql.com
miguel@hegel.local miguel@hegel.local
miguel@light.local miguel@light.local
monty@bitch.mysql.fi monty@bitch.mysql.fi
@ -51,5 +53,3 @@ tonu@x3.internalnet
venu@work.mysql.com venu@work.mysql.com
zak@balfor.local zak@balfor.local
zak@linux.local zak@linux.local
arjen@george.bitbike.com
lenz@kallisto.mysql.com

View file

@ -1,73 +1,183 @@
diff -Nur --exclude=SCCS --exclude=BitKeeper --exclude=ChangeSet ../glibc-2.2.5/linuxthreads/internals.h ./linuxthreads/internals.h Only in glibc-2.2.4-new: bits
--- ../glibc-2.2.5/linuxthreads/internals.h Thu Nov 29 00:44:16 2001 Only in glibc-2.2.4-new: config.cache
+++ ./linuxthreads/internals.h Fri Feb 22 21:18:09 2002 Only in glibc-2.2.4-new: config.h
@@ -343,7 +343,7 @@ Only in glibc-2.2.4-new: config.log
THREAD_SELF implementation is used, this must be a power of two and Only in glibc-2.2.4-new: config.make
a multiple of PAGE_SIZE. */ Only in glibc-2.2.4-new: config.status
#ifndef STACK_SIZE Only in glibc-2.2.4-new: glibcbug
-#define STACK_SIZE (2 * 1024 * 1024) Only in glibc-2.2.4-new/iconv: strtab.o
+#define STACK_SIZE (128 * 1024) diff -r -c glibc-2.2.4/linuxthreads/internals.h glibc-2.2.4-new/linuxthreads/internals.h
#endif *** glibc-2.2.4/linuxthreads/internals.h Mon Jul 23 20:54:13 2001
--- glibc-2.2.4-new/linuxthreads/internals.h Tue Apr 16 15:08:03 2002
/* The initial size of the thread stack. Must be a multiple of PAGE_SIZE. */ ***************
diff -Nur --exclude=SCCS --exclude=BitKeeper --exclude=ChangeSet ../glibc-2.2.5/linuxthreads/sysdeps/unix/sysv/linux/bits/local_lim.h ./linuxthreads/sysdeps/unix/sysv/linux/bits/local_lim.h *** 339,345 ****
--- ../glibc-2.2.5/linuxthreads/sysdeps/unix/sysv/linux/bits/local_lim.h Thu Jun 8 13:49:49 2000 THREAD_SELF implementation is used, this must be a power of two and
+++ ./linuxthreads/sysdeps/unix/sysv/linux/bits/local_lim.h Fri Feb 22 21:18:09 2002 a multiple of PAGE_SIZE. */
@@ -64,7 +64,7 @@ #ifndef STACK_SIZE
/* The number of threads per process. */ ! #define STACK_SIZE (2 * 1024 * 1024)
#define _POSIX_THREAD_THREADS_MAX 64 #endif
/* This is the value this implementation supports. */
-#define PTHREAD_THREADS_MAX 1024 /* The initial size of the thread stack. Must be a multiple of PAGE_SIZE. */
+#define PTHREAD_THREADS_MAX 4096 --- 339,345 ----
THREAD_SELF implementation is used, this must be a power of two and
/* Maximum amount by which a process can descrease its asynchronous I/O a multiple of PAGE_SIZE. */
priority level. */ #ifndef STACK_SIZE
diff -Nur --exclude=SCCS --exclude=BitKeeper --exclude=ChangeSet ../glibc-2.2.5/nss/nsswitch.c ./nss/nsswitch.c ! #define STACK_SIZE (128 * 1024)
--- ../glibc-2.2.5/nss/nsswitch.c Tue Jul 17 02:21:36 2001 #endif
+++ ./nss/nsswitch.c Fri Feb 22 21:18:09 2002
@@ -515,8 +515,16 @@ /* The initial size of the thread stack. Must be a multiple of PAGE_SIZE. */
+ (line - name + 1)); Only in glibc-2.2.4-new/linuxthreads: internals.h.rej
if (new_service == NULL) diff -r -c glibc-2.2.4/linuxthreads/sysdeps/unix/sysv/linux/bits/local_lim.h glibc-2.2.4-new/linuxthreads/sysdeps/unix/sysv/linux/bits/local_lim.h
return result; *** glibc-2.2.4/linuxthreads/sysdeps/unix/sysv/linux/bits/local_lim.h Fri Jun 9 22:17:35 2000
- --- glibc-2.2.4-new/linuxthreads/sysdeps/unix/sysv/linux/bits/local_lim.h Tue Apr 16 15:10:38 2002
+#ifdef DO_STATIC_NSS ***************
+ if (strncmp(name,"files",5) == 0 || *** 64,70 ****
+ strncmp(name,"dns",3) == 0) /* The number of threads per process. */
+#endif #define _POSIX_THREAD_THREADS_MAX 64
*((char *) __mempcpy (new_service->name, name, line - name)) = '\0'; /* This is the value this implementation supports. */
+#ifdef DO_STATIC_NSS ! #define PTHREAD_THREADS_MAX 1024
+ else
+ *((char *) __mempcpy (new_service->name, "files", 5)) = '\0'; /* Maximum amount by which a process can descrease its asynchronous I/O
+#endif priority level. */
+ --- 64,70 ----
/* The number of threads per process. */
/* Set default actions. */ #define _POSIX_THREAD_THREADS_MAX 64
new_service->actions[2 + NSS_STATUS_TRYAGAIN] = NSS_ACTION_CONTINUE; /* This is the value this implementation supports. */
diff -Nur --exclude=SCCS --exclude=BitKeeper --exclude=ChangeSet ../glibc-2.2.5/time/Makefile ./time/Makefile ! #define PTHREAD_THREADS_MAX 4096
--- ../glibc-2.2.5/time/Makefile Fri Feb 22 21:27:19 2002
+++ ./time/Makefile Fri Feb 22 21:26:47 2002 /* Maximum amount by which a process can descrease its asynchronous I/O
@@ -37,8 +37,8 @@ priority level. */
Only in glibc-2.2.4-new/linuxthreads/sysdeps/unix/sysv/linux/bits: local_lim.h.rej
include ../Rules Only in glibc-2.2.4-new/manual: chapters.texi
Only in glibc-2.2.4/manual: dir-add.info
-tz-cflags = -DTZDIR='"$(zonedir)"' \ Only in glibc-2.2.4/manual: libc.info
- -DTZDEFAULT='"$(localtime-file)"' \ Only in glibc-2.2.4/manual: libc.info-1
+tz-cflags = -DTZDIR='"/usr/share/zoneinfo/"' \ Only in glibc-2.2.4/manual: libc.info-10
+ -DTZDEFAULT='"/etc/localtime"' \ Only in glibc-2.2.4/manual: libc.info-11
-DTZDEFRULES='"$(posixrules-file)"' Only in glibc-2.2.4/manual: libc.info-12
Only in glibc-2.2.4/manual: libc.info-13
CFLAGS-tzfile.c = $(tz-cflags) Only in glibc-2.2.4/manual: libc.info-14
diff -Nur --exclude=SCCS --exclude=BitKeeper --exclude=ChangeSet ../glibc-2.2.5/timezone/Makefile ./timezone/Makefile Only in glibc-2.2.4/manual: libc.info-15
--- ../glibc-2.2.5/timezone/Makefile Wed Aug 29 16:45:25 2001 Only in glibc-2.2.4/manual: libc.info-16
+++ ./timezone/Makefile Fri Feb 22 21:18:09 2002 Only in glibc-2.2.4/manual: libc.info-17
@@ -159,8 +159,8 @@ Only in glibc-2.2.4/manual: libc.info-18
Only in glibc-2.2.4/manual: libc.info-19
$(objpfx)zic: $(objpfx)scheck.o $(objpfx)ialloc.o Only in glibc-2.2.4/manual: libc.info-2
Only in glibc-2.2.4/manual: libc.info-20
-tz-cflags = -DTZDIR='"$(zonedir)"' \ Only in glibc-2.2.4/manual: libc.info-21
- -DTZDEFAULT='"$(localtime-file)"' \ Only in glibc-2.2.4/manual: libc.info-22
+tz-cflags = -DTZDIR='"/usr/share/zoneinfo/"' \ Only in glibc-2.2.4/manual: libc.info-23
+ -DTZDEFAULT='"/etc/localtime"' \ Only in glibc-2.2.4/manual: libc.info-24
-DTZDEFRULES='"$(posixrules-file)"' \ Only in glibc-2.2.4/manual: libc.info-25
-DTM_GMTOFF=tm_gmtoff -DTM_ZONE=tm_zone Only in glibc-2.2.4/manual: libc.info-26
Only in glibc-2.2.4/manual: libc.info-27
Only in glibc-2.2.4/manual: libc.info-28
Only in glibc-2.2.4/manual: libc.info-29
Only in glibc-2.2.4/manual: libc.info-3
Only in glibc-2.2.4/manual: libc.info-30
Only in glibc-2.2.4/manual: libc.info-31
Only in glibc-2.2.4/manual: libc.info-32
Only in glibc-2.2.4/manual: libc.info-33
Only in glibc-2.2.4/manual: libc.info-34
Only in glibc-2.2.4/manual: libc.info-35
Only in glibc-2.2.4/manual: libc.info-36
Only in glibc-2.2.4/manual: libc.info-37
Only in glibc-2.2.4/manual: libc.info-38
Only in glibc-2.2.4/manual: libc.info-39
Only in glibc-2.2.4/manual: libc.info-4
Only in glibc-2.2.4/manual: libc.info-40
Only in glibc-2.2.4/manual: libc.info-41
Only in glibc-2.2.4/manual: libc.info-42
Only in glibc-2.2.4/manual: libc.info-43
Only in glibc-2.2.4/manual: libc.info-44
Only in glibc-2.2.4/manual: libc.info-45
Only in glibc-2.2.4/manual: libc.info-46
Only in glibc-2.2.4/manual: libc.info-47
Only in glibc-2.2.4/manual: libc.info-48
Only in glibc-2.2.4/manual: libc.info-49
Only in glibc-2.2.4/manual: libc.info-5
Only in glibc-2.2.4/manual: libc.info-50
Only in glibc-2.2.4/manual: libc.info-51
Only in glibc-2.2.4/manual: libc.info-52
Only in glibc-2.2.4/manual: libc.info-53
Only in glibc-2.2.4/manual: libc.info-54
Only in glibc-2.2.4/manual: libc.info-55
Only in glibc-2.2.4/manual: libc.info-56
Only in glibc-2.2.4/manual: libc.info-57
Only in glibc-2.2.4/manual: libc.info-58
Only in glibc-2.2.4/manual: libc.info-59
Only in glibc-2.2.4/manual: libc.info-6
Only in glibc-2.2.4/manual: libc.info-60
Only in glibc-2.2.4/manual: libc.info-7
Only in glibc-2.2.4/manual: libc.info-8
Only in glibc-2.2.4/manual: libc.info-9
Only in glibc-2.2.4-new/manual: stamp-summary
Only in glibc-2.2.4-new/manual: summary.texi
Only in glibc-2.2.4-new/manual: texis
Only in glibc-2.2.4-new/manual: top-menu.texi
Only in glibc-2.2.4-new/nss: nsswitch-org.c
diff -r -c glibc-2.2.4/nss/nsswitch.c glibc-2.2.4-new/nss/nsswitch.c
*** glibc-2.2.4/nss/nsswitch.c Mon Jul 23 20:54:48 2001
--- glibc-2.2.4-new/nss/nsswitch.c Tue Apr 16 15:43:32 2002
***************
*** 510,515 ****
--- 510,523 ----
if (name == line)
return result;
+ #ifdef DO_STATIC_NSS
+ if (!(((line-name) == 5 && strncmp(name,"files",5) == 0) ||
+ ((line-name) == 3 && strncmp(name,"dns",3) == 0)))
+ {
+ name = (char*) "files";
+ line = (char*) name+5;
+ }
+ #endif
new_service = (service_user *) malloc (sizeof (service_user)
+ (line - name + 1));
Only in glibc-2.2.4-new: skr
diff -r -c glibc-2.2.4/time/Makefile glibc-2.2.4-new/time/Makefile
*** glibc-2.2.4/time/Makefile Fri Aug 10 22:12:07 2001
--- glibc-2.2.4-new/time/Makefile Tue Apr 16 15:11:09 2002
***************
*** 37,44 ****
include ../Rules
! tz-cflags = -DTZDIR='"$(zonedir)"' \
! -DTZDEFAULT='"$(localtime-file)"' \
-DTZDEFRULES='"$(posixrules-file)"'
CFLAGS-tzfile.c = $(tz-cflags)
--- 37,44 ----
include ../Rules
! tz-cflags = -DTZDIR='"/usr/share/zoneinfo/"' \
! -DTZDEFAULT='"/etc/localtime"' \
-DTZDEFRULES='"$(posixrules-file)"'
CFLAGS-tzfile.c = $(tz-cflags)
diff -r -c glibc-2.2.4/timezone/Makefile glibc-2.2.4-new/timezone/Makefile
*** glibc-2.2.4/timezone/Makefile Mon Jul 23 20:58:05 2001
--- glibc-2.2.4-new/timezone/Makefile Tue Apr 16 15:11:09 2002
***************
*** 159,166 ****
$(objpfx)zic: $(objpfx)scheck.o $(objpfx)ialloc.o
! tz-cflags = -DTZDIR='"$(zonedir)"' \
! -DTZDEFAULT='"$(localtime-file)"' \
-DTZDEFRULES='"$(posixrules-file)"' \
-DTM_GMTOFF=tm_gmtoff -DTM_ZONE=tm_zone
--- 159,166 ----
$(objpfx)zic: $(objpfx)scheck.o $(objpfx)ialloc.o
! tz-cflags = -DTZDIR='"/usr/share/zoneinfo/"' \
! -DTZDEFAULT='"/etc/localtime"' \
-DTZDEFRULES='"$(posixrules-file)"' \
-DTM_GMTOFF=tm_gmtoff -DTM_ZONE=tm_zone

View file

@ -30373,6 +30373,9 @@ stored into a temporary table) is calculated in MySQL Version
@item expr2 or expr3 returns an integer @tab integer @item expr2 or expr3 returns an integer @tab integer
@end multitable @end multitable
If expr2 and expr3 are strings, then the result is case sensitive if
both strings are case sensitive. (Starting from 3.23.51)
@findex CASE @findex CASE
@item CASE value WHEN [compare-value] THEN result [WHEN [compare-value] THEN result ...] [ELSE result] END @item CASE value WHEN [compare-value] THEN result [WHEN [compare-value] THEN result ...] [ELSE result] END
@item CASE WHEN [condition] THEN result [WHEN [condition] THEN result ...] [ELSE result] END @item CASE WHEN [condition] THEN result [WHEN [condition] THEN result ...] [ELSE result] END
@ -35268,6 +35271,9 @@ Note that if you use any other option to @code{ALTER TABLE} than
if the data wouldn't strictly need to be copied (like when you change the if the data wouldn't strictly need to be copied (like when you change the
name of a column). We plan to fix this in the future, but as one doesn't name of a column). We plan to fix this in the future, but as one doesn't
normally do @code{ALTER TABLE} that often this isn't that high on our TODO. normally do @code{ALTER TABLE} that often this isn't that high on our TODO.
For MyISAM tables, you can speed up the index recreation part (which is the
slowest part of the recreation process) by setting the
@code{myisam_sort_buffer_size} variable to a high value.
@itemize @bullet @itemize @bullet
@item @item
@ -45806,9 +45812,6 @@ Another common reason to receive the @code{MySQL server has gone away} error
is because you have issued a ``close'' on your MySQL connection is because you have issued a ``close'' on your MySQL connection
and then tried to run a query on the closed connection. and then tried to run a query on the closed connection.
You can check that the MySQL hasn't died by executing
@code{mysqladmin version} and examining the uptime.
If you have a script, you just have to issue the query again for the client If you have a script, you just have to issue the query again for the client
to do an automatic reconnection. to do an automatic reconnection.
@ -45823,6 +45826,15 @@ server.
to the server, but it didn't get a full answer (or any answer) to the question. to the server, but it didn't get a full answer (or any answer) to the question.
@end multitable @end multitable
You will also get this error if someone has kills the running thread with
@code{kill #threadid#}.
You can check that the MySQL hasn't died by executing @code{mysqladmin
version} and examining the uptime. If the problem is that mysqld
crashed you should concentrate one finding the reason for the crash.
You should in this case start by checking if issuing the query again
will kill MySQL again. @xref{Crashing}.
You can also get these errors if you send a query to the server that is You can also get these errors if you send a query to the server that is
incorrect or too large. If @code{mysqld} gets a packet that is too large incorrect or too large. If @code{mysqld} gets a packet that is too large
or out of order, it assumes that something has gone wrong with the client and or out of order, it assumes that something has gone wrong with the client and
@ -45833,6 +45845,26 @@ starting @code{mysqld} with the @code{-O max_allowed_packet=#} option
use more memory only when you issue a big query or when @code{mysqld} must use more memory only when you issue a big query or when @code{mysqld} must
return a big result row! return a big result row!
If you want to make a bug report regarding this problem, be sure that
you include the following information:
@itemize @bullet
@item
Include information if MySQL died or not. (You can find this in the
@code{hostname.err file}. @xref{Crashing}.
@item
If a specific query kills @code{mysqld} and the involved tables where
checked with @code{CHECK TABLE} before you did the query, can you do
a test case for this? @xref{Reproduceable test case}.
@item
What is the value of the @code{wait_timeout} variable in the MySQL server ?
@code{mysqladmin variables} gives you the value of this
@item
Have you tried to run @code{mysqld} with @code{--log} and check if the
issued query appears in the log ?
@end itemize
@xref{Asking questions}.
@node Can not connect to server, Blocked host, Gone away, Common errors @node Can not connect to server, Blocked host, Gone away, Common errors
@appendixsubsec @code{Can't connect to [local] MySQL server} Error @appendixsubsec @code{Can't connect to [local] MySQL server} Error
@ -49371,19 +49403,32 @@ not yet 100% confident in this code.
@node News-3.23.51, News-3.23.50, News-3.23.x, News-3.23.x @node News-3.23.51, News-3.23.50, News-3.23.x, News-3.23.x
@appendixsubsec Changes in release 3.23.51 @appendixsubsec Changes in release 3.23.51
@itemize @bullet @itemize @bullet
@item Fixed the result from @code{IF()} is case in-sensitive if the 2 and
Fixed @code{SIGINT} and @code{SIGQUIT} problems in @code{mysql}. third arguments are case sensitive.
@item
Fixed bug in character table converts when used with big ( > 64K) strings.
@end itemize @end itemize
@node News-3.23.50, News-3.23.49, News-3.23.51, News-3.23.x @node News-3.23.50, News-3.23.49, News-3.23.51, News-3.23.x
@appendixsubsec Changes in release 3.23.50 @appendixsubsec Changes in release 3.23.50
@itemize @bullet @itemize @bullet
@item @item
Fixed problem with @code{crash-me} and gcc 3.0.4.
@item
Fixed that @code{@@@@unknown_variable} doesn't hang server.
@item
Added @code{@@@@VERSION} as a synonym for @code{VERSION()}.
@item
@code{SHOW VARIABLES LIKE 'xxx'} is now case insensitive.
@item
Fixed timeout for @code{GET_LOCK()} on HPUX with DCE threads.
@item
Fixed memory allocation bug in the glibc library used to build Linux
binaries, which caused mysqld to die in 'free()'.
@item
Fixed @code{SIGINT} and @code{SIGQUIT} problems in @code{mysql}.
@item
Fixed bug in character table converts when used with big ( > 64K) strings.
@item
@code{InnoDB} now retains foreign key constraints through @code{ALTER TABLE} @code{InnoDB} now retains foreign key constraints through @code{ALTER TABLE}
and @code{CREATE/DROP INDEX}. and @code{CREATE/DROP INDEX}.
@item @item

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2000 MySQL AB /* Copyright (C) 2000-2002 MySQL 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
@ -354,18 +354,6 @@ int main(int argc,char *argv[])
mysql_thread_id(&mysql),mysql_get_server_info(&mysql)); mysql_thread_id(&mysql),mysql_get_server_info(&mysql));
put_info((char*) glob_buffer.ptr(),INFO_INFO); put_info((char*) glob_buffer.ptr(),INFO_INFO);
#ifdef HAVE_OPENSSL
if (mysql.net.vio->ssl_ && SSL_get_cipher(mysql.net.vio->ssl_))
{
sprintf((char*) glob_buffer.ptr(),
"SSL cipher in use is %s\n", SSL_get_cipher(mysql.net.vio->ssl_));
put_info((char*) glob_buffer.ptr(),INFO_INFO);
}
else
put_info("SSL is not in use\n",INFO_INFO);
#endif /* HAVE_OPENSSL */
#ifdef HAVE_READLINE #ifdef HAVE_READLINE
initialize_readline(my_progname); initialize_readline(my_progname);
if (!status.batch && !quick && !opt_html && !opt_xml) if (!status.batch && !quick && !opt_html && !opt_xml)
@ -697,7 +685,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break; break;
case 'p': case 'p':
if (argument == disabled_my_option) if (argument == disabled_my_option)
opt_password= ""; opt_password= (char*) "";
else else
{ {
if (argument) if (argument)
@ -2329,6 +2317,13 @@ com_status(String *buffer __attribute__((unused)),
tee_fprintf(stdout, "Current user:\t\t%s\n",cur[1]); tee_fprintf(stdout, "Current user:\t\t%s\n",cur[1]);
(void) mysql_fetch_row(result); // Read eof (void) mysql_fetch_row(result); // Read eof
} }
#ifdef HAVE_OPENSSL
if (mysql.net.vio->ssl_ && SSL_get_cipher(mysql.net.vio->ssl_))
tee_fprintf(stdout, "SSL cipher in use is %s\n",
SSL_get_cipher(mysql.net.vio->ssl_));
else
#endif /* HAVE_OPENSSL */
tee_puts("SSL is not in use\n", stdout);
} }
else else
{ {

View file

@ -882,9 +882,9 @@ case $SYSTEM_TYPE in
CFLAGS="$CFLAGS -DHAVE_BROKEN_GETPASS -DSOLARIS"; CFLAGS="$CFLAGS -DHAVE_BROKEN_GETPASS -DSOLARIS";
;; ;;
*hpux10.20*) *hpux10.20*)
echo "Enabling snprintf workaround for hpux 10.20" echo "Enabling workarounds for hpux 10.20"
CFLAGS="$CFLAGS -DHAVE_BROKEN_SNPRINTF -DSIGNALS_DONT_BREAK_READ -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHPUX -DSIGNAL_WITH_VIO_CLOSE" CFLAGS="$CFLAGS -DHAVE_BROKEN_SNPRINTF -DSIGNALS_DONT_BREAK_READ -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHPUX -DSIGNAL_WITH_VIO_CLOSE -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT"
CXXFLAGS="$CXXFLAGS -DHAVE_BROKEN_SNPRINTF -D_INCLUDE_LONGLONG -DSIGNALS_DONT_BREAK_READ -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHPUX -DSIGNAL_WITH_VIO_CLOSE" CXXFLAGS="$CXXFLAGS -DHAVE_BROKEN_SNPRINTF -D_INCLUDE_LONGLONG -DSIGNALS_DONT_BREAK_READ -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHPUX -DSIGNAL_WITH_VIO_CLOSE -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT"
if test "$with_named_thread" = "no" if test "$with_named_thread" = "no"
then then
echo "Using --with-named-thread=-lpthread" echo "Using --with-named-thread=-lpthread"
@ -892,9 +892,9 @@ case $SYSTEM_TYPE in
fi fi
;; ;;
*hpux11.*) *hpux11.*)
echo "Enabling pread/pwrite workaround for hpux 11" echo "Enabling workarounds for hpux 11"
CFLAGS="$CFLAGS -DHAVE_BROKEN_PREAD -DDONT_USE_FINITE -DHAVE_BROKEN_GETPASS -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS" CFLAGS="$CFLAGS -DHAVE_BROKEN_PREAD -DDONT_USE_FINITE -DHAVE_BROKEN_GETPASS -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT"
CXXFLAGS="$CXXFLAGS -DHAVE_BROKEN_PREAD -DDONT_USE_FINITE -D_INCLUDE_LONGLONG -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS" CXXFLAGS="$CXXFLAGS -DHAVE_BROKEN_PREAD -DDONT_USE_FINITE -D_INCLUDE_LONGLONG -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT"
if test "$with_named_thread" = "no" if test "$with_named_thread" = "no"
then then
echo "Using --with-named-thread=-lpthread" echo "Using --with-named-thread=-lpthread"

View file

@ -20,8 +20,9 @@ LDADD = libdbug.a ../strings/libmystrings.a
pkglib_LIBRARIES = libdbug.a pkglib_LIBRARIES = libdbug.a
noinst_HEADERS = dbug_long.h noinst_HEADERS = dbug_long.h
libdbug_a_SOURCES = dbug.c sanity.c libdbug_a_SOURCES = dbug.c sanity.c
EXTRA_DIST = example1.c example2.c example3.c user.r monty.doc readme.prof \ EXTRA_DIST = example1.c example2.c example3.c \
main.c factorial.c user.r monty.doc readme.prof \
main.c factorial.c dbug_analyze.c
OMIT_DEPENDENCIES = pthread.h stdio.h __stdio.h stdlib.h __stdlib.h math.h\ OMIT_DEPENDENCIES = pthread.h stdio.h __stdio.h stdlib.h __stdlib.h math.h\
__math.h time.h __time.h unistd.h __unistd.h types.h \ __math.h time.h __time.h unistd.h __unistd.h types.h \
@ -32,7 +33,7 @@ OMIT_DEPENDENCIES = pthread.h stdio.h __stdio.h stdlib.h __stdlib.h math.h\
sleep.h specific.h version.h pwd.h timers.h uio.h \ sleep.h specific.h version.h pwd.h timers.h uio.h \
cdefs.h machdep.h signal.h __signal.h util.h cdefs.h machdep.h signal.h __signal.h util.h
# Must be linked with libs thta are not compiled yet # Must be linked with libs that are not compiled yet
extra_progs: factorial dbug_analyze extra_progs: factorial dbug_analyze
factorial: main.o factorial.o factorial: main.o factorial.o

View file

@ -10,3 +10,11 @@ giving a double ':'. (As in "O,c::\tmp\log")
DBUG_DUMP("keyword",memory-position,length) writes a hexdump of the DBUG_DUMP("keyword",memory-position,length) writes a hexdump of the
given memory-area to the outputfile. given memory-area to the outputfile.
All changes that I or other people at MySQL AB have done to all files
in the dbug library (Mainly in dbug.c, dbug_analyze.c, dbug_long.h,
dbug.h) are put in public domain, as the rest of the dbug.c library)
To my knowledge, all code in dbug library are in public domain.
Michael Widenius

View file

@ -349,6 +349,13 @@ extern void my_pthread_attr_setprio(pthread_attr_t *attr, int priority);
#undef HAVE_GETHOSTBYADDR_R /* No definition */ #undef HAVE_GETHOSTBYADDR_R /* No definition */
#endif #endif
#if defined(HAVE_BROKEN_PTHREAD_COND_TIMEDWAIT)
extern int my_pthread_cond_timedwait(pthread_cond_t *cond,
pthread_mutex_t *mutex,
struct timespec *abstime);
#define pthread_cond_timedwait(A,B,C) my_pthread_cond_timedwait((A),(B),(C))
#endif
#if defined(OS2) #if defined(OS2)
#define my_pthread_getspecific(T,A) ((T) &(A)) #define my_pthread_getspecific(T,A) ((T) &(A))
#define pthread_setspecific(A,B) win_pthread_setspecific(&(A),(B),sizeof(A)) #define pthread_setspecific(A,B) win_pthread_setspecific(&(A),(B),sizeof(A))

View file

@ -228,6 +228,7 @@ btr_cur_search_to_nth_level(
ulint insert_planned; ulint insert_planned;
ulint buf_mode; ulint buf_mode;
ulint estimate; ulint estimate;
ulint ignore_sec_unique;
ulint root_height = 0; /* remove warning */ ulint root_height = 0; /* remove warning */
#ifdef BTR_CUR_ADAPT #ifdef BTR_CUR_ADAPT
btr_search_t* info; btr_search_t* info;
@ -246,7 +247,9 @@ btr_cur_search_to_nth_level(
#endif #endif
insert_planned = latch_mode & BTR_INSERT; insert_planned = latch_mode & BTR_INSERT;
estimate = latch_mode & BTR_ESTIMATE; estimate = latch_mode & BTR_ESTIMATE;
latch_mode = latch_mode & ~(BTR_INSERT | BTR_ESTIMATE); ignore_sec_unique = latch_mode & BTR_IGNORE_SEC_UNIQUE;
latch_mode = latch_mode & ~(BTR_INSERT | BTR_ESTIMATE
| BTR_IGNORE_SEC_UNIQUE);
ut_ad(!insert_planned || (mode == PAGE_CUR_LE)); ut_ad(!insert_planned || (mode == PAGE_CUR_LE));
@ -343,7 +346,8 @@ btr_cur_search_to_nth_level(
rw_latch = latch_mode; rw_latch = latch_mode;
if (insert_planned && ibuf_should_try(index)) { if (insert_planned && ibuf_should_try(index,
ignore_sec_unique)) {
/* Try insert to the insert buffer if the /* Try insert to the insert buffer if the
page is not in the buffer pool */ page is not in the buffer pool */
@ -356,7 +360,6 @@ retry_page_get:
buf_mode, buf_mode,
IB__FILE__, __LINE__, IB__FILE__, __LINE__,
mtr); mtr);
if (page == NULL) { if (page == NULL) {
/* This must be a search to perform an insert; /* This must be a search to perform an insert;
try insert to the insert buffer */ try insert to the insert buffer */
@ -365,7 +368,7 @@ retry_page_get:
ut_ad(insert_planned); ut_ad(insert_planned);
ut_ad(cursor->thr); ut_ad(cursor->thr);
if (ibuf_should_try(index) && if (ibuf_should_try(index, ignore_sec_unique) &&
ibuf_insert(tuple, index, space, page_no, ibuf_insert(tuple, index, space, page_no,
cursor->thr)) { cursor->thr)) {
/* Insertion to the insert buffer succeeded */ /* Insertion to the insert buffer succeeded */

View file

@ -1201,7 +1201,8 @@ loop:
ut_dulint_get_low(id), ut_dulint_get_low(id),
table->name, table->name,
foreign->referenced_table_name, foreign->referenced_table_name,
foreign->n_fields); foreign->n_fields
+ (foreign->type << 24));
for (i = 0; i < foreign->n_fields; i++) { for (i = 0; i < foreign->n_fields; i++) {

View file

@ -1652,7 +1652,7 @@ dict_foreign_find_index(
->col->name; ->col->name;
if (ut_strlen(columns[i]) != if (ut_strlen(columns[i]) !=
ut_strlen(col_name) ut_strlen(col_name)
|| 0 != ut_memcmp(columns[i], || 0 != ut_cmp_in_lower_case(columns[i],
col_name, col_name,
ut_strlen(col_name))) { ut_strlen(col_name))) {
break; break;
@ -1857,8 +1857,9 @@ dict_scan_col(
ibool* success,/* out: TRUE if success */ ibool* success,/* out: TRUE if success */
dict_table_t* table, /* in: table in which the column is */ dict_table_t* table, /* in: table in which the column is */
dict_col_t** column, /* out: pointer to column if success */ dict_col_t** column, /* out: pointer to column if success */
char** column_name)/* out: pointer to column->name if char** column_name,/* out: pointer to column->name if
success */ success */
ulint* column_name_len)/* out: column name length */
{ {
dict_col_t* col; dict_col_t* col;
char* old_ptr; char* old_ptr;
@ -1886,20 +1887,28 @@ dict_scan_col(
ptr++; ptr++;
} }
for (i = 0; i < dict_table_get_n_cols(table); i++) { *column_name_len = (ulint)(ptr - old_ptr);
if (table == NULL) {
*success = TRUE;
*column = NULL;
*column_name = old_ptr;
} else {
for (i = 0; i < dict_table_get_n_cols(table); i++) {
col = dict_table_get_nth_col(table, i); col = dict_table_get_nth_col(table, i);
if (ut_strlen(col->name) == (ulint)(ptr - old_ptr) if (ut_strlen(col->name) == (ulint)(ptr - old_ptr)
&& 0 == ut_cmp_in_lower_case(col->name, old_ptr, && 0 == ut_cmp_in_lower_case(col->name, old_ptr,
(ulint)(ptr - old_ptr))) { (ulint)(ptr - old_ptr))) {
/* Found */ /* Found */
*success = TRUE; *success = TRUE;
*column = col; *column = col;
*column_name = col->name; *column_name = col->name;
break; break;
}
} }
} }
@ -1918,14 +1927,18 @@ dict_scan_table_name(
/*=================*/ /*=================*/
/* out: scanned to */ /* out: scanned to */
char* ptr, /* in: scanned to */ char* ptr, /* in: scanned to */
dict_table_t** table, /* out: table object or NULL if error */ dict_table_t** table, /* out: table object or NULL */
char* name) /* in: foreign key table name */ char* name, /* in: foreign key table name */
ibool* success,/* out: TRUE if ok name found */
char* second_table_name)/* in/out: buffer where to store
the referenced table name; must be at least
2500 bytes */
{ {
char* dot_ptr = NULL; char* dot_ptr = NULL;
char* old_ptr; char* old_ptr;
ulint i; ulint i;
char second_table_name[10000];
*success = FALSE;
*table = NULL; *table = NULL;
while (isspace(*ptr)) { while (isspace(*ptr)) {
@ -1951,7 +1964,7 @@ dict_scan_table_name(
ptr++; ptr++;
} }
if (ptr - old_ptr > 9000) { if (ptr - old_ptr > 2000) {
return(old_ptr); return(old_ptr);
} }
@ -1982,6 +1995,8 @@ dict_scan_table_name(
second_table_name[ptr - old_ptr] = '\0'; second_table_name[ptr - old_ptr] = '\0';
} }
*success = TRUE;
*table = dict_table_get_low(second_table_name); *table = dict_table_get_low(second_table_name);
if (*ptr == '`') { if (*ptr == '`') {
@ -2047,9 +2062,12 @@ dict_create_foreign_constraints(
ibool success; ibool success;
ulint error; ulint error;
ulint i; ulint i;
dict_col_t* columns[1000]; ulint j;
char* column_names[1000]; dict_col_t* columns[500];
char* column_names[500];
ulint column_name_lens[500];
char referenced_table_name[2500];
ut_ad(mutex_own(&(dict_sys->mutex))); ut_ad(mutex_own(&(dict_sys->mutex)));
table = dict_table_get_low(name); table = dict_table_get_low(name);
@ -2094,7 +2112,7 @@ loop:
/* Scan the columns in the first list */ /* Scan the columns in the first list */
col_loop1: col_loop1:
ptr = dict_scan_col(ptr, &success, table, columns + i, ptr = dict_scan_col(ptr, &success, table, columns + i,
column_names + i); column_names + i, column_name_lens + i);
if (!success) { if (!success) {
return(DB_CANNOT_ADD_CONSTRAINT); return(DB_CANNOT_ADD_CONSTRAINT);
} }
@ -2145,9 +2163,13 @@ col_loop1:
1 + ut_strlen(columns[i]->name)); 1 + ut_strlen(columns[i]->name));
} }
ptr = dict_scan_table_name(ptr, &referenced_table, name); ptr = dict_scan_table_name(ptr, &referenced_table, name,
&success, referenced_table_name);
if (!referenced_table) { /* Note that referenced_table can be NULL if the user has suppressed
checking of foreign key constraints! */
if (!success || (!referenced_table && trx->check_foreigns)) {
dict_foreign_free(foreign); dict_foreign_free(foreign);
return(DB_CANNOT_ADD_CONSTRAINT); return(DB_CANNOT_ADD_CONSTRAINT);
@ -2165,7 +2187,7 @@ col_loop1:
col_loop2: col_loop2:
ptr = dict_scan_col(ptr, &success, referenced_table, columns + i, ptr = dict_scan_col(ptr, &success, referenced_table, columns + i,
column_names + i); column_names + i, column_name_lens + i);
i++; i++;
if (!success) { if (!success) {
@ -2187,43 +2209,104 @@ col_loop2:
return(DB_CANNOT_ADD_CONSTRAINT); return(DB_CANNOT_ADD_CONSTRAINT);
} }
ptr = dict_accept(ptr, "ON", &success);
if (!success) {
goto try_find_index;
}
ptr = dict_accept(ptr, "DELETE", &success);
if (!success) {
goto try_find_index;
}
ptr = dict_accept(ptr, "CASCADE", &success);
if (success) {
foreign->type = DICT_FOREIGN_ON_DELETE_CASCADE;
goto try_find_index;
}
ptr = dict_accept(ptr, "SET", &success);
if (!success) {
goto try_find_index;
}
ptr = dict_accept(ptr, "NULL", &success);
if (success) {
for (j = 0; j < foreign->n_fields; j++) {
if ((dict_index_get_nth_type(
foreign->foreign_index, j)->prtype)
& DATA_NOT_NULL) {
/* It is not sensible to define SET NULL
if the column is not allowed to be NULL! */
dict_foreign_free(foreign);
return(DB_CANNOT_ADD_CONSTRAINT);
}
}
foreign->type = DICT_FOREIGN_ON_DELETE_SET_NULL;
goto try_find_index;
}
try_find_index:
/* Try to find an index which contains the columns as the first fields /* Try to find an index which contains the columns as the first fields
and in the right order, and the types are the same as in and in the right order, and the types are the same as in
foreign->foreign_index */ foreign->foreign_index */
index = dict_foreign_find_index(referenced_table, column_names, i, if (referenced_table) {
index = dict_foreign_find_index(referenced_table,
column_names, i,
foreign->foreign_index); foreign->foreign_index);
if (!index) {
if (!index) { dict_foreign_free(foreign);
dict_foreign_free(foreign); return(DB_CANNOT_ADD_CONSTRAINT);
return(DB_CANNOT_ADD_CONSTRAINT); }
} else {
ut_a(trx->check_foreigns == FALSE);
index = NULL;
} }
foreign->referenced_index = index; foreign->referenced_index = index;
foreign->referenced_table = referenced_table; foreign->referenced_table = referenced_table;
foreign->referenced_table_name = mem_heap_alloc(foreign->heap, foreign->referenced_table_name = mem_heap_alloc(foreign->heap,
1 + ut_strlen(referenced_table->name)); 1 + ut_strlen(referenced_table_name));
ut_memcpy(foreign->referenced_table_name, referenced_table->name, ut_memcpy(foreign->referenced_table_name, referenced_table_name,
1 + ut_strlen(referenced_table->name)); 1 + ut_strlen(referenced_table_name));
foreign->referenced_col_names = mem_heap_alloc(foreign->heap, foreign->referenced_col_names = mem_heap_alloc(foreign->heap,
i * sizeof(void*)); i * sizeof(void*));
for (i = 0; i < foreign->n_fields; i++) { for (i = 0; i < foreign->n_fields; i++) {
foreign->referenced_col_names[i] foreign->referenced_col_names[i]
= mem_heap_alloc(foreign->heap, = mem_heap_alloc(foreign->heap,
1 + ut_strlen(columns[i]->name)); 1 + column_name_lens[i]);
ut_memcpy( ut_memcpy(foreign->referenced_col_names[i], column_names[i],
foreign->referenced_col_names[i], columns[i]->name, column_name_lens[i]);
1 + ut_strlen(columns[i]->name)); (foreign->referenced_col_names[i])[column_name_lens[i]] = '\0';
} }
/* We found an ok constraint definition: add to the lists */ /* We found an ok constraint definition: add to the lists */
UT_LIST_ADD_LAST(foreign_list, table->foreign_list, foreign); UT_LIST_ADD_LAST(foreign_list, table->foreign_list, foreign);
UT_LIST_ADD_LAST(referenced_list, referenced_table->referenced_list,
if (referenced_table) {
UT_LIST_ADD_LAST(referenced_list,
referenced_table->referenced_list,
foreign); foreign);
}
goto loop; goto loop;
} }
@ -3039,6 +3122,14 @@ dict_print_info_on_foreign_keys_in_create_format(
buf2 += sprintf(buf2, ")"); buf2 += sprintf(buf2, ")");
if (foreign->type == DICT_FOREIGN_ON_DELETE_CASCADE) {
buf2 += sprintf(buf2, " ON DELETE CASCADE");
}
if (foreign->type == DICT_FOREIGN_ON_DELETE_SET_NULL) {
buf2 += sprintf(buf2, " ON DELETE SET NULL");
}
foreign = UT_LIST_GET_NEXT(foreign_list, foreign); foreign = UT_LIST_GET_NEXT(foreign_list, foreign);
} }

View file

@ -946,6 +946,11 @@ dict_load_foreign(
foreign->n_fields = mach_read_from_4(rec_get_nth_field(rec, 5, &len)); foreign->n_fields = mach_read_from_4(rec_get_nth_field(rec, 5, &len));
ut_a(len == 4); ut_a(len == 4);
/* We store the type to the bits 24-31 of n_fields */
foreign->type = foreign->n_fields >> 24;
foreign->n_fields = foreign->n_fields & 0xFFFFFF;
foreign->id = mem_heap_alloc(foreign->heap, ut_strlen(id) + 1); foreign->id = mem_heap_alloc(foreign->heap, ut_strlen(id) + 1);

View file

@ -61,7 +61,8 @@ dict_mem_table_create(
table->mem_fix = 0; table->mem_fix = 0;
table->n_mysql_handles_opened = 0; table->n_mysql_handles_opened = 0;
table->n_foreign_key_checks_running = 0;
table->cached = FALSE; table->cached = FALSE;
table->cols = mem_heap_alloc(heap, (n_cols + DATA_N_SYS_COLS) table->cols = mem_heap_alloc(heap, (n_cols + DATA_N_SYS_COLS)
@ -235,6 +236,7 @@ dict_mem_foreign_create(void)
foreign->id = NULL; foreign->id = NULL;
foreign->type = 0;
foreign->foreign_table_name = NULL; foreign->foreign_table_name = NULL;
foreign->foreign_table = NULL; foreign->foreign_table = NULL;
foreign->foreign_col_names = NULL; foreign->foreign_col_names = NULL;

View file

@ -49,6 +49,12 @@ inserted to the index, at the searched position */
/* This flag ORed to latch mode says that we do the search in query /* This flag ORed to latch mode says that we do the search in query
optimization */ optimization */
#define BTR_ESTIMATE 1024 #define BTR_ESTIMATE 1024
/* This flag ORed to latch mode says that we can ignore possible
UNIQUE definition on secondary indexes when we decide if we can use the
insert buffer to speed up inserts */
#define BTR_IGNORE_SEC_UNIQUE 2048
/****************************************************************** /******************************************************************
Gets a buffer page and declares its latching order level. */ Gets a buffer page and declares its latching order level. */
UNIV_INLINE UNIV_INLINE

View file

@ -249,6 +249,8 @@ struct dict_foreign_struct{
this memory heap */ this memory heap */
char* id; /* id of the constraint as a char* id; /* id of the constraint as a
null-terminated string */ null-terminated string */
ulint type; /* 0 or DICT_FOREIGN_ON_DELETE_CASCADE
or DICT_FOREIGN_ON_DELETE_SET_NULL */
char* foreign_table_name;/* foreign table name */ char* foreign_table_name;/* foreign table name */
dict_table_t* foreign_table; /* table where the foreign key is */ dict_table_t* foreign_table; /* table where the foreign key is */
char** foreign_col_names;/* names of the columns in the char** foreign_col_names;/* names of the columns in the
@ -278,6 +280,9 @@ struct dict_foreign_struct{
table */ table */
}; };
#define DICT_FOREIGN_ON_DELETE_CASCADE 1
#define DICT_FOREIGN_ON_DELETE_SET_NULL 2
#define DICT_INDEX_MAGIC_N 76789786 #define DICT_INDEX_MAGIC_N 76789786
/* Data structure for a database table */ /* Data structure for a database table */
@ -313,6 +318,12 @@ struct dict_table_struct{
NOT allowed until this count gets to zero; NOT allowed until this count gets to zero;
MySQL does NOT itself check the number of MySQL does NOT itself check the number of
open handles at drop */ open handles at drop */
ulint n_foreign_key_checks_running;
/* count of how many foreign key check
operations are currently being performed
on the table: we cannot drop the table while
there are foreign key checks running on
it! */
ibool cached; /* TRUE if the table object has been added ibool cached; /* TRUE if the table object has been added
to the dictionary cache */ to the dictionary cache */
lock_t* auto_inc_lock;/* a buffer for an auto-inc lock lock_t* auto_inc_lock;/* a buffer for an auto-inc lock
@ -359,17 +370,16 @@ struct dict_table_struct{
after database startup or table creation */ after database startup or table creation */
ulint stat_modified_counter; ulint stat_modified_counter;
/* when a row is inserted, updated, or deleted, /* when a row is inserted, updated, or deleted,
we add the row length to this number; we we add 1 to this number; we calculate new
calculate new estimates for the stat_... estimates for the stat_... values for the
values for the table and the indexes at an table and the indexes at an interval of 2 GB
interval of 2 GB or when about 1 / 16 of table or when about 1 / 16 of table has been
has been modified; also modified; also when the estimate operation is
when the estimate operation is called called for MySQL SHOW TABLE STATUS; the
for MySQL SHOW TABLE STATUS; the counter is counter is reset to zero at statistics
reset to zero at statistics calculation; calculation; this counter is not protected by
this counter any latch, because this is only used for
is not protected by any latch, because this heuristics */
is only used for heuristics */
/*----------------------*/ /*----------------------*/
mutex_t autoinc_mutex; mutex_t autoinc_mutex;
/* mutex protecting the autoincrement /* mutex protecting the autoincrement

View file

@ -127,7 +127,11 @@ UNIV_INLINE
ibool ibool
ibuf_should_try( ibuf_should_try(
/*============*/ /*============*/
dict_index_t* index); /* in: index where to insert */ dict_index_t* index, /* in: index where to insert */
ulint ignore_sec_unique); /* in: if != 0, we should
ignore UNIQUE constraint on
a secondary index when we
decide */
/********************************************************************** /**********************************************************************
Returns TRUE if the current OS thread is performing an insert buffer Returns TRUE if the current OS thread is performing an insert buffer
routine. */ routine. */

View file

@ -81,10 +81,16 @@ UNIV_INLINE
ibool ibool
ibuf_should_try( ibuf_should_try(
/*============*/ /*============*/
dict_index_t* index) /* in: index where to insert */ dict_index_t* index, /* in: index where to insert */
ulint ignore_sec_unique) /* in: if != 0, we should
ignore UNIQUE constraint on
a secondary index when we
decide */
{ {
if (!(index->type & (DICT_CLUSTERED | DICT_UNIQUE)) if (!(index->type & DICT_CLUSTERED)
&& ibuf->meter > IBUF_THRESHOLD) { && (ignore_sec_unique || !(index->type & DICT_UNIQUE))
&& ibuf->meter > IBUF_THRESHOLD) {
ibuf_flush_count++; ibuf_flush_count++;
if (ibuf_flush_count % 8 == 0) { if (ibuf_flush_count % 8 == 0) {

View file

@ -25,12 +25,6 @@ extern ibool os_has_said_disk_full;
#define UNIV_NON_BUFFERED_IO #define UNIV_NON_BUFFERED_IO
#else
#if defined(HAVE_AIO_H) && defined(HAVE_LIBRT)
#define POSIX_ASYNC_IO
#endif
#endif #endif
#ifdef __WIN__ #ifdef __WIN__
@ -347,6 +341,8 @@ os_aio_windows_handle(
void** message2, void** message2,
ulint* type); /* out: OS_FILE_WRITE or ..._READ */ ulint* type); /* out: OS_FILE_WRITE or ..._READ */
#endif #endif
/* Currently we do not use Posix async i/o */
#ifdef POSIX_ASYNC_IO #ifdef POSIX_ASYNC_IO
/************************************************************************** /**************************************************************************
This function is only used in Posix asynchronous i/o. Waits for an aio This function is only used in Posix asynchronous i/o. Waits for an aio

View file

@ -149,9 +149,9 @@ void
os_mutex_free( os_mutex_free(
/*==========*/ /*==========*/
os_mutex_t mutex); /* in: mutex to free */ os_mutex_t mutex); /* in: mutex to free */
#ifndef _WIN32
/************************************************************** /**************************************************************
Acquires ownership of a fast mutex. */ Acquires ownership of a fast mutex. Currently in Windows this is the same
as os_fast_mutex_lock! */
UNIV_INLINE UNIV_INLINE
ulint ulint
os_fast_mutex_trylock( os_fast_mutex_trylock(
@ -160,7 +160,6 @@ os_fast_mutex_trylock(
was reserved by another was reserved by another
thread */ thread */
os_fast_mutex_t* fast_mutex); /* in: mutex to acquire */ os_fast_mutex_t* fast_mutex); /* in: mutex to acquire */
#endif
/************************************************************** /**************************************************************
Releases ownership of a fast mutex. */ Releases ownership of a fast mutex. */

View file

@ -10,9 +10,9 @@ Created 9/6/1995 Heikki Tuuri
#include <winbase.h> #include <winbase.h>
#endif #endif
#ifndef _WIN32
/************************************************************** /**************************************************************
Acquires ownership of a fast mutex. */ Acquires ownership of a fast mutex. Currently in Windows this is the same
as os_fast_mutex_lock! */
UNIV_INLINE UNIV_INLINE
ulint ulint
os_fast_mutex_trylock( os_fast_mutex_trylock(
@ -23,20 +23,11 @@ os_fast_mutex_trylock(
os_fast_mutex_t* fast_mutex) /* in: mutex to acquire */ os_fast_mutex_t* fast_mutex) /* in: mutex to acquire */
{ {
#ifdef __WIN__ #ifdef __WIN__
int ret; EnterCriticalSection(fast_mutex);
/* TODO: TryEnterCriticalSection is probably not found from return(0);
NT versions < 4! */
ret = TryEnterCriticalSection(fast_mutex);
if (ret) {
return(0);
}
return(1);
#else #else
return((ulint) pthread_mutex_trylock(fast_mutex)); return((ulint) pthread_mutex_trylock(fast_mutex));
#endif #endif
} }
#endif

View file

@ -209,6 +209,27 @@ row_update_for_mysql(
row_prebuilt_t* prebuilt); /* in: prebuilt struct in MySQL row_prebuilt_t* prebuilt); /* in: prebuilt struct in MySQL
handle */ handle */
/************************************************************************* /*************************************************************************
Creates an query graph node of 'update' type to be used in the MySQL
interface. */
upd_node_t*
row_create_update_node_for_mysql(
/*=============================*/
/* out, own: update node */
dict_table_t* table, /* in: table to update */
mem_heap_t* heap); /* in: mem heap from which allocated */
/**************************************************************************
Does a cascaded delete or set null in a foreign key operation. */
ulint
row_update_cascade_for_mysql(
/*=========================*/
/* out: error code or DB_SUCCESS */
que_thr_t* thr, /* in: query thread */
upd_node_t* node, /* in: update node used in the cascade
or set null operation */
dict_table_t* table); /* in: table where we do the operation */
/*************************************************************************
Does a table creation operation for MySQL. If the name of the created Does a table creation operation for MySQL. If the name of the created
table ends to characters INNODB_MONITOR, then this also starts table ends to characters INNODB_MONITOR, then this also starts
printing of monitor output by the master thread. */ printing of monitor output by the master thread. */

View file

@ -312,6 +312,11 @@ struct upd_node_struct{
ibool in_mysql_interface; ibool in_mysql_interface;
/* TRUE if the update node was created /* TRUE if the update node was created
for the MySQL interface */ for the MySQL interface */
upd_node_t* cascade_node;/* NULL or an update node template which
is used to implement ON DELETE CASCADE
or ... SET NULL for foreign keys */
mem_heap_t* cascade_heap;/* NULL or a mem heap where the cascade
node is created */
sel_node_t* select; /* query graph subtree implementing a base sel_node_t* select; /* query graph subtree implementing a base
table cursor: the rows returned will be table cursor: the rows returned will be
updated */ updated */
@ -322,6 +327,11 @@ struct upd_node_struct{
of the MySQL interface */ of the MySQL interface */
dict_table_t* table; /* table where updated */ dict_table_t* table; /* table where updated */
upd_t* update; /* update vector for the row */ upd_t* update; /* update vector for the row */
ulint update_n_fields;
/* when this struct is used to implement
a cascade operation for foreign keys, we store
here the size of the buffer allocated for use
as the update vector */
sym_node_list_t columns;/* symbol table nodes for the columns sym_node_list_t columns;/* symbol table nodes for the columns
to retrieve from the table */ to retrieve from the table */
ibool has_clust_rec_x_lock; ibool has_clust_rec_x_lock;

View file

@ -359,12 +359,17 @@ V
Memory pool mutex */ Memory pool mutex */
/* Latching order levels */ /* Latching order levels */
/* User transaction locks are higher than any of the latch levels below:
no latches are allowed when a thread goes to wait for a normal table
or row lock! */
#define SYNC_USER_TRX_LOCK 9999
#define SYNC_NO_ORDER_CHECK 3000 /* this can be used to suppress #define SYNC_NO_ORDER_CHECK 3000 /* this can be used to suppress
latching order checking */ latching order checking */
#define SYNC_LEVEL_NONE 2000 /* default: level not defined */ #define SYNC_LEVEL_NONE 2000 /* default: level not defined */
#define SYNC_FOREIGN_KEY_CHECK 1001
#define SYNC_DICT 1000 #define SYNC_DICT 1000
#define SYNC_DICT_AUTOINC_MUTEX 999 #define SYNC_DICT_AUTOINC_MUTEX 999
#define SYNC_FOREIGN_KEY_CHECK 998
#define SYNC_PURGE_IS_RUNNING 997 #define SYNC_PURGE_IS_RUNNING 997
#define SYNC_DICT_HEADER 995 #define SYNC_DICT_HEADER 995
#define SYNC_IBUF_HEADER 914 #define SYNC_IBUF_HEADER 914
@ -429,7 +434,7 @@ implementation of a mutual exclusion semaphore. */
struct mutex_struct { struct mutex_struct {
ulint lock_word; /* This ulint is the target of the atomic ulint lock_word; /* This ulint is the target of the atomic
test-and-set instruction in Win32 */ test-and-set instruction in Win32 */
#ifndef _WIN32 #if !defined(_WIN32) || !defined(UNIV_CAN_USE_X86_ASSEMBLER)
os_fast_mutex_t os_fast_mutex_t
os_fast_mutex; /* In other systems we use this OS mutex os_fast_mutex; /* In other systems we use this OS mutex
in place of lock_word */ in place of lock_word */

View file

@ -53,7 +53,7 @@ mutex_test_and_set(
1 */ 1 */
mutex_t* mutex) /* in: mutex */ mutex_t* mutex) /* in: mutex */
{ {
#ifdef _WIN32 #if defined(_WIN32) && defined(UNIV_CAN_USE_X86_ASSEMBLER)
ulint res; ulint res;
ulint* lw; /* assembler code is used to ensure that ulint* lw; /* assembler code is used to ensure that
lock_word is loaded from memory */ lock_word is loaded from memory */
@ -120,7 +120,7 @@ mutex_reset_lock_word(
/*==================*/ /*==================*/
mutex_t* mutex) /* in: mutex */ mutex_t* mutex) /* in: mutex */
{ {
#ifdef _WIN32 #if defined(_WIN32) && defined(UNIV_CAN_USE_X86_ASSEMBLER)
ulint* lw; /* assembler code is used to ensure that ulint* lw; /* assembler code is used to ensure that
lock_word is loaded from memory */ lock_word is loaded from memory */
ut_ad(mutex); ut_ad(mutex);

View file

@ -259,7 +259,7 @@ therefore 256 */
/* The offset of the transaction system header on the page */ /* The offset of the transaction system header on the page */
#define TRX_SYS FSEG_PAGE_DATA #define TRX_SYS FSEG_PAGE_DATA
/* Transaction system header; protected by trx_sys->mutex */ /* Transaction system header */
/*-------------------------------------------------------------*/ /*-------------------------------------------------------------*/
#define TRX_SYS_TRX_ID_STORE 0 /* the maximum trx id or trx number #define TRX_SYS_TRX_ID_STORE 0 /* the maximum trx id or trx number
modulo TRX_SYS_TRX_ID_UPDATE_MARGIN modulo TRX_SYS_TRX_ID_UPDATE_MARGIN

View file

@ -93,7 +93,6 @@ trx_sysf_get(
{ {
trx_sysf_t* header; trx_sysf_t* header;
ut_ad(mutex_own(&(kernel_mutex)));
ut_ad(mtr); ut_ad(mtr);
header = TRX_SYS + buf_page_get(TRX_SYS_SPACE, TRX_SYS_PAGE_NO, header = TRX_SYS + buf_page_get(TRX_SYS_SPACE, TRX_SYS_PAGE_NO,

View file

@ -298,6 +298,17 @@ struct trx_struct{
of view of concurrency control: of view of concurrency control:
TRX_ACTIVE, TRX_COMMITTED_IN_MEMORY, TRX_ACTIVE, TRX_COMMITTED_IN_MEMORY,
... */ ... */
ibool check_foreigns; /* normally TRUE, but if the user
wants to suppress foreign key checks,
(in table imports, for example) we
set this FALSE */
ibool check_unique_secondary;
/* normally TRUE, but if the user
wants to speed up inserts by
suppressing unique key checks
for secondary indexes when we decide
if we can use the insert buffer for
them, we set this FALSE */
dulint id; /* transaction id */ dulint id; /* transaction id */
dulint no; /* transaction serialization number == dulint no; /* transaction serialization number ==
max trx id when the transaction is max trx id when the transaction is
@ -328,6 +339,9 @@ struct trx_struct{
/* how many tables the current SQL /* how many tables the current SQL
statement uses, except those statement uses, except those
in consistent read */ in consistent read */
ibool has_dict_foreign_key_check_lock;
/* TRUE if the trx currently holds
an s-lock on dict_foreign_... */
ibool has_search_latch; ibool has_search_latch;
/* TRUE if this trx has latched the /* TRUE if this trx has latched the
search system latch in S-mode */ search system latch in S-mode */

View file

@ -14,6 +14,13 @@ Created 1/20/1994 Heikki Tuuri
#include <windows.h> #include <windows.h>
/* When compiling for Itanium IA64, undefine the flag below to prevent use
of 32-bit assembler */
#ifndef WIN64
#define UNIV_CAN_USE_X86_ASSEMBLER
#endif
/* If you want to check for errors with compiler level -W4, /* If you want to check for errors with compiler level -W4,
comment out the above include of windows.h and let the following defines comment out the above include of windows.h and let the following defines
be defined: be defined:
@ -71,13 +78,14 @@ memory is read outside the allocated blocks. */
*/ */
/* Make a non-inline debug version */ /* Make a non-inline debug version */
/* /*
#define UNIV_DEBUG #define UNIV_DEBUG
#define UNIV_MEM_DEBUG #define UNIV_MEM_DEBUG
#define UNIV_SEARCH_DEBUG #define UNIV_SYNC_DEBUG
#define UNIV_IBUF_DEBUG #define UNIV_IBUF_DEBUG
#define UNIV_SYNC_DEBUG #define UNIV_SEARCH_DEBUG
#define UNIV_SYNC_PERF_STAT #define UNIV_SYNC_PERF_STAT
#define UNIV_SEARCH_PERF_STAT #define UNIV_SEARCH_PERF_STAT
*/ */

View file

@ -1535,6 +1535,8 @@ lock_rec_enqueue_waiting(
if (que_thr_stop(thr)) { if (que_thr_stop(thr)) {
ut_a(0);
return(DB_QUE_THR_SUSPENDED); return(DB_QUE_THR_SUSPENDED);
} }
@ -2919,6 +2921,7 @@ lock_table_enqueue_waiting(
stopped anyway */ stopped anyway */
if (que_thr_stop(thr)) { if (que_thr_stop(thr)) {
ut_a(0);
return(DB_QUE_THR_SUSPENDED); return(DB_QUE_THR_SUSPENDED);
} }

View file

@ -526,7 +526,8 @@ opt_search_plan_for_table(
dict_index_t* best_index; dict_index_t* best_index;
ulint n_fields; ulint n_fields;
ulint goodness; ulint goodness;
ulint last_op; ulint last_op = 75946965; /* Eliminate a Purify
warning */
ulint best_goodness; ulint best_goodness;
ulint best_last_op = 0; /* remove warning */ ulint best_last_op = 0; /* remove warning */
ulint mix_id_pos; ulint mix_id_pos;

View file

@ -555,6 +555,12 @@ que_graph_free_recursive(
btr_pcur_free_for_mysql(upd->pcur); btr_pcur_free_for_mysql(upd->pcur);
} }
que_graph_free_recursive(upd->cascade_node);
if (upd->cascade_heap) {
mem_heap_free(upd->cascade_heap);
}
que_graph_free_recursive(upd->select); que_graph_free_recursive(upd->select);
mem_heap_free(upd->heap); mem_heap_free(upd->heap);
@ -1110,9 +1116,6 @@ que_thr_move_to_run_state_for_mysql(
trx->n_active_thrs++; trx->n_active_thrs++;
thr->is_active = TRUE; thr->is_active = TRUE;
ut_ad((thr->graph)->n_active_thrs == 1);
ut_ad(trx->n_active_thrs == 1);
} }
thr->state = QUE_THR_RUNNING; thr->state = QUE_THR_RUNNING;

View file

@ -355,6 +355,223 @@ row_ins_dupl_error_with_rec(
return(FALSE); return(FALSE);
} }
/*************************************************************************
Either deletes or sets the referencing columns SQL NULL in a child row.
Used in ON DELETE ... clause for foreign keys when a parent row is
deleted. */
static
ulint
row_ins_foreign_delete_or_set_null(
/*===============================*/
/* out: DB_SUCCESS, DB_LOCK_WAIT,
or error code */
que_thr_t* thr, /* in: query thread whose run_node
is an update node */
dict_foreign_t* foreign, /* in: foreign key constraint whose
type is != 0 */
btr_pcur_t* pcur, /* in: cursor placed on a matching
index record in the child table */
mtr_t* mtr) /* in: mtr holding the latch of pcur
page */
{
upd_node_t* node;
upd_node_t* cascade;
dict_table_t* table = foreign->foreign_table;
dict_index_t* index;
dict_index_t* clust_index;
dtuple_t* ref;
mem_heap_t* tmp_heap;
rec_t* rec;
rec_t* clust_rec;
upd_t* update;
ulint err;
ulint i;
char err_buf[1000];
ut_a(thr && foreign && pcur && mtr);
node = thr->run_node;
if (node->cascade_node == NULL) {
/* Extend our query graph by creating a child to current
update node. The child is used in the cascade or set null
operation. */
node->cascade_heap = mem_heap_create(128);
node->cascade_node = row_create_update_node_for_mysql(
table, node->cascade_heap);
que_node_set_parent(node->cascade_node, node);
}
/* Initialize cascade_node to do the operation we want. Note that we
use the SAME cascade node to do all foreign key operations of the
SQL DELETE: the table of the cascade node may change if there are
several child tables to the table where the delete is done! */
cascade = node->cascade_node;
cascade->table = table;
if (foreign->type == DICT_FOREIGN_ON_DELETE_CASCADE ) {
cascade->is_delete = TRUE;
} else {
cascade->is_delete = FALSE;
if (foreign->n_fields > cascade->update_n_fields) {
/* We have to make the update vector longer */
cascade->update = upd_create(foreign->n_fields,
node->cascade_heap);
cascade->update_n_fields = foreign->n_fields;
}
}
index = btr_pcur_get_btr_cur(pcur)->index;
rec = btr_pcur_get_rec(pcur);
if (index->type & DICT_CLUSTERED) {
/* pcur is already positioned in the clustered index of
the child table */
clust_index = index;
clust_rec = rec;
} else {
/* We have to look for the record in the clustered index
in the child table */
clust_index = dict_table_get_first_index(table);
tmp_heap = mem_heap_create(256);
ref = row_build_row_ref(ROW_COPY_POINTERS, index, rec,
tmp_heap);
btr_pcur_open_with_no_init(clust_index, ref,
PAGE_CUR_LE, BTR_SEARCH_LEAF,
cascade->pcur, 0, mtr);
mem_heap_free(tmp_heap);
clust_rec = btr_pcur_get_rec(cascade->pcur);
}
if (!page_rec_is_user_rec(clust_rec)) {
fprintf(stderr, "InnoDB: error in cascade of a foreign key op\n"
"InnoDB: index %s table %s\n", index->name,
index->table->name);
rec_sprintf(err_buf, 900, rec);
fprintf(stderr, "InnoDB: record %s\n", err_buf);
rec_sprintf(err_buf, 900, clust_rec);
fprintf(stderr, "InnoDB: clustered record %s\n", err_buf);
fprintf(stderr,
"InnoDB: Make a detailed bug report and send it\n");
fprintf(stderr, "InnoDB: to mysql@lists.mysql.com\n");
err = DB_SUCCESS;
goto nonstandard_exit_func;
}
/* Set an X-lock on the row to delete or update in the child table */
err = lock_table(0, table, LOCK_IX, thr);
if (err == DB_SUCCESS) {
err = lock_clust_rec_read_check_and_lock(0, clust_rec,
clust_index, LOCK_X, thr);
}
if (err != DB_SUCCESS) {
goto nonstandard_exit_func;
}
if (rec_get_deleted_flag(clust_rec)) {
/* This should never happen since we already have an S-lock
on non-delete-marked clust_rec or secondary index record! */
fprintf(stderr,
"InnoDB: error 2 in cascade of a foreign key op\n"
"InnoDB: index %s table %s\n", index->name,
index->table->name);
rec_sprintf(err_buf, 900, rec);
fprintf(stderr, "InnoDB: record %s\n", err_buf);
rec_sprintf(err_buf, 900, clust_rec);
fprintf(stderr, "InnoDB: clustered record %s\n", err_buf);
fprintf(stderr,
"InnoDB: Make a detailed bug report and send it\n");
fprintf(stderr, "InnoDB: to mysql@lists.mysql.com\n");
ut_a(0);
goto nonstandard_exit_func;
}
if (foreign->type == DICT_FOREIGN_ON_DELETE_SET_NULL) {
/* Build the appropriate update vector which sets
foreign->n_fields first fields in rec to SQL NULL */
update = cascade->update;
update->info_bits = 0;
update->n_fields = foreign->n_fields;
for (i = 0; i < foreign->n_fields; i++) {
(update->fields + i)->field_no
= dict_table_get_nth_col_pos(table,
dict_index_get_nth_col_no(index, i));
(update->fields + i)->exp = NULL;
(update->fields + i)->new_val.len = UNIV_SQL_NULL;
(update->fields + i)->new_val.data = NULL;
(update->fields + i)->extern_storage = FALSE;
}
}
/* Store pcur position and initialize or store the cascade node
pcur stored position */
btr_pcur_store_position(pcur, mtr);
if (index == clust_index) {
btr_pcur_copy_stored_position(cascade->pcur, pcur);
} else {
btr_pcur_store_position(cascade->pcur, mtr);
}
mtr_commit(mtr);
ut_a(cascade->pcur->rel_pos == BTR_PCUR_ON);
cascade->state = UPD_NODE_UPDATE_CLUSTERED;
err = row_update_cascade_for_mysql(thr, cascade,
foreign->foreign_table);
mtr_start(mtr);
/* Restore pcur position */
btr_pcur_restore_position(BTR_SEARCH_LEAF, pcur, mtr);
return(err);
nonstandard_exit_func:
btr_pcur_store_position(pcur, mtr);
mtr_commit(mtr);
mtr_start(mtr);
btr_pcur_restore_position(BTR_SEARCH_LEAF, pcur, mtr);
return(err);
}
/************************************************************************* /*************************************************************************
Sets a shared lock on a record. Used in locking possible duplicate key Sets a shared lock on a record. Used in locking possible duplicate key
records. */ records. */
@ -416,6 +633,13 @@ row_ins_check_foreign_constraint(
ut_ad(rw_lock_own(&dict_foreign_key_check_lock, RW_LOCK_SHARED)); ut_ad(rw_lock_own(&dict_foreign_key_check_lock, RW_LOCK_SHARED));
if (thr_get_trx(thr)->check_foreigns == FALSE) {
/* The user has suppressed foreign key checks currently for
this session */
return(DB_SUCCESS);
}
/* If any of the foreign key fields in entry is SQL NULL, we /* If any of the foreign key fields in entry is SQL NULL, we
suppress the foreign key check: this is compatible with Oracle, suppress the foreign key check: this is compatible with Oracle,
for example */ for example */
@ -478,8 +702,8 @@ row_ins_check_foreign_constraint(
goto next_rec; goto next_rec;
} }
/* Try to place a lock on the index record */ /* Try to place a lock on the index record */
err = row_ins_set_shared_rec_lock(rec, check_index, thr); err = row_ins_set_shared_rec_lock(rec, check_index, thr);
@ -501,11 +725,21 @@ row_ins_check_foreign_constraint(
if (check_ref) { if (check_ref) {
err = DB_SUCCESS; err = DB_SUCCESS;
break;
} else if (foreign->type != 0) {
err =
row_ins_foreign_delete_or_set_null(
thr, foreign, &pcur, &mtr);
if (err != DB_SUCCESS) {
break;
}
} else { } else {
err = DB_ROW_IS_REFERENCED; err = DB_ROW_IS_REFERENCED;
break;
} }
break;
} }
} }
@ -534,6 +768,8 @@ next_rec:
} }
} }
btr_pcur_close(&pcur);
mtr_commit(&mtr); mtr_commit(&mtr);
/* Restore old value */ /* Restore old value */
@ -561,6 +797,10 @@ row_ins_check_foreign_constraints(
{ {
dict_foreign_t* foreign; dict_foreign_t* foreign;
ulint err; ulint err;
trx_t* trx;
ibool got_s_lock = FALSE;
trx = thr_get_trx(thr);
foreign = UT_LIST_GET_FIRST(table->foreign_list); foreign = UT_LIST_GET_FIRST(table->foreign_list);
@ -569,16 +809,26 @@ row_ins_check_foreign_constraints(
if (foreign->referenced_table == NULL) { if (foreign->referenced_table == NULL) {
dict_table_get(foreign->referenced_table_name, dict_table_get(foreign->referenced_table_name,
thr_get_trx(thr)); trx);
} }
rw_lock_s_lock(&dict_foreign_key_check_lock); if (!trx->has_dict_foreign_key_check_lock) {
got_s_lock = TRUE;
rw_lock_s_lock(&dict_foreign_key_check_lock);
trx->has_dict_foreign_key_check_lock = TRUE;
}
err = row_ins_check_foreign_constraint(TRUE, foreign, err = row_ins_check_foreign_constraint(TRUE, foreign,
table, index, entry, thr); table, index, entry, thr);
if (got_s_lock) {
rw_lock_s_unlock(&dict_foreign_key_check_lock); rw_lock_s_unlock(&dict_foreign_key_check_lock);
trx->has_dict_foreign_key_check_lock = FALSE;
}
if (err != DB_SUCCESS) { if (err != DB_SUCCESS) {
return(err); return(err);
} }
@ -868,13 +1118,14 @@ row_ins_index_entry_low(
ulint n_ext_vec,/* in: number of fields in ext_vec */ ulint n_ext_vec,/* in: number of fields in ext_vec */
que_thr_t* thr) /* in: query thread */ que_thr_t* thr) /* in: query thread */
{ {
btr_cur_t cursor; btr_cur_t cursor;
ulint ignore_sec_unique = 0;
ulint modify = 0; /* remove warning */ ulint modify = 0; /* remove warning */
rec_t* insert_rec; rec_t* insert_rec;
rec_t* rec; rec_t* rec;
ulint err; ulint err;
ulint n_unique; ulint n_unique;
big_rec_t* big_rec = NULL; big_rec_t* big_rec = NULL;
mtr_t mtr; mtr_t mtr;
log_free_check(); log_free_check();
@ -887,8 +1138,13 @@ row_ins_index_entry_low(
the function will return in both low_match and up_match of the the function will return in both low_match and up_match of the
cursor sensible values */ cursor sensible values */
if (!(thr_get_trx(thr)->check_unique_secondary)) {
ignore_sec_unique = BTR_IGNORE_SEC_UNIQUE;
}
btr_cur_search_to_nth_level(index, 0, entry, PAGE_CUR_LE, btr_cur_search_to_nth_level(index, 0, entry, PAGE_CUR_LE,
mode | BTR_INSERT, &cursor, 0, &mtr); mode | BTR_INSERT | ignore_sec_unique,
&cursor, 0, &mtr);
if (cursor.flag == BTR_CUR_INSERT_TO_IBUF) { if (cursor.flag == BTR_CUR_INSERT_TO_IBUF) {
/* The insertion was made to the insert buffer already during /* The insertion was made to the insert buffer already during

View file

@ -499,29 +499,24 @@ UNIV_INLINE
void void
row_update_statistics_if_needed( row_update_statistics_if_needed(
/*============================*/ /*============================*/
row_prebuilt_t* prebuilt) /* in: prebuilt struct */ dict_table_t* table) /* in: table */
{ {
ulint counter; ulint counter;
counter = prebuilt->table->stat_modified_counter; counter = table->stat_modified_counter;
/* Since the physical size of an InnoDB row is bigger than the table->stat_modified_counter = counter + 1;
MySQL row len, we put a safety factor 2 below */
counter += 2 * prebuilt->mysql_row_len;
prebuilt->table->stat_modified_counter = counter;
/* Calculate new statistics if 1 / 16 of table has been modified /* Calculate new statistics if 1 / 16 of table has been modified
since the last time a statistics batch was run, or if since the last time a statistics batch was run, or if
stat_modified_counter > 2 000 000 000 (to avoid wrap-around) */ stat_modified_counter > 2 000 000 000 (to avoid wrap-around).
We calculate statistics at most every 16th round, since we may have
a counter table which is very small and updated very often. */
if (counter > 2000000000 if (counter > 2000000000
|| ((ib_longlong)counter > || ((ib_longlong)counter > 16 + table->stat_n_rows / 16)) {
(UNIV_PAGE_SIZE * prebuilt->table->stat_clustered_index_size)
/ 16)) {
dict_update_statistics(prebuilt->table); dict_update_statistics(table);
} }
} }
@ -712,7 +707,7 @@ run_again:
prebuilt->table->stat_n_rows--; prebuilt->table->stat_n_rows--;
} }
row_update_statistics_if_needed(prebuilt); row_update_statistics_if_needed(prebuilt->table);
trx->op_info = (char *) ""; trx->op_info = (char *) "";
return((int) err); return((int) err);
@ -745,6 +740,43 @@ row_prebuild_sel_graph(
} }
} }
/*************************************************************************
Creates an query graph node of 'update' type to be used in the MySQL
interface. */
upd_node_t*
row_create_update_node_for_mysql(
/*=============================*/
/* out, own: update node */
dict_table_t* table, /* in: table to update */
mem_heap_t* heap) /* in: mem heap from which allocated */
{
upd_node_t* node;
node = upd_node_create(heap);
node->in_mysql_interface = TRUE;
node->is_delete = FALSE;
node->searched_update = FALSE;
node->select_will_do_update = FALSE;
node->select = NULL;
node->pcur = btr_pcur_create_for_mysql();
node->table = table;
node->update = upd_create(dict_table_get_n_cols(table), heap);
node->update_n_fields = dict_table_get_n_cols(table);
UT_LIST_INIT(node->columns);
node->has_clust_rec_x_lock = TRUE;
node->cmpl_info = 0;
node->table_sym = NULL;
node->col_assign_list = NULL;
return(node);
}
/************************************************************************* /*************************************************************************
Gets pointer to a prebuilt update vector used in updates. If the update Gets pointer to a prebuilt update vector used in updates. If the update
graph has not yet been built in the prebuilt struct, then this function graph has not yet been built in the prebuilt struct, then this function
@ -767,26 +799,9 @@ row_get_prebuilt_update_vector(
/* Not called before for this handle: create an update node /* Not called before for this handle: create an update node
and query graph to the prebuilt struct */ and query graph to the prebuilt struct */
node = upd_node_create(prebuilt->heap); node = row_create_update_node_for_mysql(table, prebuilt->heap);
prebuilt->upd_node = node; prebuilt->upd_node = node;
node->in_mysql_interface = TRUE;
node->is_delete = FALSE;
node->searched_update = FALSE;
node->select_will_do_update = FALSE;
node->select = NULL;
node->pcur = btr_pcur_create_for_mysql();
node->table = table;
node->update = upd_create(dict_table_get_n_cols(table),
prebuilt->heap);
UT_LIST_INIT(node->columns);
node->has_clust_rec_x_lock = TRUE;
node->cmpl_info = 0;
node->table_sym = NULL;
node->col_assign_list = NULL;
prebuilt->upd_graph = prebuilt->upd_graph =
que_node_get_parent( que_node_get_parent(
@ -914,7 +929,7 @@ run_again:
que_thr_stop_for_mysql_no_error(thr, trx); que_thr_stop_for_mysql_no_error(thr, trx);
if (prebuilt->upd_node->is_delete) { if (node->is_delete) {
if (prebuilt->table->stat_n_rows > 0) { if (prebuilt->table->stat_n_rows > 0) {
prebuilt->table->stat_n_rows--; prebuilt->table->stat_n_rows--;
} }
@ -924,13 +939,66 @@ run_again:
srv_n_rows_updated++; srv_n_rows_updated++;
} }
row_update_statistics_if_needed(prebuilt); row_update_statistics_if_needed(prebuilt->table);
trx->op_info = (char *) ""; trx->op_info = (char *) "";
return((int) err); return((int) err);
} }
/**************************************************************************
Does a cascaded delete or set null in a foreign key operation. */
ulint
row_update_cascade_for_mysql(
/*=========================*/
/* out: error code or DB_SUCCESS */
que_thr_t* thr, /* in: query thread */
upd_node_t* node, /* in: update node used in the cascade
or set null operation */
dict_table_t* table) /* in: table where we do the operation */
{
ulint err;
trx_t* trx;
trx = thr_get_trx(thr);
run_again:
thr->run_node = node;
thr->prev_node = node;
row_upd_step(thr);
err = trx->error_state;
if (err == DB_LOCK_WAIT) {
que_thr_stop_for_mysql(thr);
row_mysql_handle_errors(&err, trx, thr, NULL);
goto run_again;
}
if (err != DB_SUCCESS) {
return(err);
}
if (node->is_delete) {
if (table->stat_n_rows > 0) {
table->stat_n_rows--;
}
srv_n_rows_deleted++;
} else {
srv_n_rows_updated++;
}
row_update_statistics_if_needed(table);
return(err);
}
/************************************************************************* /*************************************************************************
Checks if a table is such that we automatically created a clustered Checks if a table is such that we automatically created a clustered
index on it (on row id). */ index on it (on row id). */
@ -1171,6 +1239,7 @@ row_create_table_for_mysql(
/* Serialize data dictionary operations with dictionary mutex: /* Serialize data dictionary operations with dictionary mutex:
no deadlocks can occur then in these operations */ no deadlocks can occur then in these operations */
rw_lock_x_lock(&(dict_foreign_key_check_lock));
mutex_enter(&(dict_sys->mutex)); mutex_enter(&(dict_sys->mutex));
heap = mem_heap_create(512); heap = mem_heap_create(512);
@ -1223,6 +1292,8 @@ row_create_table_for_mysql(
} }
mutex_exit(&(dict_sys->mutex)); mutex_exit(&(dict_sys->mutex));
rw_lock_x_unlock(&(dict_foreign_key_check_lock));
que_graph_free((que_t*) que_node_get_parent(thr)); que_graph_free((que_t*) que_node_get_parent(thr));
trx->op_info = (char *) ""; trx->op_info = (char *) "";
@ -1270,6 +1341,7 @@ row_create_index_for_mysql(
/* Serialize data dictionary operations with dictionary mutex: /* Serialize data dictionary operations with dictionary mutex:
no deadlocks can occur then in these operations */ no deadlocks can occur then in these operations */
rw_lock_x_lock(&(dict_foreign_key_check_lock));
mutex_enter(&(dict_sys->mutex)); mutex_enter(&(dict_sys->mutex));
heap = mem_heap_create(512); heap = mem_heap_create(512);
@ -1300,6 +1372,7 @@ row_create_index_for_mysql(
} }
mutex_exit(&(dict_sys->mutex)); mutex_exit(&(dict_sys->mutex));
rw_lock_x_unlock(&(dict_foreign_key_check_lock));
que_graph_free((que_t*) que_node_get_parent(thr)); que_graph_free((que_t*) que_node_get_parent(thr));
@ -1355,6 +1428,7 @@ row_table_add_foreign_constraints(
/* Serialize data dictionary operations with dictionary mutex: /* Serialize data dictionary operations with dictionary mutex:
no deadlocks can occur then in these operations */ no deadlocks can occur then in these operations */
rw_lock_x_lock(&(dict_foreign_key_check_lock));
mutex_enter(&(dict_sys->mutex)); mutex_enter(&(dict_sys->mutex));
trx->dict_operation = TRUE; trx->dict_operation = TRUE;
@ -1379,6 +1453,7 @@ row_table_add_foreign_constraints(
} }
mutex_exit(&(dict_sys->mutex)); mutex_exit(&(dict_sys->mutex));
rw_lock_x_unlock(&(dict_foreign_key_check_lock));
return((int) err); return((int) err);
} }
@ -1473,7 +1548,8 @@ loop:
goto already_dropped; goto already_dropped;
} }
if (table->n_mysql_handles_opened > 0) { if (table->n_mysql_handles_opened > 0
|| table->n_foreign_key_checks_running > 0) {
return(n_tables + n_tables_dropped); return(n_tables + n_tables_dropped);
} }
@ -1722,6 +1798,9 @@ row_drop_table_for_mysql(
no deadlocks can occur then in these operations */ no deadlocks can occur then in these operations */
if (!has_dict_mutex) { if (!has_dict_mutex) {
/* Prevent foreign key checks while we are dropping the table */
rw_lock_x_lock(&(dict_foreign_key_check_lock));
mutex_enter(&(dict_sys->mutex)); mutex_enter(&(dict_sys->mutex));
} }
@ -1734,9 +1813,6 @@ row_drop_table_for_mysql(
graph->fork_type = QUE_FORK_MYSQL_INTERFACE; graph->fork_type = QUE_FORK_MYSQL_INTERFACE;
/* Prevent foreign key checks while we are dropping the table */
rw_lock_x_lock(&(dict_foreign_key_check_lock));
/* Prevent purge from running while we are dropping the table */ /* Prevent purge from running while we are dropping the table */
rw_lock_s_lock(&(purge_sys->purge_is_running)); rw_lock_s_lock(&(purge_sys->purge_is_running));
@ -1771,6 +1847,22 @@ row_drop_table_for_mysql(
goto funct_exit; goto funct_exit;
} }
if (table->n_foreign_key_checks_running > 0) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: You are trying to drop table %s\n"
"InnoDB: though there are foreign key check running on it.\n"
"InnoDB: Adding the table to the background drop queue.\n",
table->name);
row_add_table_to_background_drop_list(table);
err = DB_SUCCESS;
goto funct_exit;
}
/* Remove any locks there are on the table or its records */ /* Remove any locks there are on the table or its records */
lock_reset_all_on_table(table); lock_reset_all_on_table(table);
@ -1798,10 +1890,9 @@ row_drop_table_for_mysql(
funct_exit: funct_exit:
rw_lock_s_unlock(&(purge_sys->purge_is_running)); rw_lock_s_unlock(&(purge_sys->purge_is_running));
rw_lock_x_unlock(&(dict_foreign_key_check_lock));
if (!has_dict_mutex) { if (!has_dict_mutex) {
mutex_exit(&(dict_sys->mutex)); mutex_exit(&(dict_sys->mutex));
rw_lock_x_unlock(&(dict_foreign_key_check_lock));
} }
que_graph_free(graph); que_graph_free(graph);
@ -1837,6 +1928,7 @@ row_drop_database_for_mysql(
trx_start_if_not_started(trx); trx_start_if_not_started(trx);
loop: loop:
rw_lock_x_lock(&(dict_foreign_key_check_lock));
mutex_enter(&(dict_sys->mutex)); mutex_enter(&(dict_sys->mutex));
while ((table_name = dict_get_first_table_name_in_db(name))) { while ((table_name = dict_get_first_table_name_in_db(name))) {
@ -1878,6 +1970,7 @@ loop:
} }
mutex_exit(&(dict_sys->mutex)); mutex_exit(&(dict_sys->mutex));
rw_lock_x_unlock(&(dict_foreign_key_check_lock));
trx_commit_for_mysql(trx); trx_commit_for_mysql(trx);
@ -2014,6 +2107,7 @@ row_rename_table_for_mysql(
/* Serialize data dictionary operations with dictionary mutex: /* Serialize data dictionary operations with dictionary mutex:
no deadlocks can occur then in these operations */ no deadlocks can occur then in these operations */
rw_lock_x_lock(&(dict_foreign_key_check_lock));
mutex_enter(&(dict_sys->mutex)); mutex_enter(&(dict_sys->mutex));
table = dict_table_get_low(old_name); table = dict_table_get_low(old_name);
@ -2095,6 +2189,7 @@ row_rename_table_for_mysql(
} }
funct_exit: funct_exit:
mutex_exit(&(dict_sys->mutex)); mutex_exit(&(dict_sys->mutex));
rw_lock_x_unlock(&(dict_foreign_key_check_lock));
que_graph_free(graph); que_graph_free(graph);

View file

@ -2116,8 +2116,14 @@ row_sel_store_mysql_rec(
extern_field_heap = NULL; extern_field_heap = NULL;
} }
} else { } else {
mysql_rec[templ->mysql_null_byte_offset] |= if (!templ->mysql_null_bit_mask) {
fprintf(stderr,
"InnoDB: Error: trying to return an SQL NULL field in a non-null\n"
"innoDB: column! Table name %s\n", prebuilt->table->name);
} else {
mysql_rec[templ->mysql_null_byte_offset] |=
(byte) (templ->mysql_null_bit_mask); (byte) (templ->mysql_null_bit_mask);
}
} }
} }
} }

View file

@ -73,8 +73,7 @@ steps of query graph execution. */
/************************************************************************* /*************************************************************************
Checks if index currently is mentioned as a referenced index in a foreign Checks if index currently is mentioned as a referenced index in a foreign
key constraint. This function also loads into the dictionary cache the key constraint. */
possible referencing table. */
static static
ibool ibool
row_upd_index_is_referenced( row_upd_index_is_referenced(
@ -85,44 +84,28 @@ row_upd_index_is_referenced(
the referencing table has been dropped when the referencing table has been dropped when
we leave this function: this function is only we leave this function: this function is only
for heuristic use! */ for heuristic use! */
dict_index_t* index) /* in: index */ dict_index_t* index, /* in: index */
trx_t* trx) /* in: transaction */
{ {
dict_table_t* table = index->table; dict_table_t* table = index->table;
dict_foreign_t* foreign; dict_foreign_t* foreign;
ulint phase = 1;
try_again:
if (!UT_LIST_GET_FIRST(table->referenced_list)) { if (!UT_LIST_GET_FIRST(table->referenced_list)) {
return(FALSE); return(FALSE);
} }
if (phase == 2) { if (!trx->has_dict_foreign_key_check_lock) {
mutex_enter(&(dict_sys->mutex)); rw_lock_s_lock(&dict_foreign_key_check_lock);
} }
rw_lock_s_lock(&dict_foreign_key_check_lock);
foreign = UT_LIST_GET_FIRST(table->referenced_list); foreign = UT_LIST_GET_FIRST(table->referenced_list);
while (foreign) { while (foreign) {
if (foreign->referenced_index == index) { if (foreign->referenced_index == index) {
if (foreign->foreign_table == NULL) {
if (phase == 2) {
dict_table_get_low(foreign->
foreign_table_name);
} else {
phase = 2;
rw_lock_s_unlock(
&dict_foreign_key_check_lock);
goto try_again;
}
}
rw_lock_s_unlock(&dict_foreign_key_check_lock); if (!trx->has_dict_foreign_key_check_lock) {
rw_lock_s_unlock(&dict_foreign_key_check_lock);
if (phase == 2) {
mutex_exit(&(dict_sys->mutex));
} }
return(TRUE); return(TRUE);
@ -131,10 +114,8 @@ try_again:
foreign = UT_LIST_GET_NEXT(referenced_list, foreign); foreign = UT_LIST_GET_NEXT(referenced_list, foreign);
} }
rw_lock_s_unlock(&dict_foreign_key_check_lock); if (!trx->has_dict_foreign_key_check_lock) {
rw_lock_s_unlock(&dict_foreign_key_check_lock);
if (phase == 2) {
mutex_exit(&(dict_sys->mutex));
} }
return(FALSE); return(FALSE);
@ -160,8 +141,17 @@ row_upd_check_references_constraints(
dict_foreign_t* foreign; dict_foreign_t* foreign;
mem_heap_t* heap; mem_heap_t* heap;
dtuple_t* entry; dtuple_t* entry;
trx_t* trx;
rec_t* rec; rec_t* rec;
ulint err; ulint err;
ibool got_s_lock = FALSE;
if (UT_LIST_GET_FIRST(table->referenced_list) == NULL) {
return(DB_SUCCESS);
}
trx = thr_get_trx(thr);
rec = btr_pcur_get_rec(pcur); rec = btr_pcur_get_rec(pcur);
@ -173,17 +163,61 @@ row_upd_check_references_constraints(
mtr_start(mtr); mtr_start(mtr);
rw_lock_s_lock(&dict_foreign_key_check_lock); if (!trx->has_dict_foreign_key_check_lock) {
got_s_lock = TRUE;
rw_lock_s_lock(&dict_foreign_key_check_lock);
trx->has_dict_foreign_key_check_lock = TRUE;
}
foreign = UT_LIST_GET_FIRST(table->referenced_list); foreign = UT_LIST_GET_FIRST(table->referenced_list);
while (foreign) { while (foreign) {
if (foreign->referenced_index == index) { if (foreign->referenced_index == index) {
if (foreign->foreign_table == NULL) {
dict_table_get(foreign->foreign_table_name,
trx);
}
if (foreign->foreign_table) {
mutex_enter(&(dict_sys->mutex));
(foreign->foreign_table
->n_foreign_key_checks_running)++;
mutex_exit(&(dict_sys->mutex));
}
/* NOTE that if the thread ends up waiting for a lock
we will release dict_foreign_key_check_lock
temporarily! But the counter on the table
protects 'foreign' from being dropped while the check
is running. */
err = row_ins_check_foreign_constraint(FALSE, foreign, err = row_ins_check_foreign_constraint(FALSE, foreign,
table, index, entry, thr); table, index, entry, thr);
if (foreign->foreign_table) {
mutex_enter(&(dict_sys->mutex));
ut_a(foreign->foreign_table
->n_foreign_key_checks_running > 0);
(foreign->foreign_table
->n_foreign_key_checks_running)--;
mutex_exit(&(dict_sys->mutex));
}
if (err != DB_SUCCESS) { if (err != DB_SUCCESS) {
rw_lock_s_unlock(&dict_foreign_key_check_lock); if (got_s_lock) {
rw_lock_s_unlock(
&dict_foreign_key_check_lock);
trx->has_dict_foreign_key_check_lock
= FALSE;
}
mem_heap_free(heap); mem_heap_free(heap);
return(err); return(err);
@ -193,7 +227,11 @@ row_upd_check_references_constraints(
foreign = UT_LIST_GET_NEXT(referenced_list, foreign); foreign = UT_LIST_GET_NEXT(referenced_list, foreign);
} }
rw_lock_s_unlock(&dict_foreign_key_check_lock); if (got_s_lock) {
rw_lock_s_unlock(&dict_foreign_key_check_lock);
trx->has_dict_foreign_key_check_lock = FALSE;
}
mem_heap_free(heap); mem_heap_free(heap);
return(DB_SUCCESS); return(DB_SUCCESS);
@ -222,6 +260,9 @@ upd_node_create(
node->index = NULL; node->index = NULL;
node->update = NULL; node->update = NULL;
node->cascade_heap = NULL;
node->cascade_node = NULL;
node->select = NULL; node->select = NULL;
node->heap = mem_heap_create(128); node->heap = mem_heap_create(128);
@ -1027,7 +1068,7 @@ row_upd_sec_index_entry(
index = node->index; index = node->index;
check_ref = row_upd_index_is_referenced(index); check_ref = row_upd_index_is_referenced(index, thr_get_trx(thr));
heap = mem_heap_create(1024); heap = mem_heap_create(1024);
@ -1391,7 +1432,7 @@ row_upd_clust_step(
index = dict_table_get_first_index(node->table); index = dict_table_get_first_index(node->table);
check_ref = row_upd_index_is_referenced(index); check_ref = row_upd_index_is_referenced(index, thr_get_trx(thr));
pcur = node->pcur; pcur = node->pcur;

View file

@ -2026,15 +2026,18 @@ srv_suspend_mysql_thread(
/*=====================*/ /*=====================*/
/* out: TRUE if the lock wait timeout was /* out: TRUE if the lock wait timeout was
exceeded */ exceeded */
que_thr_t* thr) /* in: query thread associated with que_thr_t* thr) /* in: query thread associated with the MySQL
the MySQL OS thread */ OS thread */
{ {
srv_slot_t* slot; srv_slot_t* slot;
os_event_t event; os_event_t event;
double wait_time; double wait_time;
trx_t* trx;
ut_ad(!mutex_own(&kernel_mutex)); ut_ad(!mutex_own(&kernel_mutex));
trx = thr_get_trx(thr);
os_event_set(srv_lock_timeout_thread_event); os_event_set(srv_lock_timeout_thread_event);
mutex_enter(&kernel_mutex); mutex_enter(&kernel_mutex);
@ -2070,10 +2073,21 @@ srv_suspend_mysql_thread(
srv_conc_force_exit_innodb(thr_get_trx(thr)); srv_conc_force_exit_innodb(thr_get_trx(thr));
/* Release possible foreign key check latch */
if (trx->has_dict_foreign_key_check_lock) {
rw_lock_s_unlock(&dict_foreign_key_check_lock);
}
/* Wait for the release */ /* Wait for the release */
os_event_wait(event); os_event_wait(event);
if (trx->has_dict_foreign_key_check_lock) {
rw_lock_s_lock(&dict_foreign_key_check_lock);
}
/* Return back inside InnoDB */ /* Return back inside InnoDB */
srv_conc_force_enter_innodb(thr_get_trx(thr)); srv_conc_force_enter_innodb(thr_get_trx(thr));

View file

@ -220,7 +220,7 @@ mutex_create_func(
char* cfile_name, /* in: file name where created */ char* cfile_name, /* in: file name where created */
ulint cline) /* in: file line where created */ ulint cline) /* in: file line where created */
{ {
#ifdef _WIN32 #if defined(_WIN32) && defined(UNIV_CAN_USE_X86_ASSEMBLER)
mutex_reset_lock_word(mutex); mutex_reset_lock_word(mutex);
#else #else
os_fast_mutex_init(&(mutex->os_fast_mutex)); os_fast_mutex_init(&(mutex->os_fast_mutex));
@ -273,7 +273,7 @@ mutex_free(
mutex_exit(&mutex_list_mutex); mutex_exit(&mutex_list_mutex);
#ifndef _WIN32 #if !defined(_WIN32) || !defined(UNIV_CAN_USE_X86_ASSEMBLER)
os_fast_mutex_free(&(mutex->os_fast_mutex)); os_fast_mutex_free(&(mutex->os_fast_mutex));
#endif #endif
/* If we free the mutex protecting the mutex list (freeing is /* If we free the mutex protecting the mutex list (freeing is
@ -1009,7 +1009,7 @@ sync_thread_add_level(
} else if (level == SYNC_ANY_LATCH) { } else if (level == SYNC_ANY_LATCH) {
ut_a(sync_thread_levels_g(array, SYNC_ANY_LATCH)); ut_a(sync_thread_levels_g(array, SYNC_ANY_LATCH));
} else if (level == SYNC_TRX_SYS_HEADER) { } else if (level == SYNC_TRX_SYS_HEADER) {
ut_a(sync_thread_levels_contain(array, SYNC_KERNEL)); ut_a(sync_thread_levels_g(array, SYNC_TRX_SYS_HEADER));
} else if (level == SYNC_DOUBLEWRITE) { } else if (level == SYNC_DOUBLEWRITE) {
ut_a(sync_thread_levels_g(array, SYNC_DOUBLEWRITE)); ut_a(sync_thread_levels_g(array, SYNC_DOUBLEWRITE));
} else if (level == SYNC_BUF_BLOCK) { } else if (level == SYNC_BUF_BLOCK) {

View file

@ -438,7 +438,6 @@ trx_sys_update_mysql_binlog_offset(
trx_sysf_t* sys_header; trx_sysf_t* sys_header;
char namebuf[TRX_SYS_MYSQL_LOG_NAME_LEN]; char namebuf[TRX_SYS_MYSQL_LOG_NAME_LEN];
ut_ad(mutex_own(&kernel_mutex));
ut_ad(trx->mysql_log_file_name); ut_ad(trx->mysql_log_file_name);
memset(namebuf, ' ', TRX_SYS_MYSQL_LOG_NAME_LEN - 1); memset(namebuf, ' ', TRX_SYS_MYSQL_LOG_NAME_LEN - 1);
@ -524,7 +523,7 @@ trx_sys_print_mysql_binlog_offset(void)
} }
fprintf(stderr, fprintf(stderr,
"InnoDB: Last MySQL binlog file offset %lu %lu, file name %s\n", "InnoDB: Last MySQL binlog file position %lu %lu, file name %s\n",
mach_read_from_4(sys_header + TRX_SYS_MYSQL_LOG_INFO mach_read_from_4(sys_header + TRX_SYS_MYSQL_LOG_INFO
+ TRX_SYS_MYSQL_LOG_OFFSET_HIGH), + TRX_SYS_MYSQL_LOG_OFFSET_HIGH),
mach_read_from_4(sys_header + TRX_SYS_MYSQL_LOG_INFO mach_read_from_4(sys_header + TRX_SYS_MYSQL_LOG_INFO

View file

@ -71,6 +71,9 @@ trx_create(
trx->type = TRX_USER; trx->type = TRX_USER;
trx->conc_state = TRX_NOT_STARTED; trx->conc_state = TRX_NOT_STARTED;
trx->check_foreigns = TRUE;
trx->check_unique_secondary = TRUE;
trx->dict_operation = FALSE; trx->dict_operation = FALSE;
trx->mysql_thd = NULL; trx->mysql_thd = NULL;
@ -113,6 +116,7 @@ trx_create(
trx->lock_heap = mem_heap_create_in_buffer(256); trx->lock_heap = mem_heap_create_in_buffer(256);
UT_LIST_INIT(trx->trx_locks); UT_LIST_INIT(trx->trx_locks);
trx->has_dict_foreign_key_check_lock = FALSE;
trx->has_search_latch = FALSE; trx->has_search_latch = FALSE;
trx->search_latch_timeout = BTR_SEA_TIMEOUT; trx->search_latch_timeout = BTR_SEA_TIMEOUT;
@ -703,8 +707,7 @@ trx_commit_off_kernel(
/*-------------------------------------*/ /*-------------------------------------*/
/* Only in some performance tests the variable srv_flush.. /* Most MySQL users run with srv_flush.. set to FALSE: */
will be set to FALSE: */
if (srv_flush_log_at_trx_commit) { if (srv_flush_log_at_trx_commit) {

View file

@ -698,7 +698,7 @@ static const char *default_options[]=
"port","socket","compress","password","pipe", "timeout", "user", "port","socket","compress","password","pipe", "timeout", "user",
"init-command", "host", "database", "debug", "return-found-rows", "init-command", "host", "database", "debug", "return-found-rows",
"ssl-key" ,"ssl-cert" ,"ssl-ca" ,"ssl-capath", "ssl-key" ,"ssl-cert" ,"ssl-ca" ,"ssl-capath",
"character-set-dir", "default-character-set", "interactive-timeout", "character-sets-dir", "default-character-set", "interactive-timeout",
"connect-timeout", "local-infile", "disable-local-infile", "connect-timeout", "local-infile", "disable-local-infile",
"replication-probe", "enable-reads-from-master", "repl-parse-query", "replication-probe", "enable-reads-from-master", "repl-parse-query",
"ssl-cipher", "ssl-cipher",

View file

@ -264,7 +264,8 @@ FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, byte *query,
ftbe->weight=1; ftbe->weight=1;
ftbe->flags=FTB_FLAG_YES; ftbe->flags=FTB_FLAG_YES;
ftbe->nos=1; ftbe->nos=1;
ftbe->quot=ftbe->up=0; ftbe->quot=0;
ftbe->up=0;
ftbe->ythresh=ftbe->yweaks=0; ftbe->ythresh=ftbe->yweaks=0;
ftbe->docid[0]=ftbe->docid[1]=HA_POS_ERROR; ftbe->docid[0]=ftbe->docid[1]=HA_POS_ERROR;
ftb->root=ftbe; ftb->root=ftbe;
@ -288,12 +289,14 @@ int _ftb_strstr(const byte *s0, const byte *e0,
while (s0 < e0) while (s0 < e0)
{ {
while (s0 < e0 && cs->to_upper[*s0++] != cs->to_upper[*s1]) while (s0 < e0 && cs->to_upper[(uint) (uchar) *s0++] !=
cs->to_upper[(uint) (uchar) *s1])
/* no-op */; /* no-op */;
if (s0 >= e0) if (s0 >= e0)
return 0; return 0;
p=s1+1; p=s1+1;
while (s0 < e0 && p < e1 && cs->to_upper[*s0++] == cs->to_upper[*p++]) while (s0 < e0 && p < e1 && cs->to_upper[(uint) (uchar) *s0++] ==
cs->to_upper[(uint) (uchar) *p++])
/* no-op */; /* no-op */;
if (p >= e1) if (p >= e1)
return 1; return 1;

View file

@ -240,7 +240,6 @@ static struct option long_options[] =
{"force", no_argument, 0, 'f'}, {"force", no_argument, 0, 'f'},
{"join", required_argument, 0, 'j'}, {"join", required_argument, 0, 'j'},
{"help", no_argument, 0, '?'}, {"help", no_argument, 0, '?'},
{"packlength",required_argument, 0, 'p'},
{"silent", no_argument, 0, 's'}, {"silent", no_argument, 0, 's'},
{"tmpdir", required_argument, 0, 'T'}, {"tmpdir", required_argument, 0, 'T'},
{"test", no_argument, 0, 't'}, {"test", no_argument, 0, 't'},
@ -252,7 +251,7 @@ static struct option long_options[] =
static void print_version(void) static void print_version(void)
{ {
printf("%s Ver 1.12 for %s on %s\n",my_progname,SYSTEM_TYPE,MACHINE_TYPE); printf("%s Ver 1.13 for %s on %s\n",my_progname,SYSTEM_TYPE,MACHINE_TYPE);
} }
static void usage(void) static void usage(void)

View file

@ -874,6 +874,7 @@ start_slave()
--report-host=127.0.0.1 --report-user=root \ --report-host=127.0.0.1 --report-user=root \
--report-port=$slave_port \ --report-port=$slave_port \
--master-retry-count=5 \ --master-retry-count=5 \
-O slave_net_timeout=10 \
$SMALL_SERVER \ $SMALL_SERVER \
$EXTRA_SLAVE_OPT $EXTRA_SLAVE_MYSQLD_OPT" $EXTRA_SLAVE_OPT $EXTRA_SLAVE_MYSQLD_OPT"
CUR_MYERR=$slave_err CUR_MYERR=$slave_err

View file

@ -0,0 +1,48 @@
drop table if exists t1;
select IF(0,"ERROR","this"),IF(1,"is","ERROR"),IF(NULL,"ERROR","a"),IF(1,2,3)|0,IF(1,2.0,3.0)+0 ;
IF(0,"ERROR","this") IF(1,"is","ERROR") IF(NULL,"ERROR","a") IF(1,2,3)|0 IF(1,2.0,3.0)+0
this is a 2 2.0
CREATE TABLE t1 (st varchar(255) NOT NULL, u int(11) NOT NULL) TYPE=MyISAM;
INSERT INTO t1 VALUES ('a',1),('A',1),('aa',1),('AA',1),('a',1),('aaa',0),('BBB',0);
select if(1,st,st) s from t1 order by s;
s
a
A
a
aa
AA
aaa
BBB
select if(u=1,st,st) s from t1 order by s;
s
a
A
a
aa
AA
aaa
BBB
select if(u=1,binary st,st) s from t1 order by s;
s
A
AA
BBB
a
a
aa
aaa
select if(u=1,st,binary st) s from t1 where st like "%a%" order by s;
s
A
AA
a
a
aa
aaa
drop table t1;
create table t1 (num double(12,2));
insert into t1 values (144.54);
select sum(if(num is null,0.00,num)) from t1;
sum(if(num is null,0.00,num))
144.54
drop table t1;

View file

@ -28,9 +28,6 @@ select "aba" regexp concat("^","a");
select !0,NOT 0=1,!(0=0),1 AND 1,1 && 0,0 OR 1,1 || NULL, 1=1 or 1=1 and 1=0; select !0,NOT 0=1,!(0=0),1 AND 1,1 && 0,0 OR 1,1 || NULL, 1=1 or 1=1 and 1=0;
!0 NOT 0=1 !(0=0) 1 AND 1 1 && 0 0 OR 1 1 || NULL 1=1 or 1=1 and 1=0 !0 NOT 0=1 !(0=0) 1 AND 1 1 && 0 0 OR 1 1 || NULL 1=1 or 1=1 and 1=0
1 1 0 1 0 1 1 1 1 1 0 1 0 1 1 1
select IF(0,"ERROR","this"),IF(1,"is","ERROR"),IF(NULL,"ERROR","a"),IF(1,2,3)|0,IF(1,2.0,3.0)+0 ;
IF(0,"ERROR","this") IF(1,"is","ERROR") IF(NULL,"ERROR","a") IF(1,2,3)|0 IF(1,2.0,3.0)+0
this is a 2 2.0
select 2 between 1 and 3, "monty" between "max" and "my",2=2 and "monty" between "max" and "my" and 3=3; select 2 between 1 and 3, "monty" between "max" and "my",2=2 and "monty" between "max" and "my" and 3=3;
2 between 1 and 3 "monty" between "max" and "my" 2=2 and "monty" between "max" and "my" and 3=3 2 between 1 and 3 "monty" between "max" and "my" 2=2 and "monty" between "max" and "my" and 3=3
1 1 1 1 1 1
@ -52,10 +49,3 @@ select 1 and 2 between 2 and 10, 2 between 2 and 10 and 1;
select 1 and 0 or 2, 2 or 1 and 0; select 1 and 0 or 2, 2 or 1 and 0;
1 and 0 or 2 2 or 1 and 0 1 and 0 or 2 2 or 1 and 0
1 1 1 1
drop table if exists t1;
create table t1 (num double(12,2));
insert into t1 values (144.54);
select sum(if(num is null,0.00,num)) from t1;
sum(if(num is null,0.00,num))
144.54
drop table t1;

View file

@ -1,6 +0,0 @@
select last_insert_id(345);
last_insert_id(345)
345
select @@IDENTITY,last_insert_id();
@@IDENTITY last_insert_id()
345 345

View file

@ -170,7 +170,7 @@ show keys from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 0 PRIMARY 1 id A 87 NULL NULL BTREE t1 0 PRIMARY 1 id A 87 NULL NULL BTREE
t1 1 parent_id 1 parent_id A 43 NULL NULL BTREE t1 1 parent_id 1 parent_id A 43 NULL NULL BTREE
t1 1 level 1 level A 8 NULL NULL BTREE t1 1 level 1 level A 6 NULL NULL BTREE
drop table t1; drop table t1;
CREATE TABLE t1 ( CREATE TABLE t1 (
gesuchnr int(11) DEFAULT '0' NOT NULL, gesuchnr int(11) DEFAULT '0' NOT NULL,

View file

@ -37,6 +37,9 @@ drop table t1;
show variables like "wait_timeout%"; show variables like "wait_timeout%";
Variable_name Value Variable_name Value
wait_timeout 28800 wait_timeout 28800
show variables like "WAIT_timeout%";
Variable_name Value
wait_timeout 28800
show variables like "this_doesn't_exists%"; show variables like "this_doesn't_exists%";
Variable_name Value Variable_name Value
show table status from test like "this_doesn't_exists%"; show table status from test like "this_doesn't_exists%";

View file

@ -44,3 +44,17 @@ c_id c_name c_country
1 Bozo USA 1 Bozo USA
4 Mr. Floppy GB 4 Mr. Floppy GB
drop table t1; drop table t1;
select @@VERSION=version();
@@VERSION=version()
1
select last_insert_id(345);
last_insert_id(345)
345
select @@IDENTITY,last_insert_id();
@@IDENTITY last_insert_id()
345 345
select @@identity;
@@IDENTITY
345
select @@unknown_variable;
Unknown system variable 'unknown_variable'

30
mysql-test/t/func_if.test Normal file
View file

@ -0,0 +1,30 @@
#
# Init section
#
drop table if exists t1;
#
# Simple IF tests
#
select IF(0,"ERROR","this"),IF(1,"is","ERROR"),IF(NULL,"ERROR","a"),IF(1,2,3)|0,IF(1,2.0,3.0)+0 ;
#
# Test of IF and case-sensitiveness
#
CREATE TABLE t1 (st varchar(255) NOT NULL, u int(11) NOT NULL) TYPE=MyISAM;
INSERT INTO t1 VALUES ('a',1),('A',1),('aa',1),('AA',1),('a',1),('aaa',0),('BBB',0);
select if(1,st,st) s from t1 order by s;
select if(u=1,st,st) s from t1 order by s;
select if(u=1,binary st,st) s from t1 order by s;
select if(u=1,st,binary st) s from t1 where st like "%a%" order by s;
drop table t1;
#
# Problem with IF()
#
create table t1 (num double(12,2));
insert into t1 values (144.54);
select sum(if(num is null,0.00,num)) from t1;
drop table t1;

View file

@ -11,7 +11,6 @@ select 'abc' like '%c','abcabc' like '%c', "ab" like "", "ab" like "a", "ab" li
select "Det här är svenska" regexp "h[[:alpha:]]+r", "aba" regexp "^(a|b)*$"; select "Det här är svenska" regexp "h[[:alpha:]]+r", "aba" regexp "^(a|b)*$";
select "aba" regexp concat("^","a"); select "aba" regexp concat("^","a");
select !0,NOT 0=1,!(0=0),1 AND 1,1 && 0,0 OR 1,1 || NULL, 1=1 or 1=1 and 1=0; select !0,NOT 0=1,!(0=0),1 AND 1,1 && 0,0 OR 1,1 || NULL, 1=1 or 1=1 and 1=0;
select IF(0,"ERROR","this"),IF(1,"is","ERROR"),IF(NULL,"ERROR","a"),IF(1,2,3)|0,IF(1,2.0,3.0)+0 ;
select 2 between 1 and 3, "monty" between "max" and "my",2=2 and "monty" between "max" and "my" and 3=3; select 2 between 1 and 3, "monty" between "max" and "my",2=2 and "monty" between "max" and "my" and 3=3;
select 'b' between 'a' and 'c', 'B' between 'a' and 'c'; select 'b' between 'a' and 'c', 'B' between 'a' and 'c';
select 2 in (3,2,5,9,5,1),"monty" in ("david","monty","allan"), 1.2 in (1.4,1.2,1.0); select 2 in (3,2,5,9,5,1),"monty" in ("david","monty","allan"), 1.2 in (1.4,1.2,1.0);
@ -24,13 +23,3 @@ select -1.49 or -1.49,0.6 or 0.6;
select 5 between 0 and 10 between 0 and 1,(5 between 0 and 10) between 0 and 1; select 5 between 0 and 10 between 0 and 1,(5 between 0 and 10) between 0 and 1;
select 1 and 2 between 2 and 10, 2 between 2 and 10 and 1; select 1 and 2 between 2 and 10, 2 between 2 and 10 and 1;
select 1 and 0 or 2, 2 or 1 and 0; select 1 and 0 or 2, 2 or 1 and 0;
#
# Problem with IF()
#
drop table if exists t1;
create table t1 (num double(12,2));
insert into t1 values (144.54);
select sum(if(num is null,0.00,num)) from t1;
drop table t1;

View file

@ -1,2 +0,0 @@
select last_insert_id(345);
select @@IDENTITY,last_insert_id();

View file

@ -20,6 +20,7 @@ drop table t1;
#show variables; #show variables;
show variables like "wait_timeout%"; show variables like "wait_timeout%";
show variables like "WAIT_timeout%";
show variables like "this_doesn't_exists%"; show variables like "this_doesn't_exists%";
show table status from test like "this_doesn't_exists%"; show table status from test like "this_doesn't_exists%";
show databases; show databases;

View file

@ -27,3 +27,14 @@ SELECT * FROM t1 WHERE c_id=@min_cid OR c_id=@max_cid OR c_id=666;
ALTER TABLE t1 DROP PRIMARY KEY; ALTER TABLE t1 DROP PRIMARY KEY;
select * from t1 where c_id=@min_cid OR c_id=@max_cid; select * from t1 where c_id=@min_cid OR c_id=@max_cid;
drop table t1; drop table t1;
#
# Test system variables
#
select @@VERSION=version();
select last_insert_id(345);
select @@IDENTITY,last_insert_id();
select @@identity;
--error 1193
select @@unknown_variable;

View file

@ -410,9 +410,23 @@ int my_pthread_cond_init(pthread_cond_t *mp, const pthread_condattr_t *attr)
#endif #endif
/* Change functions on HP to work according to POSIX */
#ifdef HAVE_BROKEN_PTHREAD_COND_TIMEDWAIT
#undef pthread_cond_timedwait
int my_pthread_cond_timedwait(pthread_cond_t *cond,
pthread_mutex_t *mutex,
struct timespec *abstime)
{
int error=pthread_cond_timedwait(cond,mutex,abstime);
return error == EAGAIN ? ETIMEDOUT : error;
}
#endif /* HAVE_BROKEN_PTHREAD_COND_TIMEDWAIT */
/* /*
** Emulate SOLARIS style calls, not because it's better, but just to make the Emulate SOLARIS style calls, not because it's better, but just to make the
** usage of getbostbyname_r simpler. usage of getbostbyname_r simpler.
*/ */
#if !defined(my_gethostbyname_r) && defined(HAVE_GETHOSTBYNAME_R) #if !defined(my_gethostbyname_r) && defined(HAVE_GETHOSTBYNAME_R)

View file

@ -105,7 +105,7 @@ static long thread_id=0;
my_bool my_thread_init(void) my_bool my_thread_init(void)
{ {
struct st_my_thread_var *tmp; struct st_my_thread_var *tmp;
#ifdef EXTRA_DEBUG #ifdef EXTRA_DEBUG_THREADS
fprintf(stderr,"my_thread_init(): thread_id=%ld\n",pthread_self()); fprintf(stderr,"my_thread_init(): thread_id=%ld\n",pthread_self());
#endif #endif
#if !defined(__WIN__) || defined(USE_TLS) || ! defined(SAFE_MUTEX) #if !defined(__WIN__) || defined(USE_TLS) || ! defined(SAFE_MUTEX)
@ -152,7 +152,7 @@ end:
void my_thread_end(void) void my_thread_end(void)
{ {
struct st_my_thread_var *tmp=my_thread_var; struct st_my_thread_var *tmp=my_thread_var;
#ifdef EXTRA_DEBUG #ifdef EXTRA_DEBUG_THREADS
fprintf(stderr,"my_thread_end(): tmp=%p,thread_id=%ld\n", fprintf(stderr,"my_thread_end(): tmp=%p,thread_id=%ld\n",
tmp,pthread_self()); tmp,pthread_self());
#endif #endif

View file

@ -29,7 +29,7 @@ columns_in_order_by=+64 # number of columns in order by
comment_#=yes # # as comment comment_#=yes # # as comment
comment_--=yes # -- as comment (ANSI) comment_--=yes # -- as comment (ANSI)
comment_/**/=yes # /* */ as comment comment_/**/=yes # /* */ as comment
comment_//=no # // as comment (ANSI) comment_//=no # // as comment
compute=no # Compute compute=no # Compute
connections=101 # Simultaneous connections (installation default) connections=101 # Simultaneous connections (installation default)
constraint_check=no # Column constraints constraint_check=no # Column constraints
@ -62,6 +62,7 @@ except=no # except
except_all=no # except all except_all=no # except all
except_all_incompat=no # except all (incompatible lists) except_all_incompat=no # except all (incompatible lists)
except_incompat=no # except (incompatible lists) except_incompat=no # except (incompatible lists)
field_name_case=yes # case independent field names
float_int_expr=yes # mixing of integer and float in expression float_int_expr=yes # mixing of integer and float in expression
foreign_key=no # foreign keys foreign_key=no # foreign keys
foreign_key_syntax=yes # foreign key syntax foreign_key_syntax=yes # foreign key syntax
@ -228,10 +229,10 @@ func_odbc_timestampdiff=no # Function TIMESTAMPDIFF
func_odbc_truncate=yes # Function TRUNCATE func_odbc_truncate=yes # Function TRUNCATE
func_odbc_ucase=yes # Function UCASE func_odbc_ucase=yes # Function UCASE
func_odbc_user()=yes # Function USER() func_odbc_user()=yes # Function USER()
func_odbc_week=yes # Function WEEK func_odbc_week=error # Function WEEK
func_odbc_year=yes # Function YEAR func_odbc_year=yes # Function YEAR
func_sql_+=yes # Function +, -, * and / func_sql_+=yes # Function +, -, * and /
func_sql_bit_length=no # Function BIT_LENGTH func_sql_bit_length=yes # Function BIT_LENGTH
func_sql_cast=no # Function CAST func_sql_cast=no # Function CAST
func_sql_char_length=error # Function CHAR_LENGTH func_sql_char_length=error # Function CHAR_LENGTH
func_sql_char_length(constant)=yes # Function CHAR_LENGTH(constant) func_sql_char_length(constant)=yes # Function CHAR_LENGTH(constant)
@ -299,13 +300,14 @@ group_func_sql_min_str=yes # Group function MIN on strings
group_func_sql_some=no # Group function SOME group_func_sql_some=no # Group function SOME
group_func_sql_sum=yes # Group function SUM group_func_sql_sum=yes # Group function SUM
group_functions=yes # Group functions group_functions=yes # Group functions
group_many_distinct_functions=yes # Group functions with several distinct
group_on_unused=yes # Group on unused column group_on_unused=yes # Group on unused column
has_true_false=no # TRUE and FALSE has_true_false=no # TRUE and FALSE
having=yes # Having having=yes # Having
having_with_alias=yes # Having on alias having_with_alias=yes # Having on alias
having_with_group=yes # Having with group function having_with_group=yes # Having with group function
hex_numbers=yes # hex numbers (0x41) hex_numbers=yes # hex numbers (0x41)
hex_strings=no # hex strings (x'1ace') hex_strings=yes # hex strings (x'1ace')
ignore_end_space=yes # Ignore end space in compare ignore_end_space=yes # Ignore end space in compare
index_in_create=yes # index in create table index_in_create=yes # index in create table
index_namespace=yes # different namespace for index index_namespace=yes # different namespace for index
@ -319,7 +321,7 @@ intersect=no # intersect
intersect_all=no # intersect all intersect_all=no # intersect all
intersect_all_incompat=no # intersect all (incompatible lists) intersect_all_incompat=no # intersect all (incompatible lists)
intersect_incompat=no # intersect (incompatible lists) intersect_incompat=no # intersect (incompatible lists)
join_tables=63 # tables in join join_tables=31 # tables in join
left_outer_join=yes # left outer join left_outer_join=yes # left outer join
left_outer_join_using=yes # left outer join using left_outer_join_using=yes # left outer join using
like_with_column=yes # column LIKE column like_with_column=yes # column LIKE column
@ -331,7 +333,7 @@ max_char_size=255 # max char() size
max_column_name=64 # column name length max_column_name=64 # column name length
max_columns=3398 # Columns in table max_columns=3398 # Columns in table
max_conditions=85660 # OR and AND in WHERE max_conditions=85660 # OR and AND in WHERE
max_expressions=1837 # simple expressions max_expressions=856 # simple expressions
max_index=32 # max index max_index=32 # max index
max_index_length=500 # index length max_index_length=500 # index length
max_index_name=64 # index name length max_index_name=64 # index name length
@ -341,7 +343,7 @@ max_index_varchar_part_length=255 # index varchar part length
max_row_length=65534 # max table row length (without blobs) max_row_length=65534 # max table row length (without blobs)
max_row_length_with_null=65502 # table row length with nulls (without blobs) max_row_length_with_null=65502 # table row length with nulls (without blobs)
max_select_alias_name=+512 # select alias name length max_select_alias_name=+512 # select alias name length
max_stack_expression=1837 # stacked expressions max_stack_expression=856 # stacked expressions
max_table_alias_name=+512 # table alias name length max_table_alias_name=+512 # table alias name length
max_table_name=64 # table name length max_table_name=64 # table name length
max_text_size=1048543 # max text or blob size max_text_size=1048543 # max text or blob size
@ -353,8 +355,8 @@ minus_neg=yes # Calculate 1--1
multi_drop=yes # many tables to drop table multi_drop=yes # many tables to drop table
multi_null_in_unique=yes # null in unique index multi_null_in_unique=yes # null in unique index
multi_strings=yes # Multiple line strings multi_strings=yes # Multiple line strings
multi_table_delete=no # DELETE FROM table1,table2... multi_table_delete=yes # DELETE FROM table1,table2...
multi_table_update=no # Update with many tables multi_table_update=yes # Update with many tables
natural_join=yes # natural join natural_join=yes # natural join
natural_join_incompat=yes # natural join (incompatible lists) natural_join_incompat=yes # natural join (incompatible lists)
natural_left_outer_join=yes # natural left outer join natural_left_outer_join=yes # natural left outer join
@ -365,7 +367,7 @@ null_in_unique=yes # null in unique index
null_num_expr=yes # Is 1+NULL = NULL null_num_expr=yes # Is 1+NULL = NULL
nulls_in_unique=yes # null combination in unique index nulls_in_unique=yes # null combination in unique index
odbc_left_outer_join=yes # left outer join odbc style odbc_left_outer_join=yes # left outer join odbc style
operating_system=Linux 2.2.13-SMP alpha # crash-me tested on operating_system=Linux 2.4.16-64GB-SMP i686 # crash-me tested on
order_by=yes # Order by order_by=yes # Order by
order_by_alias=yes # Order by alias order_by_alias=yes # Order by alias
order_by_function=yes # Order by function order_by_function=yes # Order by function
@ -385,7 +387,7 @@ quote_with_"=yes # Allows ' and " as string markers
remember_end_space=no # Remembers end space in char() remember_end_space=no # Remembers end space in char()
remember_end_space_varchar=no # Remembers end space in varchar() remember_end_space_varchar=no # Remembers end space in varchar()
rename_table=yes # rename table rename_table=yes # rename table
repeat_string_size=1047552 # return string size from function repeat_string_size=1048576 # return string size from function
right_outer_join=yes # right outer join right_outer_join=yes # right outer join
rowid=auto_increment # Type for row id rowid=auto_increment # Type for row id
select_constants=yes # Select constants select_constants=yes # Select constants
@ -394,7 +396,7 @@ select_limit2=yes # SELECT with LIMIT #,#
select_string_size=1048565 # constant string size in SELECT select_string_size=1048565 # constant string size in SELECT
select_table_update=no # Update with sub select select_table_update=no # Update with sub select
select_without_from=yes # SELECT without FROM select_without_from=yes # SELECT without FROM
server_version=MySQL 3.23.39 debug # server version server_version=MySQL 4.0.2 alpha debug # server version
simple_joins=yes # ANSI SQL simple joins simple_joins=yes # ANSI SQL simple joins
storage_of_float=round # Storage of float values storage_of_float=round # Storage of float values
subqueries=no # subqueries subqueries=no # subqueries
@ -402,7 +404,7 @@ table_alias=yes # Table alias
table_name_case=no # case independent table names table_name_case=no # case independent table names
table_wildcard=yes # Select table_name.* table_wildcard=yes # Select table_name.*
temporary_table=yes # temporary tables temporary_table=yes # temporary tables
transactions=yes # constant string size in where transactions=yes # transactions
truncate_table=yes # truncate truncate_table=yes # truncate
type_extra_abstime=no # Type abstime type_extra_abstime=no # Type abstime
type_extra_bfile=no # Type bfile type_extra_bfile=no # Type bfile
@ -512,12 +514,11 @@ type_sql_time=yes # Type time
type_sql_timestamp=yes # Type timestamp type_sql_timestamp=yes # Type timestamp
type_sql_timestamp_with_time_zone=no # Type timestamp with time zone type_sql_timestamp_with_time_zone=no # Type timestamp with time zone
type_sql_varchar(1_arg)=yes # Type varchar(1 arg) type_sql_varchar(1_arg)=yes # Type varchar(1 arg)
union=no # union union=yes # union
union_all=no # union all union_all=yes # union all
union_all_incompat=no # union all (incompatible lists) union_all_incompat=yes # union all (incompatible lists)
union_incompat=no # union (incompatible lists) union_incompat=yes # union (incompatible lists)
unique_in_create=yes # unique in create table unique_in_create=yes # unique in create table
unique_null_in_create=yes # unique null in create unique_null_in_create=yes # unique null in create
user_comment=Alpha DS20 2x500 MHz, 2G memory, key_buffer=16M; ccc + cxx # comment
views=no # views views=no # views
where_string_size=1048539 # constant string size in where where_string_size=1048539 # constant string size in where

View file

@ -490,8 +490,12 @@ Item_func_if::fix_length_and_dec()
decimals=max(args[1]->decimals,args[2]->decimals); decimals=max(args[1]->decimals,args[2]->decimals);
enum Item_result arg1_type=args[1]->result_type(); enum Item_result arg1_type=args[1]->result_type();
enum Item_result arg2_type=args[2]->result_type(); enum Item_result arg2_type=args[2]->result_type();
binary=1;
if (arg1_type == STRING_RESULT || arg2_type == STRING_RESULT) if (arg1_type == STRING_RESULT || arg2_type == STRING_RESULT)
{
cached_result_type = STRING_RESULT; cached_result_type = STRING_RESULT;
binary=args[1]->binary | args[2]->binary;
}
else if (arg1_type == REAL_RESULT || arg2_type == REAL_RESULT) else if (arg1_type == REAL_RESULT || arg2_type == REAL_RESULT)
cached_result_type = REAL_RESULT; cached_result_type = REAL_RESULT;
else else

View file

@ -59,7 +59,7 @@ bool
Item_func::fix_fields(THD *thd,TABLE_LIST *tables) Item_func::fix_fields(THD *thd,TABLE_LIST *tables)
{ {
Item **arg,**arg_end; Item **arg,**arg_end;
char buff[sizeof(double)]; // Max argument in function char buff[STACK_BUFF_ALLOC]; // Max argument in function
binary=0; binary=0;
used_tables_cache=0; used_tables_cache=0;
const_item_cache=1; const_item_cache=1;
@ -1087,7 +1087,7 @@ bool
udf_handler::fix_fields(THD *thd,TABLE_LIST *tables,Item_result_field *func, udf_handler::fix_fields(THD *thd,TABLE_LIST *tables,Item_result_field *func,
uint arg_count, Item **arguments) uint arg_count, Item **arguments)
{ {
char buff[sizeof(double)]; // Max argument in function char buff[STACK_BUFF_ALLOC]; // Max argument in function
DBUG_ENTER("Item_udf_func::fix_fields"); DBUG_ENTER("Item_udf_func::fix_fields");
if (thd) if (thd)
@ -1607,7 +1607,7 @@ longlong Item_func_get_lock::val_int()
set_timespec(abstime,timeout); set_timespec(abstime,timeout);
while (!thd->killed && while (!thd->killed &&
(error=pthread_cond_timedwait(&ull->cond,&LOCK_user_locks,&abstime)) (error=pthread_cond_timedwait(&ull->cond,&LOCK_user_locks,&abstime))
!= ETIME && error != ETIMEDOUT && ull->locked) ; != ETIME && error != ETIMEDOUT && error != EINVAL && ull->locked) ;
if (thd->killed) if (thd->killed)
error=EINTR; // Return NULL error=EINTR; // Return NULL
if (ull->locked) if (ull->locked)
@ -2248,9 +2248,12 @@ double Item_func_match::val()
Item *get_system_var(LEX_STRING name) Item *get_system_var(LEX_STRING name)
{ {
if (!strcmp(name.str,"IDENTITY")) if (!my_strcasecmp(name.str,"IDENTITY"))
return new Item_int((char*) "@@IDENTITY", return new Item_int((char*) "@@IDENTITY",
current_thd->insert_id(),21); current_thd->insert_id(),21);
my_error(ER_UNKNOWN_SYSTEM_VARIABLE,MYF(0),name); if (!my_strcasecmp(name.str,"VERSION"))
return new Item_string("@@VERSION",server_version,
(uint) strlen(server_version));
net_printf(&current_thd->net, ER_UNKNOWN_SYSTEM_VARIABLE, name.str);
return 0; return 0;
} }

View file

@ -75,22 +75,30 @@ char* query_table_status(THD *thd,const char *db,const char *table_name);
#define MAX_FIELDS_BEFORE_HASH 32 #define MAX_FIELDS_BEFORE_HASH 32
#define USER_VARS_HASH_SIZE 16 #define USER_VARS_HASH_SIZE 16
#define STACK_MIN_SIZE 8192 // Abort if less stack during eval. #define STACK_MIN_SIZE 8192 // Abort if less stack during eval.
#define STACK_BUFF_ALLOC 32 // For stack overrun checks
#ifndef MYSQLD_NET_RETRY_COUNT #ifndef MYSQLD_NET_RETRY_COUNT
#define MYSQLD_NET_RETRY_COUNT 10 // Abort read after this many int. #define MYSQLD_NET_RETRY_COUNT 10 // Abort read after this many int.
#endif #endif
#define TEMP_POOL_SIZE 128 #define TEMP_POOL_SIZE 128
/* The following parameters is to decide when to use an extra cache to /*
optimise seeks when reading a big table in sorted order */ The following parameters is to decide when to use an extra cache to
optimise seeks when reading a big table in sorted order
*/
#define MIN_FILE_LENGTH_TO_USE_ROW_CACHE (16L*1024*1024) #define MIN_FILE_LENGTH_TO_USE_ROW_CACHE (16L*1024*1024)
#define MIN_ROWS_TO_USE_TABLE_CACHE 100 #define MIN_ROWS_TO_USE_TABLE_CACHE 100
// The following is used to decide if MySQL should use table scanning /*
// instead of reading with keys. The number says how many evaluation of the The following is used to decide if MySQL should use table scanning
// WHERE clause is comparable to reading one extra row from a table. instead of reading with keys. The number says how many evaluation of the
WHERE clause is comparable to reading one extra row from a table.
*/
#define TIME_FOR_COMPARE 5 // 5 compares == one read #define TIME_FOR_COMPARE 5 // 5 compares == one read
// Number of rows in a reference table when refereed through a not unique key.
// This value is only used when we don't know anything about the key /*
// distribution. Number of rows in a reference table when refereed through a not unique key.
This value is only used when we don't know anything about the key
distribution.
*/
#define MATCHING_ROWS_IN_OTHER_TABLE 10 #define MATCHING_ROWS_IN_OTHER_TABLE 10
/* Don't pack string keys shorter than this (if PACK_KEYS=1 isn't used) */ /* Don't pack string keys shorter than this (if PACK_KEYS=1 isn't used) */

View file

@ -101,6 +101,16 @@ extern "C" { // Because of SCO 3.2V4.2
#endif /* NEED_SYS_SYSLOG_H */ #endif /* NEED_SYS_SYSLOG_H */
int allow_severity = LOG_INFO; int allow_severity = LOG_INFO;
int deny_severity = LOG_WARNING; int deny_severity = LOG_WARNING;
#ifdef __linux__
#define my_fromhost(A) fromhost()
#define my_hosts_access(A) hosts_access()
#define my_eval_client(A) eval_client()
#else
#define my_fromhost(A) fromhost(A)
#define my_hosts_access(A) hosts_access(A)
#define my_eval_client(A) eval_client(A)
#endif
#endif /* HAVE_LIBWRAP */ #endif /* HAVE_LIBWRAP */
#ifdef HAVE_SYS_MMAN_H #ifdef HAVE_SYS_MMAN_H
@ -984,24 +994,22 @@ static void server_init(void)
IPaddr.sin_addr.s_addr = my_bind_addr; IPaddr.sin_addr.s_addr = my_bind_addr;
IPaddr.sin_port = (unsigned short) htons((unsigned short) mysql_port); IPaddr.sin_port = (unsigned short) htons((unsigned short) mysql_port);
(void) setsockopt(ip_sock,SOL_SOCKET,SO_REUSEADDR,(char*)&arg,sizeof(arg)); (void) setsockopt(ip_sock,SOL_SOCKET,SO_REUSEADDR,(char*)&arg,sizeof(arg));
for(;;) if (bind(ip_sock, my_reinterpret_cast(struct sockaddr *) (&IPaddr),
sizeof(IPaddr)) < 0)
{ {
if (bind(ip_sock, my_reinterpret_cast(struct sockaddr *) (&IPaddr),
sizeof(IPaddr)) >= 0)
break;
DBUG_PRINT("error",("Got error: %d from bind",socket_errno)); DBUG_PRINT("error",("Got error: %d from bind",socket_errno));
sql_perror("Can't start server: Bind on TCP/IP port");/* Had a loop here */ sql_perror("Can't start server: Bind on TCP/IP port");
sql_print_error("Do you already have another mysqld server running on port: %d ?",mysql_port); sql_print_error("Do you already have another mysqld server running on port: %d ?",mysql_port);
unireg_abort(1); unireg_abort(1);
} }
if (listen(ip_sock,(int) back_log) < 0) if (listen(ip_sock,(int) back_log) < 0)
{ {
sql_perror("Can't start server: listen() on TCP/IP port");
sql_print_error("Error: listen() on TCP/IP failed with error %d", sql_print_error("Error: listen() on TCP/IP failed with error %d",
socket_errno); socket_errno);
unireg_abort(1); unireg_abort(1);
} }
} }
if (mysqld_chroot) if (mysqld_chroot)
set_root(mysqld_chroot); set_root(mysqld_chroot);
set_user(mysqld_user); // Works also with mysqld_user==NULL set_user(mysqld_user); // Works also with mysqld_user==NULL
@ -2332,7 +2340,6 @@ static void create_new_thread(THD *thd)
if (cached_thread_count > wake_thread) if (cached_thread_count > wake_thread)
{ {
start_cached_thread(thd); start_cached_thread(thd);
(void) pthread_mutex_unlock(&LOCK_thread_count);
} }
else else
{ {
@ -2359,9 +2366,9 @@ static void create_new_thread(THD *thd)
(void) pthread_mutex_unlock(&LOCK_thread_count); (void) pthread_mutex_unlock(&LOCK_thread_count);
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
(void) pthread_mutex_unlock(&LOCK_thread_count);
} }
(void) pthread_mutex_unlock(&LOCK_thread_count);
} }
DBUG_PRINT("info",("Thread created")); DBUG_PRINT("info",("Thread created"));
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
@ -2505,24 +2512,16 @@ pthread_handler_decl(handle_connections_sockets,arg __attribute__((unused)))
struct request_info req; struct request_info req;
signal(SIGCHLD, SIG_DFL); signal(SIGCHLD, SIG_DFL);
request_init(&req, RQ_DAEMON, libwrapName, RQ_FILE, new_sock, NULL); request_init(&req, RQ_DAEMON, libwrapName, RQ_FILE, new_sock, NULL);
#ifndef __linux__ my_fromhost(&req);
fromhost(&req); if (!my_hosts_access(&req))
if (!hosts_access(&req))
{ {
/* /*
This may be stupid but refuse() includes an exit(0) This may be stupid but refuse() includes an exit(0)
which we surely don't want... which we surely don't want...
clean_exit() - same stupid thing ... clean_exit() - same stupid thing ...
*/ */
syslog(deny_severity, "refused connect from %s", eval_client(&req)); syslog(deny_severity, "refused connect from %s",
#else my_eval_client(&req));
fromhost();
if (!hosts_access())
{
syslog(deny_severity, "refused connect from %s", eval_client());
#endif
if (req.sink)
((void (*)(int))req.sink)(req.fd);
/* /*
C++ sucks (the gibberish in front just translates the supplied C++ sucks (the gibberish in front just translates the supplied
@ -2530,7 +2529,10 @@ pthread_handler_decl(handle_connections_sockets,arg __attribute__((unused)))
to a void(*sink)(int) if you omit the cast, the C++ compiler to a void(*sink)(int) if you omit the cast, the C++ compiler
will cry... will cry...
*/ */
(void) shutdown(new_sock,2); // This looks fine to me... if (req.sink)
((void (*)(int))req.sink)(req.fd);
(void) shutdown(new_sock,2);
(void) closesocket(new_sock); (void) closesocket(new_sock);
continue; continue;
} }

View file

@ -203,7 +203,7 @@
"S-Bíťová chyba při zápisu na master", "S-Bíťová chyba při zápisu na master",
"-BŽádný sloupec nemá vytvořen fulltextový index", "-BŽádný sloupec nemá vytvořen fulltextový index",
"Nemohu prov-Bést zadaný příkaz, protože existují aktivní zamčené tabulky nebo aktivní transakce", "Nemohu prov-Bést zadaný příkaz, protože existují aktivní zamčené tabulky nebo aktivní transakce",
"Nezn-Bámá systémová proměnná '%-.64'", "Nezn-Bámá systémová proměnná '%-.64s'",
"Tabulka '%-.64s' je ozna-Bčena jako porušená a měla by být opravena", "Tabulka '%-.64s' je ozna-Bčena jako porušená a měla by být opravena",
"Tabulka '%-.64s' je ozna-Bčena jako porušená a poslední (automatická?) oprava se nezdařila", "Tabulka '%-.64s' je ozna-Bčena jako porušená a poslední (automatická?) oprava se nezdařila",
"Warning: Some non-transactional changed tables couldn't be rolled back", "Warning: Some non-transactional changed tables couldn't be rolled back",

View file

@ -197,7 +197,7 @@
"Netværksfejl ved skrivning til master", "Netværksfejl ved skrivning til master",
"Kan ikke finde en FULLTEXT nøgle som svarer til kolonne listen", "Kan ikke finde en FULLTEXT nøgle som svarer til kolonne listen",
"Kan ikke udføre den givne kommando fordi der findes aktive, låste tabeller eller fordi der udføres en transaktion", "Kan ikke udføre den givne kommando fordi der findes aktive, låste tabeller eller fordi der udføres en transaktion",
"Ukendt systemvariabel '%-.64'", "Ukendt systemvariabel '%-.64s'",
"Tabellen '%-.64s' er markeret med fejl og bør repareres", "Tabellen '%-.64s' er markeret med fejl og bør repareres",
"Tabellen '%-.64s' er markeret med fejl og sidste (automatiske?) REPAIR fejlede", "Tabellen '%-.64s' er markeret med fejl og sidste (automatiske?) REPAIR fejlede",
"Advarsel: Visse data i tabeller der ikke understøtter transaktioner kunne ikke tilbagestilles", "Advarsel: Visse data i tabeller der ikke understøtter transaktioner kunne ikke tilbagestilles",

View file

@ -202,7 +202,7 @@
"Net fout tijdens schrijven naar master", "Net fout tijdens schrijven naar master",
"Kan geen FULLTEXT index vinden passend bij de kolom lijst", "Kan geen FULLTEXT index vinden passend bij de kolom lijst",
"Kan het gegeven commando niet uitvoeren, want u heeft actieve gelockte tabellen of een actieve transactie", "Kan het gegeven commando niet uitvoeren, want u heeft actieve gelockte tabellen of een actieve transactie",
"Onbekende systeem variabele '%-.64'", "Onbekende systeem variabele '%-.64s'",
"Tabel '%-.64s' staat als gecrashed gemarkeerd en dient te worden gerepareerd", "Tabel '%-.64s' staat als gecrashed gemarkeerd en dient te worden gerepareerd",
"Tabel '%-.64s' staat als gecrashed gemarkeerd en de laatste (automatische?) reparatie poging mislukte", "Tabel '%-.64s' staat als gecrashed gemarkeerd en de laatste (automatische?) reparatie poging mislukte",
"Waarschuwing: Roll back mislukt voor sommige buiten transacties gewijzigde tabellen", "Waarschuwing: Roll back mislukt voor sommige buiten transacties gewijzigde tabellen",

View file

@ -194,7 +194,7 @@
"Net error writing to master", "Net error writing to master",
"Can't find FULLTEXT index matching the column list", "Can't find FULLTEXT index matching the column list",
"Can't execute the given command because you have active locked tables or an active transaction", "Can't execute the given command because you have active locked tables or an active transaction",
"Unknown system variable '%-.64'", "Unknown system variable '%-.64s'",
"Table '%-.64s' is marked as crashed and should be repaired", "Table '%-.64s' is marked as crashed and should be repaired",
"Table '%-.64s' is marked as crashed and last (automatic?) repair failed", "Table '%-.64s' is marked as crashed and last (automatic?) repair failed",
"Warning: Some non-transactional changed tables couldn't be rolled back", "Warning: Some non-transactional changed tables couldn't be rolled back",

View file

@ -199,7 +199,7 @@
"Net error writing to master", "Net error writing to master",
"Ei suutnud leida FULLTEXT indeksit, mis kattuks kasutatud tulpadega", "Ei suutnud leida FULLTEXT indeksit, mis kattuks kasutatud tulpadega",
"Ei suuda täita antud käsku kuna on aktiivseid lukke või käimasolev transaktsioon", "Ei suuda täita antud käsku kuna on aktiivseid lukke või käimasolev transaktsioon",
"Tundmatu süsteemne muutuja '%-.64'", "Tundmatu süsteemne muutuja '%-.64s'",
"Tabel '%-.64s' on märgitud vigaseks ja tuleb parandada", "Tabel '%-.64s' on märgitud vigaseks ja tuleb parandada",
"Tabel '%-.64s' on märgitud vigaseks ja viimane (automaatne?) parandus ebaõnnestus", "Tabel '%-.64s' on märgitud vigaseks ja viimane (automaatne?) parandus ebaõnnestus",
"Hoiatus: mõnesid transaktsioone mittetoetavaid tabeleid ei suudetud tagasi kerida", "Hoiatus: mõnesid transaktsioone mittetoetavaid tabeleid ei suudetud tagasi kerida",

View file

@ -194,7 +194,7 @@
"Net error writing to master", "Net error writing to master",
"Can't find FULLTEXT index matching the column list", "Can't find FULLTEXT index matching the column list",
"Can't execute the given command because you have active locked tables or an active transaction", "Can't execute the given command because you have active locked tables or an active transaction",
"Unknown system variable '%-.64'", "Unknown system variable '%-.64s'",
"Table '%-.64s' is marked as crashed and should be repaired", "Table '%-.64s' is marked as crashed and should be repaired",
"Table '%-.64s' is marked as crashed and last (automatic?) repair failed", "Table '%-.64s' is marked as crashed and last (automatic?) repair failed",
"Warning: Some non-transactional changed tables couldn't be rolled back", "Warning: Some non-transactional changed tables couldn't be rolled back",

View file

@ -197,7 +197,7 @@
"Netzfehler beim Schreiben zum Master", "Netzfehler beim Schreiben zum Master",
"Kann keinen FULLTEXT-Index finden der der Spaltenliste entspricht", "Kann keinen FULLTEXT-Index finden der der Spaltenliste entspricht",
"Kann das aktuelle Kommando wegen aktiver Tabellensperre oder aktiver Transaktion nicht ausführen", "Kann das aktuelle Kommando wegen aktiver Tabellensperre oder aktiver Transaktion nicht ausführen",
"Unbekannte System-Variabel '%-.64'", "Unbekannte System-Variabel '%-.64s'",
"Tabelle '%-.64s' ist als defekt makiert und sollte repariert werden", "Tabelle '%-.64s' ist als defekt makiert und sollte repariert werden",
"Tabelle '%-.64s' ist als defekt makiert und der letzte (automatische) Reparaturversuch schlug fehl.", "Tabelle '%-.64s' ist als defekt makiert und der letzte (automatische) Reparaturversuch schlug fehl.",
"Warnung: Das Rollback konnte bei einigen Tabellen, die nicht mittels Transaktionen geändert wurden, nicht ausgeführt werden.", "Warnung: Das Rollback konnte bei einigen Tabellen, die nicht mittels Transaktionen geändert wurden, nicht ausgeführt werden.",

View file

@ -194,7 +194,7 @@
"Net error writing to master", "Net error writing to master",
"Can't find FULLTEXT index matching the column list", "Can't find FULLTEXT index matching the column list",
"Can't execute the given command because you have active locked tables or an active transaction", "Can't execute the given command because you have active locked tables or an active transaction",
"Unknown system variable '%-.64'", "Unknown system variable '%-.64s'",
"Table '%-.64s' is marked as crashed and should be repaired", "Table '%-.64s' is marked as crashed and should be repaired",
"Table '%-.64s' is marked as crashed and last (automatic?) repair failed", "Table '%-.64s' is marked as crashed and last (automatic?) repair failed",
"Warning: Some non-transactional changed tables couldn't be rolled back", "Warning: Some non-transactional changed tables couldn't be rolled back",

View file

@ -196,7 +196,7 @@
"Net error writing to master", "Net error writing to master",
"Can't find FULLTEXT index matching the column list", "Can't find FULLTEXT index matching the column list",
"Can't execute the given command because you have active locked tables or an active transaction", "Can't execute the given command because you have active locked tables or an active transaction",
"Unknown system variable '%-.64'", "Unknown system variable '%-.64s'",
"Table '%-.64s' is marked as crashed and should be repaired", "Table '%-.64s' is marked as crashed and should be repaired",
"Table '%-.64s' is marked as crashed and last (automatic?) repair failed", "Table '%-.64s' is marked as crashed and last (automatic?) repair failed",
"Warning: Some non-transactional changed tables couldn't be rolled back", "Warning: Some non-transactional changed tables couldn't be rolled back",

View file

@ -194,7 +194,7 @@
"Errore di rete durante l'invio al master", "Errore di rete durante l'invio al master",
"Impossibile trovare un indice FULLTEXT che corrisponda all'elenco delle colonne", "Impossibile trovare un indice FULLTEXT che corrisponda all'elenco delle colonne",
"Impossibile eseguire il comando richiesto: tabelle sotto lock o transazione in atto", "Impossibile eseguire il comando richiesto: tabelle sotto lock o transazione in atto",
"Variabile di sistema '%-.64' sconosciuta", "Variabile di sistema '%-.64s' sconosciuta",
"La tabella '%-.64s' e` segnalata come corrotta e deve essere riparata", "La tabella '%-.64s' e` segnalata come corrotta e deve essere riparata",
"La tabella '%-.64s' e` segnalata come corrotta e l'ultima ricostruzione (automatica?) e` fallita", "La tabella '%-.64s' e` segnalata come corrotta e l'ultima ricostruzione (automatica?) e` fallita",
"Attenzione: Alcune delle modifiche alle tabelle non transazionali non possono essere ripristinate (roll back impossibile)", "Attenzione: Alcune delle modifiche alle tabelle non transazionali non possono essere ripristinate (roll back impossibile)",

View file

@ -196,7 +196,7 @@
"Net error writing to master", "Net error writing to master",
"Can't find FULLTEXT index matching the column list", "Can't find FULLTEXT index matching the column list",
"Can't execute the given command because you have active locked tables or an active transaction", "Can't execute the given command because you have active locked tables or an active transaction",
"Unknown system variable '%-.64'", "Unknown system variable '%-.64s'",
"Table '%-.64s' is marked as crashed and should be repaired", "Table '%-.64s' is marked as crashed and should be repaired",
"Table '%-.64s' is marked as crashed and last (automatic?) repair failed", "Table '%-.64s' is marked as crashed and last (automatic?) repair failed",
"Warning: Some non-transactional changed tables couldn't be rolled back", "Warning: Some non-transactional changed tables couldn't be rolled back",

View file

@ -194,7 +194,7 @@
"Net error writing to master", "Net error writing to master",
"Can't find FULLTEXT index matching the column list", "Can't find FULLTEXT index matching the column list",
"Can't execute the given command because you have active locked tables or an active transaction", "Can't execute the given command because you have active locked tables or an active transaction",
"Unknown system variable '%-.64'", "Unknown system variable '%-.64s'",
"Table '%-.64s' is marked as crashed and should be repaired", "Table '%-.64s' is marked as crashed and should be repaired",
"Table '%-.64s' is marked as crashed and last (automatic?) repair failed", "Table '%-.64s' is marked as crashed and last (automatic?) repair failed",
"Warning: Some non-transactional changed tables couldn't be rolled back", "Warning: Some non-transactional changed tables couldn't be rolled back",

View file

@ -196,7 +196,7 @@
"Net error writing to master", "Net error writing to master",
"Can't find FULLTEXT index matching the column list", "Can't find FULLTEXT index matching the column list",
"Can't execute the given command because you have active locked tables or an active transaction", "Can't execute the given command because you have active locked tables or an active transaction",
"Unknown system variable '%-.64'", "Unknown system variable '%-.64s'",
"Table '%-.64s' is marked as crashed and should be repaired", "Table '%-.64s' is marked as crashed and should be repaired",
"Table '%-.64s' is marked as crashed and last (automatic?) repair failed", "Table '%-.64s' is marked as crashed and last (automatic?) repair failed",
"Warning: Some non-transactional changed tables couldn't be rolled back", "Warning: Some non-transactional changed tables couldn't be rolled back",

View file

@ -196,7 +196,7 @@
"Net error writing to master", "Net error writing to master",
"Can't find FULLTEXT index matching the column list", "Can't find FULLTEXT index matching the column list",
"Can't execute the given command because you have active locked tables or an active transaction", "Can't execute the given command because you have active locked tables or an active transaction",
"Unknown system variable '%-.64'", "Unknown system variable '%-.64s'",
"Table '%-.64s' is marked as crashed and should be repaired", "Table '%-.64s' is marked as crashed and should be repaired",
"Table '%-.64s' is marked as crashed and last (automatic?) repair failed", "Table '%-.64s' is marked as crashed and last (automatic?) repair failed",
"Warning: Some non-transactional changed tables couldn't be rolled back", "Warning: Some non-transactional changed tables couldn't be rolled back",

View file

@ -198,7 +198,7 @@
"Net error writing to master", "Net error writing to master",
"Can't find FULLTEXT index matching the column list", "Can't find FULLTEXT index matching the column list",
"Can't execute the given command because you have active locked tables or an active transaction", "Can't execute the given command because you have active locked tables or an active transaction",
"Unknown system variable '%-.64'", "Unknown system variable '%-.64s'",
"Table '%-.64s' is marked as crashed and should be repaired", "Table '%-.64s' is marked as crashed and should be repaired",
"Table '%-.64s' is marked as crashed and last (automatic?) repair failed", "Table '%-.64s' is marked as crashed and last (automatic?) repair failed",
"Warning: Some non-transactional changed tables couldn't be rolled back", "Warning: Some non-transactional changed tables couldn't be rolled back",

View file

@ -194,7 +194,7 @@
"Erro de rede na gravação do 'master'", "Erro de rede na gravação do 'master'",
"Não pode encontrar índice FULLTEXT que combine com a lista de colunas", "Não pode encontrar índice FULLTEXT que combine com a lista de colunas",
"Não pode executar o comando dado porque você tem tabelas ativas travadas ou uma 'transaction' ativa", "Não pode executar o comando dado porque você tem tabelas ativas travadas ou uma 'transaction' ativa",
"Variável de sistema '%-.64' desconhecida", "Variável de sistema '%-.64s' desconhecida",
"Tabela '%-.64s' está marcada como danificada e deve ser reparada", "Tabela '%-.64s' está marcada como danificada e deve ser reparada",
"Tabela '%-.64s' está marcada como danificada e a última reparação (automática?) falhou", "Tabela '%-.64s' está marcada como danificada e a última reparação (automática?) falhou",
"Aviso: Algumas tabelas não-transacionais alteradas não puderam ser reconstituídas ('rolled back')", "Aviso: Algumas tabelas não-transacionais alteradas não puderam ser reconstituídas ('rolled back')",

View file

@ -198,7 +198,7 @@
"Net error writing to master", "Net error writing to master",
"Can't find FULLTEXT index matching the column list", "Can't find FULLTEXT index matching the column list",
"Can't execute the given command because you have active locked tables or an active transaction", "Can't execute the given command because you have active locked tables or an active transaction",
"Unknown system variable '%-.64'", "Unknown system variable '%-.64s'",
"Table '%-.64s' is marked as crashed and should be repaired", "Table '%-.64s' is marked as crashed and should be repaired",
"Table '%-.64s' is marked as crashed and last (automatic?) repair failed", "Table '%-.64s' is marked as crashed and last (automatic?) repair failed",
"Warning: Some non-transactional changed tables couldn't be rolled back", "Warning: Some non-transactional changed tables couldn't be rolled back",

View file

@ -197,7 +197,7 @@
"Сетевая ошибка при писании мастеру", "Сетевая ошибка при писании мастеру",
"FULLTEXT индекс, соответствующий заданному списку столбцов, не найден", "FULLTEXT индекс, соответствующий заданному списку столбцов, не найден",
"Не могу выполнить комманду из-за активных locked таблиц или активной транзакции", "Не могу выполнить комманду из-за активных locked таблиц или активной транзакции",
"Неизвестная системная переменная '%-.64'", "Неизвестная системная переменная '%-.64s'",
"Таблица '%-.64s' помечена как испорченная и должна быть исправлена", "Таблица '%-.64s' помечена как испорченная и должна быть исправлена",
"Таблица '%-.64s' помечена как испорченная и последняя попытка исправления (автоматическая?) не удалась", "Таблица '%-.64s' помечена как испорченная и последняя попытка исправления (автоматическая?) не удалась",
"Предупреждение: некоторые нетранзакционные таблицы не подчиняются ROLLBACK", "Предупреждение: некоторые нетранзакционные таблицы не подчиняются ROLLBACK",

View file

@ -202,7 +202,7 @@
"Net error writing to master", "Net error writing to master",
"Can't find FULLTEXT index matching the column list", "Can't find FULLTEXT index matching the column list",
"Can't execute the given command because you have active locked tables or an active transaction", "Can't execute the given command because you have active locked tables or an active transaction",
"Unknown system variable '%-.64'", "Unknown system variable '%-.64s'",
"Table '%-.64s' is marked as crashed and should be repaired", "Table '%-.64s' is marked as crashed and should be repaired",
"Table '%-.64s' is marked as crashed and last (automatic?) repair failed", "Table '%-.64s' is marked as crashed and last (automatic?) repair failed",
"Warning: Some non-transactional changed tables couldn't be rolled back", "Warning: Some non-transactional changed tables couldn't be rolled back",

View file

@ -195,7 +195,7 @@
"Error de red escribiendo para el master", "Error de red escribiendo para el master",
"No puedo encontrar índice FULLTEXT correspondiendo a la lista de columnas", "No puedo encontrar índice FULLTEXT correspondiendo a la lista de columnas",
"No puedo ejecutar el comando dado porque tienes tablas bloqueadas o una transición activa", "No puedo ejecutar el comando dado porque tienes tablas bloqueadas o una transición activa",
"Desconocida variable de sistema '%-.64'", "Desconocida variable de sistema '%-.64s'",
"Tabla '%-.64s' está marcada como crashed y debe ser reparada", "Tabla '%-.64s' está marcada como crashed y debe ser reparada",
"Tabla '%-.64s' está marcada como crashed y la última reparación (automactica?) falló", "Tabla '%-.64s' está marcada como crashed y la última reparación (automactica?) falló",
"Aviso: Algunas tablas no transancionales no pueden tener rolled back", "Aviso: Algunas tablas no transancionales no pueden tener rolled back",

View file

@ -194,7 +194,7 @@
"Fick nätverksfel vid skrivning till master", "Fick nätverksfel vid skrivning till master",
"Hittar inte ett FULLTEXT index i kolumnlistan", "Hittar inte ett FULLTEXT index i kolumnlistan",
"Kan inte exekvera kommandot emedan du har en låst tabell eller an aktiv transaktion", "Kan inte exekvera kommandot emedan du har en låst tabell eller an aktiv transaktion",
"Okänd system variabel '%-.64'", "Okänd system variabel '%-.64s'",
"Tabell '%-.64s' är crashad och bör repareras med REPAIR TABLE", "Tabell '%-.64s' är crashad och bör repareras med REPAIR TABLE",
"Tabell '%-.64s' är crashad och senast (automatiska?) reparation misslyckades", "Tabell '%-.64s' är crashad och senast (automatiska?) reparation misslyckades",
"Warning: Några icke transaktionella tabeller kunde inte återställas vid ROLLBACK", "Warning: Några icke transaktionella tabeller kunde inte återställas vid ROLLBACK",

View file

@ -199,7 +199,7 @@
"Мережева помилка запису до головного", "Мережева помилка запису до головного",
"Не можу знайти FULLTEXT ╕ндекс, що в╕дпов╕да╓ перел╕ку стовбц╕в", "Не можу знайти FULLTEXT ╕ндекс, що в╕дпов╕да╓ перел╕ку стовбц╕в",
"Не можу виконати подану команду тому, що таблиця заблокована або викону╓ться транзакц╕я", "Не можу виконати подану команду тому, що таблиця заблокована або викону╓ться транзакц╕я",
"疽屢켓皐 譚戇터适 謐┧适 '%-.64'", "疽屢켓皐 譚戇터适 謐┧适 '%-.64s'",
"Таблицю '%-.64s' марковано як з╕псовану та ╖╖ потр╕бно в╕дновити", "Таблицю '%-.64s' марковано як з╕псовану та ╖╖ потр╕бно в╕дновити",
"Таблицю '%-.64s' марковано як з╕псовану та останн╓ (автоматичне?) в╕дновлення не вдалося", "Таблицю '%-.64s' марковано як з╕псовану та останн╓ (автоматичне?) в╕дновлення не вдалося",
"Застереження: Деяк╕ нетранзакц╕йн╕ зм╕ни таблиць не можна буде повернути", "Застереження: Деяк╕ нетранзакц╕йн╕ зм╕ни таблиць не можна буде повернути",

View file

@ -570,21 +570,30 @@ mysqld_show_create(THD *thd, TABLE_LIST *table_list)
{ {
packet->length(0); packet->length(0);
net_store_data(packet,convert, table->table_name); net_store_data(packet,convert, table->table_name);
// a hack - we need to reserve some space for the length before /*
// we know what it is - let's assume that the length of create table A hack - we need to reserve some space for the length before
// statement will fit into 3 bytes ( 16 MB max :-) ) we know what it is - let's assume that the length of create table
statement will fit into 3 bytes ( 16 MB max :-) )
*/
ulong store_len_offset = packet->length(); ulong store_len_offset = packet->length();
packet->length(store_len_offset + 4); packet->length(store_len_offset + 4);
if (store_create_info(thd, table, packet)) if (store_create_info(thd, table, packet))
DBUG_RETURN(-1); DBUG_RETURN(-1);
ulong create_len = packet->length() - store_len_offset - 4; ulong create_len = packet->length() - store_len_offset - 4;
if (create_len > 0x00ffffff) // better readable in HEX ... if (create_len > 0x00ffffff) // better readable in HEX ...
DBUG_RETURN(1); // just in case somebody manages to create a table {
// with *that* much stuff in the definition /*
Just in case somebody manages to create a table
with *that* much stuff in the definition
*/
DBUG_RETURN(1);
}
// now we have to store the length in three bytes, even if it would fit /*
// into fewer, so we cannot use net_store_data() anymore, Now we have to store the length in three bytes, even if it would fit
// and do it ourselves into fewer bytes, so we cannot use net_store_data() anymore,
and do it ourselves
*/
char* p = (char*)packet->ptr() + store_len_offset; char* p = (char*)packet->ptr() + store_len_offset;
*p++ = (char) 253; // The client the length is stored using 3-bytes *p++ = (char) 253; // The client the length is stored using 3-bytes
int3store(p, create_len); int3store(p, create_len);
@ -1148,7 +1157,7 @@ int mysqld_show(THD *thd, const char *wild, show_var_st *variables)
pthread_mutex_lock(&LOCK_status); pthread_mutex_lock(&LOCK_status);
for (i=0; variables[i].name; i++) for (i=0; variables[i].name; i++)
{ {
if (!(wild && wild[0] && wild_compare(variables[i].name,wild))) if (!(wild && wild[0] && wild_case_compare(variables[i].name,wild)))
{ {
packet2.length(0); packet2.length(0);
net_store_data(&packet2,convert,variables[i].name); net_store_data(&packet2,convert,variables[i].name);

View file

@ -40,19 +40,16 @@ extern void sql_element_free(void *ptr);
bool String::real_alloc(uint32 arg_length) bool String::real_alloc(uint32 arg_length)
{ {
arg_length=ALIGN_SIZE(arg_length+1); arg_length=ALIGN_SIZE(arg_length+1);
str_length=0;
if (Alloced_length < arg_length) if (Alloced_length < arg_length)
{ {
free(); free();
if (!(Ptr=(char*) my_malloc(arg_length,MYF(MY_WME)))) if (!(Ptr=(char*) my_malloc(arg_length,MYF(MY_WME))))
{
str_length=0;
return TRUE; return TRUE;
}
Alloced_length=arg_length; Alloced_length=arg_length;
alloced=1; alloced=1;
} }
Ptr[0]=0; Ptr[0]=0;
str_length=0;
return FALSE; return FALSE;
} }

View file

@ -1,18 +1,19 @@
/* Copyright (C) 2000 MySQL AB /* Copyright (C) 2002 MySQL AB
This program is free software; you can redistribute it and/or modify This library is free software; you can redistribute it and/or
it under the terms of the GNU General Public License as published by modify it under the terms of the GNU Library General Public
the Free Software Foundation; either version 2 of the License, or License as published by the Free Software Foundation; either
(at your option) any later version. version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, This library 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
GNU General Public License for more details. Library 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 Library General Public
along with this program; if not, write to the Free Software License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA */
/* File : bfill.c /* File : bfill.c
Author : Richard A. O'Keefe. Author : Richard A. O'Keefe.

View file

@ -1,18 +1,19 @@
/* Copyright (C) 2000 MySQL AB /* Copyright (C) 2002 MySQL AB
This program is free software; you can redistribute it and/or modify This library is free software; you can redistribute it and/or
it under the terms of the GNU General Public License as published by modify it under the terms of the GNU Library General Public
the Free Software Foundation; either version 2 of the License, or License as published by the Free Software Foundation; either
(at your option) any later version. version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, This library 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
GNU General Public License for more details. Library 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 Library General Public
along with this program; if not, write to the Free Software License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA */
/* File : bmove.c /* File : bmove.c
Author : Richard A. O'Keefe. Author : Richard A. O'Keefe.

View file

@ -1,18 +1,19 @@
/* Copyright (C) 2000 MySQL AB /* Copyright (C) 2002 MySQL AB & tommy@valley.ne.jp.
This program is free software; you can redistribute it and/or modify This library is free software; you can redistribute it and/or
it under the terms of the GNU General Public License as published by modify it under the terms of the GNU Library General Public
the Free Software Foundation; either version 2 of the License, or License as published by the Free Software Foundation; either
(at your option) any later version. version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, This library 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
GNU General Public License for more details. Library 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 Library General Public
along with this program; if not, write to the Free Software License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA */
/* This file is for Japanese EUC charset, and created by tommy@valley.ne.jp. /* This file is for Japanese EUC charset, and created by tommy@valley.ne.jp.
*/ */

View file

@ -1,18 +1,19 @@
/* Copyright (C) 2000 MySQL AB /* Copyright (C) 2002 MySQL AB
This program is free software; you can redistribute it and/or modify This library is free software; you can redistribute it and/or
it under the terms of the GNU General Public License as published by modify it under the terms of the GNU Library General Public
the Free Software Foundation; either version 2 of the License, or License as published by the Free Software Foundation; either
(at your option) any later version. version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, This library 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
GNU General Public License for more details. Library 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 Library General Public
along with this program; if not, write to the Free Software License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA */
/* File : strend.c /* File : strend.c
Author : Richard A. O'Keefe. Author : Richard A. O'Keefe.

View file

@ -1,18 +1,19 @@
/* Copyright (C) 2000 MySQL AB /* Copyright (C) 2002 MySQL AB
This program is free software; you can redistribute it and/or modify This library is free software; you can redistribute it and/or
it under the terms of the GNU General Public License as published by modify it under the terms of the GNU Library General Public
the Free Software Foundation; either version 2 of the License, or License as published by the Free Software Foundation; either
(at your option) any later version. version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, This library 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
GNU General Public License for more details. Library 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 Library General Public
along with this program; if not, write to the Free Software License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA */
/* File : strstr.c /* File : strstr.c
Author : Monty Author : Monty

View file

@ -1,18 +1,19 @@
/* Copyright (C) 2000 MySQL AB /* Copyright (C) 2002 MySQL AB
This program is free software; you can redistribute it and/or modify This library is free software; you can redistribute it and/or
it under the terms of the GNU General Public License as published by modify it under the terms of the GNU Library General Public
the Free Software Foundation; either version 2 of the License, or License as published by the Free Software Foundation; either
(at your option) any later version. version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, This library 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
GNU General Public License for more details. Library 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 Library General Public
along with this program; if not, write to the Free Software License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA */
/* File : strxmov.c /* File : strxmov.c
Author : Richard A. O'Keefe. Author : Richard A. O'Keefe.

View file

@ -1,18 +1,19 @@
/* Copyright (C) 2000 MySQL AB /* Copyright (C) 2002 MySQL AB
This program is free software; you can redistribute it and/or modify This library is free software; you can redistribute it and/or
it under the terms of the GNU General Public License as published by modify it under the terms of the GNU Library General Public
the Free Software Foundation; either version 2 of the License, or License as published by the Free Software Foundation; either
(at your option) any later version. version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, This library 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
GNU General Public License for more details. Library 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 Library General Public
along with this program; if not, write to the Free Software License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA */
/* File : strxnmov.c /* File : strxnmov.c
Author : Richard A. O'Keefe. Author : Richard A. O'Keefe.