summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <ndbdev@dl145c.mysql.com>2005-09-13 05:33:11 +0200
committerunknown <ndbdev@dl145c.mysql.com>2005-09-13 05:33:11 +0200
commit0260e3dcc16544d73ae2a3e8996fa97ad5d288dd (patch)
treedc1114386c562d2cbb719f0a1bca93f08a3afefe
parent54e99aa58e826f15da7b8f8c071d02960c37a210 (diff)
parentb50eb4cd42d2d5073afb2af5af8b19c825a9cca1 (diff)
downloadmariadb-git-0260e3dcc16544d73ae2a3e8996fa97ad5d288dd.tar.gz
Merge
configure.in: Auto merged client/mysqltest.c: Auto merged include/my_global.h: Auto merged mysql-test/mysql-test-run.pl: Auto merged sql/sql_parse.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_yacc.yy: Auto merged storage/ndb/src/mgmsrv/MgmtSrvr.cpp: Auto merged storage/ndb/src/ndbapi/SignalSender.cpp: Auto merged sql/sql_table.cc: SCCS merged
-rw-r--r--README65
-rw-r--r--client/mysqltest.c3
-rw-r--r--config/ac-macros/character_sets.m44
-rw-r--r--configure.in102
-rw-r--r--extra/innochecksum.c378
-rw-r--r--include/my_global.h3
-rw-r--r--include/my_pthread.h5
-rw-r--r--include/violite.h4
-rwxr-xr-xmysql-test/mysql-test-run.pl2
-rw-r--r--mysql-test/r/create.result26
-rw-r--r--mysql-test/r/ctype_uca.result110
-rw-r--r--mysql-test/r/innodb.result13
-rw-r--r--mysql-test/r/ndb_autodiscover.result2
-rw-r--r--mysql-test/r/select.result21
-rw-r--r--mysql-test/r/temp_table.result2
-rw-r--r--mysql-test/r/warnings.result4
-rw-r--r--mysql-test/t/create.test12
-rw-r--r--mysql-test/t/ctype_uca.test1
-rw-r--r--mysql-test/t/innodb.test10
-rw-r--r--mysql-test/t/rpl_error_ignored_table.test1
-rw-r--r--mysql-test/t/rpl_flush_tables.test1
-rw-r--r--mysql-test/t/rpl_loaddata_rule_m.test1
-rw-r--r--mysql-test/t/rpl_log.test1
-rw-r--r--mysql-test/t/rpl_max_relay_size.test1
-rw-r--r--mysql-test/t/rpl_multi_query.test1
-rw-r--r--mysql-test/t/rpl_reset_slave.test1
-rw-r--r--mysql-test/t/select.test24
-rw-r--r--mysys/charset-def.c4
-rw-r--r--sql-common/client.c2
-rw-r--r--sql/examples/ha_archive.cc2
-rw-r--r--sql/filesort.cc2
-rw-r--r--sql/item_cmpfunc.cc12
-rw-r--r--sql/net_serv.cc2
-rw-r--r--sql/sql_db.cc6
-rw-r--r--sql/sql_parse.cc2
-rw-r--r--sql/sql_select.cc12
-rw-r--r--sql/sql_table.cc27
-rw-r--r--sql/sql_yacc.yy11
-rw-r--r--storage/ndb/src/mgmsrv/MgmtSrvr.cpp5
-rw-r--r--storage/ndb/src/ndbapi/SignalSender.cpp10
-rw-r--r--strings/ctype-uca.c75
-rw-r--r--vio/vio.c4
-rw-r--r--vio/vio_priv.h2
-rw-r--r--vio/viosocket.c9
-rw-r--r--vio/viossl.c9
45 files changed, 657 insertions, 337 deletions
diff --git a/README b/README
index 29851358765..88cdaaf67d4 100644
--- a/README
+++ b/README
@@ -1,52 +1,35 @@
-This is a release of MySQL, a GPL (free) SQL database server (more
-licence information in the PUBLIC file and in the reference manual).
+This is a release of MySQL, a dual-license SQL database server.
+MySQL is brought to you by the MySQL team at MySQL AB.
-Please read the "Upgrading from..." section in the manual first, if you are
-migrating from older versions of MySQL!
+License information can be found in these files:
+- For GPL (free) distributions, see the COPYING file.
+- For commercial distributions, see the MySQLEULA.txt file.
-The latest information about MySQL can be found at:
-http://www.mysql.com
-To see what it can do take a look at the features section in the
-manual.
+For further information about MySQL or additional documentation, see:
+- The latest information about MySQL: http://www.mysql.com
+- The current MySQL documentation: http:/dev.mysql.com/doc
-For installation instructions see the Installation chapter in the
-manual.
+Some manual sections of special interest:
-For future plans see the TODO appendix in the manual.
+- If you are migrating from an older version of MySQL, please read the
+ "Upgrading from..." section first!
+- To see what MySQL can do, take a look at the features section.
+- For installation instructions, see the Installation chapter.
+- For future plans, see the TODO appendix.
+- For the new features/bugfix history, see the News appendix.
+- For the currently known bugs/misfeatures (known errors) see the problems
+ appendix.
+- For a list of developers and other contributors, see the Credits
+ appendix.
-New features/bug fixes history is in the news appendix in the manual.
-
-For the currently known bugs/misfeatures (known errors) see the bugs
-appendix in the manual.
-
-For examples of SQL and benchmarking information see the bench
-directory.
-
-The manual mentioned above can be found in the Docs directory. The
-manual is available in the following formats: as plain ASCII text in
-Docs/manual.txt, in HTML format in Docs/manual_toc.html, as GNU Info in
-Docs/mysql.info and as PostScript in Docs/manual.ps.
-
-MySQL is brought to you by the MySQL team at MySQL AB
-
-For a list of developers and other contributors, see the Credits appendix
-in the manual.
+A local copy of the MySQL Reference Manual can be found in the Docs
+directory in GNU Info format. You can also browse the manual online or
+download it in any of several formats at the URL given earlier in this
+file.
************************************************************
IMPORTANT:
-Send bug (error) reports, questions and comments to the mailing list
-at mysql@lists.mysql.com
-
-Please use the 'mysqlbug' script when posting bug reports or questions
-about MySQL. mysqlbug will gather some information about your system
-and start your editor with a form in which you can describe your
-problem. Bug reports might be silently ignored by the MySQL
-maintainers if there is not a good reason included in the report as to
-why mysqlbug has not been used. A report that says 'MySQL does not
-work for me. Why?' is not considered a valid bug report.
-
-The mysqlbug script can be found in the 'scripts' directory of the
-distribution, that is '<where-you-installed-mysql>/scripts'.
+Bug or error reports should be sent to http://bugs.mysql.com.
diff --git a/client/mysqltest.c b/client/mysqltest.c
index a01322181e0..0cad29bd8de 100644
--- a/client/mysqltest.c
+++ b/client/mysqltest.c
@@ -2382,7 +2382,8 @@ int read_line(char *buf, int size)
if (feof(cur_file->file))
{
found_eof:
- if (cur_file->file != stdin){
+ if (cur_file->file != stdin)
+ {
my_fclose(cur_file->file, MYF(0));
cur_file->file= 0;
}
diff --git a/config/ac-macros/character_sets.m4 b/config/ac-macros/character_sets.m4
index 3ecc4bb5a03..1ab6e7dd780 100644
--- a/config/ac-macros/character_sets.m4
+++ b/config/ac-macros/character_sets.m4
@@ -343,7 +343,7 @@ case $default_charset in
default_charset_default_collation="ucs2_general_ci"
define(UCSC1, ucs2_general_ci ucs2_bin)
define(UCSC2, ucs2_czech_ci ucs2_danish_ci)
- define(UCSC3, ucs2_estonian_ci ucs2_icelandic_ci)
+ define(UCSC3, ucs2_esperanto_ci ucs2_estonian_ci ucs2_icelandic_ci)
define(UCSC4, ucs2_latvian_ci ucs2_lithuanian_ci)
define(UCSC5, ucs2_persian_ci ucs2_polish_ci ucs2_romanian_ci)
define(UCSC6, ucs2_slovak_ci ucs2_slovenian_ci)
@@ -367,7 +367,7 @@ case $default_charset in
else
define(UTFC1, utf8_general_ci utf8_bin)
define(UTFC2, utf8_czech_ci utf8_danish_ci)
- define(UTFC3, utf8_estonian_ci utf8_icelandic_ci)
+ define(UTFC3, utf8_esperanto_ci utf8_estonian_ci utf8_icelandic_ci)
define(UTFC4, utf8_latvian_ci utf8_lithuanian_ci)
define(UTFC5, utf8_persian_ci utf8_polish_ci utf8_romanian_ci)
define(UTFC6, utf8_slovak_ci utf8_slovenian_ci)
diff --git a/configure.in b/configure.in
index f5b930e7c8b..cba7f0a40e6 100644
--- a/configure.in
+++ b/configure.in
@@ -323,19 +323,19 @@ case "$target_os" in
;;
esac
;;
- sysv5UnixWare*)
+ sysv5UnixWare* | sysv5OpenUNIX8*)
if test "$GCC" != "yes"; then
- # We are using built-in inline function
+ # Use the built-in alloca()
CFLAGS="$CFLAGS -Kalloca"
fi
CXXFLAGS="$CXXFLAGS -DNO_CPLUSPLUS_ALLOCA"
;;
- sysv5OpenUNIX8*)
+ sysv5SCO_SV6.0.0*)
if test "$GCC" != "yes"; then
- # We are using built-in inline function
+ # Use the built-in alloca()
CFLAGS="$CFLAGS -Kalloca"
+ CXXFLAGS="$CFLAGS -Kalloca"
fi
- CXXFLAGS="$CXXFLAGS -DNO_CPLUSPLUS_ALLOCA"
;;
esac
AC_SUBST(CC)
@@ -1048,6 +1048,15 @@ case $SYSTEM_TYPE in
MAX_C_OPTIMIZE="-O"
fi
;;
+ *darwin9*)
+ if test "$ac_cv_prog_gcc" = "yes"
+ then
+ FLAGS="-D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT"
+ CFLAGS="$CFLAGS $FLAGS"
+ CXXFLAGS="$CXXFLAGS $FLAGS"
+ MAX_C_OPTIMIZE="-O"
+ fi
+ ;;
*freebsd*)
AC_MSG_WARN([Adding fix for interrupted reads])
OSVERSION=`sysctl -a | grep osreldate | awk '{ print $2 }'`
@@ -1360,8 +1369,6 @@ then
if expr "$SYSTEM_TYPE" : ".*unixware7.0.0" > /dev/null
then
AC_DEFINE(HAVE_UNIXWARE7_THREADS, [1])
- else
- AC_DEFINE(HAVE_UNIXWARE7_POSIX, [1])
fi
AC_MSG_RESULT("yes")
# We must have cc
@@ -1387,87 +1394,40 @@ then
AC_MSG_RESULT("no")
fi
fi
-# Hack for SCO UnixWare7
-#
-if test "$with_named_thread" = "no"
-then
- AC_MSG_CHECKING("SCO UnixWare7 native threads")
- if expr "$SYSTEM_TYPE" : ".*UnixWare*" > /dev/null
- then
- if test -f /usr/lib/libthread.so -o -f /usr/lib/libthreadT.so
- then
- MYSQL_REMOVE_SOCKET_FROM_LIBS_HACK
- if expr "$CC" : ".*gcc.*"
- then
- with_named_thread="-pthread -lsocket -lnsl"
- else
- with_named_thread="-Kthread -lsocket -lnsl"
- fi
- if expr "$SYSTEM_TYPE" : ".*unixware7.0.0" > /dev/null
- then
- AC_DEFINE(HAVE_UNIXWARE7_THREADS, [1])
- else
- AC_DEFINE(HAVE_UNIXWARE7_POSIX, [1])
- fi
- # We must have cc
- AC_MSG_CHECKING("for gcc")
- if expr "$CC" : ".*gcc.*"
- then
- CC="$CC -pthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK"
- CXX="$CXX -pthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK"
- else
- CC="$CC -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK"
- CXX="$CXX -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK"
- fi
- AC_MSG_RESULT("yes")
- else
- AC_MSG_ERROR([configure: error: Can't find thread libs on SCO UnixWare7. See the Installation chapter in the Reference Manual.])
- fi
- else
- AC_MSG_RESULT("no")
- fi
-fi
-# Hack for Caldera OpenUNIX8
+#
+# Check for SCO threading libraries
#
if test "$with_named_thread" = "no"
then
- AC_MSG_CHECKING("OpenUNIX8 native threads")
- if expr "$SYSTEM_TYPE" : ".*OpenUNIX*" > /dev/null
+ AC_MSG_CHECKING([SCO OpenServer 6, UnixWare 7 or OpenUNIX 8 native threads])
+ if expr "$SYSTEM_TYPE" : ".*UnixWare.*" > /dev/null || \
+ expr "$SYSTEM_TYPE" : ".*SCO_SV6.*" > /dev/null || \
+ expr "$SYSTEM_TYPE" : ".*OpenUNIX.*" > /dev/null
then
if test -f /usr/lib/libthread.so -o -f /usr/lib/libthreadT.so
then
MYSQL_REMOVE_SOCKET_FROM_LIBS_HACK
- if expr "$CC" : ".*gcc.*"
+ if expr "$CC" : ".*gcc.*" > /dev/null
then
- with_named_thread="-pthread -lsocket -lnsl"
+ with_named_thread="-pthread -lsocket -lnsl"
+ CC="$CC -pthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK";
+ CXX="$CXX -pthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK";
else
with_named_thread="-Kthread -lsocket -lnsl"
+ CC="$CC -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK";
+ CXX="$CXX -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK";
fi
if expr "$SYSTEM_TYPE" : ".*unixware7.0.0" > /dev/null
then
- AC_DEFINE([HAVE_UNIXWARE7_THREADS], [1],
- [UNIXWARE7 threads are not posix])
- else
- AC_DEFINE([HAVE_UNIXWARE7_POSIX], [1],
- [new UNIXWARE7 threads that are not yet posix])
+ AC_DEFINE(HAVE_UNIXWARE7_THREADS, [1], [Have UnixWare 7 (or similar) almost-POSIX threading library])
fi
- # We must have cc
- AC_MSG_CHECKING("for gcc")
- if expr "$CC" : ".*gcc.*"
- then
- CC="$CC -pthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK"
- CXX="$CXX -pthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK"
- else
- CC="$CC -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK"
- CXX="$CXX -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK"
- fi
- AC_MSG_RESULT("yes")
+ AC_MSG_RESULT(yes)
else
- AC_MSG_ERROR([configure: error: Can't find thread libs on Caldera OpenUNIX 8. See the Installation chapter in the Reference Manual.])
+ AC_MSG_ERROR([configure: error: Can't find thread library on SCO/Caldera system. See the Installation chapter in the Reference Manual.])
fi
else
- AC_MSG_RESULT("no")
+ AC_MSG_RESULT(no)
fi
fi
@@ -2510,7 +2470,7 @@ then
AC_CONFIG_FILES(storage/bdb/Makefile)
echo "CONFIGURING FOR BERKELEY DB"
- bdb_conf_flags="--disable-shared"
+ bdb_conf_flags="--disable-shared --build=$build_alias"
if test $with_debug = "yes"
then
bdb_conf_flags="$bdb_conf_flags --enable-debug --enable-diagnostic"
diff --git a/extra/innochecksum.c b/extra/innochecksum.c
index bbeb96224c9..739953298af 100644
--- a/extra/innochecksum.c
+++ b/extra/innochecksum.c
@@ -24,7 +24,7 @@
Published with a permission.
*/
-// needed to have access to 64 bit file functions
+/* needed to have access to 64 bit file functions */
#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE
@@ -35,7 +35,7 @@
#include <sys/stat.h>
#include <unistd.h>
-// all of these ripped from InnoDB code from MySQL 4.0.22
+/* all of these ripped from InnoDB code from MySQL 4.0.22 */
#define UT_HASH_RANDOM_MASK 1463735687
#define UT_HASH_RANDOM_MASK2 1653893711
#define FIL_PAGE_LSN 16
@@ -46,18 +46,19 @@
#define FIL_PAGE_SPACE_OR_CHKSUM 0
#define UNIV_PAGE_SIZE (2 * 8192)
-// command line argument to do page checks (that's it)
-// another argument to specify page ranges... seek to right spot and go from there
+/* command line argument to do page checks (that's it) */
+/* another argument to specify page ranges... seek to right spot and go from there */
typedef unsigned long int ulint;
typedef unsigned char byte;
/* innodb function in name; modified slightly to not have the ASM version (lots of #ifs that didn't apply) */
-ulint mach_read_from_4(byte *b) {
- return( ((ulint)(b[0]) << 24)
- + ((ulint)(b[1]) << 16)
- + ((ulint)(b[2]) << 8)
- + (ulint)(b[3])
+ulint mach_read_from_4(byte *b)
+{
+ return( ((ulint)(b[0]) << 24)
+ + ((ulint)(b[1]) << 16)
+ + ((ulint)(b[2]) << 8)
+ + (ulint)(b[3])
);
}
@@ -80,12 +81,13 @@ ut_fold_binary(
ulint len) /* in: length */
{
ulint i;
- ulint fold = 0;
+ ulint fold= 0;
- for (i = 0; i < len; i++) {
- fold = ut_fold_ulint_pair(fold, (ulint)(*str));
+ for (i= 0; i < len; i++)
+ {
+ fold= ut_fold_ulint_pair(fold, (ulint)(*str));
- str++;
+ str++;
}
return(fold);
@@ -106,12 +108,12 @@ buf_calc_page_new_checksum(
checksum is stored, and also the last 8 bytes of page because
there we store the old formula checksum. */
- checksum = ut_fold_binary(page + FIL_PAGE_OFFSET,
- FIL_PAGE_FILE_FLUSH_LSN - FIL_PAGE_OFFSET)
- + ut_fold_binary(page + FIL_PAGE_DATA,
- UNIV_PAGE_SIZE - FIL_PAGE_DATA
- - FIL_PAGE_END_LSN_OLD_CHKSUM);
- checksum = checksum & 0xFFFFFFFF;
+ checksum= ut_fold_binary(page + FIL_PAGE_OFFSET,
+ FIL_PAGE_FILE_FLUSH_LSN - FIL_PAGE_OFFSET)
+ + ut_fold_binary(page + FIL_PAGE_DATA,
+ UNIV_PAGE_SIZE - FIL_PAGE_DATA
+ - FIL_PAGE_END_LSN_OLD_CHKSUM);
+ checksum= checksum & 0xFFFFFFFF;
return(checksum);
}
@@ -124,183 +126,203 @@ buf_calc_page_old_checksum(
{
ulint checksum;
- checksum = ut_fold_binary(page, FIL_PAGE_FILE_FLUSH_LSN);
+ checksum= ut_fold_binary(page, FIL_PAGE_FILE_FLUSH_LSN);
- checksum = checksum & 0xFFFFFFFF;
+ checksum= checksum & 0xFFFFFFFF;
return(checksum);
}
-int main(int argc, char **argv) {
- FILE *f; // our input file
- byte *p; // storage of pages read
- int bytes; // bytes read count
- ulint ct; // current page number (0 based)
- int now; // current time
- int lastt; // last time
- ulint oldcsum, oldcsumfield, csum, csumfield, logseq, logseqfield; // ulints for checksum storage
- struct stat st; // for stat, if you couldn't guess
- unsigned long long int size; // size of file (has to be 64 bits)
- ulint pages; // number of pages in file
- ulint start_page = 0, end_page = 0, use_end_page = 0; // for starting and ending at certain pages
- off_t offset = 0;
- int just_count = 0; // if true, just print page count
- int verbose = 0;
- int debug = 0;
- int c;
- int fd;
-
- // remove arguments
- while ((c = getopt(argc, argv, "cvds:e:p:")) != -1) {
- switch (c) {
- case 'v':
- verbose = 1;
- break;
- case 'c':
- just_count = 1;
- break;
- case 's':
- start_page = atoi(optarg);
- break;
- case 'e':
- end_page = atoi(optarg);
- use_end_page = 1;
- break;
- case 'p':
- start_page = atoi(optarg);
- end_page = atoi(optarg);
- use_end_page = 1;
- break;
- case 'd':
- debug = 1;
- break;
- case ':':
- fprintf(stderr, "option -%c requires an argument\n", optopt);
- return 1;
- break;
- case '?':
- fprintf(stderr, "unrecognized option: -%c\n", optopt);
- return 1;
- break;
- }
+int main(int argc, char **argv)
+{
+ FILE *f; /* our input file */
+ byte *p; /* storage of pages read */
+ int bytes; /* bytes read count */
+ ulint ct; /* current page number (0 based) */
+ int now; /* current time */
+ int lastt; /* last time */
+ ulint oldcsum, oldcsumfield, csum, csumfield, logseq, logseqfield; /* ulints for checksum storage */
+ struct stat st; /* for stat, if you couldn't guess */
+ unsigned long long int size; /* size of file (has to be 64 bits) */
+ ulint pages; /* number of pages in file */
+ ulint start_page= 0, end_page= 0, use_end_page= 0; /* for starting and ending at certain pages */
+ off_t offset= 0;
+ int just_count= 0; /* if true, just print page count */
+ int verbose= 0;
+ int debug= 0;
+ int c;
+ int fd;
+
+ /* remove arguments */
+ while ((c= getopt(argc, argv, "cvds:e:p:")) != -1)
+ {
+ switch (c)
+ {
+ case 'v':
+ verbose= 1;
+ break;
+ case 'c':
+ just_count= 1;
+ break;
+ case 's':
+ start_page= atoi(optarg);
+ break;
+ case 'e':
+ end_page= atoi(optarg);
+ use_end_page= 1;
+ break;
+ case 'p':
+ start_page= atoi(optarg);
+ end_page= atoi(optarg);
+ use_end_page= 1;
+ break;
+ case 'd':
+ debug= 1;
+ break;
+ case ':':
+ fprintf(stderr, "option -%c requires an argument\n", optopt);
+ return 1;
+ break;
+ case '?':
+ fprintf(stderr, "unrecognized option: -%c\n", optopt);
+ return 1;
+ break;
}
-
- // debug implies verbose...
- if (debug) verbose = 1;
-
- // make sure we have the right arguments
- if (optind >= argc) {
- printf("InnoDB offline file checksum utility.\n");
- printf("usage: %s [-c] [-s <start page>] [-e <end page>] [-p <page>] [-v] [-d] <filename>\n", argv[0]);
- printf("\t-c\tprint the count of pages in the file\n");
- printf("\t-s n\tstart on this page number (0 based)\n");
- printf("\t-e n\tend at this page number (0 based)\n");
- printf("\t-p n\tcheck only this page (0 based)\n");
- printf("\t-v\tverbose (prints progress every 5 seconds)\n");
- printf("\t-d\tdebug mode (prints checksums for each page)\n");
- return 1;
+ }
+
+ /* debug implies verbose... */
+ if (debug) verbose= 1;
+
+ /* make sure we have the right arguments */
+ if (optind >= argc)
+ {
+ printf("InnoDB offline file checksum utility.\n");
+ printf("usage: %s [-c] [-s <start page>] [-e <end page>] [-p <page>] [-v] [-d] <filename>\n", argv[0]);
+ printf("\t-c\tprint the count of pages in the file\n");
+ printf("\t-s n\tstart on this page number (0 based)\n");
+ printf("\t-e n\tend at this page number (0 based)\n");
+ printf("\t-p n\tcheck only this page (0 based)\n");
+ printf("\t-v\tverbose (prints progress every 5 seconds)\n");
+ printf("\t-d\tdebug mode (prints checksums for each page)\n");
+ return 1;
+ }
+
+ /* stat the file to get size and page count */
+ if (stat(argv[optind], &st))
+ {
+ perror("error statting file");
+ return 1;
+ }
+ size= st.st_size;
+ pages= size / UNIV_PAGE_SIZE;
+ if (just_count)
+ {
+ printf("%lu\n", pages);
+ return 0;
+ }
+ else if (verbose)
+ {
+ printf("file %s= %llu bytes (%lu pages)...\n", argv[1], size, pages);
+ printf("checking pages in range %lu to %lu\n", start_page, use_end_page ? end_page : (pages - 1));
+ }
+
+ /* open the file for reading */
+ f= fopen(argv[optind], "r");
+ if (!f)
+ {
+ perror("error opening file");
+ return 1;
+ }
+
+ /* seek to the necessary position */
+ if (start_page)
+ {
+ fd= fileno(f);
+ if (!fd)
+ {
+ perror("unable to obtain file descriptor number");
+ return 1;
}
- // stat the file to get size and page count
- if (stat(argv[optind], &st)) {
- perror("error statting file");
- return 1;
+ offset= (off_t)start_page * (off_t)UNIV_PAGE_SIZE;
+
+ if (lseek(fd, offset, SEEK_SET) != offset)
+ {
+ perror("unable to seek to necessary offset");
+ return 1;
}
- size = st.st_size;
- pages = size / UNIV_PAGE_SIZE;
- if (just_count) {
- printf("%lu\n", pages);
- return 0;
- } else if (verbose) {
- printf("file %s = %llu bytes (%lu pages)...\n", argv[1], size, pages);
- printf("checking pages in range %lu to %lu\n", start_page, use_end_page ? end_page : (pages - 1));
+ }
+
+ /* allocate buffer for reading (so we don't realloc every time) */
+ p= (byte *)malloc(UNIV_PAGE_SIZE);
+
+ /* main checksumming loop */
+ ct= start_page;
+ lastt= 0;
+ while (!feof(f))
+ {
+ bytes= fread(p, 1, UNIV_PAGE_SIZE, f);
+ if (!bytes && feof(f)) return 0;
+ if (bytes != UNIV_PAGE_SIZE)
+ {
+ fprintf(stderr, "bytes read (%d) doesn't match universal page size (%d)\n", bytes, UNIV_PAGE_SIZE);
+ return 1;
}
- // open the file for reading
- f = fopen(argv[optind], "r");
- if (!f) {
- perror("error opening file");
- return 1;
+ /* check the "stored log sequence numbers" */
+ logseq= mach_read_from_4(p + FIL_PAGE_LSN + 4);
+ logseqfield= mach_read_from_4(p + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM + 4);
+ if (debug)
+ printf("page %lu: log sequence number: first = %lu; second = %lu\n", ct, logseq, logseqfield);
+ if (logseq != logseqfield)
+ {
+ fprintf(stderr, "page %lu invalid (fails log sequence number check)\n", ct);
+ return 1;
}
- // seek to the necessary position
- if (start_page) {
- fd = fileno(f);
- if (!fd) {
- perror("unable to obtain file descriptor number");
- return 1;
- }
-
- offset = (off_t)start_page * (off_t)UNIV_PAGE_SIZE;
-
- if (lseek(fd, offset, SEEK_SET) != offset) {
- perror("unable to seek to necessary offset");
- return 1;
- }
+ /* check old method of checksumming */
+ oldcsum= buf_calc_page_old_checksum(p);
+ oldcsumfield= mach_read_from_4(p + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM);
+ if (debug)
+ printf("page %lu: old style: calculated = %lu; recorded = %lu\n", ct, oldcsum, oldcsumfield);
+ if (oldcsumfield != mach_read_from_4(p + FIL_PAGE_LSN) && oldcsumfield != oldcsum)
+ {
+ fprintf(stderr, "page %lu invalid (fails old style checksum)\n", ct);
+ return 1;
}
- // allocate buffer for reading (so we don't realloc every time)
- p = (byte *)malloc(UNIV_PAGE_SIZE);
-
- // main checksumming loop
- ct = start_page;
- lastt = 0;
- while (!feof(f)) {
- bytes = fread(p, 1, UNIV_PAGE_SIZE, f);
- if (!bytes && feof(f)) return 0;
- if (bytes != UNIV_PAGE_SIZE) {
- fprintf(stderr, "bytes read (%d) doesn't match universal page size (%d)\n", bytes, UNIV_PAGE_SIZE);
- return 1;
- }
-
- // check the "stored log sequence numbers"
- logseq = mach_read_from_4(p + FIL_PAGE_LSN + 4);
- logseqfield = mach_read_from_4(p + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM + 4);
- if (debug)
- printf("page %lu: log sequence number: first = %lu; second = %lu\n", ct, logseq, logseqfield);
- if (logseq != logseqfield) {
- fprintf(stderr, "page %lu invalid (fails log sequence number check)\n", ct);
- return 1;
- }
-
- // check old method of checksumming
- oldcsum = buf_calc_page_old_checksum(p);
- oldcsumfield = mach_read_from_4(p + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM);
- if (debug)
- printf("page %lu: old style: calculated = %lu; recorded = %lu\n", ct, oldcsum, oldcsumfield);
- if (oldcsumfield != mach_read_from_4(p + FIL_PAGE_LSN) && oldcsumfield != oldcsum) {
- fprintf(stderr, "page %lu invalid (fails old style checksum)\n", ct);
- return 1;
- }
-
- // now check the new method
- csum = buf_calc_page_new_checksum(p);
- csumfield = mach_read_from_4(p + FIL_PAGE_SPACE_OR_CHKSUM);
- if (debug)
- printf("page %lu: new style: calculated = %lu; recorded = %lu\n", ct, csum, csumfield);
- if (csumfield != 0 && csum != csumfield) {
- fprintf(stderr, "page %lu invalid (fails new style checksum)\n", ct);
- return 1;
- }
+ /* now check the new method */
+ csum= buf_calc_page_new_checksum(p);
+ csumfield= mach_read_from_4(p + FIL_PAGE_SPACE_OR_CHKSUM);
+ if (debug)
+ printf("page %lu: new style: calculated = %lu; recorded = %lu\n", ct, csum, csumfield);
+ if (csumfield != 0 && csum != csumfield)
+ {
+ fprintf(stderr, "page %lu invalid (fails new style checksum)\n", ct);
+ return 1;
+ }
- // end if this was the last page we were supposed to check
- if (use_end_page && (ct >= end_page))
- return 0;
-
- // do counter increase and progress printing
- ct++;
- if (verbose) {
- if (ct % 64 == 0) {
- now = time(0);
- if (!lastt) lastt = now;
- if (now - lastt >= 1) {
- printf("page %lu okay: %.3f%% done\n", (ct - 1), (float) ct / pages * 100);
- lastt = now;
- }
- }
+ /* end if this was the last page we were supposed to check */
+ if (use_end_page && (ct >= end_page))
+ return 0;
+
+ /* do counter increase and progress printing */
+ ct++;
+ if (verbose)
+ {
+ if (ct % 64 == 0)
+ {
+ now= time(0);
+ if (!lastt) lastt= now;
+ if (now - lastt >= 1)
+ {
+ printf("page %lu okay: %.3f%% done\n", (ct - 1), (float) ct / pages * 100);
+ lastt= now;
}
+ }
}
- return 0;
+ }
+ return 0;
}
diff --git a/include/my_global.h b/include/my_global.h
index d240c5519d6..9a485542cc0 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -922,6 +922,7 @@ typedef off_t os_off_t;
#define socket_errno WSAGetLastError()
#define SOCKET_EINTR WSAEINTR
#define SOCKET_EAGAIN WSAEINPROGRESS
+#define SOCKET_ETIMEDOUT WSAETIMEDOUT
#define SOCKET_EWOULDBLOCK WSAEWOULDBLOCK
#define SOCKET_ENFILE ENFILE
#define SOCKET_EMFILE EMFILE
@@ -929,6 +930,7 @@ typedef off_t os_off_t;
#define socket_errno sock_errno()
#define SOCKET_EINTR SOCEINTR
#define SOCKET_EAGAIN SOCEINPROGRESS
+#define SOCKET_ETIMEDOUT SOCKET_EINTR
#define SOCKET_EWOULDBLOCK SOCEWOULDBLOCK
#define SOCKET_ENFILE SOCENFILE
#define SOCKET_EMFILE SOCEMFILE
@@ -938,6 +940,7 @@ typedef off_t os_off_t;
#define closesocket(A) close(A)
#define SOCKET_EINTR EINTR
#define SOCKET_EAGAIN EAGAIN
+#define SOCKET_ETIMEDOUT SOCKET_EINTR
#define SOCKET_EWOULDBLOCK EWOULDBLOCK
#define SOCKET_ENFILE ENFILE
#define SOCKET_EMFILE EMFILE
diff --git a/include/my_pthread.h b/include/my_pthread.h
index 47a38d1a642..132a298bc69 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -298,11 +298,6 @@ extern int my_pthread_create_detached;
int sigwait(sigset_t *set, int *sig);
#endif
-#if defined(HAVE_UNIXWARE7_POSIX)
-#undef HAVE_NONPOSIX_SIGWAIT
-#define HAVE_NONPOSIX_SIGWAIT /* sigwait takes only 1 argument */
-#endif
-
#ifndef HAVE_NONPOSIX_SIGWAIT
#define my_sigwait(A,B) sigwait((A),(B))
#else
diff --git a/include/violite.h b/include/violite.h
index 48046346f8c..b48f3724f5b 100644
--- a/include/violite.h
+++ b/include/violite.h
@@ -74,6 +74,8 @@ int vio_fastsend(Vio *vio);
int vio_keepalive(Vio *vio, my_bool onoff);
/* Whenever we should retry the last read/write operation. */
my_bool vio_should_retry(Vio *vio);
+/* Check that operation was timed out */
+my_bool vio_was_interrupted(Vio *vio);
/* Short text description of the socket for those, who are curious.. */
const char* vio_description(Vio *vio);
/* Return the type of the connection */
@@ -153,6 +155,7 @@ int vio_close_shared_memory(Vio * vio);
#define vio_fastsend(vio) (vio)->fastsend(vio)
#define vio_keepalive(vio, set_keep_alive) (vio)->viokeepalive(vio, set_keep_alive)
#define vio_should_retry(vio) (vio)->should_retry(vio)
+#define vio_was_interrupted(vio) (vio)->was_interrupted(vio)
#define vio_close(vio) ((vio)->vioclose)(vio)
#define vio_peer_addr(vio, buf, prt) (vio)->peer_addr(vio, buf, prt)
#define vio_in_addr(vio, in) (vio)->in_addr(vio, in)
@@ -198,6 +201,7 @@ struct st_vio
my_bool (*peer_addr)(Vio*, char *, uint16*);
void (*in_addr)(Vio*, struct in_addr*);
my_bool (*should_retry)(Vio*);
+ my_bool (*was_interrupted)(Vio*);
int (*vioclose)(Vio*);
void (*timeout)(Vio*, unsigned int which, unsigned int timeout);
void *ssl_arg;
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index b9532705683..d1db4a65bac 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -891,7 +891,7 @@ sub executable_setup () {
mtr_script_exists("$path_client_bindir/mysql_fix_privilege_tables",
"$glob_basedir/scripts/mysql_fix_privilege_tables");
$exe_my_print_defaults=
- mtr_script_exists("path_client_bindir/my_print_defaults");
+ mtr_script_exists("$path_client_bindir/my_print_defaults");
$path_language= mtr_path_exists("$glob_basedir/share/mysql/english/",
"$glob_basedir/share/english/");
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index e1e66019f65..3e7c9d6eb4a 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -9,6 +9,8 @@ NULL
drop table if exists t1;
create table t1 (b char(0) not null);
create table if not exists t1 (b char(0) not null);
+Warnings:
+Note 1050 Table 't1' already exists
insert into t1 values (""),(null);
Warnings:
Warning 1263 Column set to default value; NULL supplied to NOT NULL column 'b' at row 2
@@ -244,9 +246,13 @@ create table t1 select x'4132';
drop table t1;
create table t1 select 1,2,3;
create table if not exists t1 select 1,2;
+Warnings:
+Note 1050 Table 't1' already exists
create table if not exists t1 select 1,2,3,4;
ERROR 21S01: Column count doesn't match value count at row 1
create table if not exists t1 select 1;
+Warnings:
+Note 1050 Table 't1' already exists
select * from t1;
1 2 3
1 2 3
@@ -255,9 +261,13 @@ select * from t1;
drop table t1;
create table t1 select 1,2,3;
create table if not exists t1 select 1,2;
+Warnings:
+Note 1050 Table 't1' already exists
create table if not exists t1 select 1,2,3,4;
ERROR 21S01: Column count doesn't match value count at row 1
create table if not exists t1 select 1;
+Warnings:
+Note 1050 Table 't1' already exists
select * from t1;
1 2 3
1 2 3
@@ -268,6 +278,7 @@ create table t1 (a int not null, b int, primary key (a));
insert into t1 values (1,1);
create table if not exists t1 select 2;
Warnings:
+Note 1050 Table 't1' already exists
Warning 1364 Field 'a' doesn't have a default value
select * from t1;
a b
@@ -275,6 +286,7 @@ a b
0 2
create table if not exists t1 select 3 as 'a',4 as 'b';
Warnings:
+Note 1050 Table 't1' already exists
Warning 1364 Field 'a' doesn't have a default value
create table if not exists t1 select 3 as 'a',3 as 'b';
ERROR 23000: Duplicate entry '3' for key 1
@@ -615,3 +627,17 @@ create table t1 like v1;
ERROR HY000: 'mysqltest.v1' is not BASE TABLE
drop view v1;
drop database mysqltest;
+create database mysqltest;
+create database if not exists mysqltest character set latin2;
+Warnings:
+Note 1007 Can't create database 'mysqltest'; database exists
+show create database mysqltest;
+Database Create Database
+mysqltest CREATE DATABASE `mysqltest` /*!40100 DEFAULT CHARACTER SET latin1 */
+drop database mysqltest;
+use test;
+create table t1 (a int);
+create table if not exists t1 (a int);
+Warnings:
+Note 1050 Table 't1' already exists
+drop table t1;
diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result
index 3803dd932d7..e2805e41f3a 100644
--- a/mysql-test/r/ctype_uca.result
+++ b/mysql-test/r/ctype_uca.result
@@ -1905,6 +1905,116 @@ Z,z,Ź,ź,Ż,ż,Ž,ž
ǁ
ǂ
ǃ
+select group_concat(c1 order by c1) from t1 group by c1 collate utf8_esperanto_ci;
+group_concat(c1 order by c1)
+A,a,À,Á,Â,Ã,Ä,Å,à,á,â,ã,ä,å,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ
+AA,Aa,aA,aa
+Æ,æ,Ǣ,ǣ,Ǽ,ǽ
+B,b
+Ƃ,ƃ
+C,c,Ç,ç,Ć,ć,Ċ,ċ,Č,č
+CH,Ch,cH,ch
+Ĉ,ĉ
+Ƈ,ƈ
+D,d,Ď,ď
+DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz
+Đ,đ
+Ƌ,ƌ
+Ð,ð
+E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě
+Ǝ,ǝ
+F,f
+Ƒ,ƒ
+G,g,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ
+Ĝ,ĝ
+Ǥ,ǥ
+Ƣ,ƣ
+H,h
+Ĥ,ĥ
+ƕ,Ƕ
+Ħ,ħ
+I,i,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ
+IJ,Ij,iJ,ij,IJ,ij
+J,j,ǰ
+Ĵ,ĵ
+K,k,Ķ,ķ,Ǩ,ǩ
+Ƙ,ƙ
+L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ
+Ŀ,ŀ
+LJ,Lj,lJ,lj,LJ,Lj,lj
+LL,Ll,lL,ll
+Ł,ł
+M,m
+N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ
+NJ,Nj,nJ,nj,NJ,Nj,nj
+Ŋ,ŋ
+O,o,Ò,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ
+OE,Oe,oE,oe,Œ,œ
+Ø,ø,Ǿ,ǿ
+P,p
+Ƥ,ƥ
+Q,q
+R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř
+RR,Rr,rR,rr
+S,s,Ś,ś,Ş,ş,Š,š,ſ
+SS,Ss,sS,ss,ß
+Ŝ,ŝ
+T,t,Ţ,ţ,Ť,ť
+Ŧ,ŧ
+Ƭ,ƭ
+U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ
+Ŭ,ŭ
+V,v
+W,w,Ŵ,ŵ
+X,x
+Y,y,Ý,ý,ÿ,Ŷ,ŷ,Ÿ
+Ƴ,ƴ
+Z,z,Ź,ź,Ż,ż,Ž,ž
+Ƶ,ƶ
+Ʒ,Ǯ,ǯ
+Ƹ,ƹ
+Þ,þ
+ƿ,Ƿ
+Ƨ,ƨ
+Ƽ,ƽ
+Ƅ,ƅ
drop table t1;
SET NAMES utf8;
CREATE TABLE t1 (c varchar(255) NOT NULL COLLATE utf8_general_ci, INDEX (c));
diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result
index cc074c8ebf5..559e88aad46 100644
--- a/mysql-test/r/innodb.result
+++ b/mysql-test/r/innodb.result
@@ -1719,6 +1719,17 @@ select * from t1;
a
42
drop table t1;
+create table t1 (a int not null, b int not null, c blob not null, d int not null, e int, primary key (a,b,c(255),d)) engine=innodb;
+insert into t1 values (2,2,"b",2,2),(1,1,"a",1,1),(3,3,"ab",3,3);
+select * from t1 order by a,b,c,d;
+a b c d e
+1 1 a 1 1
+2 2 b 2 2
+3 3 ab 3 3
+explain select * from t1 order by a,b,c,d;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using filesort
+drop table t1;
create table t1 (x bigint unsigned not null primary key) engine=innodb;
insert into t1(x) values (0xfffffffffffffff0),(0xfffffffffffffff1);
select * from t1;
@@ -1765,7 +1776,7 @@ Variable_name Value
Innodb_rows_deleted 2070
show status like "Innodb_rows_inserted";
Variable_name Value
-Innodb_rows_inserted 31722
+Innodb_rows_inserted 31725
show status like "Innodb_rows_updated";
Variable_name Value
Innodb_rows_updated 29530
diff --git a/mysql-test/r/ndb_autodiscover.result b/mysql-test/r/ndb_autodiscover.result
index 0f17160ea99..6d1b7eb152d 100644
--- a/mysql-test/r/ndb_autodiscover.result
+++ b/mysql-test/r/ndb_autodiscover.result
@@ -99,6 +99,8 @@ id int not null primary key,
id2 int not null,
name char(20)
) engine=ndb;
+Warnings:
+Note 1050 Table 't3' already exists
show status like 'handler_discover%';
Variable_name Value
Handler_discover 0
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index 5f2f5f50a16..d7de9b6509b 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -2922,3 +2922,24 @@ a b b
select * from t1 inner join t2 using (a);
a b b
1 10 10
+drop table t1, t2;
+create table t1 (a int, c int);
+create table t2 (b int);
+create table t3 (b int, a int);
+create table t4 (c int);
+insert into t1 values (1,1);
+insert into t2 values (1);
+insert into t3 values (1,1);
+insert into t4 values (1);
+select * from t1 join t2 join t3 on (t2.b = t3.b and t1.a = t3.a);
+a c b b a
+1 1 1 1 1
+select * from t1, t2 join t3 on (t2.b = t3.b and t1.a = t3.a);
+ERROR 42S22: Unknown column 't1.a' in 'on clause'
+select * from t1 join t2 join t3 join t4 on (t1.a = t4.c and t2.b = t4.c);
+a c b b a c
+1 1 1 1 1 1
+select * from t1 join t2 join t4 using (c);
+c a b
+1 1 1
+drop table t1, t2, t3, t4;
diff --git a/mysql-test/r/temp_table.result b/mysql-test/r/temp_table.result
index 081bd35622e..1b7e3927adb 100644
--- a/mysql-test/r/temp_table.result
+++ b/mysql-test/r/temp_table.result
@@ -23,6 +23,8 @@ a b
6 g
create TEMPORARY TABLE t2 engine=heap select * from t1;
create TEMPORARY TABLE IF NOT EXISTS t2 (a int) engine=heap;
+Warnings:
+Note 1050 Table 't2' already exists
CREATE TEMPORARY TABLE t1 (a int not null, b char (10) not null);
ERROR 42S01: Table 't1' already exists
ALTER TABLE t1 RENAME t2;
diff --git a/mysql-test/r/warnings.result b/mysql-test/r/warnings.result
index fd516996ae8..d8329e446ac 100644
--- a/mysql-test/r/warnings.result
+++ b/mysql-test/r/warnings.result
@@ -63,9 +63,11 @@ show count(*) warnings;
1
create table t1(id int);
create table if not exists t1(id int);
+Warnings:
+Note 1050 Table 't1' already exists
select @@warning_count;
@@warning_count
-0
+1
drop table t1;
create table t1(a tinyint, b int not null, c date, d char(5));
load data infile '../../std_data/warnings_loaddata.dat' into table t1 fields terminated by ',';
diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test
index 450bcd0344a..b72dc49e89a 100644
--- a/mysql-test/t/create.test
+++ b/mysql-test/t/create.test
@@ -533,4 +533,16 @@ create view v1 as select 'foo' from dual;
create table t1 like v1;
drop view v1;
drop database mysqltest;
+# Bug #6008 MySQL does not create warnings when
+# creating database and using IF NOT EXISTS
+#
+create database mysqltest;
+create database if not exists mysqltest character set latin2;
+show create database mysqltest;
+drop database mysqltest;
+use test;
+create table t1 (a int);
+create table if not exists t1 (a int);
+drop table t1;
+
# End of 4.1 tests
diff --git a/mysql-test/t/ctype_uca.test b/mysql-test/t/ctype_uca.test
index 098ea33c6b2..43ef0cc8755 100644
--- a/mysql-test/t/ctype_uca.test
+++ b/mysql-test/t/ctype_uca.test
@@ -211,6 +211,7 @@ select group_concat(c1 order by c1) from t1 group by c1 collate utf8_lithuanian_
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_slovak_ci;
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_spanish2_ci;
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_roman_ci;
+select group_concat(c1 order by c1) from t1 group by c1 collate utf8_esperanto_ci;
drop table t1;
diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test
index 7d449ac9261..ed238f46e0b 100644
--- a/mysql-test/t/innodb.test
+++ b/mysql-test/t/innodb.test
@@ -1249,6 +1249,16 @@ insert into t1 values (42);
select * from t1;
drop table t1;
+#
+# Bug #13025 Server crash during filesort
+#
+
+create table t1 (a int not null, b int not null, c blob not null, d int not null, e int, primary key (a,b,c(255),d)) engine=innodb;
+insert into t1 values (2,2,"b",2,2),(1,1,"a",1,1),(3,3,"ab",3,3);
+select * from t1 order by a,b,c,d;
+explain select * from t1 order by a,b,c,d;
+drop table t1;
+
# End of 4.1 tests
#
diff --git a/mysql-test/t/rpl_error_ignored_table.test b/mysql-test/t/rpl_error_ignored_table.test
index a854c3621ab..cb4137c49e0 100644
--- a/mysql-test/t/rpl_error_ignored_table.test
+++ b/mysql-test/t/rpl_error_ignored_table.test
@@ -57,3 +57,4 @@ connection slave;
sync_with_master;
# End of 4.1 tests
+# Adding comment for force manual merge 5.0 -> wl1012. delete me if needed
diff --git a/mysql-test/t/rpl_flush_tables.test b/mysql-test/t/rpl_flush_tables.test
index 48fda818890..4411d6ea1c9 100644
--- a/mysql-test/t/rpl_flush_tables.test
+++ b/mysql-test/t/rpl_flush_tables.test
@@ -40,3 +40,4 @@ select * from t3;
# in the .err files; these are not fatal and are not reported by mysql-test-run.
# End of 4.1 tests
+# Adding comment for force manual merge 5.0 -> wl1012. Delete me if needed.
diff --git a/mysql-test/t/rpl_loaddata_rule_m.test b/mysql-test/t/rpl_loaddata_rule_m.test
index 68024c340a8..c956f2c7720 100644
--- a/mysql-test/t/rpl_loaddata_rule_m.test
+++ b/mysql-test/t/rpl_loaddata_rule_m.test
@@ -27,3 +27,4 @@ show binlog events from 98;
drop database mysqltest;
# End of 4.1 tests
+# Adding comment for force manual merge 5.0 -> wl1012: Delete me
diff --git a/mysql-test/t/rpl_log.test b/mysql-test/t/rpl_log.test
index 899f812535a..1f71d2981c5 100644
--- a/mysql-test/t/rpl_log.test
+++ b/mysql-test/t/rpl_log.test
@@ -110,3 +110,4 @@ show slave status;
show binlog events in 'slave-bin.000005' from 4;
# End of 4.1 tests
+# Adding comment for force manual merge 5.0 -> wl1012: Delete me
diff --git a/mysql-test/t/rpl_max_relay_size.test b/mysql-test/t/rpl_max_relay_size.test
index 8b54cf5ab7f..9b6b06e0b14 100644
--- a/mysql-test/t/rpl_max_relay_size.test
+++ b/mysql-test/t/rpl_max_relay_size.test
@@ -93,3 +93,4 @@ flush logs;
show master status;
# End of 4.1 tests
+#
diff --git a/mysql-test/t/rpl_multi_query.test b/mysql-test/t/rpl_multi_query.test
index fa94928e13a..b4cd88f756e 100644
--- a/mysql-test/t/rpl_multi_query.test
+++ b/mysql-test/t/rpl_multi_query.test
@@ -29,3 +29,4 @@ drop database mysqltest;
sync_slave_with_master;
# End of 4.1 tests
+#
diff --git a/mysql-test/t/rpl_reset_slave.test b/mysql-test/t/rpl_reset_slave.test
index aeac1b50110..00b1cf68294 100644
--- a/mysql-test/t/rpl_reset_slave.test
+++ b/mysql-test/t/rpl_reset_slave.test
@@ -48,3 +48,4 @@ sync_with_master;
show status like 'slave_open_temp_tables';
# End of 4.1 tests
+#
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index c4b50a7556b..61242b3d96e 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -2499,3 +2499,27 @@ insert into t2 values (1,10);
# both queries should produce the same result
select * from t1 inner join t2 using (A);
select * from t1 inner join t2 using (a);
+drop table t1, t2;
+
+#
+# Bug #12943 Incorrect nesting of [INNER| CROSS] JOIN due to unspecified
+# associativity in the parser.
+#
+
+create table t1 (a int, c int);
+create table t2 (b int);
+create table t3 (b int, a int);
+create table t4 (c int);
+insert into t1 values (1,1);
+insert into t2 values (1);
+insert into t3 values (1,1);
+insert into t4 values (1);
+
+select * from t1 join t2 join t3 on (t2.b = t3.b and t1.a = t3.a);
+# Notice that ',' has lower priority than 'join', thus we have that:
+# t1, t2 join t3 <==> t1, (t2 join t3).
+-- error 1054
+select * from t1, t2 join t3 on (t2.b = t3.b and t1.a = t3.a);
+select * from t1 join t2 join t3 join t4 on (t1.a = t4.c and t2.b = t4.c);
+select * from t1 join t2 join t4 using (c);
+drop table t1, t2, t3, t4;
diff --git a/mysys/charset-def.c b/mysys/charset-def.c
index 0464ba893fb..5b30d1ee135 100644
--- a/mysys/charset-def.c
+++ b/mysys/charset-def.c
@@ -42,6 +42,7 @@ extern CHARSET_INFO my_charset_ucs2_slovak_uca_ci;
extern CHARSET_INFO my_charset_ucs2_spanish2_uca_ci;
extern CHARSET_INFO my_charset_ucs2_roman_uca_ci;
extern CHARSET_INFO my_charset_ucs2_persian_uca_ci;
+extern CHARSET_INFO my_charset_ucs2_esperanto_uca_ci;
#endif
#ifdef HAVE_CHARSET_utf8
@@ -62,6 +63,7 @@ extern CHARSET_INFO my_charset_utf8_slovak_uca_ci;
extern CHARSET_INFO my_charset_utf8_spanish2_uca_ci;
extern CHARSET_INFO my_charset_utf8_roman_uca_ci;
extern CHARSET_INFO my_charset_utf8_persian_uca_ci;
+extern CHARSET_INFO my_charset_utf8_esperanto_uca_ci;
#ifdef HAVE_UTF8_GENERAL_CS
extern CHARSET_INFO my_charset_utf8_general_cs;
#endif
@@ -148,6 +150,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused)))
add_compiled_collation(&my_charset_ucs2_spanish2_uca_ci);
add_compiled_collation(&my_charset_ucs2_roman_uca_ci);
add_compiled_collation(&my_charset_ucs2_persian_uca_ci);
+ add_compiled_collation(&my_charset_ucs2_esperanto_uca_ci);
#endif
#endif
@@ -180,6 +183,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused)))
add_compiled_collation(&my_charset_utf8_spanish2_uca_ci);
add_compiled_collation(&my_charset_utf8_roman_uca_ci);
add_compiled_collation(&my_charset_utf8_persian_uca_ci);
+ add_compiled_collation(&my_charset_utf8_esperanto_uca_ci);
#endif
#endif
diff --git a/sql-common/client.c b/sql-common/client.c
index cc70bbc7523..43c50f12ae1 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -599,7 +599,7 @@ net_safe_read(MYSQL *mysql)
DBUG_PRINT("error",("Wrong connection or packet. fd: %s len: %d",
vio_description(net->vio),len));
#ifdef MYSQL_SERVER
- if (vio_errno(net->vio) == SOCKET_EINTR)
+ if (vio_was_interrupted(net->vio))
return (packet_error);
#endif /*MYSQL_SERVER*/
end_server(mysql);
diff --git a/sql/examples/ha_archive.cc b/sql/examples/ha_archive.cc
index 7b9f6e23548..85104405024 100644
--- a/sql/examples/ha_archive.cc
+++ b/sql/examples/ha_archive.cc
@@ -544,7 +544,7 @@ int ha_archive::create(const char *name, TABLE *table_arg,
error= my_errno;
goto error;
}
- if ((archive= gzdopen(create_file, "ab")) == NULL)
+ if ((archive= gzdopen(create_file, "wb")) == NULL)
{
error= errno;
goto error2;
diff --git a/sql/filesort.cc b/sql/filesort.cc
index 75da43afed5..ad784c729fa 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -466,7 +466,7 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
my_store_ptr(ref_pos,ref_length,record); // Position to row
record+= sort_form->s->db_record_offset;
}
- else
+ else if (!error)
file->position(sort_form->record[0]);
}
if (error && error != HA_ERR_RECORD_DELETED)
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 78a512d0ddb..48839abcb10 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -1017,8 +1017,7 @@ longlong Item_func_interval::val_int()
1 got error
*/
-bool
-Item_func_between::fix_fields(THD *thd, Item **ref)
+bool Item_func_between::fix_fields(THD *thd, Item **ref)
{
if (Item_func_opt_neg::fix_fields(thd, ref))
return 1;
@@ -1028,8 +1027,9 @@ Item_func_between::fix_fields(THD *thd, Item **ref)
return 0;
/* not_null_tables_cache == union(T1(e), intersection(T1(e1),T1(e2))) */
- not_null_tables_cache= args[0]->not_null_tables() |
- (args[1]->not_null_tables() & args[2]->not_null_tables());
+ not_null_tables_cache= (args[0]->not_null_tables() |
+ (args[1]->not_null_tables() &
+ args[2]->not_null_tables()));
return 0;
}
@@ -1330,8 +1330,8 @@ Item_func_if::fix_fields(THD *thd, Item **ref)
if (Item_func::fix_fields(thd, ref))
return 1;
- not_null_tables_cache= (args[1]->not_null_tables()
- & args[2]->not_null_tables());
+ not_null_tables_cache= (args[1]->not_null_tables() &
+ args[2]->not_null_tables());
return 0;
}
diff --git a/sql/net_serv.cc b/sql/net_serv.cc
index 9f6295f8a36..7326c0395e3 100644
--- a/sql/net_serv.cc
+++ b/sql/net_serv.cc
@@ -763,7 +763,7 @@ my_real_read(NET *net, ulong *complen)
net->error= 2; /* Close socket */
net->report_error= 1;
#ifdef MYSQL_SERVER
- net->last_errno= (interrupted ? ER_NET_READ_INTERRUPTED :
+ net->last_errno= (vio_was_interrupted(net->vio) ? ER_NET_READ_INTERRUPTED :
ER_NET_READ_ERROR);
#endif
goto end;
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index f24e2cdc0ad..69ccbe690db 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -437,7 +437,11 @@ bool mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create_info,
error= -1;
goto exit;
}
- result= 0;
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
+ ER_DB_CREATE_EXISTS, ER(ER_DB_CREATE_EXISTS), db);
+ error= 0;
+ send_ok(thd);
+ goto exit;
}
else
{
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 378be129444..f4cab56e97c 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -6364,7 +6364,7 @@ void st_select_lex::set_lock_for_tables(thr_lock_type lock_type)
SYNOPSIS
make_join_on_context()
thd pointer to current thread
- left_op lefto operand of the JOIN
+ left_op left operand of the JOIN
right_op rigth operand of the JOIN
DESCRIPTION
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index d19d511e74c..0fc43345c04 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -13104,12 +13104,12 @@ static bool change_group_ref(THD *thd, Item_func *expr, ORDER *group_list,
{
Name_resolution_context *context= &thd->lex->current_select->context;
Item **arg,**arg_end;
+ bool arg_changed= FALSE;
for (arg= expr->arguments(),
arg_end= expr->arguments()+expr->arg_count;
arg != arg_end; arg++)
{
Item *item= *arg;
- bool arg_changed= FALSE;
if (item->type() == Item::FIELD_ITEM || item->type() == Item::REF_ITEM)
{
ORDER *group_tmp;
@@ -13131,11 +13131,11 @@ static bool change_group_ref(THD *thd, Item_func *expr, ORDER *group_list,
if (change_group_ref(thd, (Item_func *) item, group_list, &arg_changed))
return 1;
}
- if (arg_changed)
- {
- expr->maybe_null= 1;
- *changed= TRUE;
- }
+ }
+ if (arg_changed)
+ {
+ expr->maybe_null= 1;
+ *changed= TRUE;
}
}
return 0;
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 573d5349471..6f60419ff94 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -1695,6 +1695,9 @@ bool mysql_create_table(THD *thd,const char *db, const char *table_name,
if (create_info->options & HA_LEX_CREATE_IF_NOT_EXISTS)
{
create_info->table_existed= 1; // Mark that table existed
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
+ ER_TABLE_EXISTS_ERROR, ER(ER_TABLE_EXISTS_ERROR),
+ alias);
goto no_err;
}
my_error(ER_TABLE_EXISTS_ERROR, MYF(0), alias);
@@ -1708,12 +1711,8 @@ bool mysql_create_table(THD *thd,const char *db, const char *table_name,
if (!access(path,F_OK))
{
if (create_info->options & HA_LEX_CREATE_IF_NOT_EXISTS)
- {
- create_info->table_existed= 1; // Mark that table existed
- error= FALSE;
- }
- else
- my_error(ER_TABLE_EXISTS_ERROR, MYF(0), table_name);
+ goto warn;
+ my_error(ER_TABLE_EXISTS_ERROR,MYF(0),table_name);
goto end;
}
}
@@ -1736,12 +1735,8 @@ bool mysql_create_table(THD *thd,const char *db, const char *table_name,
DBUG_PRINT("info", ("Table with same name already existed in handler"));
if (create_if_not_exists)
- {
- create_info->table_existed= 1; // Mark that table existed
- error= FALSE;
- }
- else
- my_error(ER_TABLE_EXISTS_ERROR, MYF(0), table_name);
+ goto warn;
+ my_error(ER_TABLE_EXISTS_ERROR,MYF(0),table_name);
goto end;
}
}
@@ -1774,6 +1769,14 @@ bool mysql_create_table(THD *thd,const char *db, const char *table_name,
mysql_bin_log.write(&qinfo);
}
error= FALSE;
+ goto end;
+
+warn:
+ error= 0;
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
+ ER_TABLE_EXISTS_ERROR, ER(ER_TABLE_EXISTS_ERROR),
+ alias);
+ create_info->table_existed= 1; // Mark that table existed
end:
VOID(pthread_mutex_unlock(&LOCK_open));
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index fc877511357..b87fc9ffa36 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -670,6 +670,9 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token YEAR_SYM
%token ZEROFILL
+%left JOIN_SYM
+/* A dummy token to force the priority of table_ref production in a join. */
+%left TABLE_REF_PRIORITY
%left SET_VAR
%left OR_OR_SYM OR_SYM OR2_SYM XOR
%left AND_SYM AND_AND_SYM
@@ -5776,7 +5779,13 @@ derived_table_list:
;
join_table:
- table_ref normal_join table_ref { YYERROR_UNLESS($1 && ($$=$3)); }
+ /*
+ Evaluate production 'table_ref' before 'normal_join' so that
+ [INNER | CROSS] JOIN is properly nested as other left-associative
+ joins.
+ */
+ table_ref %prec TABLE_REF_PRIORITY normal_join table_ref
+ { YYERROR_UNLESS($1 && ($$=$3)); }
| table_ref STRAIGHT_JOIN table_factor
{ YYERROR_UNLESS($1 && ($$=$3)); $3->straight=1; }
| table_ref normal_join table_ref
diff --git a/storage/ndb/src/mgmsrv/MgmtSrvr.cpp b/storage/ndb/src/mgmsrv/MgmtSrvr.cpp
index fae0941beb8..d946b4af4a7 100644
--- a/storage/ndb/src/mgmsrv/MgmtSrvr.cpp
+++ b/storage/ndb/src/mgmsrv/MgmtSrvr.cpp
@@ -2521,10 +2521,7 @@ MgmtSrvr::startBackup(Uint32& backupId, int waitCompleted)
case GSN_NODE_FAILREP:{
const NodeFailRep * const rep =
CAST_CONSTPTR(NodeFailRep, signal->getDataPtr());
-#ifdef VM_TRACE
- ndbout_c("Node %d failed", rep->failNo);
-#endif
- if (rep->failNo == nodeId ||
+ if (NodeBitmask::get(rep->theNodes,nodeId) ||
waitCompleted == 1)
return 1326;
// wait for next signal
diff --git a/storage/ndb/src/ndbapi/SignalSender.cpp b/storage/ndb/src/ndbapi/SignalSender.cpp
index 6314361e55c..96feeb973a0 100644
--- a/storage/ndb/src/ndbapi/SignalSender.cpp
+++ b/storage/ndb/src/ndbapi/SignalSender.cpp
@@ -250,14 +250,22 @@ SignalSender::execNodeStatus(void* signalSender,
// node shutdown complete
s->header.theVerId_signalNumber = GSN_NF_COMPLETEREP;
NFCompleteRep *rep = (NFCompleteRep *)s->getDataPtrSend();
+ rep->blockNo = 0;
+ rep->nodeId = 0;
rep->failedNodeId = nodeId;
+ rep->unused = 0;
+ rep->from = 0;
}
else
{
// node failure
s->header.theVerId_signalNumber = GSN_NODE_FAILREP;
NodeFailRep *rep = (NodeFailRep *)s->getDataPtrSend();
- rep->failNo = nodeId;
+ rep->failNo = 0;
+ rep->masterNodeId = 0;
+ rep->noOfNodes = 1;
+ NodeBitmask::clear(rep->theNodes);
+ NodeBitmask::set(rep->theNodes,nodeId);
}
ss->m_jobBuffer.push_back(s);
diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c
index dcf1c07113e..a280ed59352 100644
--- a/strings/ctype-uca.c
+++ b/strings/ctype-uca.c
@@ -6692,6 +6692,18 @@ static const char persian[]=
" < \\uFEF5 < \\uFEF6 < \\uFEF7 < \\uFEF8 < \\uFEF9 < \\uFEFA"
" < \\uFEFB < \\uFEFC";
+/*
+ Esperanto tailoring.
+ Contributed by Bertilo Wennergren <bertilow at gmail dot com>
+ September 1, 2005
+*/
+static const char esperanto[]=
+ "& C < \\u0109 <<< \\u0108"
+ "& G < \\u011D <<< \\u011C"
+ "& H < \\u0125 <<< \\u0124"
+ "& J < \\u0135 <<< \\u0134"
+ "& S < \\u015d <<< \\u015c"
+ "& U < \\u016d <<< \\u016c";
/*
Unicode Collation Algorithm:
@@ -8564,6 +8576,38 @@ CHARSET_INFO my_charset_ucs2_persian_uca_ci=
};
+CHARSET_INFO my_charset_ucs2_esperanto_uca_ci=
+{
+ 145,0,0, /* number */
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ "ucs2", /* cs name */
+ "ucs2_esperanto_ci",/* name */
+ "", /* comment */
+ esperanto, /* tailoring */
+ NULL, /* ctype */
+ NULL, /* to_lower */
+ NULL, /* to_upper */
+ NULL, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ NULL, /* tab_to_uni */
+ NULL, /* tab_from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state_map */
+ NULL, /* ident_map */
+ 8, /* strxfrm_multiply */
+ 1, /* caseup_multiply */
+ 1, /* casedn_multiply */
+ 2, /* mbminlen */
+ 2, /* mbmaxlen */
+ 9, /* min_sort_char */
+ 0xFFFF, /* max_sort_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_ucs2_handler,
+ &my_collation_ucs2_uca_handler
+};
+
+
#endif
@@ -9140,6 +9184,37 @@ CHARSET_INFO my_charset_utf8_persian_uca_ci=
&my_collation_any_uca_handler
};
+CHARSET_INFO my_charset_utf8_esperanto_uca_ci=
+{
+ 209,0,0, /* number */
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+ "utf8", /* cs name */
+ "utf8_esperanto_ci",/* name */
+ "", /* comment */
+ esperanto, /* tailoring */
+ ctype_utf8, /* ctype */
+ NULL, /* to_lower */
+ NULL, /* to_upper */
+ NULL, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ NULL, /* tab_to_uni */
+ NULL, /* tab_from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state_map */
+ NULL, /* ident_map */
+ 8, /* strxfrm_multiply */
+ 1, /* caseup_multiply */
+ 1, /* casedn_multiply */
+ 1, /* mbminlen */
+ 3, /* mbmaxlen */
+ 9, /* min_sort_char */
+ 0xFFFF, /* max_sort_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_utf8_handler,
+ &my_collation_any_uca_handler
+};
+
#endif /* HAVE_CHARSET_utf8 */
#endif /* HAVE_UCA_COLLATIONS */
diff --git a/vio/vio.c b/vio/vio.c
index bcf0ac032c8..e444c634c96 100644
--- a/vio/vio.c
+++ b/vio/vio.c
@@ -54,6 +54,7 @@ static void vio_init(Vio* vio, enum enum_vio_type type,
vio->fastsend =vio_fastsend;
vio->viokeepalive =vio_keepalive;
vio->should_retry =vio_should_retry;
+ vio->was_interrupted=vio_was_interrupted;
vio->vioclose =vio_close_pipe;
vio->peer_addr =vio_peer_addr;
vio->in_addr =vio_in_addr;
@@ -73,6 +74,7 @@ static void vio_init(Vio* vio, enum enum_vio_type type,
vio->fastsend =vio_fastsend;
vio->viokeepalive =vio_keepalive;
vio->should_retry =vio_should_retry;
+ vio->was_interrupted=vio_was_interrupted;
vio->vioclose =vio_close_shared_memory;
vio->peer_addr =vio_peer_addr;
vio->in_addr =vio_in_addr;
@@ -92,6 +94,7 @@ static void vio_init(Vio* vio, enum enum_vio_type type,
vio->fastsend =vio_ssl_fastsend;
vio->viokeepalive =vio_ssl_keepalive;
vio->should_retry =vio_ssl_should_retry;
+ vio->was_interrupted=vio_ssl_was_interrupted;
vio->vioclose =vio_ssl_close;
vio->peer_addr =vio_ssl_peer_addr;
vio->in_addr =vio_ssl_in_addr;
@@ -109,6 +112,7 @@ static void vio_init(Vio* vio, enum enum_vio_type type,
vio->fastsend =vio_fastsend;
vio->viokeepalive =vio_keepalive;
vio->should_retry =vio_should_retry;
+ vio->was_interrupted=vio_was_interrupted;
vio->vioclose =vio_close;
vio->peer_addr =vio_peer_addr;
vio->in_addr =vio_in_addr;
diff --git a/vio/vio_priv.h b/vio/vio_priv.h
index 3a75a08021d..c1c78cc6efa 100644
--- a/vio/vio_priv.h
+++ b/vio/vio_priv.h
@@ -39,6 +39,8 @@ int vio_ssl_fastsend(Vio *vio);
int vio_ssl_keepalive(Vio *vio, my_bool onoff);
/* Whenever we should retry the last read/write operation. */
my_bool vio_ssl_should_retry(Vio *vio);
+/* Check that operation was timed out */
+my_bool vio_ssl_was_interrupted(Vio *vio);
/* When the workday is over... */
int vio_ssl_close(Vio *vio);
/* Return last error number */
diff --git a/vio/viosocket.c b/vio/viosocket.c
index 3b4013f4089..e0ca18539ce 100644
--- a/vio/viosocket.c
+++ b/vio/viosocket.c
@@ -242,6 +242,15 @@ vio_should_retry(Vio * vio __attribute__((unused)))
}
+my_bool
+vio_was_interrupted(Vio *vio __attribute__((unused)))
+{
+ int en= socket_errno;
+ return (en == SOCKET_EAGAIN || en == SOCKET_EINTR ||
+ en == SOCKET_EWOULDBLOCK || en == SOCKET_ETIMEDOUT);
+}
+
+
int vio_close(Vio * vio)
{
int r=0;
diff --git a/vio/viossl.c b/vio/viossl.c
index fbbc545bb9b..e6af07c4b0b 100644
--- a/vio/viossl.c
+++ b/vio/viossl.c
@@ -184,6 +184,15 @@ vio_ssl_should_retry(Vio * vio __attribute__((unused)))
}
+my_bool
+vio_ssl_was_interrupted(Vio *vio __attribute__((unused)))
+{
+ int en= socket_errno;
+ return (en == SOCKET_EAGAIN || en == SOCKET_EINTR ||
+ en == SOCKET_EWOULDBLOCK || en == SOCKET_ETIMEDOUT);
+}
+
+
int vio_ssl_close(Vio * vio)
{
int r;