From fb18601ee8c2e6cf8d2a9bfbaf6f7ca317b982af Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Tue, 8 Feb 2011 17:36:25 +0200 Subject: [PATCH 001/192] Bug #59815: Missing License information with enterprise GPL packages on behalf of Kent: Include the README into the binary packages --- scripts/make_win_bin_dist | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index c1d01a0342d..7859f42ca29 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -198,6 +198,7 @@ cp Docs/INSTALL-BINARY $DESTDIR/Docs/ cp Docs/manual.chm $DESTDIR/Docs/ || /bin/true cp ChangeLog $DESTDIR/Docs/ || /bin/true cp support-files/my-*.ini $DESTDIR/ +cp README $DESTDIR/ if [ -f COPYING ] ; then cp COPYING $DESTDIR/ From d5ffcb42350efa6aff05815b237183836bcc778d Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Fri, 11 Feb 2011 11:32:03 +0100 Subject: [PATCH 002/192] Raise version number after cloning 5.1.56 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 6d5bc07ba9a..dc944386f22 100644 --- a/configure.in +++ b/configure.in @@ -12,7 +12,7 @@ dnl dnl When changing the major version number please also check the switch dnl statement in mysqlbinlog::check_master_version(). You may also need dnl to update version.c in ndb. -AC_INIT([MySQL Server], [5.1.56], [], [mysql]) +AC_INIT([MySQL Server], [5.1.57], [], [mysql]) AC_CONFIG_SRCDIR([sql/mysqld.cc]) AC_CANONICAL_SYSTEM From 9afa024034cff75cca62b5c5939da1ad01d32330 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Fri, 11 Feb 2011 11:50:37 +0100 Subject: [PATCH 003/192] Raise version number after cloning 5.5.10 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 17335ff3fc5..ca1578a8642 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ MYSQL_VERSION_MAJOR=5 MYSQL_VERSION_MINOR=5 -MYSQL_VERSION_PATCH=10 +MYSQL_VERSION_PATCH=11 MYSQL_VERSION_EXTRA= From a6ea6dc217f8ed4c4ff4a6f44e091801fed0420c Mon Sep 17 00:00:00 2001 From: Magne Mahre Date: Thu, 24 Feb 2011 12:23:38 +0100 Subject: [PATCH 004/192] Bug#11767480 - SPATIAL INDEXES ON NON-SPATIAL COLUMNS CAUSE CRASHES. This is a backport of the patch for MySQL Bug#50574. Adding a SPATIAL INDEX on non-geometrical columns caused a segmentation fault when the table was subsequently inserted into. A test was added in mysql_prepare_create_table to explicitly check whether non-geometrical columns are used in a spatial index, and throw an error if so. For MySQL 5.5 and later, a new and more meaningful error message was introduced. For 5.1, we (re-)use an existing error code. --- mysql-test/r/gis.result | 33 +++++++++++++++++++++++++++++ mysql-test/t/gis.test | 47 +++++++++++++++++++++++++++++++++++++++++ sql/sql_table.cc | 22 +++++++++++++------ 3 files changed, 96 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index a9beb9631ae..151d0cfffa1 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -1034,4 +1034,37 @@ p NULL NULL drop table t1; +CREATE TABLE t0 (a BINARY(32) NOT NULL); +CREATE SPATIAL INDEX i on t0 (a); +ERROR HY000: Incorrect arguments to SPATIAL INDEX +INSERT INTO t0 VALUES (1); +CREATE TABLE t1( +col0 BINARY NOT NULL, +col2 TIMESTAMP, +SPATIAL INDEX i1 (col0) +) ENGINE=MyISAM; +ERROR HY000: Incorrect arguments to SPATIAL INDEX +CREATE TABLE t1 ( +col0 BINARY NOT NULL, +col2 TIMESTAMP +) ENGINE=MyISAM; +CREATE SPATIAL INDEX idx0 ON t1(col0); +ERROR HY000: Incorrect arguments to SPATIAL INDEX +ALTER TABLE t1 ADD SPATIAL INDEX i1 (col0); +ERROR HY000: Incorrect arguments to SPATIAL INDEX +CREATE TABLE t2 ( +col0 INTEGER NOT NULL, +col1 POINT, +col2 POINT +); +CREATE SPATIAL INDEX idx0 ON t2 (col1, col2); +ERROR HY000: Incorrect arguments to SPATIAL INDEX +CREATE TABLE t3 ( +col0 INTEGER NOT NULL, +col1 POINT, +col2 LINESTRING, +SPATIAL INDEX i1 (col1, col2) +); +ERROR HY000: Incorrect arguments to SPATIAL INDEX +DROP TABLE t0, t1, t2; End of 5.1 tests diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index bdbbfc7c064..b50df062d7e 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -754,4 +754,51 @@ insert into t1 values (geomfromtext("point(1 0)")); select * from (select polygon(t1.a) as p from t1 order by t1.a) d; drop table t1; +# +# Bug#11767480 - SPATIAL INDEXES ON NON-SPATIAL COLUMNS CAUSE CRASHES. +# +CREATE TABLE t0 (a BINARY(32) NOT NULL); +--error ER_WRONG_ARGUMENTS +CREATE SPATIAL INDEX i on t0 (a); +INSERT INTO t0 VALUES (1); + +--error ER_WRONG_ARGUMENTS +CREATE TABLE t1( + col0 BINARY NOT NULL, + col2 TIMESTAMP, + SPATIAL INDEX i1 (col0) +) ENGINE=MyISAM; + +# Test other ways to add indices +CREATE TABLE t1 ( + col0 BINARY NOT NULL, + col2 TIMESTAMP +) ENGINE=MyISAM; + +--error ER_WRONG_ARGUMENTS +CREATE SPATIAL INDEX idx0 ON t1(col0); + +--error ER_WRONG_ARGUMENTS +ALTER TABLE t1 ADD SPATIAL INDEX i1 (col0); + +CREATE TABLE t2 ( + col0 INTEGER NOT NULL, + col1 POINT, + col2 POINT +); + +--error ER_WRONG_ARGUMENTS +CREATE SPATIAL INDEX idx0 ON t2 (col1, col2); + +--error ER_WRONG_ARGUMENTS +CREATE TABLE t3 ( + col0 INTEGER NOT NULL, + col1 POINT, + col2 LINESTRING, + SPATIAL INDEX i1 (col1, col2) +); + +# cleanup +DROP TABLE t0, t1, t2; + --echo End of 5.1 tests diff --git a/sql/sql_table.cc b/sql/sql_table.cc index b919ea9eae7..c5fc037a49e 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1,4 +1,4 @@ -/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc. +/* Copyright 2000-2011, Oracle and/or its affiliates. All rights reserved. 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 @@ -11,7 +11,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA */ /* drop and alter of tables */ @@ -3184,11 +3185,20 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, { column->length*= sql_field->charset->mbmaxlen; - if (key->type == Key::SPATIAL && column->length) + if (key->type == Key::SPATIAL) { - my_error(ER_WRONG_SUB_KEY, MYF(0)); - DBUG_RETURN(TRUE); - } + if (column->length) + { + my_error(ER_WRONG_SUB_KEY, MYF(0)); + DBUG_RETURN(TRUE); + } + + if (!f_is_geom(sql_field->pack_flag)) + { + my_error(ER_WRONG_ARGUMENTS, MYF(0), "SPATIAL INDEX"); + DBUG_RETURN(TRUE); + } + } if (f_is_blob(sql_field->pack_flag) || (f_is_geom(sql_field->pack_flag) && key->type != Key::SPATIAL)) From afe4b605a366e587327f3da2ae3e625f2471e666 Mon Sep 17 00:00:00 2001 From: Jimmy Yang Date: Fri, 25 Feb 2011 00:33:13 -0800 Subject: [PATCH 005/192] Fix Bug #11765975 __FILE__ macros expanded to full path instead of relative in CMake builds rb://600 approved by Sunny Bains --- storage/innobase/handler/ha_innodb.cc | 30 ++++++++++++++++++++---- storage/innobase/include/ha_prototypes.h | 9 +++++++ storage/innobase/mem/mem0dbg.c | 13 ++++++---- storage/innobase/sync/sync0arr.c | 12 ++++++---- storage/innobase/sync/sync0rw.c | 12 ++++++---- storage/innobase/sync/sync0sync.c | 9 ++++--- storage/innobase/ut/ut0dbg.c | 9 ++++--- 7 files changed, 69 insertions(+), 25 deletions(-) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 34c4500a723..725efe33e65 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -51,6 +51,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA #include #include #include +#include /** @file ha_innodb.cc */ @@ -1146,6 +1147,20 @@ innobase_strcasecmp( return(my_strcasecmp(system_charset_info, a, b)); } +/******************************************************************//** +Strip dir name from a full path name and return only the file name +@return file name or "null" if no file name */ +extern "C" UNIV_INTERN +const char* +innobase_basename( +/*==============*/ + const char* path_name) /*!< in: full path name */ +{ + const char* name = base_name(path_name); + + return((name) ? name : "null"); +} + /******************************************************************//** Makes all characters in a NUL-terminated UTF-8 string lower case. */ extern "C" UNIV_INTERN @@ -9251,7 +9266,8 @@ innodb_mutex_show_status( if (mutex->count_using > 0) { buf1len= my_snprintf(buf1, sizeof(buf1), "%s:%s", - mutex->cmutex_name, mutex->cfile_name); + mutex->cmutex_name, + innobase_basename(mutex->cfile_name)); buf2len= my_snprintf(buf2, sizeof(buf2), "count=%lu, spin_waits=%lu," " spin_rounds=%lu, " @@ -9281,7 +9297,8 @@ innodb_mutex_show_status( } #else /* UNIV_DEBUG */ buf1len= (uint) my_snprintf(buf1, sizeof(buf1), "%s:%lu", - mutex->cfile_name, (ulong) mutex->cline); + innobase_basename(mutex->cfile_name), + (ulong) mutex->cline); buf2len= (uint) my_snprintf(buf2, sizeof(buf2), "os_waits=%lu", (ulong) mutex->count_os_wait); @@ -9297,7 +9314,8 @@ innodb_mutex_show_status( if (block_mutex) { buf1len = (uint) my_snprintf(buf1, sizeof buf1, "combined %s:%lu", - block_mutex->cfile_name, + innobase_basename( + block_mutex->cfile_name), (ulong) block_mutex->cline); buf2len = (uint) my_snprintf(buf2, sizeof buf2, "os_waits=%lu", @@ -9328,7 +9346,8 @@ innodb_mutex_show_status( } buf1len = my_snprintf(buf1, sizeof buf1, "%s:%lu", - lock->cfile_name, (ulong) lock->cline); + innobase_basename(lock->cfile_name), + (ulong) lock->cline); buf2len = my_snprintf(buf2, sizeof buf2, "os_waits=%lu", (ulong) lock->count_os_wait); @@ -9343,7 +9362,8 @@ innodb_mutex_show_status( if (block_lock) { buf1len = (uint) my_snprintf(buf1, sizeof buf1, "combined %s:%lu", - block_lock->cfile_name, + innobase_basename( + block_lock->cfile_name), (ulong) block_lock->cline); buf2len = (uint) my_snprintf(buf2, sizeof buf2, "os_waits=%lu", diff --git a/storage/innobase/include/ha_prototypes.h b/storage/innobase/include/ha_prototypes.h index b75002944bd..dd9e8db82ee 100644 --- a/storage/innobase/include/ha_prototypes.h +++ b/storage/innobase/include/ha_prototypes.h @@ -173,6 +173,15 @@ innobase_strcasecmp( const char* a, /*!< in: first string to compare */ const char* b); /*!< in: second string to compare */ +/******************************************************************//** +Strip dir name from a full path name and return only its file name. +@return file name or "null" if no file name */ +UNIV_INTERN +const char* +innobase_basename( +/*==============*/ + const char* path_name); /*!< in: full path name */ + /******************************************************************//** Returns true if the thread is executing a SELECT statement. @return true if thd is executing SELECT */ diff --git a/storage/innobase/mem/mem0dbg.c b/storage/innobase/mem/mem0dbg.c index d91e610a08a..e36a372b087 100644 --- a/storage/innobase/mem/mem0dbg.c +++ b/storage/innobase/mem/mem0dbg.c @@ -400,7 +400,7 @@ mem_hash_remove( fprintf(stderr, "Memory heap or buffer freed in %s line %lu" " did not exist.\n", - file_name, (ulong) line); + innobase_basename(file_name), (ulong) line); ut_error; } @@ -419,8 +419,9 @@ mem_hash_remove( "in %s line %lu and tried to free in %s line %lu.\n" "Hex dump of 400 bytes around memory heap" " first block start:\n", - node->nth_heap, node->file_name, (ulong) node->line, - file_name, (ulong) line); + node->nth_heap, + innobase_basename(node->file_name), (ulong) node->line, + innobase_basename(file_name), (ulong) line); ut_print_buf(stderr, (byte*)node->heap - 200, 400); fputs("\nDump of the mem heap:\n", stderr); mem_heap_validate_or_print(node->heap, NULL, TRUE, &error, @@ -763,7 +764,8 @@ mem_validate_no_assert(void) "Inconsistency in memory heap" " or buffer created\n" "in %s line %lu.\n", - node->file_name, node->line); + innobase_basename(node->file_name), + node->line); mutex_exit(&mem_hash_mutex); @@ -989,7 +991,8 @@ mem_print_info_low( fprintf(outfile, "%lu: file %s line %lu of size %lu phys.size %lu" " with %lu blocks, type %lu\n", - node->nth_heap, node->file_name, node->line, + node->nth_heap, + innobase_basename(node->file_name), node->line, allocated_mem, ph_size, n_blocks, (node->heap)->type); next_heap: diff --git a/storage/innobase/sync/sync0arr.c b/storage/innobase/sync/sync0arr.c index 3ecbce72ebd..0d1581b41b4 100644 --- a/storage/innobase/sync/sync0arr.c +++ b/storage/innobase/sync/sync0arr.c @@ -40,6 +40,7 @@ Created 9/5/1995 Heikki Tuuri #include "os0sync.h" #include "os0file.h" #include "srv0srv.h" +#include "ha_prototypes.h" /* WAIT ARRAY @@ -478,8 +479,8 @@ sync_array_cell_print( fprintf(file, "--Thread %lu has waited at %s line %lu" " for %.2f seconds the semaphore:\n", - (ulong) os_thread_pf(cell->thread), cell->file, - (ulong) cell->line, + (ulong) os_thread_pf(cell->thread), + innobase_basename(cell->file), (ulong) cell->line, difftime(time(NULL), cell->reservation_time)); if (type == SYNC_MUTEX) { @@ -493,7 +494,8 @@ sync_array_cell_print( "Last time reserved in file %s line %lu, " #endif /* UNIV_SYNC_DEBUG */ "waiters flag %lu\n", - (void*) mutex, mutex->cfile_name, (ulong) mutex->cline, + (void*) mutex, innobase_basename(mutex->cfile_name), + (ulong) mutex->cline, (ulong) mutex->lock_word, #ifdef UNIV_SYNC_DEBUG mutex->file_name, (ulong) mutex->line, @@ -512,7 +514,7 @@ sync_array_cell_print( fprintf(file, " RW-latch at %p created in file %s line %lu\n", - (void*) rwlock, rwlock->cfile_name, + (void*) rwlock, innobase_basename(rwlock->cfile_name), (ulong) rwlock->cline); writer = rw_lock_get_writer(rwlock); if (writer != RW_LOCK_NOT_LOCKED) { @@ -533,7 +535,7 @@ sync_array_cell_print( (ulong) rw_lock_get_reader_count(rwlock), (ulong) rwlock->waiters, rwlock->lock_word, - rwlock->last_s_file_name, + innobase_basename(rwlock->last_s_file_name), (ulong) rwlock->last_s_line, rwlock->last_x_file_name, (ulong) rwlock->last_x_line); diff --git a/storage/innobase/sync/sync0rw.c b/storage/innobase/sync/sync0rw.c index 73d1e3aa46e..9010e4fcec1 100644 --- a/storage/innobase/sync/sync0rw.c +++ b/storage/innobase/sync/sync0rw.c @@ -407,7 +407,8 @@ lock_loop: " cfile %s cline %lu rnds %lu\n", (ulong) os_thread_pf(os_thread_get_curr_id()), (void*) lock, - lock->cfile_name, (ulong) lock->cline, (ulong) i); + innobase_basename(lock->cfile_name), + (ulong) lock->cline, (ulong) i); } /* We try once again to obtain the lock */ @@ -442,7 +443,8 @@ lock_loop: "Thread %lu OS wait rw-s-lock at %p" " cfile %s cline %lu\n", os_thread_pf(os_thread_get_curr_id()), - (void*) lock, lock->cfile_name, + (void*) lock, + innobase_basename(lock->cfile_name), (ulong) lock->cline); } @@ -664,7 +666,8 @@ lock_loop: "Thread %lu spin wait rw-x-lock at %p" " cfile %s cline %lu rnds %lu\n", os_thread_pf(os_thread_get_curr_id()), (void*) lock, - lock->cfile_name, (ulong) lock->cline, (ulong) i); + innobase_basename(lock->cfile_name), + (ulong) lock->cline, (ulong) i); } sync_array_reserve_cell(sync_primary_wait_array, @@ -687,7 +690,8 @@ lock_loop: "Thread %lu OS wait for rw-x-lock at %p" " cfile %s cline %lu\n", os_thread_pf(os_thread_get_curr_id()), (void*) lock, - lock->cfile_name, (ulong) lock->cline); + innobase_basename(lock->cfile_name), + (ulong) lock->cline); } /* these stats may not be accurate */ diff --git a/storage/innobase/sync/sync0sync.c b/storage/innobase/sync/sync0sync.c index 0f6a60ca260..b66920a0784 100644 --- a/storage/innobase/sync/sync0sync.c +++ b/storage/innobase/sync/sync0sync.c @@ -543,7 +543,8 @@ spin_loop: "Thread %lu spin wait mutex at %p" " cfile %s cline %lu rnds %lu\n", (ulong) os_thread_pf(os_thread_get_curr_id()), (void*) mutex, - mutex->cfile_name, (ulong) mutex->cline, (ulong) i); + innobase_basename(mutex->cfile_name), + (ulong) mutex->cline, (ulong) i); #endif mutex_spin_round_count += i; @@ -620,7 +621,8 @@ spin_loop: fprintf(stderr, "Thread %lu OS wait mutex at %p cfile %s cline %lu rnds %lu\n", (ulong) os_thread_pf(os_thread_get_curr_id()), (void*) mutex, - mutex->cfile_name, (ulong) mutex->cline, (ulong) i); + innobase_basename(mutex->cfile_name), + (ulong) mutex->cline, (ulong) i); #endif mutex_os_wait_count++; @@ -869,7 +871,8 @@ sync_print_warning( if (mutex->magic_n == MUTEX_MAGIC_N) { fprintf(stderr, "Mutex created at %s %lu\n", - mutex->cfile_name, (ulong) mutex->cline); + innobase_basename(mutex->cfile_name), + (ulong) mutex->cline); if (mutex_get_lock_word(mutex) != 0) { ulint line; diff --git a/storage/innobase/ut/ut0dbg.c b/storage/innobase/ut/ut0dbg.c index 42ad8c03762..64fadd76d1c 100644 --- a/storage/innobase/ut/ut0dbg.c +++ b/storage/innobase/ut/ut0dbg.c @@ -25,6 +25,7 @@ Created 1/30/1994 Heikki Tuuri #include "univ.i" #include "ut0dbg.h" +#include "ha_prototypes.h" #if defined(__GNUC__) && (__GNUC__ > 2) #else @@ -55,12 +56,13 @@ ut_dbg_assertion_failed( ut_print_timestamp(stderr); #ifdef UNIV_HOTBACKUP fprintf(stderr, " InnoDB: Assertion failure in file %s line %lu\n", - file, line); + innobase_basename(file), line); #else /* UNIV_HOTBACKUP */ fprintf(stderr, " InnoDB: Assertion failure in thread %lu" " in file %s line %lu\n", - os_thread_pf(os_thread_get_curr_id()), file, line); + os_thread_pf(os_thread_get_curr_id()), + innobase_basename(file), line); #endif /* UNIV_HOTBACKUP */ if (expr) { fprintf(stderr, @@ -93,7 +95,8 @@ ut_dbg_stop_thread( { #ifndef UNIV_HOTBACKUP fprintf(stderr, "InnoDB: Thread %lu stopped in file %s line %lu\n", - os_thread_pf(os_thread_get_curr_id()), file, line); + os_thread_pf(os_thread_get_curr_id()), + innobase_basename(file), line); os_thread_sleep(1000000000); #endif /* !UNIV_HOTBACKUP */ } From 05c4a3518e26c8acd9cd8e2436da7e11ddbc6474 Mon Sep 17 00:00:00 2001 From: Vasil Dimov Date: Fri, 25 Feb 2011 11:50:18 +0200 Subject: [PATCH 006/192] Fix BUG#11798085 - INCORRECT INTEGER TYPES USED IN CALCULATION RESULT IN OVERFLOW Do not assign the result of the difference to a signed variable and checking whether it is negative afterwards because this limits the max diff to 2G on 32 bit systems. E.g. "signed = 3.5G - 1G" would be negative and the code would assume that 3.5G < 1G. Instead compare the two variables directly and assign to unsigned only if we know that the result of the subtraction will be positive. Discussed with: Jimmy and Sunny (via IRC) --- storage/innodb_plugin/buf/buf0buf.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/storage/innodb_plugin/buf/buf0buf.c b/storage/innodb_plugin/buf/buf0buf.c index 6bbd5565c58..51a3a393d36 100644 --- a/storage/innodb_plugin/buf/buf0buf.c +++ b/storage/innodb_plugin/buf/buf0buf.c @@ -1893,16 +1893,19 @@ buf_block_align( /* TODO: protect buf_pool->chunks with a mutex (it will currently remain constant after buf_pool_init()) */ for (chunk = buf_pool->chunks, i = buf_pool->n_chunks; i--; chunk++) { - lint offs = ptr - chunk->blocks->frame; + ulint offs; - if (UNIV_UNLIKELY(offs < 0)) { + if (UNIV_UNLIKELY(ptr < chunk->blocks->frame)) { continue; } + /* else */ + + offs = ptr - chunk->blocks->frame; offs >>= UNIV_PAGE_SIZE_SHIFT; - if (UNIV_LIKELY((ulint) offs < chunk->size)) { + if (UNIV_LIKELY(offs < chunk->size)) { buf_block_t* block = &chunk->blocks[offs]; /* The function buf_chunk_init() invokes From 1e2607318492a7e2532934ccc3cccaacf0e113f3 Mon Sep 17 00:00:00 2001 From: Jimmy Yang Date: Fri, 25 Feb 2011 03:21:02 -0800 Subject: [PATCH 007/192] Include "ha_prototypes.h" to sync/sync0rw.c for innobase_basename(). --- storage/innobase/mem/mem0dbg.c | 2 ++ storage/innobase/sync/sync0rw.c | 1 + storage/innobase/sync/sync0sync.c | 1 + 3 files changed, 4 insertions(+) diff --git a/storage/innobase/mem/mem0dbg.c b/storage/innobase/mem/mem0dbg.c index e36a372b087..ae43d6097a6 100644 --- a/storage/innobase/mem/mem0dbg.c +++ b/storage/innobase/mem/mem0dbg.c @@ -24,6 +24,8 @@ but is included in mem0mem.* ! Created 6/9/1994 Heikki Tuuri *************************************************************************/ +#include "ha_prototypes.h" + #ifdef UNIV_MEM_DEBUG # ifndef UNIV_HOTBACKUP /* The mutex which protects in the debug version the hash table diff --git a/storage/innobase/sync/sync0rw.c b/storage/innobase/sync/sync0rw.c index 9010e4fcec1..397d505df50 100644 --- a/storage/innobase/sync/sync0rw.c +++ b/storage/innobase/sync/sync0rw.c @@ -39,6 +39,7 @@ Created 9/11/1995 Heikki Tuuri #include "mem0mem.h" #include "srv0srv.h" #include "os0sync.h" /* for INNODB_RW_LOCKS_USE_ATOMICS */ +#include "ha_prototypes.h" /* IMPLEMENTATION OF THE RW_LOCK diff --git a/storage/innobase/sync/sync0sync.c b/storage/innobase/sync/sync0sync.c index b66920a0784..23fd64cc5ed 100644 --- a/storage/innobase/sync/sync0sync.c +++ b/storage/innobase/sync/sync0sync.c @@ -43,6 +43,7 @@ Created 9/5/1995 Heikki Tuuri #ifdef UNIV_SYNC_DEBUG # include "srv0start.h" /* srv_is_being_started */ #endif /* UNIV_SYNC_DEBUG */ +#include "ha_prototypes.h" /* REASONS FOR IMPLEMENTING THE SPIN LOCK MUTEX From 47741182d623f27b2f91d0e0c408dd06f9dab8e0 Mon Sep 17 00:00:00 2001 From: Vasil Dimov Date: Mon, 28 Feb 2011 10:39:48 +0200 Subject: [PATCH 008/192] Non-functional change: use plugin_author instead of hardcoded string. plugin_author is currently defined as "Innobase Oy" so this change is a no-op. --- storage/innobase/handler/i_s.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/innobase/handler/i_s.cc b/storage/innobase/handler/i_s.cc index 709274bab16..91acbf579da 100644 --- a/storage/innobase/handler/i_s.cc +++ b/storage/innobase/handler/i_s.cc @@ -1068,7 +1068,7 @@ UNIV_INTERN struct st_mysql_plugin i_s_innodb_lock_waits = /* plugin author (for SHOW PLUGINS) */ /* const char* */ - STRUCT_FLD(author, "Innobase Oy"), + STRUCT_FLD(author, plugin_author), /* general descriptive text (for SHOW PLUGINS) */ /* const char* */ From e4e154e92be8eef60a36d5efebcfd40178b2ac90 Mon Sep 17 00:00:00 2001 From: Vasil Dimov Date: Mon, 28 Feb 2011 11:02:24 +0200 Subject: [PATCH 009/192] Change InnoDB plugins author to Oracle Corporation --- storage/innobase/handler/i_s.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/innobase/handler/i_s.cc b/storage/innobase/handler/i_s.cc index 91acbf579da..3d195f8c47b 100644 --- a/storage/innobase/handler/i_s.cc +++ b/storage/innobase/handler/i_s.cc @@ -47,7 +47,7 @@ extern "C" { #include "trx0trx.h" /* for TRX_QUE_STATE_STR_MAX_LEN */ } -static const char plugin_author[] = "Innobase Oy"; +static const char plugin_author[] = "Oracle Corporation"; #define OK(expr) \ if ((expr) != 0) { \ From 7bb633e7c9890fc0c66b2d501fc4be245ecebd07 Mon Sep 17 00:00:00 2001 From: Vasil Dimov Date: Mon, 28 Feb 2011 11:07:22 +0200 Subject: [PATCH 010/192] Use plugin_author also for the InnoDB SE plugin Move the const variable plugin_author to a common header file that is being included by both ha_innodb.cc and i_s.cc --- storage/innobase/handler/ha_innodb.cc | 2 +- storage/innobase/handler/i_s.cc | 2 -- storage/innobase/handler/i_s.h | 2 ++ 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 725efe33e65..2d02dd0e770 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -11367,7 +11367,7 @@ mysql_declare_plugin(innobase) MYSQL_STORAGE_ENGINE_PLUGIN, &innobase_storage_engine, innobase_hton_name, - "Innobase Oy", + plugin_author, "Supports transactions, row-level locking, and foreign keys", PLUGIN_LICENSE_GPL, innobase_init, /* Plugin Init */ diff --git a/storage/innobase/handler/i_s.cc b/storage/innobase/handler/i_s.cc index 3d195f8c47b..f7fe8a01517 100644 --- a/storage/innobase/handler/i_s.cc +++ b/storage/innobase/handler/i_s.cc @@ -47,8 +47,6 @@ extern "C" { #include "trx0trx.h" /* for TRX_QUE_STATE_STR_MAX_LEN */ } -static const char plugin_author[] = "Oracle Corporation"; - #define OK(expr) \ if ((expr) != 0) { \ DBUG_RETURN(1); \ diff --git a/storage/innobase/handler/i_s.h b/storage/innobase/handler/i_s.h index 402c88bbedb..dc0deef119b 100644 --- a/storage/innobase/handler/i_s.h +++ b/storage/innobase/handler/i_s.h @@ -26,6 +26,8 @@ Created July 18, 2007 Vasil Dimov #ifndef i_s_h #define i_s_h +const char plugin_author[] = "Oracle Corporation"; + extern struct st_mysql_plugin i_s_innodb_trx; extern struct st_mysql_plugin i_s_innodb_locks; extern struct st_mysql_plugin i_s_innodb_lock_waits; From 8da1dfa9cb607a824c1e23c8dec44bb2c70095ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 28 Feb 2011 13:51:18 +0200 Subject: [PATCH 011/192] Bug #58549 Race condition in buf_LRU_drop_page_hash_for_tablespace() and compressed tables buf_LRU_drop_page_hash_for_tablespace(): after releasing and reacquiring the buffer pool mutex, do not dereference any block descriptor pointer that is not known to be a pointer to an uncompressed page frame (type buf_block_t; state == BUF_BLOCK_FILE_PAGE). Also, defer the acquisition of the block_mutex until it is needed. buf_page_get_gen(): Add mode == BUF_GET_IF_IN_POOL_PEEK for buffer-fixing a block without making it young in the LRU list. buf_page_get_gen(), buf_page_init(), buf_LRU_block_remove_hashed_page(): Set bpage->state = BUF_BLOCK_ZIP_FREE before buf_buddy_free(bpage), so that similar race conditions might be detected a little easier. btr_search_drop_page_hash_when_freed(): Use BUF_GET_IF_IN_POOL_PEEK when dropping the hash indexes. rb://528 approved by Jimmy Yang --- storage/innodb_plugin/ChangeLog | 6 ++ storage/innodb_plugin/btr/btr0sea.c | 4 +- storage/innodb_plugin/buf/buf0buf.c | 32 ++++++--- storage/innodb_plugin/buf/buf0lru.c | 87 +++++++++++++------------ storage/innodb_plugin/include/buf0buf.h | 4 +- 5 files changed, 81 insertions(+), 52 deletions(-) diff --git a/storage/innodb_plugin/ChangeLog b/storage/innodb_plugin/ChangeLog index 1b2747ab012..1ece3ad1825 100644 --- a/storage/innodb_plugin/ChangeLog +++ b/storage/innodb_plugin/ChangeLog @@ -1,3 +1,9 @@ +2011-02-28 The InnoDB Team + + * btr/btr0sea.c, buf/buf0buf.c, buf/buf0lru.c: + Fix Bug#58549 Race condition in buf_LRU_drop_page_hash_for_tablespace() + and compressed tables + 2011-02-15 The InnoDB Team * sync/sync0rw.c, innodb_bug59307.test: diff --git a/storage/innodb_plugin/btr/btr0sea.c b/storage/innodb_plugin/btr/btr0sea.c index 9835efcf712..cd0eadbb1b8 100644 --- a/storage/innodb_plugin/btr/btr0sea.c +++ b/storage/innodb_plugin/btr/btr0sea.c @@ -1201,8 +1201,8 @@ btr_search_drop_page_hash_when_freed( having to fear a deadlock. */ block = buf_page_get_gen(space, zip_size, page_no, RW_S_LATCH, NULL, - BUF_GET_IF_IN_POOL, __FILE__, __LINE__, - &mtr); + BUF_PEEK_IF_IN_POOL, __FILE__, __LINE__, + &mtr); /* Because the buffer pool mutex was released by buf_page_peek_if_search_hashed(), it is possible that the block was removed from the buffer pool by another thread diff --git a/storage/innodb_plugin/buf/buf0buf.c b/storage/innodb_plugin/buf/buf0buf.c index 51a3a393d36..14ec7b75911 100644 --- a/storage/innodb_plugin/buf/buf0buf.c +++ b/storage/innodb_plugin/buf/buf0buf.c @@ -2031,7 +2031,7 @@ buf_page_get_gen( ulint rw_latch,/*!< in: RW_S_LATCH, RW_X_LATCH, RW_NO_LATCH */ buf_block_t* guess, /*!< in: guessed block or NULL */ ulint mode, /*!< in: BUF_GET, BUF_GET_IF_IN_POOL, - BUF_GET_NO_LATCH */ + BUF_PEEK_IF_IN_POOL, BUF_GET_NO_LATCH */ const char* file, /*!< in: file name */ ulint line, /*!< in: line where called */ mtr_t* mtr) /*!< in: mini-transaction */ @@ -2047,9 +2047,19 @@ buf_page_get_gen( ut_ad((rw_latch == RW_S_LATCH) || (rw_latch == RW_X_LATCH) || (rw_latch == RW_NO_LATCH)); - ut_ad((mode != BUF_GET_NO_LATCH) || (rw_latch == RW_NO_LATCH)); - ut_ad((mode == BUF_GET) || (mode == BUF_GET_IF_IN_POOL) - || (mode == BUF_GET_NO_LATCH)); +#ifdef UNIV_DEBUG + switch (mode) { + case BUF_GET_NO_LATCH: + ut_ad(rw_latch == RW_NO_LATCH); + break; + case BUF_GET: + case BUF_GET_IF_IN_POOL: + case BUF_PEEK_IF_IN_POOL: + break; + default: + ut_error; + } +#endif /* UNIV_DEBUG */ ut_ad(zip_size == fil_space_get_zip_size(space)); ut_ad(ut_is_2pow(zip_size)); #ifndef UNIV_LOG_DEBUG @@ -2091,7 +2101,8 @@ loop2: buf_pool_mutex_exit(); - if (mode == BUF_GET_IF_IN_POOL) { + if (mode == BUF_GET_IF_IN_POOL + || mode == BUF_PEEK_IF_IN_POOL) { return(NULL); } @@ -2130,7 +2141,8 @@ loop2: must_read = buf_block_get_io_fix(block) == BUF_IO_READ; - if (must_read && mode == BUF_GET_IF_IN_POOL) { + if (must_read && (mode == BUF_GET_IF_IN_POOL + || mode == BUF_PEEK_IF_IN_POOL)) { /* The page is only being read to buffer */ buf_pool_mutex_exit(); @@ -2248,6 +2260,7 @@ wait_until_unfixed: mutex_exit(&buf_pool_zip_mutex); buf_pool->n_pend_unzip++; + bpage->state = BUF_BLOCK_ZIP_FREE; buf_buddy_free(bpage, sizeof *bpage); buf_pool_mutex_exit(); @@ -2324,7 +2337,9 @@ wait_until_unfixed: buf_pool_mutex_exit(); - buf_page_set_accessed_make_young(&block->page, access_time); + if (UNIV_LIKELY(mode != BUF_PEEK_IF_IN_POOL)) { + buf_page_set_accessed_make_young(&block->page, access_time); + } #if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG ut_a(!block->page.file_page_was_freed); @@ -2377,7 +2392,7 @@ wait_until_unfixed: mtr_memo_push(mtr, block, fix_type); - if (!access_time) { + if (UNIV_LIKELY(mode != BUF_PEEK_IF_IN_POOL) && !access_time) { /* In the case of a first access, try to apply linear read-ahead */ @@ -2926,6 +2941,7 @@ err_exit: && UNIV_LIKELY_NULL(buf_page_hash_get(space, offset))) { /* The block was added by some other thread. */ + bpage->state = BUF_BLOCK_ZIP_FREE; buf_buddy_free(bpage, sizeof *bpage); buf_buddy_free(data, zip_size); diff --git a/storage/innodb_plugin/buf/buf0lru.c b/storage/innodb_plugin/buf/buf0lru.c index 39feb06ff23..a69b2658c51 100644 --- a/storage/innodb_plugin/buf/buf0lru.c +++ b/storage/innodb_plugin/buf/buf0lru.c @@ -246,71 +246,75 @@ buf_LRU_drop_page_hash_for_tablespace( page_arr = ut_malloc(sizeof(ulint) * BUF_LRU_DROP_SEARCH_HASH_SIZE); buf_pool_mutex_enter(); + num_entries = 0; scan_again: - num_entries = 0; bpage = UT_LIST_GET_LAST(buf_pool->LRU); while (bpage != NULL) { - mutex_t* block_mutex = buf_page_get_mutex(bpage); buf_page_t* prev_bpage; + ibool is_fixed; - mutex_enter(block_mutex); prev_bpage = UT_LIST_GET_PREV(LRU, bpage); ut_a(buf_page_in_file(bpage)); if (buf_page_get_state(bpage) != BUF_BLOCK_FILE_PAGE || bpage->space != id - || bpage->buf_fix_count > 0 || bpage->io_fix != BUF_IO_NONE) { - /* We leave the fixed pages as is in this scan. - To be dealt with later in the final scan. */ - mutex_exit(block_mutex); + /* Compressed pages are never hashed. + Skip blocks of other tablespaces. + Skip I/O-fixed blocks (to be dealt with later). */ +next_page: + bpage = prev_bpage; + continue; + } + + mutex_enter(&((buf_block_t*) bpage)->mutex); + is_fixed = bpage->buf_fix_count > 0 + || !((buf_block_t*) bpage)->is_hashed; + mutex_exit(&((buf_block_t*) bpage)->mutex); + + if (is_fixed) { goto next_page; } - if (((buf_block_t*) bpage)->is_hashed) { + /* Store the page number so that we can drop the hash + index in a batch later. */ + page_arr[num_entries] = bpage->offset; + ut_a(num_entries < BUF_LRU_DROP_SEARCH_HASH_SIZE); + ++num_entries; - /* Store the offset(i.e.: page_no) in the array - so that we can drop hash index in a batch - later. */ - page_arr[num_entries] = bpage->offset; - mutex_exit(block_mutex); - ut_a(num_entries < BUF_LRU_DROP_SEARCH_HASH_SIZE); - ++num_entries; - - if (num_entries < BUF_LRU_DROP_SEARCH_HASH_SIZE) { - goto next_page; - } - /* Array full. We release the buf_pool_mutex to - obey the latching order. */ - buf_pool_mutex_exit(); - - buf_LRU_drop_page_hash_batch(id, zip_size, page_arr, - num_entries); - num_entries = 0; - buf_pool_mutex_enter(); - } else { - mutex_exit(block_mutex); + if (num_entries < BUF_LRU_DROP_SEARCH_HASH_SIZE) { + goto next_page; } -next_page: - /* Note that we may have released the buf_pool mutex - above after reading the prev_bpage during processing - of a page_hash_batch (i.e.: when the array was full). - This means that prev_bpage can change in LRU list. - This is OK because this function is a 'best effort' - to drop as many search hash entries as possible and - it does not guarantee that ALL such entries will be - dropped. */ - bpage = prev_bpage; + /* Array full. We release the buf_pool_mutex to + obey the latching order. */ + buf_pool_mutex_exit(); + buf_LRU_drop_page_hash_batch(id, zip_size, page_arr, + num_entries); + buf_pool_mutex_enter(); + num_entries = 0; + + /* Note that we released the buf_pool mutex above + after reading the prev_bpage during processing of a + page_hash_batch (i.e.: when the array was full). + Because prev_bpage could belong to a compressed-only + block, it may have been relocated, and thus the + pointer cannot be trusted. Because bpage is of type + buf_block_t, it is safe to dereference. + + bpage can change in the LRU list. This is OK because + this function is a 'best effort' to drop as many + search hash entries as possible and it does not + guarantee that ALL such entries will be dropped. */ /* If, however, bpage has been removed from LRU list to the free list then we should restart the scan. bpage->state is protected by buf_pool mutex. */ - if (bpage && !buf_page_in_file(bpage)) { - ut_a(num_entries == 0); + if (bpage + && buf_page_get_state(bpage) != BUF_BLOCK_FILE_PAGE) { goto scan_again; } } @@ -1799,6 +1803,7 @@ buf_LRU_block_remove_hashed_page( buf_pool_mutex_exit_forbid(); buf_buddy_free(bpage->zip.data, page_zip_get_size(&bpage->zip)); + bpage->state = BUF_BLOCK_ZIP_FREE; buf_buddy_free(bpage, sizeof(*bpage)); buf_pool_mutex_exit_allow(); UNIV_MEM_UNDESC(bpage); diff --git a/storage/innodb_plugin/include/buf0buf.h b/storage/innodb_plugin/include/buf0buf.h index a16de67aa3a..05dead5ac9e 100644 --- a/storage/innodb_plugin/include/buf0buf.h +++ b/storage/innodb_plugin/include/buf0buf.h @@ -41,6 +41,8 @@ Created 11/5/1995 Heikki Tuuri /* @{ */ #define BUF_GET 10 /*!< get always */ #define BUF_GET_IF_IN_POOL 11 /*!< get if in pool */ +#define BUF_PEEK_IF_IN_POOL 12 /*!< get if in pool, do not make + the block young in the LRU list */ #define BUF_GET_NO_LATCH 14 /*!< get and bufferfix, but set no latch; we have separated this case, because @@ -284,7 +286,7 @@ buf_page_get_gen( ulint rw_latch,/*!< in: RW_S_LATCH, RW_X_LATCH, RW_NO_LATCH */ buf_block_t* guess, /*!< in: guessed block or NULL */ ulint mode, /*!< in: BUF_GET, BUF_GET_IF_IN_POOL, - BUF_GET_NO_LATCH */ + BUF_PEEK_IF_IN_POOL, BUF_GET_NO_LATCH */ const char* file, /*!< in: file name */ ulint line, /*!< in: line where called */ mtr_t* mtr); /*!< in: mini-transaction */ From 929d13ca4977ed1fa3dcbe6628c393ffc148004f Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Thu, 3 Mar 2011 11:43:07 +0300 Subject: [PATCH 012/192] BUG#11764339 - valgrind errors, random data when returning ordered data from archive tables Archive was using wrong memory address to check if field is NULL (after filesort, when reading record again). --- mysql-test/r/archive.result | 16 ++++++++++++++++ mysql-test/t/archive.test | 15 +++++++++++++++ storage/archive/ha_archive.cc | 2 +- 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/archive.result b/mysql-test/r/archive.result index f90bcb521e1..15ded03f414 100644 --- a/mysql-test/r/archive.result +++ b/mysql-test/r/archive.result @@ -12756,3 +12756,19 @@ a 1 2 DROP TABLE t1; +# +# BUG#57162 - valgrind errors, random data when returning +# ordered data from archive tables +# +SET sort_buffer_size=32804; +CREATE TABLE t1(a INT, b CHAR(255), c CHAR(255), d CHAR(255), +e CHAR(255), f INT) ENGINE=ARCHIVE DEFAULT CHARSET utf8; +INSERT INTO t1 VALUES(-1,'b','c','d','e',1); +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT t1.* FROM t1,t1 t2,t1 t3,t1 t4,t1 t5,t1 t6; +SELECT * FROM t1 ORDER BY f LIMIT 1; +a b c d e f +-1 b c d e 1 +DROP TABLE t1; +SET sort_buffer_size=DEFAULT; diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test index 7084f5f540e..98ba5e03ede 100644 --- a/mysql-test/t/archive.test +++ b/mysql-test/t/archive.test @@ -1678,3 +1678,18 @@ SELECT * FROM t1; REPAIR TABLE t1 EXTENDED; SELECT * FROM t1; DROP TABLE t1; + +--echo # +--echo # BUG#57162 - valgrind errors, random data when returning +--echo # ordered data from archive tables +--echo # +SET sort_buffer_size=32804; +CREATE TABLE t1(a INT, b CHAR(255), c CHAR(255), d CHAR(255), + e CHAR(255), f INT) ENGINE=ARCHIVE DEFAULT CHARSET utf8; +INSERT INTO t1 VALUES(-1,'b','c','d','e',1); +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT t1.* FROM t1,t1 t2,t1 t3,t1 t4,t1 t5,t1 t6; +SELECT * FROM t1 ORDER BY f LIMIT 1; +DROP TABLE t1; +SET sort_buffer_size=DEFAULT; diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc index 988337ec50e..9740bf934cd 100644 --- a/storage/archive/ha_archive.cc +++ b/storage/archive/ha_archive.cc @@ -1111,7 +1111,7 @@ int ha_archive::unpack_row(azio_stream *file_to_read, uchar *record) ptr+= table->s->null_bytes; for (Field **field=table->field ; *field ; field++) { - if (!((*field)->is_null())) + if (!((*field)->is_null_in_record(record))) { ptr= (*field)->unpack(record + (*field)->offset(table->record[0]), ptr); } From 4148b03910b5642cd77c9d4512d56e6d04d578b7 Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Thu, 3 Mar 2011 15:25:41 +0100 Subject: [PATCH 013/192] Bug #11792200 - DIVIDING LARGE NUMBERS CAUSES STACK CORRUPTIONS This was a buffer overrun in do_div_mod(), overwriting the internal buffer of auto variable 'tmp' in Item_func_int_div::val_int. Result on windows: 'this' is set to zero, and crash. Ran fine on other platforms (no valgrind warnings), but this is undefined behaviour on any platform of course. --- include/decimal.h | 22 +++++++++--------- mysql-test/r/func_math.result | 8 +++++++ mysql-test/t/func_math.test | 5 ++++ sql/my_decimal.h | 43 +++++++++++++++++++---------------- strings/decimal.c | 40 +++++++++++++++++--------------- 5 files changed, 69 insertions(+), 49 deletions(-) diff --git a/include/decimal.h b/include/decimal.h index 530ed9e1757..90946f65ac6 100644 --- a/include/decimal.h +++ b/include/decimal.h @@ -29,14 +29,14 @@ typedef struct st_decimal_t { int internal_str2dec(const char *from, decimal_t *to, char **end, my_bool fixed); -int decimal2string(decimal_t *from, char *to, int *to_len, +int decimal2string(const decimal_t *from, char *to, int *to_len, int fixed_precision, int fixed_decimals, char filler); int decimal2ulonglong(decimal_t *from, ulonglong *to); int ulonglong2decimal(ulonglong from, decimal_t *to); int decimal2longlong(decimal_t *from, longlong *to); int longlong2decimal(longlong from, decimal_t *to); -int decimal2double(decimal_t *from, double *to); +int decimal2double(const decimal_t *from, double *to); int double2decimal(double from, decimal_t *to); int decimal_actual_fraction(decimal_t *from); int decimal2bin(decimal_t *from, uchar *to, int precision, int scale); @@ -47,17 +47,17 @@ int decimal_bin_size(int precision, int scale); int decimal_result_size(decimal_t *from1, decimal_t *from2, char op, int param); -int decimal_intg(decimal_t *from); -int decimal_add(decimal_t *from1, decimal_t *from2, decimal_t *to); -int decimal_sub(decimal_t *from1, decimal_t *from2, decimal_t *to); -int decimal_cmp(decimal_t *from1, decimal_t *from2); -int decimal_mul(decimal_t *from1, decimal_t *from2, decimal_t *to); -int decimal_div(decimal_t *from1, decimal_t *from2, decimal_t *to, +int decimal_intg(const decimal_t *from); +int decimal_add(const decimal_t *from1, const decimal_t *from2, decimal_t *to); +int decimal_sub(const decimal_t *from1, const decimal_t *from2, decimal_t *to); +int decimal_cmp(const decimal_t *from1, const decimal_t *from2); +int decimal_mul(const decimal_t *from1, const decimal_t *from2, decimal_t *to); +int decimal_div(const decimal_t *from1, const decimal_t *from2, decimal_t *to, int scale_incr); -int decimal_mod(decimal_t *from1, decimal_t *from2, decimal_t *to); -int decimal_round(decimal_t *from, decimal_t *to, int new_scale, +int decimal_mod(const decimal_t *from1, const decimal_t *from2, decimal_t *to); +int decimal_round(const decimal_t *from, decimal_t *to, int new_scale, decimal_round_mode mode); -int decimal_is_zero(decimal_t *from); +int decimal_is_zero(const decimal_t *from); void max_decimal(int precision, int frac, decimal_t *to); #define string2decimal(A,B,C) internal_str2dec((A), (B), (C), 0) diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result index 3149a2a3344..57ec0cc0aca 100644 --- a/mysql-test/r/func_math.result +++ b/mysql-test/r/func_math.result @@ -656,3 +656,11 @@ Warning 1366 Incorrect decimal value: '' for column '' at row -1 SELECT 1 div null; 1 div null NULL +# +# Bug #11792200 - DIVIDING LARGE NUMBERS CAUSES STACK CORRUPTIONS +# +select (1.175494351E-37 div 1.7976931348623157E+308); +(1.175494351E-37 div 1.7976931348623157E+308) +0 +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '' diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test index e56b9c7d20d..daa338a8424 100644 --- a/mysql-test/t/func_math.test +++ b/mysql-test/t/func_math.test @@ -500,3 +500,8 @@ SELECT ((@a:=@b:=1.0) div (@b:=@a:=get_format(datetime, 'usa'))); --echo # Bug #59498 div function broken in mysql-trunk --echo # SELECT 1 div null; + +--echo # +--echo # Bug #11792200 - DIVIDING LARGE NUMBERS CAUSES STACK CORRUPTIONS +--echo # +select (1.175494351E-37 div 1.7976931348623157E+308); diff --git a/sql/my_decimal.h b/sql/my_decimal.h index e2f5c95dac2..f3fd39f5721 100644 --- a/sql/my_decimal.h +++ b/sql/my_decimal.h @@ -178,7 +178,7 @@ void max_my_decimal(my_decimal *to, int precision, int frac) { DBUG_ASSERT((precision <= DECIMAL_MAX_PRECISION)&& (frac <= DECIMAL_MAX_SCALE)); - max_decimal(precision, frac, (decimal_t*) to); + max_decimal(precision, frac, to); } inline void max_internal_decimal(my_decimal *to) @@ -277,14 +277,19 @@ inline int binary2my_decimal(uint mask, const uchar *bin, my_decimal *d, int prec, int scale) { - return check_result(mask, bin2decimal(bin, (decimal_t*) d, prec, scale)); + return check_result(mask, bin2decimal(bin, d, prec, scale)); } inline int my_decimal_set_zero(my_decimal *d) { - decimal_make_zero(((decimal_t*) d)); + /* + We need the up-cast here, since my_decimal has sign() member functions, + which conflicts with decimal_t::size + (and decimal_make_zero is a macro, rather than a funcion). + */ + decimal_make_zero(static_cast(d)); return 0; } @@ -292,7 +297,7 @@ int my_decimal_set_zero(my_decimal *d) inline bool my_decimal_is_zero(const my_decimal *decimal_value) { - return decimal_is_zero((decimal_t*) decimal_value); + return decimal_is_zero(decimal_value); } @@ -300,7 +305,7 @@ inline int my_decimal_round(uint mask, const my_decimal *from, int scale, bool truncate, my_decimal *to) { - return check_result(mask, decimal_round((decimal_t*) from, to, scale, + return check_result(mask, decimal_round(from, to, scale, (truncate ? TRUNCATE : HALF_UP))); } @@ -308,14 +313,14 @@ int my_decimal_round(uint mask, const my_decimal *from, int scale, inline int my_decimal_floor(uint mask, const my_decimal *from, my_decimal *to) { - return check_result(mask, decimal_round((decimal_t*) from, to, 0, FLOOR)); + return check_result(mask, decimal_round(from, to, 0, FLOOR)); } inline int my_decimal_ceiling(uint mask, const my_decimal *from, my_decimal *to) { - return check_result(mask, decimal_round((decimal_t*) from, to, 0, CEILING)); + return check_result(mask, decimal_round(from, to, 0, CEILING)); } @@ -337,7 +342,7 @@ int my_decimal2int(uint mask, const my_decimal *d, my_bool unsigned_flag, { my_decimal rounded; /* decimal_round can return only E_DEC_TRUNCATED */ - decimal_round((decimal_t*)d, &rounded, 0, HALF_UP); + decimal_round(d, &rounded, 0, HALF_UP); return check_result(mask, (unsigned_flag ? decimal2ulonglong(&rounded, (ulonglong *)l) : decimal2longlong(&rounded, l))); @@ -348,15 +353,14 @@ inline int my_decimal2double(uint, const my_decimal *d, double *result) { /* No need to call check_result as this will always succeed */ - return decimal2double((decimal_t*) d, result); + return decimal2double(d, result); } inline int str2my_decimal(uint mask, const char *str, my_decimal *d, char **end) { - return check_result_and_overflow(mask, string2decimal(str,(decimal_t*)d,end), - d); + return check_result_and_overflow(mask, string2decimal(str, d, end), d); } @@ -379,7 +383,7 @@ my_decimal *date2my_decimal(MYSQL_TIME *ltime, my_decimal *dec); inline int double2my_decimal(uint mask, double val, my_decimal *d) { - return check_result_and_overflow(mask, double2decimal(val, (decimal_t*)d), d); + return check_result_and_overflow(mask, double2decimal(val, d), d); } @@ -409,7 +413,7 @@ int my_decimal_add(uint mask, my_decimal *res, const my_decimal *a, const my_decimal *b) { return check_result_and_overflow(mask, - decimal_add((decimal_t*)a,(decimal_t*)b,res), + decimal_add(a, b, res), res); } @@ -419,7 +423,7 @@ int my_decimal_sub(uint mask, my_decimal *res, const my_decimal *a, const my_decimal *b) { return check_result_and_overflow(mask, - decimal_sub((decimal_t*)a,(decimal_t*)b,res), + decimal_sub(a, b, res), res); } @@ -429,7 +433,7 @@ int my_decimal_mul(uint mask, my_decimal *res, const my_decimal *a, const my_decimal *b) { return check_result_and_overflow(mask, - decimal_mul((decimal_t*)a,(decimal_t*)b,res), + decimal_mul(a, b, res), res); } @@ -439,8 +443,7 @@ int my_decimal_div(uint mask, my_decimal *res, const my_decimal *a, const my_decimal *b, int div_scale_inc) { return check_result_and_overflow(mask, - decimal_div((decimal_t*)a,(decimal_t*)b,res, - div_scale_inc), + decimal_div(a, b, res, div_scale_inc), res); } @@ -450,7 +453,7 @@ int my_decimal_mod(uint mask, my_decimal *res, const my_decimal *a, const my_decimal *b) { return check_result_and_overflow(mask, - decimal_mod((decimal_t*)a,(decimal_t*)b,res), + decimal_mod(a, b, res), res); } @@ -462,14 +465,14 @@ int my_decimal_mod(uint mask, my_decimal *res, const my_decimal *a, inline int my_decimal_cmp(const my_decimal *a, const my_decimal *b) { - return decimal_cmp((decimal_t*) a, (decimal_t*) b); + return decimal_cmp(a, b); } inline int my_decimal_intg(const my_decimal *a) { - return decimal_intg((decimal_t*) a); + return decimal_intg(a); } diff --git a/strings/decimal.c b/strings/decimal.c index e081c063033..4766c3b2d00 100644 --- a/strings/decimal.c +++ b/strings/decimal.c @@ -248,7 +248,7 @@ void max_decimal(int precision, int frac, decimal_t *to) } -static dec1 *remove_leading_zeroes(decimal_t *from, int *intg_result) +static dec1 *remove_leading_zeroes(const decimal_t *from, int *intg_result) { int intg= from->intg, i; dec1 *buf0= from->buf; @@ -326,7 +326,7 @@ int decimal_actual_fraction(decimal_t *from) E_DEC_OK/E_DEC_TRUNCATED/E_DEC_OVERFLOW */ -int decimal2string(decimal_t *from, char *to, int *to_len, +int decimal2string(const decimal_t *from, char *to, int *to_len, int fixed_precision, int fixed_decimals, char filler) { @@ -942,7 +942,7 @@ fatal_error: E_DEC_OK/E_DEC_OVERFLOW/E_DEC_TRUNCATED */ -int decimal2double(decimal_t *from, double *to) +int decimal2double(const decimal_t *from, double *to) { char strbuf[FLOATING_POINT_BUFFER], *end; int len= sizeof(strbuf); @@ -1461,7 +1461,7 @@ int decimal_bin_size(int precision, int scale) */ int -decimal_round(decimal_t *from, decimal_t *to, int scale, +decimal_round(const decimal_t *from, decimal_t *to, int scale, decimal_round_mode mode) { int frac0=scale>0 ? ROUND_UP(scale) : scale/DIG_PER_DEC1, @@ -1695,7 +1695,7 @@ int decimal_result_size(decimal_t *from1, decimal_t *from2, char op, int param) return -1; /* shut up the warning */ } -static int do_add(decimal_t *from1, decimal_t *from2, decimal_t *to) +static int do_add(const decimal_t *from1, const decimal_t *from2, decimal_t *to) { int intg1=ROUND_UP(from1->intg), intg2=ROUND_UP(from2->intg), frac1=ROUND_UP(from1->frac), frac2=ROUND_UP(from2->frac), @@ -1777,7 +1777,7 @@ static int do_add(decimal_t *from1, decimal_t *from2, decimal_t *to) /* to=from1-from2. if to==0, return -1/0/+1 - the result of the comparison */ -static int do_sub(decimal_t *from1, decimal_t *from2, decimal_t *to) +static int do_sub(const decimal_t *from1, const decimal_t *from2, decimal_t *to) { int intg1=ROUND_UP(from1->intg), intg2=ROUND_UP(from2->intg), frac1=ROUND_UP(from1->frac), frac2=ROUND_UP(from2->frac); @@ -1846,7 +1846,7 @@ static int do_sub(decimal_t *from1, decimal_t *from2, decimal_t *to) /* ensure that always from1 > from2 (and intg1 >= intg2) */ if (carry) { - swap_variables(decimal_t *,from1,from1); + swap_variables(const decimal_t *, from1, from2); swap_variables(dec1 *,start1, start2); swap_variables(int,intg1,intg2); swap_variables(int,frac1,frac2); @@ -1912,35 +1912,35 @@ static int do_sub(decimal_t *from1, decimal_t *from2, decimal_t *to) return error; } -int decimal_intg(decimal_t *from) +int decimal_intg(const decimal_t *from) { int res; remove_leading_zeroes(from, &res); return res; } -int decimal_add(decimal_t *from1, decimal_t *from2, decimal_t *to) +int decimal_add(const decimal_t *from1, const decimal_t *from2, decimal_t *to) { if (likely(from1->sign == from2->sign)) return do_add(from1, from2, to); return do_sub(from1, from2, to); } -int decimal_sub(decimal_t *from1, decimal_t *from2, decimal_t *to) +int decimal_sub(const decimal_t *from1, const decimal_t *from2, decimal_t *to) { if (likely(from1->sign == from2->sign)) return do_sub(from1, from2, to); return do_add(from1, from2, to); } -int decimal_cmp(decimal_t *from1, decimal_t *from2) +int decimal_cmp(const decimal_t *from1, const decimal_t *from2) { if (likely(from1->sign == from2->sign)) return do_sub(from1, from2, 0); return from1->sign > from2->sign ? -1 : 1; } -int decimal_is_zero(decimal_t *from) +int decimal_is_zero(const decimal_t *from) { dec1 *buf1=from->buf, *end=buf1+ROUND_UP(from->intg)+ROUND_UP(from->frac); @@ -1971,7 +1971,7 @@ int decimal_is_zero(decimal_t *from) XXX if this library is to be used with huge numbers of thousands of digits, fast multiplication must be implemented. */ -int decimal_mul(decimal_t *from1, decimal_t *from2, decimal_t *to) +int decimal_mul(const decimal_t *from1, const decimal_t *from2, decimal_t *to) { int intg1=ROUND_UP(from1->intg), intg2=ROUND_UP(from2->intg), frac1=ROUND_UP(from1->frac), frac2=ROUND_UP(from2->frac), @@ -2095,8 +2095,8 @@ int decimal_mul(decimal_t *from1, decimal_t *from2, decimal_t *to) changed to malloc (or at least fallback to malloc if alloca() fails) but then, decimal_mul() should be rewritten too :( */ -static int do_div_mod(decimal_t *from1, decimal_t *from2, - decimal_t *to, decimal_t *mod, int scale_incr) +static int do_div_mod(const decimal_t *from1, const decimal_t *from2, + decimal_t *to, decimal_t *mod, int scale_incr) { int frac1=ROUND_UP(from1->frac)*DIG_PER_DEC1, prec1=from1->intg+frac1, frac2=ROUND_UP(from2->frac)*DIG_PER_DEC1, prec2=from2->intg+frac2, @@ -2181,9 +2181,12 @@ static int do_div_mod(decimal_t *from1, decimal_t *from2, } buf0=to->buf; stop0=buf0+intg0+frac0; + DBUG_ASSERT(stop0 <= &to->buf[to->len]); if (likely(div_mod)) - while (dintg++ < 0) + while (dintg++ < 0 && buf0 < &to->buf[to->len]) + { *buf0++=0; + } len1=(i=ROUND_UP(prec1))+ROUND_UP(2*frac2+scale_incr+1) + 1; set_if_bigger(len1, 3); @@ -2355,7 +2358,8 @@ done: */ int -decimal_div(decimal_t *from1, decimal_t *from2, decimal_t *to, int scale_incr) +decimal_div(const decimal_t *from1, const decimal_t *from2, decimal_t *to, + int scale_incr) { return do_div_mod(from1, from2, to, 0, scale_incr); } @@ -2387,7 +2391,7 @@ decimal_div(decimal_t *from1, decimal_t *from2, decimal_t *to, int scale_incr) thus, there's no requirement for M or N to be integers */ -int decimal_mod(decimal_t *from1, decimal_t *from2, decimal_t *to) +int decimal_mod(const decimal_t *from1, const decimal_t *from2, decimal_t *to) { return do_div_mod(from1, from2, 0, to, 0); } From 6c85d6535781870e9d35a0f00ace9ef42edf3e90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Bl=C3=A5udd?= Date: Fri, 4 Mar 2011 09:41:29 +0100 Subject: [PATCH 014/192] Bug#60111 storage type for table not saved in .frm - Add new "format section" in extra data segment with additional table and column properties. This was originally introduced in 5.1.20 based MySQL Cluster - Remove hardcoded STORAGE DISK for table and instead output the real storage format used. Keep both TABLESPACE and STORAGE inside same version guard. - Implement default version of handler::get_tablespace_name() since tablespace is now available in share and it's unnecessary for each handler to implement. (the function could actually be removed totally now). - Add test for combinations of TABLESPACE and STORAGE with CREATE TABLE and ALTER TABLE - Add test to show that 5.5 now can read a .frm file created by MySQL Cluster 7.0.22. Although it does not yet show the column level attributes, they are read. --- include/mysql_com.h | 4 + mysql-test/r/tablespace.result | 112 +++++++++++++++++++ mysql-test/std_data/cluster_7022_table.MYD | 0 mysql-test/std_data/cluster_7022_table.MYI | Bin 0 -> 1024 bytes mysql-test/std_data/cluster_7022_table.frm | Bin 0 -> 8794 bytes mysql-test/t/tablespace.test | 122 +++++++++++++++++++++ sql/handler.cc | 16 +++ sql/handler.h | 3 +- sql/sql_show.cc | 25 +++-- sql/sql_table.cc | 17 +-- sql/table.cc | 95 +++++++++++++--- sql/table.h | 2 + sql/unireg.cc | 64 +++++++++++ 13 files changed, 421 insertions(+), 39 deletions(-) create mode 100644 mysql-test/r/tablespace.result create mode 100644 mysql-test/std_data/cluster_7022_table.MYD create mode 100644 mysql-test/std_data/cluster_7022_table.MYI create mode 100644 mysql-test/std_data/cluster_7022_table.frm create mode 100644 mysql-test/t/tablespace.test diff --git a/include/mysql_com.h b/include/mysql_com.h index f4c023721de..c35a604781d 100644 --- a/include/mysql_com.h +++ b/include/mysql_com.h @@ -114,6 +114,10 @@ enum enum_server_command #define FIELD_IN_PART_FUNC_FLAG (1 << 19)/* Field part of partition func */ #define FIELD_IN_ADD_INDEX (1<< 20) /* Intern: Field used in ADD INDEX */ #define FIELD_IS_RENAMED (1<< 21) /* Intern: Field is being renamed */ +#define FIELD_FLAGS_STORAGE_MEDIA 22 /* Field storage media, bit 22-23, + reserved by MySQL Cluster */ +#define FIELD_FLAGS_COLUMN_FORMAT 24 /* Field column format, bit 24-25, + reserved by MySQL Cluster */ #define REFRESH_GRANT 1 /* Refresh grant tables */ #define REFRESH_LOG 2 /* Start on new log file */ diff --git a/mysql-test/r/tablespace.result b/mysql-test/r/tablespace.result new file mode 100644 index 00000000000..38d450ae430 --- /dev/null +++ b/mysql-test/r/tablespace.result @@ -0,0 +1,112 @@ +CREATE TABLE t1(a int) TABLESPACE ts ENGINE=MyISAM; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 TABLESPACE ts */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(a int) TABLESPACE ts STORAGE DISK ENGINE=MyISAM; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 TABLESPACE ts STORAGE DISK */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(a int) TABLESPACE ts STORAGE MEMORY ENGINE=MyISAM; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 TABLESPACE ts STORAGE MEMORY */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(a int) STORAGE MEMORY ENGINE=MyISAM; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 STORAGE MEMORY */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(a int) STORAGE DISK ENGINE=MyISAM; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 STORAGE DISK */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(a int) TABLESPACE ts ENGINE=MyISAM; +ALTER TABLE t1 ADD COLUMN b int; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) /*!50100 TABLESPACE ts */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(a int) TABLESPACE ts STORAGE DISK ENGINE=MyISAM; +ALTER TABLE t1 ADD COLUMN b int; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) /*!50100 TABLESPACE ts STORAGE DISK */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(a int) ENGINE=MyISAM; +ALTER TABLE t1 TABLESPACE ts; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 TABLESPACE ts */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +ALTER TABLE t1 TABLESPACE ts2; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 TABLESPACE ts2 */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(a int) ENGINE=MyISAM; +ALTER TABLE t1 STORAGE MEMORY; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 STORAGE MEMORY */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +ALTER TABLE t1 STORAGE DISK; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 STORAGE DISK */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(a int) ENGINE=MyISAM; +ALTER TABLE t1 STORAGE MEMORY TABLESPACE ts; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 TABLESPACE ts STORAGE MEMORY */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +ALTER TABLE t1 STORAGE DISK TABLESPACE ts2; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) /*!50100 TABLESPACE ts2 STORAGE DISK */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL, + `b` int(11) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + `d` int(11) NOT NULL, + `e` int(11) DEFAULT NULL, + `f` int(11) DEFAULT NULL, + `g` int(11) DEFAULT NULL, + `h` int(11) NOT NULL, + `i` int(11) DEFAULT NULL, + `j` int(11) DEFAULT NULL, + `k` int(11) DEFAULT NULL, + PRIMARY KEY (`a`) +) /*!50100 TABLESPACE the_tablespacename STORAGE DISK */ ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; diff --git a/mysql-test/std_data/cluster_7022_table.MYD b/mysql-test/std_data/cluster_7022_table.MYD new file mode 100644 index 00000000000..e69de29bb2d diff --git a/mysql-test/std_data/cluster_7022_table.MYI b/mysql-test/std_data/cluster_7022_table.MYI new file mode 100644 index 0000000000000000000000000000000000000000..332b0e647970cd3e9079334b890ee5c597eb23c8 GIT binary patch literal 1024 zcmezOkDZZ$fpHeY28I-dBMcxm0|$@hD xE196GpfuDKED$aWgbNeo0IOwz7|x;q;X(AXI6!y}5DI7;m@!I>h5$`N001OsBdY)a literal 0 HcmV?d00001 diff --git a/mysql-test/std_data/cluster_7022_table.frm b/mysql-test/std_data/cluster_7022_table.frm new file mode 100644 index 0000000000000000000000000000000000000000..84714a1721a401b1209aa59ee118a0e9405bc39e GIT binary patch literal 8794 zcmeI2Jx>Bb5Qg6y5I7DHKcXfSVoWr~1gxy3q#z+!X=4sJjsrC&($MkW{4xFu#~Hq| z1%-APXPUizGTEJdwz|oFdA^?l${uh7Bwh{cpfluv9i7X#h(z)}KY-g6sMmq&YGR`q zFau`54445kU zqWG68GiXhl_l?%#tQYg^0Vc!fX%cpyqxZM47rllrk=`1WbJ*MW^&TzEfEh3YX21-X z0W)9*%zzm%17^SsY%=gjC~xBbg?R`NV=Bk3;beX2Hjb8W9%2*%I=rg>Fr<${p}d)( zE;67VvY@`KL=k+@KsqfH%Z4;W0hFK!8leOlBTYeodGAGPNa?c+1zBmv%$6XdAaFod z!LGJzmKiw(2Tq2s;Mf6q1r-Mb3QnCh3JT7hjG}@|2b2_CJAgy(a*z8Q@ql964X GGrj@C&O3s->tablespace; + if (!ts) + return NULL; + + if (!buff) + { + buff= my_strdup(ts, MYF(0)); + return buff; + } + + strnmov(buff, ts, buff_len); + return buff; +} + /**************************************************************************** ** Some general functions that isn't in the handler class ****************************************************************************/ diff --git a/sql/handler.h b/sql/handler.h index 3cd4acee80d..8ff6a9f8f03 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -1646,8 +1646,7 @@ public: { return FALSE; } virtual char* get_foreign_key_create_info() { return(NULL);} /* gets foreign key create string from InnoDB */ - virtual char* get_tablespace_name(THD *thd, char *name, uint name_len) - { return(NULL);} /* gets tablespace name from handler */ + virtual char* get_tablespace_name(THD *thd, char *name, uint name_len); /** used in ALTER TABLE; 1 if changing storage engine is allowed */ virtual bool can_switch_engines() { return 1; } /** diff --git a/sql/sql_show.cc b/sql/sql_show.cc index abef175ab55..c3dda3072f2 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1379,17 +1379,24 @@ int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet, if (!(thd->variables.sql_mode & MODE_NO_TABLE_OPTIONS) && !foreign_db_mode) { show_table_options= TRUE; - /* - Get possible table space definitions and append them - to the CREATE TABLE statement - */ - if ((for_str= file->get_tablespace_name(thd,0,0))) + /* TABLESPACE and STORAGE */ + if (share->tablespace || + share->default_storage_media != HA_SM_DEFAULT) { - packet->append(STRING_WITH_LEN(" /*!50100 TABLESPACE ")); - packet->append(for_str, strlen(for_str)); - packet->append(STRING_WITH_LEN(" STORAGE DISK */")); - my_free(for_str); + packet->append(STRING_WITH_LEN(" /*!50100")); + if (share->tablespace) + { + packet->append(STRING_WITH_LEN(" TABLESPACE ")); + packet->append(share->tablespace, strlen(share->tablespace)); + } + + if (share->default_storage_media == HA_SM_DISK) + packet->append(STRING_WITH_LEN(" STORAGE DISK")); + if (share->default_storage_media == HA_SM_MEMORY) + packet->append(STRING_WITH_LEN(" STORAGE MEMORY")); + + packet->append(STRING_WITH_LEN(" */")); } /* diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 2855bb0ec4a..21b8b5bf0a0 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -5281,17 +5281,12 @@ mysql_prepare_alter_table(THD *thd, TABLE *table, if (!(used_fields & HA_CREATE_USED_KEY_BLOCK_SIZE)) create_info->key_block_size= table->s->key_block_size; - if (!create_info->tablespace && create_info->storage_media != HA_SM_MEMORY) - { - char *tablespace= static_cast(thd->alloc(FN_LEN + 1)); - /* - Regular alter table of disk stored table (no tablespace/storage change) - Copy tablespace name - */ - if (tablespace && - (table->file->get_tablespace_name(thd, tablespace, FN_LEN))) - create_info->tablespace= tablespace; - } + if (!create_info->tablespace) + create_info->tablespace= table->s->tablespace; + + if (create_info->storage_media == HA_SM_DEFAULT) + create_info->storage_media= table->s->default_storage_media; + restore_record(table, s->default_values); // Empty record for DEFAULT Create_field *def; diff --git a/sql/table.cc b/sql/table.cc index 0ce7d7427d3..7bdfa65d94b 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -750,6 +750,9 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, const char **interval_array; enum legacy_db_type legacy_db_type; my_bitmap_map *bitmaps; + uchar *extra_segment_buff= 0; + const uint format_section_header_size= 8; + uchar *format_section_fields= 0; DBUG_ENTER("open_binary_frm"); new_field_pack_flag= head[27]; @@ -942,27 +945,27 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, if ((n_length= uint4korr(head+55))) { /* Read extra data segment */ - uchar *buff, *next_chunk, *buff_end; + uchar *next_chunk, *buff_end; DBUG_PRINT("info", ("extra segment size is %u bytes", n_length)); - if (!(next_chunk= buff= (uchar*) my_malloc(n_length, MYF(MY_WME)))) + if (!(extra_segment_buff= (uchar*) my_malloc(n_length, MYF(MY_WME)))) goto err; - if (mysql_file_pread(file, buff, n_length, record_offset + share->reclength, + next_chunk= extra_segment_buff; + if (mysql_file_pread(file, extra_segment_buff, + n_length, record_offset + share->reclength, MYF(MY_NABP))) { - my_free(buff); goto err; } - share->connect_string.length= uint2korr(buff); + share->connect_string.length= uint2korr(next_chunk); if (!(share->connect_string.str= strmake_root(&share->mem_root, (char*) next_chunk + 2, share->connect_string. length))) { - my_free(buff); goto err; } next_chunk+= share->connect_string.length + 2; - buff_end= buff + n_length; + buff_end= extra_segment_buff + n_length; if (next_chunk + 2 < buff_end) { uint str_db_type_length= uint2korr(next_chunk); @@ -979,7 +982,6 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, plugin_data(tmp_plugin, handlerton *))) { /* bad file, legacy_db_type did not match the name */ - my_free(buff); goto err; } /* @@ -1009,7 +1011,6 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, error= 8; my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--skip-partition"); - my_free(buff); goto err; } plugin_unlock(NULL, share->db_plugin); @@ -1025,7 +1026,6 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, error= 8; name.str[name.length]=0; my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), name.str); - my_free(buff); goto err; /* purecov: end */ } @@ -1042,7 +1042,6 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, memdup_root(&share->mem_root, next_chunk + 4, partition_info_str_len + 1))) { - my_free(buff); goto err; } } @@ -1050,7 +1049,6 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, if (partition_info_str_len) { DBUG_PRINT("info", ("WITH_PARTITION_STORAGE_ENGINE is not defined")); - my_free(buff); goto err; } #endif @@ -1088,7 +1086,6 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, { DBUG_PRINT("error", ("fulltext key uses parser that is not defined in .frm")); - my_free(buff); goto err; } parser_name.str= (char*) next_chunk; @@ -1099,7 +1096,6 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, if (! keyinfo->parser) { my_error(ER_PLUGIN_IS_NOT_LOADED, MYF(0), parser_name.str); - my_free(buff); goto err; } } @@ -1111,19 +1107,68 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, { DBUG_PRINT("error", ("long table comment is not defined in .frm")); - my_free(buff); goto err; } share->comment.length = uint2korr(next_chunk); if (! (share->comment.str= strmake_root(&share->mem_root, (char*)next_chunk + 2, share->comment.length))) { - my_free(buff); goto err; } next_chunk+= 2 + share->comment.length; } - my_free(buff); + + if (next_chunk + format_section_header_size < buff_end) + { + /* + New extra data segment called "format section" with additional + table and column properties introduced by MySQL Cluster + based on 5.1.20 + + Table properties: + TABLESPACE and STORAGE [DISK|MEMORY] + + Column properties: + COLUMN_FORMAT [DYNAMIC|FIXED] and STORAGE [DISK|MEMORY] + */ + DBUG_PRINT("info", ("Found format section")); + + /* header */ + const uint format_section_length= uint2korr(next_chunk); + const uint format_section_flags= uint4korr(next_chunk+2); + /* 2 bytes unused */ + + if (next_chunk + format_section_length > buff_end) + { + DBUG_PRINT("error", ("format section length too long: %u", + format_section_length)); + goto err; + } + DBUG_PRINT("info", ("format_section_length: %u, format_section_flags: %u", + format_section_length, format_section_flags)); + + share->default_storage_media= + (enum ha_storage_media) (format_section_flags & 0x7); + + /* tablespace */ + const char *tablespace= + (const char*)next_chunk + format_section_header_size; + const uint tablespace_length= strlen(tablespace); + if (tablespace_length && + !(share->tablespace= strmake_root(&share->mem_root, + tablespace, tablespace_length+1))) + { + goto err; + } + DBUG_PRINT("info", ("tablespace: '%s'", + share->tablespace ? share->tablespace : "")); + + /* pointer to format section for fields */ + format_section_fields= + next_chunk + format_section_header_size + tablespace_length + 1; + + next_chunk+= format_section_length; + } } share->key_block_size= uint2korr(head+62); @@ -1438,6 +1483,18 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, error= 8; goto err; } + + if (format_section_fields) + { + const uchar field_flags= format_section_fields[i]; + const uchar field_storage= (field_flags & STORAGE_TYPE_MASK); + const uchar field_column_format= + ((field_flags >> COLUMN_FORMAT_SHIFT)& STORAGE_TYPE_MASK); + DBUG_PRINT("debug", ("field flags: %u, storage: %u, column_format: %u", + field_flags, field_storage, field_column_format)); + (void)field_storage; /* Reserved by and used in MySQL Cluster */ + (void)field_column_format; /* Reserved by and used in MySQL Cluster */ + } } *field_ptr=0; // End marker @@ -1705,6 +1762,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, if (use_hash) (void) my_hash_check(&share->name_hash); #endif + my_free(extra_segment_buff); DBUG_RETURN (0); err: @@ -1712,6 +1770,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, share->open_errno= my_errno; share->errarg= errarg; my_free(disk_buff); + my_free(extra_segment_buff); delete crypted; delete handler_file; my_hash_free(&share->name_hash); @@ -2687,6 +2746,8 @@ void update_create_info_from_table(HA_CREATE_INFO *create_info, TABLE *table) create_info->default_table_charset= share->table_charset; create_info->table_charset= 0; create_info->comment= share->comment; + create_info->storage_media= share->default_storage_media; + create_info->tablespace= share->tablespace; DBUG_VOID_RETURN; } diff --git a/sql/table.h b/sql/table.h index 39e9ef2e0dd..bd8c66173f4 100644 --- a/sql/table.h +++ b/sql/table.h @@ -609,6 +609,8 @@ struct TABLE_SHARE } enum row_type row_type; /* How rows are stored */ enum tmp_table_type tmp_table; + enum ha_storage_media default_storage_media; + char *tablespace; uint ref_count; /* How many TABLE objects uses this */ uint blob_ptr_size; /* 4 or 8 */ diff --git a/sql/unireg.cc b/sql/unireg.cc index 6433b8bc7c2..5a44c5e68f5 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -124,6 +124,9 @@ bool mysql_create_frm(THD *thd, const char *file_name, #endif Pack_header_error_handler pack_header_error_handler; int error; + const uint format_section_header_size= 8; + uint format_section_length; + uint tablespace_length= 0; DBUG_ENTER("mysql_create_frm"); DBUG_ASSERT(*fn_rext((char*)file_name)); // Check .frm extension @@ -256,6 +259,18 @@ bool mysql_create_frm(THD *thd, const char *file_name, forminfo[46]=(uchar) create_info->comment.length; } + /* + Add room in extra segment for "format section" with additional + table and column properties + */ + if (create_info->tablespace) + tablespace_length= strlen(create_info->tablespace); + format_section_length= + format_section_header_size + + tablespace_length + 1 + + create_fields.elements; + create_info->extra_size+= format_section_length; + if ((file=create_frm(thd, file_name, db, table, reclength, fileinfo, create_info, keys, key_info)) < 0) { @@ -353,6 +368,55 @@ bool mysql_create_frm(THD *thd, const char *file_name, goto err; } + /* "Format section" with additional table and column properties */ + { + uchar *ptr, *format_section_buff; + if (!(format_section_buff=(uchar*) my_malloc(format_section_length, + MYF(MY_WME)))) + goto err; + ptr= format_section_buff; + + /* header */ + const uint format_section_flags= + create_info->storage_media; // 3 bits + const uint format_section_unused= 0; + int2store(ptr+0, format_section_length); + int4store(ptr+2, format_section_flags); + int2store(ptr+6, format_section_unused); + ptr+= format_section_header_size; + + /* tablespace name */ + if (tablespace_length > 0) + memcpy(ptr, create_info->tablespace, tablespace_length); + ptr+= tablespace_length; + *ptr= 0; /* tablespace string terminating zero */ + ptr++; + + /* column properties */ + Create_field *field; + List_iterator it(create_fields); + while ((field=it++)) + { + const uchar field_storage= 0; /* Used in MySQL Cluster */ + const uchar field_column_format= 0; /* Used in MySQL Cluster */ + const uchar field_flags= + field_storage + (field_column_format << COLUMN_FORMAT_SHIFT); + *ptr= field_flags; + ptr++; + } + DBUG_ASSERT(format_section_buff + format_section_length == ptr); + + if (mysql_file_write(file, format_section_buff, + format_section_length, MYF_RW)) + { + my_free(format_section_buff); + goto err; + } + DBUG_PRINT("info", ("wrote format section, length: %u", + format_section_length)); + my_free(format_section_buff); + } + mysql_file_seek(file, filepos, MY_SEEK_SET, MYF(0)); if (mysql_file_write(file, forminfo, 288, MYF_RW) || mysql_file_write(file, screen_buff, info_length, MYF_RW) || From d072bb0d7f40822ae13affadd897bb47ea01d4cc Mon Sep 17 00:00:00 2001 From: "kevin.lewis@oracle.com" <> Date: Mon, 7 Mar 2011 09:42:07 -0600 Subject: [PATCH 015/192] Bug#60196 / Bug#11831040 Setting lowercase_table_names to 2 on Windows causing Foreign Key problems This problem was exposed by the fix for Bug#55222. There was a codepath in dict0load.c, dict_load_foreigns() that made sure the table name matched case sensitive in order to load a referenced table into the dictionary as needed. If an engine is rebooted which accesses a table with foreign keys, and lower_case_table_names=2, then the table with foreign keys will get an error when it is changed (insert/updated/delete). Once the referenced tables are loaded into the dictionary cache by a select statement on those tables, the same change would succeed because the affected code path would not get followed. --- .../suite/innodb/r/innodb_bug60196.result | 76 ++++++++++++++++ .../suite/innodb/t/innodb_bug60196-master.opt | 1 + .../suite/innodb/t/innodb_bug60196.test | 91 +++++++++++++++++++ storage/innobase/dict/dict0load.c | 8 +- 4 files changed, 173 insertions(+), 3 deletions(-) create mode 100755 mysql-test/suite/innodb/r/innodb_bug60196.result create mode 100755 mysql-test/suite/innodb/t/innodb_bug60196-master.opt create mode 100755 mysql-test/suite/innodb/t/innodb_bug60196.test diff --git a/mysql-test/suite/innodb/r/innodb_bug60196.result b/mysql-test/suite/innodb/r/innodb_bug60196.result new file mode 100755 index 00000000000..296c5ce7e1d --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug60196.result @@ -0,0 +1,76 @@ +DROP TABLE IF EXISTS Bug_60196_FK1 ; +DROP TABLE IF EXISTS Bug_60196_FK2 ; +DROP TABLE IF EXISTS Bug_60196 ; +CREATE TABLE `Bug_60196_FK1` (Primary_Key INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE `Bug_60196_FK2` (Primary_Key INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE `Bug_60196` ( +FK1_Key INT NOT NULL, +FK2_Key INT NOT NULL, +PRIMARY KEY (FK2_Key, FK1_Key), +KEY FK1_Key (FK1_Key), +KEY FK2_Key (FK2_Key), +CONSTRAINT FK_FK1 FOREIGN KEY (FK1_Key) +REFERENCES Bug_60196_FK1 (Primary_Key) +ON DELETE CASCADE +ON UPDATE CASCADE, +CONSTRAINT FK_FK2 FOREIGN KEY (FK2_Key) +REFERENCES Bug_60196_FK2 (Primary_Key) +ON DELETE CASCADE +ON UPDATE CASCADE +) ENGINE=InnoDB; +INSERT INTO Bug_60196_FK1 VALUES (1), (2), (3), (4), (5); +INSERT INTO Bug_60196_FK2 VALUES (1), (2), (3), (4), (5); +INSERT INTO Bug_60196 VALUES (1, 1); +INSERT INTO Bug_60196 VALUES (1, 2); +INSERT INTO Bug_60196 VALUES (1, 3); +INSERT INTO Bug_60196 VALUES (1, 99); +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`bug_60196`, CONSTRAINT `FK_FK2` FOREIGN KEY (`FK2_Key`) REFERENCES `Bug_60196_FK2` (`Primary_Key`) ON DELETE CASCADE ON UPDATE CASCADE) +INSERT INTO Bug_60196 VALUES (99, 1); +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`bug_60196`, CONSTRAINT `FK_FK1` FOREIGN KEY (`FK1_Key`) REFERENCES `Bug_60196_FK1` (`Primary_Key`) ON DELETE CASCADE ON UPDATE CASCADE) +SELECT * FROM bug_60196_FK1; +Primary_Key +1 +2 +3 +4 +5 +SELECT * FROM bug_60196_FK2; +Primary_Key +1 +2 +3 +4 +5 +SELECT * FROM bug_60196; +FK1_Key FK2_Key +1 1 +1 2 +1 3 +# Stop master server +# Restart server. +# +# Try to insert more to the example table with foreign keys. +# Bug60196 causes the foreign key file not to be found after +# the resstart above. +# +SELECT * FROM Bug_60196; +FK1_Key FK2_Key +1 1 +1 2 +1 3 +INSERT INTO Bug_60196 VALUES (2, 1); +INSERT INTO Bug_60196 VALUES (2, 2); +INSERT INTO Bug_60196 VALUES (2, 3); +SELECT * FROM Bug_60196; +FK1_Key FK2_Key +1 1 +1 2 +1 3 +2 1 +2 2 +2 3 + +# Clean up. +DROP TABLE Bug_60196; +DROP TABLE Bug_60196_FK1; +DROP TABLE Bug_60196_FK2; diff --git a/mysql-test/suite/innodb/t/innodb_bug60196-master.opt b/mysql-test/suite/innodb/t/innodb_bug60196-master.opt new file mode 100755 index 00000000000..c0a1981fa7c --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug60196-master.opt @@ -0,0 +1 @@ +--lower-case-table-names=2 diff --git a/mysql-test/suite/innodb/t/innodb_bug60196.test b/mysql-test/suite/innodb/t/innodb_bug60196.test new file mode 100755 index 00000000000..70da220d68a --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug60196.test @@ -0,0 +1,91 @@ +# Bug#60196 - Setting lowercase_table_names to 2 on Windows causing +# Foreign Key problems after an engine is restarted. + +# This test case needs InnoDB. +-- source include/have_innodb.inc + +# +# Precautionary clean up. +# +--disable_warnings +DROP TABLE IF EXISTS Bug_60196_FK1 ; +DROP TABLE IF EXISTS Bug_60196_FK2 ; +DROP TABLE IF EXISTS Bug_60196 ; +--enable_warnings + +# +# Create test data. +# +CREATE TABLE `Bug_60196_FK1` (Primary_Key INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE `Bug_60196_FK2` (Primary_Key INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE `Bug_60196` ( + FK1_Key INT NOT NULL, + FK2_Key INT NOT NULL, + PRIMARY KEY (FK2_Key, FK1_Key), + KEY FK1_Key (FK1_Key), + KEY FK2_Key (FK2_Key), + CONSTRAINT FK_FK1 FOREIGN KEY (FK1_Key) + REFERENCES Bug_60196_FK1 (Primary_Key) + ON DELETE CASCADE + ON UPDATE CASCADE, + CONSTRAINT FK_FK2 FOREIGN KEY (FK2_Key) + REFERENCES Bug_60196_FK2 (Primary_Key) + ON DELETE CASCADE + ON UPDATE CASCADE +) ENGINE=InnoDB; +INSERT INTO Bug_60196_FK1 VALUES (1), (2), (3), (4), (5); +INSERT INTO Bug_60196_FK2 VALUES (1), (2), (3), (4), (5); +INSERT INTO Bug_60196 VALUES (1, 1); +INSERT INTO Bug_60196 VALUES (1, 2); +INSERT INTO Bug_60196 VALUES (1, 3); +--error ER_NO_REFERENCED_ROW_2 +INSERT INTO Bug_60196 VALUES (1, 99); +--error ER_NO_REFERENCED_ROW_2 +INSERT INTO Bug_60196 VALUES (99, 1); + +SELECT * FROM bug_60196_FK1; +SELECT * FROM bug_60196_FK2; +SELECT * FROM bug_60196; + +--echo # Stop master server + +# Write file to make mysql-test-run.pl wait for the server to stop +-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + +# Send a shutdown request to the server +-- shutdown_server 10 + +# Call script that will poll the server waiting for it to disapear +-- source include/wait_until_disconnected.inc + +--echo # Restart server. + +# Write file to make mysql-test-run.pl start up the server again +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + +# Turn on reconnect +--enable_reconnect + +# Call script that will poll the server waiting for it to be back online again +--source include/wait_until_connected_again.inc + +# Turn off reconnect again +--disable_reconnect + +--echo # +--echo # Try to insert more to the example table with foreign keys. +--echo # Bug60196 causes the foreign key file not to be found after +--echo # the resstart above. +--echo # +SELECT * FROM Bug_60196; +INSERT INTO Bug_60196 VALUES (2, 1); +INSERT INTO Bug_60196 VALUES (2, 2); +INSERT INTO Bug_60196 VALUES (2, 3); +SELECT * FROM Bug_60196; + +--echo +--echo # Clean up. +DROP TABLE Bug_60196; +DROP TABLE Bug_60196_FK1; +DROP TABLE Bug_60196_FK2; + diff --git a/storage/innobase/dict/dict0load.c b/storage/innobase/dict/dict0load.c index 14490980bb6..37bf4a1ad59 100644 --- a/storage/innobase/dict/dict0load.c +++ b/storage/innobase/dict/dict0load.c @@ -2258,10 +2258,12 @@ loop: /* Since table names in SYS_FOREIGN are stored in a case-insensitive order, we have to check that the table name matches also in a binary string comparison. On Unix, MySQL allows table names that only differ - in character case. */ - - if (0 != ut_memcmp(field, table_name, len)) { + in character case. If lower_case_table_names=2 then what is stored + may not be the same case, but the previous comparison showed that they + match with no-case. */ + if ((srv_lower_case_table_names != 2) + && (0 != ut_memcmp(field, table_name, len))) { goto next_rec; } From d7aee58201ee1bff769bcc0d41d2c64df176391c Mon Sep 17 00:00:00 2001 From: "kevin.lewis@oracle.com" <> Date: Tue, 8 Mar 2011 09:04:13 -0600 Subject: [PATCH 016/192] Fix test failure on case-sensitive file systems. --- mysql-test/suite/innodb/t/innodb_bug60196.test | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mysql-test/suite/innodb/t/innodb_bug60196.test b/mysql-test/suite/innodb/t/innodb_bug60196.test index 70da220d68a..6d77baf8d6c 100755 --- a/mysql-test/suite/innodb/t/innodb_bug60196.test +++ b/mysql-test/suite/innodb/t/innodb_bug60196.test @@ -2,7 +2,9 @@ # Foreign Key problems after an engine is restarted. # This test case needs InnoDB. --- source include/have_innodb.inc +--source include/have_innodb.inc +--source include/have_lowercase2.inc +--source include/have_case_insensitive_file_system.inc # # Precautionary clean up. From 9b30e2e29c975687ad356a7a9722c3b84993765a Mon Sep 17 00:00:00 2001 From: Jon Olav Hauglid Date: Wed, 9 Mar 2011 16:06:13 +0100 Subject: [PATCH 017/192] Bug#11815600 [ERROR] INNODB COULD NOT FIND INDEX PRIMARY KEY NO 0 FOR TABLE IN ERROR LOG With the changes made by the patches for Bug#11751388 and Bug#11784056, concurrent reads are allowed while secondary indexes are created in InnoDB. This means that the metadata lock on the affected table is not upgraded to exclusive until the .FRM is updated at the end of ALTER TABLE processing. The problem was that if this lock upgrade failed for some reason (e.g. timeout), the index information in the server and inside InnoDB would be out of sync. This would happen since the add index operation already was committed inside InnoDB but the table metadata inside the server had not been updated yet. This patch fixes the problem by (for now) reverting the effects of the patches for Bug#11751388 and Bug#11784056. Concurrent reads will now again be blocked during creation of secondary indexes in InnoDB. Test case added to innodb_mysql_lock.test. --- mysql-test/r/innodb_mysql_lock.result | 22 +++ mysql-test/r/innodb_mysql_sync.result | 64 +------- mysql-test/t/innodb_mysql_lock.test | 32 ++++ mysql-test/t/innodb_mysql_sync.test | 227 +++++++++++++------------- storage/innobase/handler/ha_innodb.cc | 1 - 5 files changed, 171 insertions(+), 175 deletions(-) diff --git a/mysql-test/r/innodb_mysql_lock.result b/mysql-test/r/innodb_mysql_lock.result index bf1c3a89f40..cd9487721b6 100644 --- a/mysql-test/r/innodb_mysql_lock.result +++ b/mysql-test/r/innodb_mysql_lock.result @@ -148,3 +148,25 @@ COMMIT; # Connection default DROP TABLE t1, t2; DROP VIEW v1; +# +# Bug#11815600 [ERROR] INNODB COULD NOT FIND INDEX PRIMARY +# KEY NO 0 FOR TABLE IN ERROR LOG +# +DROP TABLE IF EXISTS t1; +# Connection default +CREATE TABLE t1 (id INT PRIMARY KEY, value INT) ENGINE = InnoDB; +INSERT INTO t1 VALUES (1, 12345); +START TRANSACTION; +SELECT * FROM t1; +id value +1 12345 +# Connection con1 +SET lock_wait_timeout=1; +ALTER TABLE t1 ADD INDEX idx(value); +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +# Connection default +SELECT * FROM t1; +id value +1 12345 +COMMIT; +DROP TABLE t1; diff --git a/mysql-test/r/innodb_mysql_sync.result b/mysql-test/r/innodb_mysql_sync.result index 58948835f66..71f567a4ad2 100644 --- a/mysql-test/r/innodb_mysql_sync.result +++ b/mysql-test/r/innodb_mysql_sync.result @@ -94,64 +94,6 @@ SET DEBUG_SYNC= 'RESET'; # Bug#42230 during add index, cannot do queries on storage engines # that implement add_index # -DROP DATABASE IF EXISTS db1; -DROP TABLE IF EXISTS t1; -# Test 1: Secondary index, should not block reads (original test case). -# Connection default -CREATE DATABASE db1; -CREATE TABLE db1.t1(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, value INT) engine=innodb; -INSERT INTO db1.t1(value) VALUES (1), (2); -SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; -# Sending: -ALTER TABLE db1.t1 ADD INDEX(value); -# Connection con1 -SET DEBUG_SYNC= "now WAIT_FOR manage"; -USE db1; -SELECT * FROM t1; -id value -1 1 -2 2 -SET DEBUG_SYNC= "now SIGNAL query"; -# Connection default -# Reaping: ALTER TABLE db1.t1 ADD INDEX(value) -DROP DATABASE db1; -# Test 2: Primary index (implicit), should block reads. -CREATE TABLE t1(a INT NOT NULL, b INT NOT NULL) engine=innodb; -SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; -# Sending: -ALTER TABLE t1 ADD UNIQUE INDEX(a); -# Connection con1 -SET DEBUG_SYNC= "now WAIT_FOR manage"; -USE test; -# Sending: -SELECT * FROM t1; -# Connection con2 -# Waiting for SELECT to be blocked by the metadata lock on t1 -SET DEBUG_SYNC= "now SIGNAL query"; -# Connection default -# Reaping: ALTER TABLE t1 ADD UNIQUE INDEX(a) -# Connection con1 -# Reaping: SELECT * FROM t1 -a b -# Test 3: Primary index (explicit), should block reads. -# Connection default -ALTER TABLE t1 DROP INDEX a; -SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; -# Sending: -ALTER TABLE t1 ADD PRIMARY KEY (a); -# Connection con1 -SET DEBUG_SYNC= "now WAIT_FOR manage"; -# Sending: -SELECT * FROM t1; -# Connection con2 -# Waiting for SELECT to be blocked by the metadata lock on t1 -SET DEBUG_SYNC= "now SIGNAL query"; -# Connection default -# Reaping: ALTER TABLE t1 ADD PRIMARY KEY (a) -# Connection con1 -# Reaping: SELECT * FROM t1 -a b -# Test 4: Secondary unique index, should not block reads. -# Connection default -SET DEBUG_SYNC= "RESET"; -DROP TABLE t1; +# +# DISABLED due to Bug#11815600 +# diff --git a/mysql-test/t/innodb_mysql_lock.test b/mysql-test/t/innodb_mysql_lock.test index 975444a44b1..f1dc0d52484 100644 --- a/mysql-test/t/innodb_mysql_lock.test +++ b/mysql-test/t/innodb_mysql_lock.test @@ -279,6 +279,38 @@ disconnect con2; disconnect con3; +--echo # +--echo # Bug#11815600 [ERROR] INNODB COULD NOT FIND INDEX PRIMARY +--echo # KEY NO 0 FOR TABLE IN ERROR LOG +--echo # + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--connect (con1,localhost,root) + +--echo # Connection default +connection default; +CREATE TABLE t1 (id INT PRIMARY KEY, value INT) ENGINE = InnoDB; +INSERT INTO t1 VALUES (1, 12345); +START TRANSACTION; +SELECT * FROM t1; + +--echo # Connection con1 +--connection con1 +SET lock_wait_timeout=1; +--error ER_LOCK_WAIT_TIMEOUT +ALTER TABLE t1 ADD INDEX idx(value); + +--echo # Connection default +--connection default +SELECT * FROM t1; +COMMIT; +DROP TABLE t1; +disconnect con1; + + # Check that all connections opened by test cases in this file are really # gone so execution of other tests won't be affected by their presence. --source include/wait_until_count_sessions.inc diff --git a/mysql-test/t/innodb_mysql_sync.test b/mysql-test/t/innodb_mysql_sync.test index a8925306c70..13c854d6b61 100644 --- a/mysql-test/t/innodb_mysql_sync.test +++ b/mysql-test/t/innodb_mysql_sync.test @@ -152,132 +152,133 @@ disconnect con1; --echo # that implement add_index --echo # ---disable_warnings -DROP DATABASE IF EXISTS db1; -DROP TABLE IF EXISTS t1; ---enable_warnings +--echo # +--echo # DISABLED due to Bug#11815600 +--echo # -connect(con1,localhost,root); -connect(con2,localhost,root); - ---echo # Test 1: Secondary index, should not block reads (original test case). - ---echo # Connection default -connection default; -CREATE DATABASE db1; -CREATE TABLE db1.t1(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, value INT) engine=innodb; -INSERT INTO db1.t1(value) VALUES (1), (2); -SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; ---echo # Sending: ---send ALTER TABLE db1.t1 ADD INDEX(value) - ---echo # Connection con1 -connection con1; -SET DEBUG_SYNC= "now WAIT_FOR manage"; -# Neither of these two statements should be blocked -USE db1; -SELECT * FROM t1; -SET DEBUG_SYNC= "now SIGNAL query"; - ---echo # Connection default -connection default; ---echo # Reaping: ALTER TABLE db1.t1 ADD INDEX(value) ---reap -DROP DATABASE db1; - ---echo # Test 2: Primary index (implicit), should block reads. - -CREATE TABLE t1(a INT NOT NULL, b INT NOT NULL) engine=innodb; -SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; ---echo # Sending: ---send ALTER TABLE t1 ADD UNIQUE INDEX(a) - ---echo # Connection con1 -connection con1; -SET DEBUG_SYNC= "now WAIT_FOR manage"; -USE test; ---echo # Sending: ---send SELECT * FROM t1 - ---echo # Connection con2 -connection con2; ---echo # Waiting for SELECT to be blocked by the metadata lock on t1 -let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist - WHERE state= 'Waiting for table metadata lock' - AND info='SELECT * FROM t1'; ---source include/wait_condition.inc -SET DEBUG_SYNC= "now SIGNAL query"; - ---echo # Connection default -connection default; ---echo # Reaping: ALTER TABLE t1 ADD UNIQUE INDEX(a) ---reap - ---echo # Connection con1 -connection con1; ---echo # Reaping: SELECT * FROM t1 ---reap - ---echo # Test 3: Primary index (explicit), should block reads. - ---echo # Connection default -connection default; -ALTER TABLE t1 DROP INDEX a; -SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; ---echo # Sending: ---send ALTER TABLE t1 ADD PRIMARY KEY (a) - ---echo # Connection con1 -connection con1; -SET DEBUG_SYNC= "now WAIT_FOR manage"; ---echo # Sending: ---send SELECT * FROM t1 - ---echo # Connection con2 -connection con2; ---echo # Waiting for SELECT to be blocked by the metadata lock on t1 -let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist - WHERE state= 'Waiting for table metadata lock' - AND info='SELECT * FROM t1'; ---source include/wait_condition.inc -SET DEBUG_SYNC= "now SIGNAL query"; - ---echo # Connection default -connection default; ---echo # Reaping: ALTER TABLE t1 ADD PRIMARY KEY (a) ---reap - ---echo # Connection con1 -connection con1; ---echo # Reaping: SELECT * FROM t1 ---reap - ---echo # Test 4: Secondary unique index, should not block reads. -# This requires HA_INPLACE_ADD_UNIQUE_INDEX_NO_WRITE to be supported -# by InnoDB. Adding this flag currently introduces a regression so -# this test is disabled until the regression has been fixed. - ---echo # Connection default -connection default; +#--disable_warnings +#DROP DATABASE IF EXISTS db1; +#DROP TABLE IF EXISTS t1; +#--enable_warnings +# +#connect(con1,localhost,root); +#connect(con2,localhost,root); +# +#--echo # Test 1: Secondary index, should not block reads (original test case). +# +#--echo # Connection default +#connection default; +#CREATE DATABASE db1; +#CREATE TABLE db1.t1(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, value INT) engine=innodb; +#INSERT INTO db1.t1(value) VALUES (1), (2); +#SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; +#--echo # Sending: +#--send ALTER TABLE db1.t1 ADD INDEX(value) +# +#--echo # Connection con1 +#connection con1; +#SET DEBUG_SYNC= "now WAIT_FOR manage"; +# # Neither of these two statements should be blocked +#USE db1; +#SELECT * FROM t1; +#SET DEBUG_SYNC= "now SIGNAL query"; +# +#--echo # Connection default +#connection default; +#--echo # Reaping: ALTER TABLE db1.t1 ADD INDEX(value) +#--reap +#DROP DATABASE db1; +# +#--echo # Test 2: Primary index (implicit), should block reads. +# +#CREATE TABLE t1(a INT NOT NULL, b INT NOT NULL) engine=innodb; +#SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; +#--echo # Sending: +#--send ALTER TABLE t1 ADD UNIQUE INDEX(a) +# +#--echo # Connection con1 +#connection con1; +#SET DEBUG_SYNC= "now WAIT_FOR manage"; +#USE test; +#--echo # Sending: +#--send SELECT * FROM t1 +# +#--echo # Connection con2 +#connection con2; +#--echo # Waiting for SELECT to be blocked by the metadata lock on t1 +#let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist +# WHERE state= 'Waiting for table metadata lock' +# AND info='SELECT * FROM t1'; +#--source include/wait_condition.inc +#SET DEBUG_SYNC= "now SIGNAL query"; +# +#--echo # Connection default +#connection default; +#--echo # Reaping: ALTER TABLE t1 ADD UNIQUE INDEX(a) +#--reap +# +#--echo # Connection con1 +#connection con1; +#--echo # Reaping: SELECT * FROM t1 +#--reap +# +#--echo # Test 3: Primary index (explicit), should block reads. +# +#--echo # Connection default +#connection default; +#ALTER TABLE t1 DROP INDEX a; +#SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; +#--echo # Sending: +#--send ALTER TABLE t1 ADD PRIMARY KEY (a) +# +#--echo # Connection con1 +#connection con1; +#SET DEBUG_SYNC= "now WAIT_FOR manage"; +#--echo # Sending: +#--send SELECT * FROM t1 +# +#--echo # Connection con2 +#connection con2; +#--echo # Waiting for SELECT to be blocked by the metadata lock on t1 +#let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist +# WHERE state= 'Waiting for table metadata lock' +# AND info='SELECT * FROM t1'; +#--source include/wait_condition.inc +#SET DEBUG_SYNC= "now SIGNAL query"; +# +#--echo # Connection default +#connection default; +#--echo # Reaping: ALTER TABLE t1 ADD PRIMARY KEY (a) +#--reap +# +#--echo # Connection con1 +#connection con1; +#--echo # Reaping: SELECT * FROM t1 +#--reap +# +#--echo # Test 4: Secondary unique index, should not block reads. +# +#--echo # Connection default +#connection default; #SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; #--echo # Sending: #--send ALTER TABLE t1 ADD UNIQUE (b) - +# #--echo # Connection con1 #connection con1; #SET DEBUG_SYNC= "now WAIT_FOR manage"; #SELECT * FROM t1; #SET DEBUG_SYNC= "now SIGNAL query"; - +# #--echo # Connection default #connection default; #--echo # Reaping: ALTER TABLE t1 ADD UNIQUE (b) #--reap - -disconnect con1; -disconnect con2; -SET DEBUG_SYNC= "RESET"; -DROP TABLE t1; +# +#disconnect con1; +#disconnect con2; +#SET DEBUG_SYNC= "RESET"; +#DROP TABLE t1; # Check that all connections opened by test cases in this file are really diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index daeaca90aec..8f128806054 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -2594,7 +2594,6 @@ innobase_alter_table_flags( uint flags) { return(HA_INPLACE_ADD_INDEX_NO_READ_WRITE - | HA_INPLACE_ADD_INDEX_NO_WRITE | HA_INPLACE_DROP_INDEX_NO_READ_WRITE | HA_INPLACE_ADD_UNIQUE_INDEX_NO_READ_WRITE | HA_INPLACE_DROP_UNIQUE_INDEX_NO_READ_WRITE From 0e640801776173236c6eee57779a70474e27afee Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Wed, 9 Mar 2011 17:21:22 +0200 Subject: [PATCH 018/192] Fixed a wrong error code in gis.test --- mysql-test/r/gis.result | 2 +- mysql-test/t/gis.test | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index d700865d5f3..acb55d225a7 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -1040,7 +1040,7 @@ drop table t1; # create table t1(a char(32) not null) engine=myisam; create spatial index i on t1 (a); -ERROR HY000: Can't create table '#sql-temporary' (errno: 140) +ERROR HY000: Incorrect arguments to SPATIAL INDEX drop table t1; CREATE TABLE t0 (a BINARY(32) NOT NULL); CREATE SPATIAL INDEX i on t0 (a); diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index f81cd4a72a6..f8cec14d9ae 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -760,8 +760,7 @@ drop table t1; --echo # on char > 31 bytes". --echo # create table t1(a char(32) not null) engine=myisam; ---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ ---error ER_CANT_CREATE_TABLE +--error ER_WRONG_ARGUMENTS create spatial index i on t1 (a); drop table t1; From 4bd4f411c733a256d156dbea98916d195b640275 Mon Sep 17 00:00:00 2001 From: "kevin.lewis@oracle.com" <> Date: Wed, 9 Mar 2011 11:15:55 -0600 Subject: [PATCH 019/192] Bug#60196 / Bug#11831040 Test case cannot run on embedded server. No need for precautionary cleanup of unique names. --- .../suite/innodb/r/innodb_bug60196.result | 11 ++++----- .../suite/innodb/t/innodb_bug60196.test | 24 +++++++------------ 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/mysql-test/suite/innodb/r/innodb_bug60196.result b/mysql-test/suite/innodb/r/innodb_bug60196.result index 296c5ce7e1d..85707f81a28 100755 --- a/mysql-test/suite/innodb/r/innodb_bug60196.result +++ b/mysql-test/suite/innodb/r/innodb_bug60196.result @@ -1,9 +1,6 @@ -DROP TABLE IF EXISTS Bug_60196_FK1 ; -DROP TABLE IF EXISTS Bug_60196_FK2 ; -DROP TABLE IF EXISTS Bug_60196 ; -CREATE TABLE `Bug_60196_FK1` (Primary_Key INT PRIMARY KEY) ENGINE=InnoDB; -CREATE TABLE `Bug_60196_FK2` (Primary_Key INT PRIMARY KEY) ENGINE=InnoDB; -CREATE TABLE `Bug_60196` ( +CREATE TABLE Bug_60196_FK1 (Primary_Key INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE Bug_60196_FK2 (Primary_Key INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE Bug_60196 ( FK1_Key INT NOT NULL, FK2_Key INT NOT NULL, PRIMARY KEY (FK2_Key, FK1_Key), @@ -46,7 +43,7 @@ FK1_Key FK2_Key 1 1 1 2 1 3 -# Stop master server +# Stop server # Restart server. # # Try to insert more to the example table with foreign keys. diff --git a/mysql-test/suite/innodb/t/innodb_bug60196.test b/mysql-test/suite/innodb/t/innodb_bug60196.test index 6d77baf8d6c..47c646a5a75 100755 --- a/mysql-test/suite/innodb/t/innodb_bug60196.test +++ b/mysql-test/suite/innodb/t/innodb_bug60196.test @@ -1,26 +1,20 @@ # Bug#60196 - Setting lowercase_table_names to 2 on Windows causing # Foreign Key problems after an engine is restarted. -# This test case needs InnoDB. ---source include/have_innodb.inc +# This test case needs InnoDB, a lowercase file system, +# lower-case-table-names=2, and cannot use the embedded server +# because it restarts the server. +--source include/not_embedded.inc --source include/have_lowercase2.inc --source include/have_case_insensitive_file_system.inc - -# -# Precautionary clean up. -# ---disable_warnings -DROP TABLE IF EXISTS Bug_60196_FK1 ; -DROP TABLE IF EXISTS Bug_60196_FK2 ; -DROP TABLE IF EXISTS Bug_60196 ; ---enable_warnings +--source include/have_innodb.inc # # Create test data. # -CREATE TABLE `Bug_60196_FK1` (Primary_Key INT PRIMARY KEY) ENGINE=InnoDB; -CREATE TABLE `Bug_60196_FK2` (Primary_Key INT PRIMARY KEY) ENGINE=InnoDB; -CREATE TABLE `Bug_60196` ( +CREATE TABLE Bug_60196_FK1 (Primary_Key INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE Bug_60196_FK2 (Primary_Key INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE Bug_60196 ( FK1_Key INT NOT NULL, FK2_Key INT NOT NULL, PRIMARY KEY (FK2_Key, FK1_Key), @@ -49,7 +43,7 @@ SELECT * FROM bug_60196_FK1; SELECT * FROM bug_60196_FK2; SELECT * FROM bug_60196; ---echo # Stop master server +--echo # Stop server # Write file to make mysql-test-run.pl wait for the server to stop -- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect From feeac7d1a4a804a69009d7b21c9e46c8758d0daa Mon Sep 17 00:00:00 2001 From: Kristofer Pettersson Date: Fri, 11 Mar 2011 15:10:15 +0100 Subject: [PATCH 020/192] Certain fields in the protcol required a strict formatting. If off bound values were sent to the server this could under some circumstances lead to a crash on the Windows platform. --- sql/sql_connect.cc | 175 ++++++++++++++++++++++++++++++++++++++------- 1 file changed, 149 insertions(+), 26 deletions(-) diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc index 9fa6966baa2..4c4f30600de 100644 --- a/sql/sql_connect.cc +++ b/sql/sql_connect.cc @@ -630,6 +630,94 @@ bool init_new_connection_handler_thread() return 0; } +#ifndef EMBEDDED_LIBRARY +/** + Get a null character terminated string from a user-supplied buffer. + + @param buffer[in, out] Pointer to the buffer to be scanned. + @param max_bytes_available[in, out] Limit the bytes to scan. + @param string_length[out] The number of characters scanned not including + the null character. + + @remark The string_length does not include the terminating null character. + However, after the call, the buffer is increased by string_length+1 + bytes, beyond the null character if there still available bytes to + scan. + + @return pointer to beginning of the string scanned. + @retval NULL The buffer content is malformed +*/ + +static +char *get_null_terminated_string(char **buffer, + size_t *max_bytes_available, + size_t *string_length) +{ + char *str= (char *)memchr(*buffer, '\0', *max_bytes_available); + + if (str == NULL) + return NULL; + + *string_length= (size_t)(str - *buffer); + *max_bytes_available-= *string_length + 1; + str= *buffer; + *buffer += *string_length + 1; + + return str; +} + + +/** + Get a length encoded string from a user-supplied buffer. + + @param buffer[in, out] The buffer to scan; updates position after scan. + @param max_bytes_available[in, out] Limit the number of bytes to scan + @param string_length[out] Number of characters scanned + + @remark In case the length is zero, then the total size of the string is + considered to be 1 byte; the size byte. + + @return pointer to first byte after the header in buffer. + @retval NULL The buffer content is malformed +*/ + +static +char *get_length_encoded_string(char **buffer, + size_t *max_bytes_available, + size_t *string_length) +{ + if (*max_bytes_available == 0) + return NULL; + + /* Do double cast to prevent overflow from signed / unsigned conversion */ + size_t str_len= (size_t)(unsigned char)**buffer; + + /* + If the length encoded string has the length 0 + the total size of the string is only one byte long (the size byte) + */ + if (str_len == 0) + { + ++*buffer; + *string_length= 0; + /* + Return a pointer to the 0 character so the return value will be + an empty string. + */ + return *buffer-1; + } + + if (str_len >= *max_bytes_available) + return NULL; + + char *str= *buffer+1; + *string_length= str_len; + *max_bytes_available-= *string_length + 1; + *buffer+= *string_length + 1; + return str; +} + + /* Perform handshake, authorize client and update thd ACL variables. @@ -643,7 +731,6 @@ bool init_new_connection_handler_thread() > 0 error code (not sent to user) */ -#ifndef EMBEDDED_LIBRARY static int check_connection(THD *thd) { uint connect_errors= 0; @@ -831,7 +918,7 @@ static int check_connection(THD *thd) } #endif /* HAVE_OPENSSL */ - if (end >= (char*) net->read_pos+ pkt_len +2) + if (end > (char *)net->read_pos + pkt_len) { inc_host_errors(&thd->remote.sin_addr); my_error(ER_HANDSHAKE_ERROR, MYF(0), thd->main_security_ctx.host_or_ip); @@ -843,39 +930,75 @@ static int check_connection(THD *thd) if ((thd->client_capabilities & CLIENT_TRANSACTIONS) && opt_using_transactions) net->return_status= &thd->server_status; - - char *user= end; - char *passwd= strend(user)+1; - uint user_len= passwd - user - 1; - char *db= passwd; - char db_buff[NAME_LEN + 1]; // buffer to store db in utf8 - char user_buff[USERNAME_LENGTH + 1]; // buffer to store user in utf8 - uint dummy_errors; - + /* - Old clients send null-terminated string as password; new clients send - the size (1 byte) + string (not null-terminated). Hence in case of empty - password both send '\0'. - - This strlen() can't be easily deleted without changing protocol. - - Cast *passwd to an unsigned char, so that it doesn't extend the sign for - *passwd > 127 and become 2**32-127+ after casting to uint. + In order to safely scan a head for '\0' string terminators + we must keep track of how many bytes remain in the allocated + buffer or we might read past the end of the buffer. */ - uint passwd_len= thd->client_capabilities & CLIENT_SECURE_CONNECTION ? - (uchar)(*passwd++) : strlen(passwd); - db= thd->client_capabilities & CLIENT_CONNECT_WITH_DB ? - db + passwd_len + 1 : 0; - /* strlen() can't be easily deleted without changing protocol */ - uint db_len= db ? strlen(db) : 0; + size_t bytes_remaining_in_packet= pkt_len - (end - (char *)net->read_pos); - if (passwd + passwd_len + db_len > (char *)net->read_pos + pkt_len) + size_t user_len; + char *user= get_null_terminated_string(&end, &bytes_remaining_in_packet, + &user_len); + if (user == NULL) { inc_host_errors(&thd->remote.sin_addr); my_error(ER_HANDSHAKE_ERROR, MYF(0), thd->main_security_ctx.host_or_ip); return 1; } + /* + Old clients send a null-terminated string as password; new clients send + the size (1 byte) + string (not null-terminated). Hence in case of empty + password both send '\0'. + */ + size_t passwd_len= 0; + char *passwd= NULL; + + if (thd->client_capabilities & CLIENT_SECURE_CONNECTION) + { + /* + 4.1+ password. First byte is password length. + */ + passwd= get_length_encoded_string(&end, &bytes_remaining_in_packet, + &passwd_len); + } + else + { + /* + Old passwords are zero terminated strings. + */ + passwd= get_null_terminated_string(&end, &bytes_remaining_in_packet, + &passwd_len); + } + + if (passwd == NULL) + { + inc_host_errors(&thd->remote.sin_addr); + my_error(ER_HANDSHAKE_ERROR, MYF(0), thd->main_security_ctx.host_or_ip); + return 1; + } + + size_t db_len= 0; + char *db= NULL; + + if (thd->client_capabilities & CLIENT_CONNECT_WITH_DB) + { + db= get_null_terminated_string(&end, &bytes_remaining_in_packet, + &db_len); + if (db == NULL) + { + inc_host_errors(&thd->remote.sin_addr); + my_error(ER_HANDSHAKE_ERROR, MYF(0), thd->main_security_ctx.host_or_ip); + return 1; + } + } + + char db_buff[NAME_LEN + 1]; // buffer to store db in utf8 + char user_buff[USERNAME_LENGTH + 1]; // buffer to store user in utf8 + uint dummy_errors; + /* Since 4.1 all database names are stored in utf8 */ if (db) { From 9f29134a4a319bebc2a7fc83439c747faa1ba26d Mon Sep 17 00:00:00 2001 From: Kristofer Pettersson Date: Mon, 14 Mar 2011 11:13:11 +0100 Subject: [PATCH 021/192] Certain fields in the protcol required a strict formatting. If off bound values were sent to the server this could under some circumstances lead to a crash on the Windows platform. --- sql/sql_acl.cc | 176 ++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 144 insertions(+), 32 deletions(-) diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index fae609c0d4d..09609a7fa0c 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -8397,6 +8397,92 @@ static bool parse_com_change_user_packet(MPVIO_EXT *mpvio, uint packet_length) DBUG_RETURN (0); } +/** + Get a null character terminated string from a user-supplied buffer. + + @param buffer[in, out] Pointer to the buffer to be scanned. + @param max_bytes_available[in, out] Limit the bytes to scan. + @param string_length[out] The number of characters scanned not including + the null character. + + @remark The string_length does not include the terminating null character. + However, after the call, the buffer is increased by string_length+1 + bytes, beyond the null character if there still available bytes to + scan. + + @return pointer to beginning of the string scanned. + @retval NULL The buffer content is malformed +*/ + +static +char *get_null_terminated_string(char **buffer, + size_t *max_bytes_available, + size_t *string_length) +{ + char *str= (char *)memchr(*buffer, '\0', *max_bytes_available); + + if (str == NULL) + return NULL; + + *string_length= (size_t)(str - *buffer); + *max_bytes_available-= *string_length + 1; + str= *buffer; + *buffer += *string_length + 1; + + return str; +} + +/** + Get a length encoded string from a user-supplied buffer. + + @param buffer[in, out] The buffer to scan; updates position after scan. + @param max_bytes_available[in, out] Limit the number of bytes to scan + @param string_length[out] Number of characters scanned + + @remark In case the length is zero, then the total size of the string is + considered to be 1 byte; the size byte. + + @return pointer to first byte after the header in buffer. + @retval NULL The buffer content is malformed +*/ + +static +char *get_length_encoded_string(char **buffer, + size_t *max_bytes_available, + size_t *string_length) +{ + if (*max_bytes_available == 0) + return NULL; + + /* Do double cast to prevent overflow from signed / unsigned conversion */ + size_t str_len= (size_t)(unsigned char)**buffer; + + /* + If the length encoded string has the length 0 + the total size of the string is only one byte long (the size byte) + */ + if (str_len == 0) + { + ++*buffer; + *string_length= 0; + /* + Return a pointer to the 0 character so the return value will be + an empty string. + */ + return *buffer-1; + } + + if (str_len >= *max_bytes_available) + return NULL; + + char *str= *buffer+1; + *string_length= str_len; + *max_bytes_available-= *string_length + 1; + *buffer+= *string_length + 1; + return str; +} + + /* the packet format is described in send_client_reply_packet() */ static ulong parse_client_handshake_packet(MPVIO_EXT *mpvio, uchar **buff, ulong pkt_len) @@ -8461,50 +8547,76 @@ static ulong parse_client_handshake_packet(MPVIO_EXT *mpvio, } #endif - if (end >= (char*) net->read_pos + pkt_len + 2) + if (end > (char *)net->read_pos + pkt_len) return packet_error; if ((mpvio->client_capabilities & CLIENT_TRANSACTIONS) && opt_using_transactions) net->return_status= mpvio->server_status; + + /* + In order to safely scan a head for '\0' string terminators + we must keep track of how many bytes remain in the allocated + buffer or we might read past the end of the buffer. + */ + size_t bytes_remaining_in_packet= pkt_len - (end - (char *)net->read_pos); - char *user= end; - char *passwd= strend(user) + 1; - uint user_len= passwd - user - 1, db_len; - char *db= passwd; - char db_buff[NAME_LEN + 1]; // buffer to store db in utf8 - char user_buff[USERNAME_LENGTH + 1]; // buffer to store user in utf8 - uint dummy_errors; + size_t user_len; + char *user= get_null_terminated_string(&end, &bytes_remaining_in_packet, + &user_len); + if (user == NULL) + return packet_error; /* - Old clients send null-terminated string as password; new clients send + Old clients send a null-terminated string as password; new clients send the size (1 byte) + string (not null-terminated). Hence in case of empty password both send '\0'. - - This strlen() can't be easily deleted without changing protocol. - - Cast *passwd to an unsigned char, so that it doesn't extend the sign for - *passwd > 127 and become 2**32-127+ after casting to uint. */ - uint passwd_len= mpvio->client_capabilities & CLIENT_SECURE_CONNECTION ? - (uchar) (*passwd++) : strlen(passwd); - - if (mpvio->client_capabilities & CLIENT_CONNECT_WITH_DB) + size_t passwd_len= 0; + char *passwd= NULL; + + if (mpvio->client_capabilities & CLIENT_SECURE_CONNECTION) { - db= db + passwd_len + 1; - /* strlen() can't be easily deleted without changing protocol */ - db_len= strlen(db); + /* + 4.1+ password. First byte is password length. + */ + passwd= get_length_encoded_string(&end, &bytes_remaining_in_packet, + &passwd_len); } else { - db= 0; - db_len= 0; + /* + Old passwords are zero terminated strings. + */ + passwd= get_null_terminated_string(&end, &bytes_remaining_in_packet, + &passwd_len); } - if (passwd + passwd_len + db_len > (char *) net->read_pos + pkt_len) + if (passwd == NULL) return packet_error; - char *client_plugin= passwd + passwd_len + (db ? db_len + 1 : 0); + size_t db_len= 0; + char *db= NULL; + + if (mpvio->client_capabilities & CLIENT_CONNECT_WITH_DB) + { + db= get_null_terminated_string(&end, &bytes_remaining_in_packet, + &db_len); + if (db == NULL) + return packet_error; + } + + size_t client_plugin_len= 0; + char *client_plugin= get_null_terminated_string(&end, + &bytes_remaining_in_packet, + &client_plugin_len); + if (client_plugin == NULL) + client_plugin= &empty_c_string[0]; + + char db_buff[NAME_LEN + 1]; // buffer to store db in utf8 + char user_buff[USERNAME_LENGTH + 1]; // buffer to store user in utf8 + uint dummy_errors; + /* Since 4.1 all database names are stored in utf8 */ if (db) @@ -8550,18 +8662,18 @@ static ulong parse_client_handshake_packet(MPVIO_EXT *mpvio, if (find_mpvio_user(mpvio)) return packet_error; - if (mpvio->client_capabilities & CLIENT_PLUGIN_AUTH) - { - if ((client_plugin + strlen(client_plugin)) > - (char *) net->read_pos + pkt_len) - return packet_error; - } - else + if (!(mpvio->client_capabilities & CLIENT_PLUGIN_AUTH)) { + /* + An old client is connecting + */ if (mpvio->client_capabilities & CLIENT_SECURE_CONNECTION) client_plugin= native_password_plugin_name.str; else { + /* + A really old client is connecting + */ client_plugin= old_password_plugin_name.str; /* For a passwordless accounts we use native_password_plugin. From 2de6586287658f871a69167f6365d65051b5b7bc Mon Sep 17 00:00:00 2001 From: Jorgen Loland Date: Mon, 14 Mar 2011 14:30:36 +0100 Subject: [PATCH 022/192] BUG#11766234: ASSERT (TABLE_REF->TABLE || TABLE_REF->VIEW) FAILS IN SET_FIELD_ITERATOR (Former 59299) When a PROCEDURE does a natural join, resolving of which columns are used in the join is done only once; consecutive CALLs to the procedure will reuse this information: CREATE PROCEDURE proc() SELECT * FROM t1 NATURAL JOIN v1; CALL proc(); <- natural join columns resolved here CALL proc(); <- reuse resolved NJ columns from first CALL The second CALL knows that it can reuse the resolved NJ columns because the first CALL sets st_select_lex::first_natural_join_processing=false. The problem in this bug was that the table the view v1 depends on changed between CREATE PROCEDURE and the first CALL: CREATE PROCEDURE... ALTER TABLE t2 CHANGE COLUMN a b CHAR; CALL proc(); <- error when resolving natural join columns CALL proc(); <- tries to reuse from first CALL => crash The fix for this bug is to set first_natural_join_processing= FALSE iff the natural join columns resolving was successful. --- mysql-test/r/sp.result | 18 ++++++++++++++++++ mysql-test/t/sp.test | 22 ++++++++++++++++++++++ sql/sql_base.cc | 15 ++++++--------- 3 files changed, 46 insertions(+), 9 deletions(-) diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 243bfb6c07d..f1c86d016e2 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -7452,4 +7452,22 @@ c1 # Cleanup drop table t1; drop procedure p1; +# +# BUG#11766234: 59299: ASSERT (TABLE_REF->TABLE || TABLE_REF->VIEW) +# FAILS IN SET_FIELD_ITERATOR +# +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (a INT); +CREATE VIEW v1 AS SELECT a FROM t2; +CREATE PROCEDURE proc() SELECT * FROM t1 NATURAL JOIN v1; +ALTER TABLE t2 CHANGE COLUMN a b CHAR; + +CALL proc(); +ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them +CALL proc(); +ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them + +DROP TABLE t1,t2; +DROP VIEW v1; +DROP PROCEDURE proc; # End of 5.5 test diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 11edeaf9811..cf89a6ece80 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -8713,4 +8713,26 @@ call p1(3, 2); drop table t1; drop procedure p1; +--echo # +--echo # BUG#11766234: 59299: ASSERT (TABLE_REF->TABLE || TABLE_REF->VIEW) +--echo # FAILS IN SET_FIELD_ITERATOR +--echo # + +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (a INT); +CREATE VIEW v1 AS SELECT a FROM t2; +CREATE PROCEDURE proc() SELECT * FROM t1 NATURAL JOIN v1; +ALTER TABLE t2 CHANGE COLUMN a b CHAR; + +--echo +--error ER_VIEW_INVALID +CALL proc(); +--error ER_VIEW_INVALID +CALL proc(); + +--echo +DROP TABLE t1,t2; +DROP VIEW v1; +DROP PROCEDURE proc; + --echo # End of 5.5 test diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 7c020515f87..f37f800d091 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -7594,9 +7594,10 @@ static bool setup_natural_join_row_types(THD *thd, List *from_clause, Name_resolution_context *context) { + DBUG_ENTER("setup_natural_join_row_types"); thd->where= "from clause"; if (from_clause->elements == 0) - return FALSE; /* We come here in the case of UNIONs. */ + DBUG_RETURN(false); /* We come here in the case of UNIONs. */ List_iterator_fast table_ref_it(*from_clause); TABLE_LIST *table_ref; /* Current table reference. */ @@ -7604,10 +7605,6 @@ static bool setup_natural_join_row_types(THD *thd, TABLE_LIST *left_neighbor; /* Table reference to the right of the current. */ TABLE_LIST *right_neighbor= NULL; - bool save_first_natural_join_processing= - context->select_lex->first_natural_join_processing; - - context->select_lex->first_natural_join_processing= FALSE; /* Note that tables in the list are in reversed order */ for (left_neighbor= table_ref_it++; left_neighbor ; ) @@ -7619,12 +7616,11 @@ static bool setup_natural_join_row_types(THD *thd, 1) for stored procedures, 2) for multitable update after lock failure and table reopening. */ - if (save_first_natural_join_processing) + if (context->select_lex->first_natural_join_processing) { - context->select_lex->first_natural_join_processing= FALSE; if (store_top_level_join_columns(thd, table_ref, left_neighbor, right_neighbor)) - return TRUE; + DBUG_RETURN(true); if (left_neighbor) { TABLE_LIST *first_leaf_on_the_right; @@ -7644,8 +7640,9 @@ static bool setup_natural_join_row_types(THD *thd, DBUG_ASSERT(right_neighbor); context->first_name_resolution_table= right_neighbor->first_leaf_for_name_resolution(); + context->select_lex->first_natural_join_processing= false; - return FALSE; + DBUG_RETURN (false); } From 3d124532134b2442934f7ba5e8fd75d96be33c4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 15 Mar 2011 12:01:02 +0200 Subject: [PATCH 023/192] Bug#11849231 inflateInit() invoked without initializing all memory According to the zlib documentation, next_in and avail_in must be initialized before invoking inflateInit or inflateInit2. Furthermore, the zalloc function must clear the allocated memory. btr_copy_zblob_prefix(): Replace the d_stream parameter with buf,len and return the copied length. page_zip_decompress(): Invoke inflateInit2 a little later. page_zip_zalloc(): Rename from page_zip_alloc(). Invoke mem_heap_zalloc() instead of mem_heap_alloc(). rb:619 approved by Jimmy Yang --- storage/innodb_plugin/ChangeLog | 5 ++ storage/innodb_plugin/btr/btr0cur.c | 76 ++++++++++++++------------- storage/innodb_plugin/page/page0zip.c | 17 +++--- 3 files changed, 53 insertions(+), 45 deletions(-) diff --git a/storage/innodb_plugin/ChangeLog b/storage/innodb_plugin/ChangeLog index fdd29908192..7c82cd9c27f 100644 --- a/storage/innodb_plugin/ChangeLog +++ b/storage/innodb_plugin/ChangeLog @@ -1,3 +1,8 @@ +2011-03-15 The InnoDB Team + + * btr/btr0cur.c, page/page0zip.c: + Fix Bug#11849231 inflateInit() invoked without initializing all memory + 2011-02-28 The InnoDB Team * btr/btr0sea.c, buf/buf0buf.c, buf/buf0lru.c: diff --git a/storage/innodb_plugin/btr/btr0cur.c b/storage/innodb_plugin/btr/btr0cur.c index 86d77c79e7b..d7b5ed0d135 100644 --- a/storage/innodb_plugin/btr/btr0cur.c +++ b/storage/innodb_plugin/btr/btr0cur.c @@ -4627,27 +4627,45 @@ btr_copy_blob_prefix( /*******************************************************************//** Copies the prefix of a compressed BLOB. The clustered index record -that points to this BLOB must be protected by a lock or a page latch. */ +that points to this BLOB must be protected by a lock or a page latch. +@return number of bytes written to buf */ static -void +ulint btr_copy_zblob_prefix( /*==================*/ - z_stream* d_stream,/*!< in/out: the decompressing stream */ + byte* buf, /*!< out: the externally stored part of + the field, or a prefix of it */ + ulint len, /*!< in: length of buf, in bytes */ ulint zip_size,/*!< in: compressed BLOB page size */ ulint space_id,/*!< in: space id of the BLOB pages */ ulint page_no,/*!< in: page number of the first BLOB page */ ulint offset) /*!< in: offset on the first BLOB page */ { - ulint page_type = FIL_PAGE_TYPE_ZBLOB; + ulint page_type = FIL_PAGE_TYPE_ZBLOB; + mem_heap_t* heap; + int err; + z_stream d_stream; + + d_stream.next_out = buf; + d_stream.avail_out = len; + d_stream.next_in = Z_NULL; + d_stream.avail_in = 0; + + /* Zlib inflate needs 32 kilobytes for the default + window size, plus a few kilobytes for small objects. */ + heap = mem_heap_create(40000); + page_zip_set_alloc(&d_stream, heap); ut_ad(ut_is_2pow(zip_size)); ut_ad(zip_size >= PAGE_ZIP_MIN_SIZE); ut_ad(zip_size <= UNIV_PAGE_SIZE); ut_ad(space_id); + err = inflateInit(&d_stream); + ut_a(err == Z_OK); + for (;;) { buf_page_t* bpage; - int err; ulint next_page_no; /* There is no latch on bpage directly. Instead, @@ -4663,7 +4681,7 @@ btr_copy_zblob_prefix( " compressed BLOB" " page %lu space %lu\n", (ulong) page_no, (ulong) space_id); - return; + goto func_exit; } if (UNIV_UNLIKELY @@ -4689,13 +4707,13 @@ btr_copy_zblob_prefix( offset += 4; } - d_stream->next_in = bpage->zip.data + offset; - d_stream->avail_in = zip_size - offset; + d_stream.next_in = bpage->zip.data + offset; + d_stream.avail_in = zip_size - offset; - err = inflate(d_stream, Z_NO_FLUSH); + err = inflate(&d_stream, Z_NO_FLUSH); switch (err) { case Z_OK: - if (!d_stream->avail_out) { + if (!d_stream.avail_out) { goto end_of_blob; } break; @@ -4712,13 +4730,13 @@ inflate_error: " compressed BLOB" " page %lu space %lu returned %d (%s)\n", (ulong) page_no, (ulong) space_id, - err, d_stream->msg); + err, d_stream.msg); case Z_BUF_ERROR: goto end_of_blob; } if (next_page_no == FIL_NULL) { - if (!d_stream->avail_in) { + if (!d_stream.avail_in) { ut_print_timestamp(stderr); fprintf(stderr, " InnoDB: unexpected end of" @@ -4727,7 +4745,7 @@ inflate_error: (ulong) page_no, (ulong) space_id); } else { - err = inflate(d_stream, Z_FINISH); + err = inflate(&d_stream, Z_FINISH); switch (err) { case Z_STREAM_END: case Z_BUF_ERROR: @@ -4739,7 +4757,7 @@ inflate_error: end_of_blob: buf_page_release_zip(bpage); - return; + goto func_exit; } buf_page_release_zip(bpage); @@ -4751,6 +4769,12 @@ end_of_blob: offset = FIL_PAGE_NEXT; page_type = FIL_PAGE_TYPE_ZBLOB2; } + +func_exit: + inflateEnd(&d_stream); + mem_heap_free(heap); + UNIV_MEM_ASSERT_RW(buf, d_stream.total_out); + return(d_stream.total_out); } /*******************************************************************//** @@ -4776,28 +4800,8 @@ btr_copy_externally_stored_field_prefix_low( } if (UNIV_UNLIKELY(zip_size)) { - int err; - z_stream d_stream; - mem_heap_t* heap; - - /* Zlib inflate needs 32 kilobytes for the default - window size, plus a few kilobytes for small objects. */ - heap = mem_heap_create(40000); - page_zip_set_alloc(&d_stream, heap); - - err = inflateInit(&d_stream); - ut_a(err == Z_OK); - - d_stream.next_out = buf; - d_stream.avail_out = len; - d_stream.avail_in = 0; - - btr_copy_zblob_prefix(&d_stream, zip_size, - space_id, page_no, offset); - inflateEnd(&d_stream); - mem_heap_free(heap); - UNIV_MEM_ASSERT_RW(buf, d_stream.total_out); - return(d_stream.total_out); + return(btr_copy_zblob_prefix(buf, len, zip_size, + space_id, page_no, offset)); } else { return(btr_copy_blob_prefix(buf, len, space_id, page_no, offset)); diff --git a/storage/innodb_plugin/page/page0zip.c b/storage/innodb_plugin/page/page0zip.c index a1dd4177ba8..6e866b3f016 100644 --- a/storage/innodb_plugin/page/page0zip.c +++ b/storage/innodb_plugin/page/page0zip.c @@ -653,13 +653,13 @@ page_zip_dir_encode( Allocate memory for zlib. */ static void* -page_zip_malloc( +page_zip_zalloc( /*============*/ void* opaque, /*!< in/out: memory heap */ uInt items, /*!< in: number of items to allocate */ uInt size) /*!< in: size of an item in bytes */ { - return(mem_heap_alloc(opaque, items * size)); + return(mem_heap_zalloc(opaque, items * size)); } /**********************************************************************//** @@ -684,7 +684,7 @@ page_zip_set_alloc( { z_stream* strm = stream; - strm->zalloc = page_zip_malloc; + strm->zalloc = page_zip_zalloc; strm->zfree = page_zip_free; strm->opaque = heap; } @@ -2912,19 +2912,18 @@ zlib_error: page_zip_set_alloc(&d_stream, heap); - if (UNIV_UNLIKELY(inflateInit2(&d_stream, UNIV_PAGE_SIZE_SHIFT) - != Z_OK)) { - ut_error; - } - d_stream.next_in = page_zip->data + PAGE_DATA; /* Subtract the space reserved for the page header and the end marker of the modification log. */ d_stream.avail_in = page_zip_get_size(page_zip) - (PAGE_DATA + 1); - d_stream.next_out = page + PAGE_ZIP_START; d_stream.avail_out = UNIV_PAGE_SIZE - PAGE_ZIP_START; + if (UNIV_UNLIKELY(inflateInit2(&d_stream, UNIV_PAGE_SIZE_SHIFT) + != Z_OK)) { + ut_error; + } + /* Decode the zlib header and the index information. */ if (UNIV_UNLIKELY(inflate(&d_stream, Z_BLOCK) != Z_OK)) { From 405f7ca69a36a2b2d7b02bdb945f1e6879c5aaea Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Tue, 15 Mar 2011 13:19:30 +0200 Subject: [PATCH 024/192] Bug #11765023: 57934: DOS POSSIBLE SINCE BINARY CASTING DOESN'T ADHERE TO MAX_ALLOWED_PACKET Added a check for max_packet_length in CONVERT(, BINARY|CHAR). Added a test case. --- mysql-test/r/cast.result | 15 +++++++++++++++ mysql-test/t/cast.test | 14 ++++++++++++++ sql/item_timefunc.cc | 13 +++++++++++++ 3 files changed, 42 insertions(+) diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result index dd61396e485..974a6bee63f 100644 --- a/mysql-test/r/cast.result +++ b/mysql-test/r/cast.result @@ -451,4 +451,19 @@ SELECT CONVERT(t2.a USING UTF8) FROM t1, t1 t2 LIMIT 1 1 1 DROP TABLE t1; +# +# Bug #11765023: 57934: DOS POSSIBLE SINCE BINARY CASTING +# DOESN'T ADHERE TO MAX_ALLOWED_PACKET +SET @@GLOBAL.max_allowed_packet=2048; +SELECT CONVERT('a', BINARY(2049)); +CONVERT('a', BINARY(2049)) +NULL +Warnings: +Warning 1301 Result of cast_as_binary() was larger than max_allowed_packet (2048) - truncated +SELECT CONVERT('a', CHAR(2049)); +CONVERT('a', CHAR(2049)) +NULL +Warnings: +Warning 1301 Result of cast_as_char() was larger than max_allowed_packet (2048) - truncated +SET @@GLOBAL.max_allowed_packet=default; End of 5.1 tests diff --git a/mysql-test/t/cast.test b/mysql-test/t/cast.test index 8e60d548c2f..426d7c7fdf2 100644 --- a/mysql-test/t/cast.test +++ b/mysql-test/t/cast.test @@ -282,5 +282,19 @@ SELECT 1 FROM ) AS s LIMIT 1; DROP TABLE t1; +--echo # +--echo # Bug #11765023: 57934: DOS POSSIBLE SINCE BINARY CASTING +--echo # DOESN'T ADHERE TO MAX_ALLOWED_PACKET + +SET @@GLOBAL.max_allowed_packet=2048; +# reconnect to make the new max packet size take effect +--connect (newconn, localhost, root,,) + +SELECT CONVERT('a', BINARY(2049)); +SELECT CONVERT('a', CHAR(2049)); + +connection default; +disconnect newconn; +SET @@GLOBAL.max_allowed_packet=default; --echo End of 5.1 tests diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 6335199b8de..74aae94b6f2 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -2444,6 +2444,19 @@ String *Item_char_typecast::val_str(String *str) String *res; uint32 length; + if (cast_length >= 0 && + ((unsigned) cast_length) > current_thd->variables.max_allowed_packet) + { + push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WARN_ALLOWED_PACKET_OVERFLOWED, + ER(ER_WARN_ALLOWED_PACKET_OVERFLOWED), + cast_cs == &my_charset_bin ? + "cast_as_binary" : func_name(), + current_thd->variables.max_allowed_packet); + null_value= 1; + return 0; + } + if (!charset_conversion) { if (!(res= args[0]->val_str(str))) From 9a4dd4adf9044ef9c926188e9efac78922640b26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 15 Mar 2011 15:24:51 +0200 Subject: [PATCH 025/192] Remove trailing white space. --- storage/innobase/buf/buf0buf.c | 46 +++++++++++++++++----------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/storage/innobase/buf/buf0buf.c b/storage/innobase/buf/buf0buf.c index fcfc15f03e8..aece9586fd2 100644 --- a/storage/innobase/buf/buf0buf.c +++ b/storage/innobase/buf/buf0buf.c @@ -1233,7 +1233,7 @@ buf_pool_init_instance( buf_pool->page_hash = hash_create(2 * buf_pool->curr_size); buf_pool->zip_hash = hash_create(2 * buf_pool->curr_size); - + buf_pool->last_printout_time = ut_time(); } /* 2. Initialize flushing fields @@ -1365,11 +1365,11 @@ buf_pool_drop_hash_index_instance( /* block->is_hashed cannot be modified when we have an x-latch on btr_search_latch; see the comment in buf0buf.h */ - + if (!block->is_hashed) { continue; } - + /* To follow the latching order, we have to release btr_search_latch before acquiring block->latch. */ @@ -1378,14 +1378,14 @@ buf_pool_drop_hash_index_instance( we must rescan all blocks, because some may become hashed again. */ *released_search_latch = TRUE; - + rw_lock_x_lock(&block->lock); - + /* This should be guaranteed by the callers, which will be holding btr_search_enabled_mutex. */ ut_ad(!btr_search_enabled); - + /* Because we did not buffer-fix the block by calling buf_block_get_gen(), it is possible that the block has been @@ -1395,7 +1395,7 @@ buf_pool_drop_hash_index_instance( block is mapped to. All we want to do is to drop any hash entries referring to the page. */ - + /* It is possible that block->page.state != BUF_FILE_PAGE. Even that does not matter, because @@ -1403,18 +1403,18 @@ buf_pool_drop_hash_index_instance( check block->is_hashed before doing anything. block->is_hashed can only be set on uncompressed file pages. */ - + btr_search_drop_page_hash_index(block); - + rw_lock_x_unlock(&block->lock); - + rw_lock_x_lock(&btr_search_latch); - + ut_ad(!btr_search_enabled); } } } - + /********************************************************************//** Drops the adaptive hash index. To prevent a livelock, this function is only to be called while holding btr_search_latch and while @@ -1990,30 +1990,30 @@ buf_pool_resize(void) ulint min_change_size = 1048576 * srv_buf_pool_instances; buf_pool_mutex_enter_all(); - + if (srv_buf_pool_old_size == srv_buf_pool_size) { - + buf_pool_mutex_exit_all(); return; } else if (srv_buf_pool_curr_size + min_change_size > srv_buf_pool_size) { - + change_size = (srv_buf_pool_curr_size - srv_buf_pool_size) / UNIV_PAGE_SIZE; buf_pool_mutex_exit_all(); - + /* Disable adaptive hash indexes and empty the index in order to free up memory in the buffer pool chunks. */ buf_pool_shrink(change_size); } else if (srv_buf_pool_curr_size + min_change_size < srv_buf_pool_size) { - + /* Enlarge the buffer pool by at least one megabyte */ - + change_size = srv_buf_pool_size - srv_buf_pool_curr_size; buf_pool_mutex_exit_all(); @@ -2026,10 +2026,10 @@ buf_pool_resize(void) return; } - + buf_pool_page_hash_rebuild(); } - + /****************************************************************//** Remove the sentinel block for the watch before replacing it with a real block. buf_page_watch_clear() or buf_page_watch_occurred() will notice that @@ -2890,7 +2890,7 @@ wait_until_unfixed: Try again later. */ buf_pool_mutex_exit(buf_pool); os_thread_sleep(WAIT_FOR_READ); - + goto loop; } @@ -4806,7 +4806,7 @@ buf_get_modified_ratio_pct(void) buf_get_total_list_len(&lru_len, &free_len, &flush_list_len); ratio = (100 * flush_list_len) / (1 + lru_len + free_len); - + /* 1 + is there to avoid division by zero */ return(ratio); @@ -5189,7 +5189,7 @@ buf_all_freed(void) return(TRUE); } - + /*********************************************************************//** Checks that there currently are no pending i/o-operations for the buffer pool. From aa4bfebaee1c2130519f5878b29b55e8919f3185 Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Tue, 15 Mar 2011 16:06:59 +0100 Subject: [PATCH 026/192] Bug #11762804 55442: MYSQLD DEBUG CRASHES WHILE RUNNING MYISAM_CRASH_BEFORE_FLUSH_KEYS.TEST This will cause affected tests to skip if CrashReporter would popup Found 5 tests that needed modification --- mysql-test/include/not_crashrep.inc | 24 +++++++++++++++++++ mysql-test/suite/binlog/t/binlog_index.test | 2 ++ .../suite/innodb/t/innodb_bug53756.test | 3 +++ .../innodb_plugin/t/innodb_bug53756.test | 3 +++ mysql-test/t/crash_commit_before.test | 2 ++ .../t/myisam_crash_before_flush_keys.test | 3 +++ 6 files changed, 37 insertions(+) create mode 100644 mysql-test/include/not_crashrep.inc diff --git a/mysql-test/include/not_crashrep.inc b/mysql-test/include/not_crashrep.inc new file mode 100644 index 00000000000..e126f339a5f --- /dev/null +++ b/mysql-test/include/not_crashrep.inc @@ -0,0 +1,24 @@ +# Check if CrashReporter is enabled and would open a window + +perl; +sub skip_test { + # Only relevant on Mac OS X + return 0 unless $^O eq 'darwin'; + my $crep= `defaults read com.apple.CrashReporter DialogType`; + return 0 if $?; + chomp ($crep); + $crep= lc $crep; + return ($crep eq 'basic' || $crep eq 'developer'); +} +my $skip= skip_test(); +open (F, ">" . $ENV{'MYSQL_TMP_DIR'} . "/crashrep.inc"); +print F "let \$crashrep= $skip;\n"; +close F; +EOF + +--source $MYSQL_TMP_DIR/crashrep.inc +--remove_file $MYSQL_TMP_DIR/crashrep.inc + +if ($crashrep) { + --skip CrashReporter would popup a window +} diff --git a/mysql-test/suite/binlog/t/binlog_index.test b/mysql-test/suite/binlog/t/binlog_index.test index b735574fdb9..086c0842b20 100644 --- a/mysql-test/suite/binlog/t/binlog_index.test +++ b/mysql-test/suite/binlog/t/binlog_index.test @@ -6,6 +6,8 @@ source include/not_embedded.inc; # Don't test this under valgrind, memory leaks will occur --source include/not_valgrind.inc source include/have_debug.inc; +# Avoid CrashReporter popup on Mac +--source include/not_crashrep.inc call mtr.add_suppression('Attempting backtrace'); call mtr.add_suppression('MSYQL_BIN_LOG::purge_logs failed to process registered files that would be purged.'); call mtr.add_suppression('MSYQL_BIN_LOG::open failed to sync the index file'); diff --git a/mysql-test/suite/innodb/t/innodb_bug53756.test b/mysql-test/suite/innodb/t/innodb_bug53756.test index d3b0a77c680..7a48f130b2c 100644 --- a/mysql-test/suite/innodb/t/innodb_bug53756.test +++ b/mysql-test/suite/innodb/t/innodb_bug53756.test @@ -17,6 +17,9 @@ # This test case needs InnoDB. --source include/have_innodb.inc +# Avoid CrashReporter popup on Mac +--source include/not_crashrep.inc + # # Precautionary clean up. # diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug53756.test b/mysql-test/suite/innodb_plugin/t/innodb_bug53756.test index 8c48550a64d..37a79ea3021 100644 --- a/mysql-test/suite/innodb_plugin/t/innodb_bug53756.test +++ b/mysql-test/suite/innodb_plugin/t/innodb_bug53756.test @@ -17,6 +17,9 @@ # This test case needs InnoDB. -- source include/have_innodb_plugin.inc +# Avoid CrashReporter popup on Mac +--source include/not_crashrep.inc + # # Precautionary clean up. # diff --git a/mysql-test/t/crash_commit_before.test b/mysql-test/t/crash_commit_before.test index e3dba58d4df..6e36d2345e1 100644 --- a/mysql-test/t/crash_commit_before.test +++ b/mysql-test/t/crash_commit_before.test @@ -1,6 +1,8 @@ -- source include/not_embedded.inc # Don't test this under valgrind, memory leaks will occur --source include/not_valgrind.inc +# Avoid CrashReporter popup on Mac +--source include/not_crashrep.inc # Binary must be compiled with debug for crash to occur --source include/have_debug.inc diff --git a/mysql-test/t/myisam_crash_before_flush_keys.test b/mysql-test/t/myisam_crash_before_flush_keys.test index 1860ddd27e3..ea41b3559ca 100644 --- a/mysql-test/t/myisam_crash_before_flush_keys.test +++ b/mysql-test/t/myisam_crash_before_flush_keys.test @@ -8,6 +8,9 @@ --echo # Binary must be compiled with debug for crash to occur --source include/have_debug.inc +# Avoid CrashReporter popup on Mac +--source include/not_crashrep.inc + let $MYSQLD_DATADIR= `select @@datadir`; SET GLOBAL delay_key_write=ALL; CREATE TABLE t1(a INT, From 6d07a87a58b7b1809413e5401beae4881c173cb5 Mon Sep 17 00:00:00 2001 From: Alfranio Correia Date: Wed, 16 Mar 2011 16:38:30 +0000 Subject: [PATCH 027/192] BUG#11877568 - RPL_SEMI_SYNC FAILS IN PB Currently, rpl_semi_sync is failing in PB due to the warning message: "Slave SQL: slave SQL thread is being stopped in the middle of " "applying of a group having updated a non-transaction table; " "waiting for the group completion ..." The problem started happening after the fix for BUG#11762407 what was automatically suppressing some warning messages. To fix the current issue, we suppress the aforementioned warning message and exploit the opportunity to make the sentence clearer. --- .../rpl_tests/rpl_stop_middle_group.test | 4 ++-- .../rpl/r/rpl_circular_for_4_hosts.result | 2 +- .../suite/rpl/r/rpl_heartbeat_basic.result | 2 +- .../suite/rpl/r/rpl_slow_query_log.result | 2 +- .../rpl/r/rpl_stm_start_stop_slave.result | 2 +- .../rpl/r/rpl_stm_stop_middle_group.result | 12 +++++------ mysql-test/suite/rpl/r/rpl_stop_slave.result | 2 +- .../suite/rpl/t/rpl_circular_for_4_hosts.test | 2 +- .../suite/rpl/t/rpl_heartbeat_basic.test | 2 +- mysql-test/suite/rpl/t/rpl_semi_sync.test | 1 + .../suite/rpl/t/rpl_slow_query_log.test | 3 +-- .../suite/rpl/t/rpl_stm_start_stop_slave.test | 2 +- mysql-test/suite/rpl/t/rpl_stop_slave.test | 2 +- sql/slave.cc | 20 +++++++++---------- 14 files changed, 29 insertions(+), 29 deletions(-) diff --git a/mysql-test/extra/rpl_tests/rpl_stop_middle_group.test b/mysql-test/extra/rpl_tests/rpl_stop_middle_group.test index 4941cdbafd1..977d93ec36d 100644 --- a/mysql-test/extra/rpl_tests/rpl_stop_middle_group.test +++ b/mysql-test/extra/rpl_tests/rpl_stop_middle_group.test @@ -23,8 +23,8 @@ insert into tm set a=null; # to simulate killed status on the slave commit; connection slave; -call mtr.add_suppression("Slave SQL.*slave SQL thread is being stopped in the middle of applying of a group having updated a non-transaction table"); -call mtr.add_suppression("Slave SQL.*The slave SQL is stopped, leaving the current group of events unfinished with a non-transaction table changed."); +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); +call mtr.add_suppression("Slave SQL.*Slave SQL Thread stopped with incomplete event group having non-transactional changes"); # slave will catch the killed status but won't shut down immediately # only after the whole group has done (commit) diff --git a/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result b/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result index c2877510da2..f9c5b48e227 100644 --- a/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result +++ b/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result @@ -5,7 +5,7 @@ include/rpl_init.inc [topology=1->2->3->4->1] CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b VARCHAR(100), c INT NOT NULL, PRIMARY KEY(a)) ENGINE=MyISAM; CREATE TABLE t2 (a INT NOT NULL AUTO_INCREMENT, b VARCHAR(100), c INT NOT NULL, PRIMARY KEY(a)) ENGINE=InnoDB; include/rpl_sync.inc -call mtr.add_suppression("Slave SQL.*slave SQL thread is being stopped in the middle of applying of a group having updated a non-transaction table"); +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); *** Testing schema A->B->C->D->A *** diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result index d510a14769c..93faf37053a 100644 --- a/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result +++ b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result @@ -207,7 +207,7 @@ CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10), c LONGTEXT); INSERT INTO t1 VALUES (1, 'on slave', NULL); INSERT INTO t1 VALUES (1, 'on master', NULL); call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.. on query.* Error_code: 1062"); -call mtr.add_suppression("Slave SQL.*slave SQL thread is being stopped in the middle of applying of a group having updated a non-transaction table"); +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); Heartbeat events are received while sql thread stopped (1 means 'yes'): 1 include/stop_slave.inc DROP TABLE t1; diff --git a/mysql-test/suite/rpl/r/rpl_slow_query_log.result b/mysql-test/suite/rpl/r/rpl_slow_query_log.result index 5bb1ba050a8..79b83b4ceb9 100644 --- a/mysql-test/suite/rpl/r/rpl_slow_query_log.result +++ b/mysql-test/suite/rpl/r/rpl_slow_query_log.result @@ -1,7 +1,7 @@ include/master-slave.inc [connection master] CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); -call mtr.add_suppression("Slave SQL: slave SQL thread is being stopped in the middle of applying of a group having updated a non-transaction table; waiting for the group completion"); +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); include/stop_slave.inc SET @old_log_output= @@log_output; SET GLOBAL log_output= 'TABLE'; diff --git a/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result b/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result index 9261721b1c9..57206873e2f 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result +++ b/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result @@ -70,6 +70,6 @@ include/start_slave.inc # Clean up DROP TABLE t1; SET @@global.innodb_flush_log_at_trx_commit= @old_innodb_flush_log_at_trx_commit; -call mtr.add_suppression("Slave SQL.*slave SQL thread is being stopped in the middle of applying of a group having updated a non-transaction table"); +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); SET @@global.innodb_flush_log_at_trx_commit= @old_innodb_flush_log_at_trx_commit; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result b/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result index 5936c64d0ca..0b3233437aa 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result +++ b/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result @@ -11,8 +11,8 @@ insert into tm set a=null; Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. commit; -call mtr.add_suppression("Slave SQL.*slave SQL thread is being stopped in the middle of applying of a group having updated a non-transaction table"); -call mtr.add_suppression("Slave SQL.*The slave SQL is stopped, leaving the current group of events unfinished with a non-transaction table changed."); +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); +call mtr.add_suppression("Slave SQL.*Slave SQL Thread stopped with incomplete event group having non-transactional changes"); include/wait_for_slave_sql_to_stop.inc SELECT "NO" AS Last_SQL_Error, @check as `true`; Last_SQL_Error true @@ -36,9 +36,9 @@ Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. commit; include/wait_for_slave_sql_to_stop.inc -SELECT "Fatal error: ... The slave SQL is stopped, leaving the current group of events unfinished with a non-transaction table changed. If the group consists solely of Row-based events, you can try restarting the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details)." AS Last_SQL_Error, @check as `true`; +SELECT "Fatal error: ... Slave SQL Thread stopped with incomplete event group having non-transactional changes. If the group consists solely of row-based events, you can try to restart the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details)." AS Last_SQL_Error, @check as `true`; Last_SQL_Error true -Fatal error: ... The slave SQL is stopped, leaving the current group of events unfinished with a non-transaction table changed. If the group consists solely of Row-based events, you can try restarting the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details). 1 +Fatal error: ... Slave SQL Thread stopped with incomplete event group having non-transactional changes. If the group consists solely of row-based events, you can try to restart the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details). 1 select count(*) as one from tm; one 1 @@ -53,9 +53,9 @@ set @@global.debug="+d,stop_slave_middle_group"; set @@global.debug="+d,incomplete_group_in_relay_log"; update tm as t1, ti as t2 set t1.a=t1.a * 2, t2.a=t2.a * 2; include/wait_for_slave_sql_to_stop.inc -SELECT "Fatal error: ... The slave SQL is stopped, leaving the current group of events unfinished with a non-transaction table changed. If the group consists solely of Row-based events, you can try restarting the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details)." AS Last_SQL_Error, @check as `true`; +SELECT "Fatal error: ... Slave SQL Thread stopped with incomplete event group having non-transactional changes. If the group consists solely of row-based events, you can try to restart the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details)." AS Last_SQL_Error, @check as `true`; Last_SQL_Error true -Fatal error: ... The slave SQL is stopped, leaving the current group of events unfinished with a non-transaction table changed. If the group consists solely of Row-based events, you can try restarting the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details). 1 +Fatal error: ... Slave SQL Thread stopped with incomplete event group having non-transactional changes. If the group consists solely of row-based events, you can try to restart the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details). 1 select max(a) as two from tm; two 2 diff --git a/mysql-test/suite/rpl/r/rpl_stop_slave.result b/mysql-test/suite/rpl/r/rpl_stop_slave.result index 8d85c2d26b5..014e65500c7 100644 --- a/mysql-test/suite/rpl/r/rpl_stop_slave.result +++ b/mysql-test/suite/rpl/r/rpl_stop_slave.result @@ -75,7 +75,7 @@ include/wait_for_slave_sql_to_start.inc # Test end SET GLOBAL debug= '$debug_save'; include/restart_slave.inc -call mtr.add_suppression("Slave SQL.*slave SQL thread is being stopped in the middle of applying of a group having updated a non-transaction table"); +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); [connection master] DROP TABLE t1, t2; diff --git a/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test index 4bbd367b483..7d4b538c8a6 100644 --- a/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test +++ b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test @@ -30,7 +30,7 @@ CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b VARCHAR(100), c INT NOT NULL, CREATE TABLE t2 (a INT NOT NULL AUTO_INCREMENT, b VARCHAR(100), c INT NOT NULL, PRIMARY KEY(a)) ENGINE=InnoDB; --source include/rpl_sync.inc --connection server_4 -call mtr.add_suppression("Slave SQL.*slave SQL thread is being stopped in the middle of applying of a group having updated a non-transaction table"); +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); --echo # diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test b/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test index e3147ca1b0a..b9a170c5bc1 100644 --- a/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test +++ b/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test @@ -320,7 +320,7 @@ INSERT INTO t1 VALUES (1, 'on slave', NULL); INSERT INTO t1 VALUES (1, 'on master', NULL); --connection slave call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.. on query.* Error_code: 1062"); -call mtr.add_suppression("Slave SQL.*slave SQL thread is being stopped in the middle of applying of a group having updated a non-transaction table"); +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); let $slave_errno= ER_DUP_ENTRY --source include/wait_for_slave_sql_error.inc let $rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1); diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync.test b/mysql-test/suite/rpl/t/rpl_semi_sync.test index a57ebc236a1..228757496f3 100644 --- a/mysql-test/suite/rpl/t/rpl_semi_sync.test +++ b/mysql-test/suite/rpl/t/rpl_semi_sync.test @@ -15,6 +15,7 @@ call mtr.add_suppression("Unsafe statement written to the binary log using state connection slave; call mtr.add_suppression("Master server does not support semi-sync"); call mtr.add_suppression("Semi-sync slave .* reply"); +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); enable_query_log; connection master; diff --git a/mysql-test/suite/rpl/t/rpl_slow_query_log.test b/mysql-test/suite/rpl/t/rpl_slow_query_log.test index 35df117e5a2..faf037a9dff 100644 --- a/mysql-test/suite/rpl/t/rpl_slow_query_log.test +++ b/mysql-test/suite/rpl/t/rpl_slow_query_log.test @@ -29,8 +29,7 @@ source include/master-slave.inc; source include/have_binlog_format_statement.inc; CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); -call mtr.add_suppression("Slave SQL: slave SQL thread is being stopped in the middle of applying of a group having updated a non-transaction table; waiting for the group completion"); - +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); # Prepare slave for different long_query_time we need to stop the slave # and restart it as long_query_time variable is dynamic and, after diff --git a/mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test b/mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test index 6fd5045cc43..ada080e9071 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test +++ b/mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test @@ -19,7 +19,7 @@ SET @@session.binlog_direct_non_transactional_updates= FALSE; # clean up --connection slave SET @@global.innodb_flush_log_at_trx_commit= @old_innodb_flush_log_at_trx_commit; -call mtr.add_suppression("Slave SQL.*slave SQL thread is being stopped in the middle of applying of a group having updated a non-transaction table"); +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); --connection master SET @@global.innodb_flush_log_at_trx_commit= @old_innodb_flush_log_at_trx_commit; diff --git a/mysql-test/suite/rpl/t/rpl_stop_slave.test b/mysql-test/suite/rpl/t/rpl_stop_slave.test index 8192302fdc0..fae9822e3e9 100644 --- a/mysql-test/suite/rpl/t/rpl_stop_slave.test +++ b/mysql-test/suite/rpl/t/rpl_stop_slave.test @@ -48,7 +48,7 @@ SET GLOBAL debug= '$debug_save'; source include/restart_slave_sql.inc; connection slave; -call mtr.add_suppression("Slave SQL.*slave SQL thread is being stopped in the middle of applying of a group having updated a non-transaction table"); +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); connection master; --source include/rpl_connection_master.inc diff --git a/sql/slave.cc b/sql/slave.cc index a96ee505fe9..c676c89b369 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -903,18 +903,18 @@ static bool sql_slave_killed(THD* thd, Relay_log_info* rli) && rli->is_in_group()) { char msg_stopped[]= - "... The slave SQL is stopped, leaving the current group " - "of events unfinished with a non-transaction table changed. " - "If the group consists solely of Row-based events, you can try " - "restarting the slave with --slave-exec-mode=IDEMPOTENT, which " + "... Slave SQL Thread stopped with incomplete event group " + "having non-transactional changes. " + "If the group consists solely of row-based events, you can try " + "to restart the slave with --slave-exec-mode=IDEMPOTENT, which " "ignores duplicate key, key not found, and similar errors (see " "documentation for details)."; if (rli->abort_slave) { - DBUG_PRINT("info", ("Slave SQL thread is being stopped in the middle of" - " a group having updated a non-trans table, giving" - " it some grace period")); + DBUG_PRINT("info", ("Request to stop slave SQL Thread received while " + "applying a group that has non-transactional " + "changes; waiting for completion of the group ... ")); /* Slave sql thread shutdown in face of unfinished group modified @@ -938,9 +938,9 @@ static bool sql_slave_killed(THD* thd, Relay_log_info* rli) if (ret == 0) { rli->report(WARNING_LEVEL, 0, - "slave SQL thread is being stopped in the middle " - "of applying of a group having updated a non-transaction " - "table; waiting for the group completion ... "); + "Request to stop slave SQL Thread received while " + "applying a group that has non-transactional " + "changes; waiting for completion of the group ... "); } else { From 35bda0ae15fcf8b231aec6b1a949c7c7103cd808 Mon Sep 17 00:00:00 2001 From: Kent Boortz Date: Wed, 16 Mar 2011 23:04:29 +0100 Subject: [PATCH 028/192] Removed the "Third-Party Component Notices" part --- README | 2209 +------------------------------------------------------- 1 file changed, 1 insertion(+), 2208 deletions(-) diff --git a/README b/README index 2e18fb55a22..795d325e2d5 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -MySQL Server +MySQL Server 5.0 This is a release of MySQL, a dual-license SQL database server. For the avoidance of doubt, this particular copy of the software @@ -54,2210 +54,3 @@ You can browse the MySQL Reference Manual online or download it in any of several formats at the URL given earlier in this file. Source distributions include a local copy of the manual in the Docs directory. - -******************************************************************** - -Third-Party Component Notices - -********************************************************************* - -%%The following software may be included in this product: -FindGTest.cmake (part of CMake 2.8.0) - -Use of any of this software is governed by the terms of the license below: - -# Copyright 2009 Kitware, Inc. -# Copyright 2009 Philip Lowman -# Copyright 2009 Daniel Blezek -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#=========================================================================== -# (To distributed this file outside of CMake, substitute the full -# License text for the above reference.) -# -# Thanks to Daniel Blezek for the GTEST_ADD_TESTS code - - -Text of Copyright.txt mentioned above: - -CMake - Cross Platform Makefile Generator -Copyright 2000-2009 Kitware, Inc., Insight Software Consortium -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -* Neither the names of Kitware, Inc., the Insight Software Consortium, - nor the names of their contributors may be used to endorse or promote - products derived from this software without specific prior written - permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -*************************************************************************** - -%%The following software may be included in this product: -Cmake - -Use of any of this software is governed by the terms of the license below: - -CMake is distributed under BSD License - - Copyright (c) 2008, Kitware, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - * Neither the name of Kitware, Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY Kitware, Inc. "AS IS" AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL Kitware Inc. BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -Additional License(s) - -cmake-2.4.8/Utilities/cmtar/compat/gethostname.c: - gethostname.c: minimal substitute for missing gethostname() function - created 2000-Mar-02 jmk - requires SVR4 uname() and -lc - - by Jim Knoble - Copyright ? 2000 Jim Knoble - - Permission to use, copy, modify, distribute, and sell this software - and its documentation for any purpose is hereby granted without fee, - provided that the above copyright notice appear in all copies and - that both that copyright notice and this permission notice appear in - supporting documentation. - - This software is provided "as is", without warranty of any kind, - express or implied, including but not limited to the warranties of - merchantability, fitness for a particular purpose and - noninfringement. In no event shall the author(s) be liable for any - claim, damages or other liability, whether in an action of contract, - tort or otherwise, arising from, out of or in connection with the - software or the use or other dealings in the software. - ----------------------------------- - -* Originally written by Steven M. Bellovin while -* at the University of North Carolina at Chapel Hill. Later tweaked by -* a couple of people on Usenet. Completely overhauled by Rich $alz -* and Jim Berets in August, 1990. -* -* This code is in the public domain and has no copyright. - -------------------------------- - - THIS CODE IS SPECIFICALLY EXEMPTED FROM THE NCURSES PACKAGE COPYRIGHT. - You may freely copy it for use as a template for your own field types. - If you develop a field type that might be of general use, please send - it back to the ncurses maintainers for inclusion in the next version. - -************************************************************************** - - * Author : Per Foreby, perf@efd.lth.se - * Author : Juergen Pfeifer, juergen.pfeifer@gmx.net - -************************************************************************** - ----------------------------------------- - - Copyright (c) 2002 Insight Consortium. All rights reserved. - See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for - details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - --------------------------------------------- - - Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software - Foundation, Inc. - - 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 - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. - ---------------------------------------------------- - -cmake-2.4.8/Utilities/cmzlib/zlib.h: - zlib.h -- interface of the 'zlib' general purpose compression library - version 1.1.4, March 11th, 2002 - - Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must - not be misrepresented as being the original software. - 3. This notice may not be removed or altered from any source - distribution. - - Jean-loup Gailly Mark Adler - ----------------------------------------------- - - This source code was modified by Martin Hedenfalk for use in Curl. His - latest changes were done 2000-09-18. - - It has since been patched away like a madman by Daniel Stenberg to make it - better applied to curl conditions, and to make it not use globals, pollute - name space and more. This source code awaits a rewrite to work around the - paragraph 2 in the BSD licenses as explained below. - - Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Hgskolan - It has since been patched and modified a lot by Daniel Stenberg to make it - better applied to curl conditions, and to make it not use globals, pollute - name space and more. This source code awaits a rewrite to work around the - paragraph 2 in the BSD licenses as explained below. - - Copyright (c) 1998, 1999 Kungliga Tekniska Hgskolan - (Royal Institute of Technology, Stockholm, Sweden). - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Institute nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - ---------------------------------------------- - - Permission to use, copy, modify, and distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED - WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF - MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND - CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER. - --------------------------------------------------- - -cmake-2.4.8/Utilities/cmcurl/inet_pton.c, -cmake-2.4.8/Source/CTest/Curl/inet_pton.c: - This is from the BIND 4.9.4 release, modified to compile by itself - - Copyright (c) 1996 by Internet Software Consortium. - - Permission to use, copy, modify, and distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM - DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL - INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, - OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF - USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. - -------------------------------------------------------- - -* Copyright (C) 2001 by Eric Kidd. All rights reserved. -* Copyright (C) 2001 by Luke Howard. All rights reserved. -* Copyright (C) 2002 Ximian, Inc. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* 1. Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* 2. Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* 3. The name of the author may not be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR -* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -* SUCH DAMAGE. - ---------------------------------------------------- - - Copyright (c) 1994 - The Regents of the University of California. All rights reserved. - - This code is derived from software contributed to Berkeley by - Chuck Karish of Mindcraft, Inc. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. Neither the name of the University nor the names of its contributors - Copyright (c) 1985, 1986 The Regents of the University of California. - All rights reserved. - - This code is derived from software contributed to Berkeley by - James A. Woods, derived from original work by Spencer Thomas - and Joseph Orost. - ------------------------------------------------- - - Copyright (c) 1989, 1993, 1994 - The Regents of the University of California. All rights reserved. - - This code is derived from software contributed to Berkeley by - Guido van Rossum. - - Copyright (c) 1990 The Regents of the University of California. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - This product includes software developed by the University of - California, Berkeley and its contributors. - 4. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - ------------------------------------------------------- - - Project ___| | | | _ \| | - / __| | | | |_) | | - | (__| |_| | _ <| |___ - \___|\___/|_| \_\_____| - - Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. - - Copyright (C) 2004, Daniel Stenberg, , et al. - - This software is licensed as described in the file COPYING, which - you should have received as part of this distribution. The terms - are also available at http://curl.haxx.se/docs/copyright.html. - - You may opt to use, copy, modify, merge, publish, distribute and/or sell - copies of the Software, and permit persons to whom the Software is - furnished to do so, under the terms of the COPYING file. - - This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - KIND, either express or implied. - ------------------------------------------------------------- - -*************************************************************************** - Copyright (c) 1998 Free Software Foundation, Inc. - Copyright (c) 1998,2000 Free Software Foundation, Inc. - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, distribute with modifications, sublicense, and/or sell copies - of the Software, and to permit persons to whom the Software is furnished - to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - USE OR OTHER DEALINGS IN THE SOFTWARE. - - - Except as contained in this notice, the name(s) of the above copyright - holders shall not be used in advertising or otherwise to promote the sale, - use or other dealings in this Software without prior written - authorization. -*************************************************************************** - ------------------------------------------------------- - - Copyright (c) 1997 Todd C. Miller - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR - ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - -*************************************************************************** - -%%The following software may be included in this product: -Fred Fish's Dbug Library - -Use of any of this software is governed by the terms of the license below: - - * N O T I C E * - * * - * Copyright Abandoned, 1987, Fred Fish * - * * - * * - * This previously copyrighted work has been placed into the public * - * domain by the author and may be freely used for any purpose, * - * private or commercial. * - * * - * Because of the number of inquiries I was receiving about the use * - * of this product in commercially developed works I have decided to * - * simply make it public domain to further its unrestricted use. I * - * specifically would be most happy to see this material become a * - * part of the standard Unix distributions by AT&T and the Berkeley * - * Computer Science Research Group, and a standard part of the GNU * - * system from the Free Software Foundation. * - * * - * I would appreciate it, as a courtesy, if this notice is left in * - * all copies and derivative works. Thank you. * - * * - * The author makes no warranty of any kind with respect to this * - * product and explicitly disclaims any implied warranties of mer- * - * chantability or fitness for any particular purpose. * - -*************************************************************************** - -%%The following software may be included in this product: -dbug_analyze.c (part of Fred Fish's Dbug Library) - -Use of any of this software is governed by the terms of the license below: - -* Copyright Abandoned, 1987, Fred Fish * -* * -* * -* This previously copyrighted work has been placed into the public * -* domain by the author and may be freely used for any purpose, * -* private or commercial. * -* * -* Because of the number of inquiries I was receiving about the use * -* of this product in commercially developed works I have decided to * -* simply make it public domain to further its unrestricted use. I * -* specifically would be most happy to see this material become a * -* part of the standard Unix distributions by AT&T and the Berkeley * -* Computer Science Research Group, and a standard part of the GNU * -* system from the Free Software Foundation. * -* * -* I would appreciate it, as a courtesy, if this notice is left in * -* all copies and derivative works. Thank you. * -* * -* The author makes no warranty of any kind with respect to this * -* product and explicitly disclaims any implied warranties of mer- * -* chantability or fitness for any particular purpose. * - -*************************************************************************** - -%%The following software may be included in this product: -GNU Libtool, only ltmain.sh, libtool, auto-gen fil - -Use of any of this software is governed by the terms of the license below: - -ltmain.sh inclusion: -# ltmain.sh - Provide generalized library-building support services. -# NOTE: Changing this file will not affect anything until you rerun configure. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, -# 2007 Free Software Foundation, Inc. -# Originally by Gordon Matzigkeit , 1996 -# -# 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 -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -libtool inclusion: -# libtoolT - Provide generalized library-building support services. -# Generated automatically by (GNU mysql 5.1.30) -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, -# 2006, 2007 Free Software Foundation, Inc. -# -# This file is part of GNU Libtool: -# Originally by Gordon Matzigkeit , 1996 -# -# 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 -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -Auto-generated files: -# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building -# support services. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, -# 2004, 2005, 2006, 2007 Free Software Foundation, Inc. -# -# This file is part of GNU Libtool: -# Originally by Gordon Matzigkeit , 1996 -# -# 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 -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -Additional License(s) - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -*************************************************************************** - -%%The following software may be included in this product: -innochecksum.c - -Use of any of this software is governed by the terms of the license below: - -GNU GENERAL PUBLIC LICENSE - -Version 2, June 1991 - -Copyright (C) 1989, 1991 Free Software Foundation, Inc. -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - -Everyone is permitted to copy and distribute verbatim copies -of this license document, but changing it is not allowed. - -Preamble - -The licenses for most software are designed to take away your freedom to share -and change it. By contrast, the GNU General Public License is intended to -guarantee your freedom to share and change free software--to make sure the -software is free for all its users. This General Public License applies to most -of the Free Software Foundation's software and to any other program whose -authors commit to using it. (Some other Free Software Foundation software is -covered by the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - -When we speak of free software, we are referring to freedom, not price. Our -General Public Licenses are designed to make sure that you have the freedom to -distribute copies of free software (and charge for this service if you wish), -that you receive source code or can get it if you want it, that you can change -the software or use pieces of it in new free programs; and that you know you can -do these things. - -To protect your rights, we need to make restrictions that forbid anyone to deny -you these rights or to ask you to surrender the rights. These restrictions -translate to certain responsibilities for you if you distribute copies of the -software, or if you modify it. - -For example, if you distribute copies of such a program, whether gratis or for a -fee, you must give the recipients all the rights that you have. You must make -sure that they, too, receive or can get the source code. And you must show them -these terms so they know their rights. - -We protect your rights with two steps: (1) copyright the software, and (2) offer -you this license which gives you legal permission to copy, distribute and/or -modify the software. - -Also, for each author's protection and ours, we want to make certain that -everyone understands that there is no warranty for this free software. If the -software is modified by someone else and passed on, we want its recipients to -know that what they have is not the original, so that any problems introduced by -others will not reflect on the original authors' reputations. - -Finally, any free program is threatened constantly by software patents. We wish -to avoid the danger that redistributors of a free program will individually -obtain patent licenses, in effect making the program proprietary. To prevent -this, we have made it clear that any patent must be licensed for everyone's free -use or not licensed at all. - -The precise terms and conditions for copying, distribution and modification follow. -TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - -0. This License applies to any program or other work which contains a notice -placed by the copyright holder saying it may be distributed under the terms of -this General Public License. The "Program", below, refers to any such program or -work, and a "work based on the Program" means either the Program or any -derivative work under copyright law: that is to say, a work containing the -Program or a portion of it, either verbatim or with modifications and/or -translated into another language. (Hereinafter, translation is included without -limitation in the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not covered by -this License; they are outside its scope. The act of running the Program is not -restricted, and the output from the Program is covered only if its contents -constitute a work based on the Program (independent of having been made by -running the Program). Whether that is true depends on what the Program does. - -1. You may copy and distribute verbatim copies of the Program's source code as -you receive it, in any medium, provided that you conspicuously and appropriately -publish on each copy an appropriate copyright notice and disclaimer of warranty; -keep intact all the notices that refer to this License and to the absence of any -warranty; and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and you may at -your option offer warranty protection in exchange for a fee. - -2. You may modify your copy or copies of the Program or any portion of it, thus -forming a work based on the Program, and copy and distribute such modifications -or work under the terms of Section 1 above, provided that you also meet all of -these conditions: - - a) You must cause the modified files to carry prominent notices stating that -you changed the files and the date of any change. - b) You must cause any work that you distribute or publish, that in whole or -in part contains or is derived from the Program or any part thereof, to be -licensed as a whole at no charge to all third parties under the terms of this -License. - c) If the modified program normally reads commands interactively when run, -you must cause it, when started running for such interactive use in the most -ordinary way, to print or display an announcement including an appropriate -copyright notice and a notice that there is no warranty (or else, saying that -you provide a warranty) and that users may redistribute the program under these -conditions, and telling the user how to view a copy of this License. (Exception: -if the Program itself is interactive but does not normally print such an -announcement, your work based on the Program is not required to print an -announcement.) - -These requirements apply to the modified work as a whole. If identifiable -sections of that work are not derived from the Program, and can be reasonably -considered independent and separate works in themselves, then this License, and -its terms, do not apply to those sections when you distribute them as separate -works. But when you distribute the same sections as part of a whole which is a -work based on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the entire whole, -and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest your -rights to work written entirely by you; rather, the intent is to exercise the -right to control the distribution of derivative or collective works based on the -Program. - -In addition, mere aggregation of another work not based on the Program with the -Program (or with a work based on the Program) on a volume of a storage or -distribution medium does not bring the other work under the scope of this License. - -3. You may copy and distribute the Program (or a work based on it, under Section -2) in object code or executable form under the terms of Sections 1 and 2 above -provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable source -code, which must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange; or, - b) Accompany it with a written offer, valid for at least three years, to -give any third party, for a charge no more than your cost of physically -performing source distribution, a complete machine-readable copy of the -corresponding source code, to be distributed under the terms of Sections 1 and 2 -above on a medium customarily used for software interchange; or, - c) Accompany it with the information you received as to the offer to -distribute corresponding source code. (This alternative is allowed only for -noncommercial distribution and only if you received the program in object code -or executable form with such an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for making -modifications to it. For an executable work, complete source code means all the -source code for all modules it contains, plus any associated interface -definition files, plus the scripts used to control compilation and installation -of the executable. However, as a special exception, the source code distributed -need not include anything that is normally distributed (in either source or -binary form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component itself -accompanies the executable. - -If distribution of executable or object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the source code -from the same place counts as distribution of the source code, even though third -parties are not compelled to copy the source along with the object code. - -4. You may not copy, modify, sublicense, or distribute the Program except as -expressly provided under this License. Any attempt otherwise to copy, modify, -sublicense or distribute the Program is void, and will automatically terminate -your rights under this License. However, parties who have received copies, or -rights, from you under this License will not have their licenses terminated so -long as such parties remain in full compliance. - -5. You are not required to accept this License, since you have not signed it. -However, nothing else grants you permission to modify or distribute the Program -or its derivative works. These actions are prohibited by law if you do not -accept this License. Therefore, by modifying or distributing the Program (or any -work based on the Program), you indicate your acceptance of this License to do -so, and all its terms and conditions for copying, distributing or modifying the -Program or works based on it. - -6. Each time you redistribute the Program (or any work based on the Program), -the recipient automatically receives a license from the original licensor to -copy, distribute or modify the Program subject to these terms and conditions. -You may not impose any further restrictions on the recipients' exercise of the -rights granted herein. You are not responsible for enforcing compliance by third -parties to this License. - -7. If, as a consequence of a court judgment or allegation of patent infringement -or for any other reason (not limited to patent issues), conditions are imposed -on you (whether by court order, agreement or otherwise) that contradict the -conditions of this License, they do not excuse you from the conditions of this -License. If you cannot distribute so as to satisfy simultaneously your -obligations under this License and any other pertinent obligations, then as a -consequence you may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by all those -who receive copies directly or indirectly through you, then the only way you -could satisfy both it and this License would be to refrain entirely from -distribution of the Program. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply and the -section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any patents or -other property right claims or to contest validity of any such claims; this -section has the sole purpose of protecting the integrity of the free software -distribution system, which is implemented by public license practices. Many -people have made generous contributions to the wide range of software -distributed through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing to -distribute software through any other system and a licensee cannot impose that -choice. - -This section is intended to make thoroughly clear what is believed to be a -consequence of the rest of this License. - -8. If the distribution and/or use of the Program is restricted in certain -countries either by patents or by copyrighted interfaces, the original copyright -holder who places the Program under this License may add an explicit -geographical distribution limitation excluding those countries, so that -distribution is permitted only in or among countries not thus excluded. In such -case, this License incorporates the limitation as if written in the body of this -License. - -9. The Free Software Foundation may publish revised and/or new versions of the -General Public License from time to time. Such new versions will be similar in -spirit to the present version, but may differ in detail to address new problems -or concerns. - -Each version is given a distinguishing version number. If the Program specifies -a version number of this License which applies to it and "any later version", -you have the option of following the terms and conditions either of that version -or of any later version published by the Free Software Foundation. If the -Program does not specify a version number of this License, you may choose any -version ever published by the Free Software Foundation. - -10. If you wish to incorporate parts of the Program into other free programs -whose distribution conditions are different, write to the author to ask for -permission. For software which is copyrighted by the Free Software Foundation, -write to the Free Software Foundation; we sometimes make exceptions for this. -Our decision will be guided by the two goals of preserving the free status of -all derivatives of our free software and of promoting the sharing and reuse of -software generally. - -NO WARRANTY - -11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE -PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED -IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS -IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT -NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - -12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL -ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE -PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, -SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY -TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF -THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER -PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -END OF TERMS AND CONDITIONS -How to Apply These Terms to Your New Programs - -If you develop a new program, and you want it to be of the greatest possible use -to the public, the best way to achieve this is to make it free software which -everyone can redistribute and change under these terms. - -To do so, attach the following notices to the program. It is safest to attach -them to the start of each source file to most effectively convey the exclusion -of warranty; and each file should have at least the "copyright" line and a -pointer to where the full notice is found. - -one line to give the program's name and an idea of what it does. -Copyright (C) yyyy name of author - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this when it -starts in an interactive mode: - -Gnomovision version 69, Copyright (C) year name of author -Gnomovision comes with ABSOLUTELY NO WARRANTY; for details -type `show w'. This is free software, and you are welcome -to redistribute it under certain conditions; type `show c' -for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may be -called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your school, -if any, to sign a "copyright disclaimer" for the program, if necessary. Here is -a sample; alter the names: - -Yoyodyne, Inc., hereby disclaims all copyright -interest in the program `Gnomovision' -(which makes passes at compilers) written -by James Hacker. - -signature of Ty Coon, 1 April 1989 -Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may consider -it more useful to permit linking proprietary applications with the library. If -this is what you want to do, use the GNU Lesser General Public License instead -of this License. - -Additional Documentation License(s) - -innochecksum.c is documented in the MySQL Reference -Manual at http://dev.mysql.com/doc/refman/5.1/en/innochecksum.html -The Reference Manual is not licensed under the GPL; rather, it -is offered under normal copyright, but with permission to -copy/redistribute electronically. - -*************************************************************************** - -%%The following software may be included in this product: -lib_sql.cc - -Use of any of this software is governed by the terms of the license below: - -/* - * Copyright (c) 2000 - * SWsoft company - * - * This material is provided "as is", with absolutely no warranty expressed - * or implied. Any use is at your own risk. - * - * Permission to use or copy this software for any purpose is hereby granted - * without fee, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. - * - - This code was modified by the MySQL team -*/ - -*************************************************************************** - -%%The following software may be included in this product: -libevent - -Use of any of this software is governed by the terms of the license below: - -/* - * Copyright (c) 2000-2004 Niels Provos - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -Additional License(s) - -http://creativecommons.org/licenses/publicdomain - -*************************************************************************** - -%%The following software may be included in this product: -Async DNS Library - -Use of any of this software is governed by the terms of the license below: - -/* Async DNS Library - * Adam Langley - * http://www.imperialviolet.org/eventdns.html - * Public Domain code - * - * This software is Public Domain. To view a copy of the public domain dedication, - * visit http://creativecommons.org/licenses/publicdomain/ or send a letter to - * Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - * - * I ask and expect, but do not require, that all derivative works contain an - * attribution similar to: - * Parts developed by Adam Langley - * - * You may wish to replace the word "Parts" with something else depending on - * the amount of original code. - * - * (Derivative works does not include programs which link against, run or include - * the source verbatim in their source distributions) - * - * Version: 0.1b - */ - -*************************************************************************** - -%%The following software may be included in this product: -log.c - -Use of any of this software is governed by the terms of the license below: - -/* $OpenBSD: err.c,v 1.2 2002/06/25 15:50:15 mickey Exp $ */ - -/* - * log.c - * - * Based on err.c, which was adapted from OpenBSD libc *err* *warn* code. - * - * Copyright (c) 2005 Nick Mathewson - * - * Copyright (c) 2000 Dug Song - * - * Copyright (c) 1993 - * The Regents of the University of California. All rights -reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -*************************************************************************** - -%%The following software may be included in this product: -min_heap.h - -Use of any of this software is governed by the terms of the license below: - -/* - * Copyright (c) 2006 Maxim Yegorushkin - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -*************************************************************************** - -%%The following software may be included in this product: -win32.c - -Use of any of this software is governed by the terms of the license below: - -/* - * Copyright 2000-2002 Niels Provos - * Copyright 2003 Michael A. Davis - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -*************************************************************************** - -%%The following software may be included in this product: -regex++ - -Use of any of this software is governed by the terms of the license below: - -Copyright 1992, 1993, 1994 Henry Spencer. All rights reserved. -This software is not subject to any license of the American Telephone -and Telegraph Company or of the Regents of the University of California. - -Permission is granted to anyone to use this software for any purpose on -any computer system, and to alter it and redistribute it, subject -to the following restrictions: - -1. The author is not responsible for the consequences of use of this - software, no matter how awful, even if they arise from flaws in it. - -2. The origin of this software must not be misrepresented, either by - explicit claim or by omission. Since few users ever read sources, - credits must appear in the documentation. - -3. Altered versions must be plainly marked as such, and must not be - misrepresented as being the original software. Since few users - ever read sources, credits must appear in the documentation. - -4. This notice may not be removed or altered. - -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -/*- - * Copyright (c) 1994 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)COPYRIGHT 8.1 (Berkeley) 3/16/94 - */ - -*************************************************************************** - -%%The following software may be included in this product: -Richard A. O'Keefe strings package - -Use of any of this software is governed by the terms of the license below: - -These files are in the public domain. This includes getopt.c, which -is the work of Henry Spencer, University of Toronto Zoology, who says of -it "None of this software is derived from Bell software. I had no access -to the source for Bell's versions at the time I wrote it. This software -is hereby explicitly placed in the public domain. It may be used for -any purpose on any machine by anyone." I would greatly prefer it if *my* -material received no military use. - -*************************************************************************** - -%%The following software may be included in this product: -t_ctype.h - -Use of any of this software is governed by the terms of the license below: - -http://bioinfo.mbb.yale.edu/genome/yeast/cluster/database/mysql/include/t_ctype.h - -/* - Copyright (C) 1998, 1999 by Pruet Boonma, all rights reserved. - Copyright (C) 1998 by Theppitak Karoonboonyanan, all rights reserved. - Permission to use, copy, modify, distribute and sell this software - and its documentation for any purpose is hereby granted without fee, - provided that the above copyright notice appear in all copies. - Smaphan Raruenrom and Pruet Boonma makes no representations about - the suitability of this software for any purpose. It is provided - "as is" without express or implied warranty. -*/ - -*************************************************************************** - -%%The following software may be included in this product: -SHA-1 in C - -Use of any of this software is governed by the terms of the license below: - - SHA-1 in C - By Steve Reid - 100% Public Domain - -Additional License(s) - -100% Public Domain - -*************************************************************************** - -%%The following software may be included in this product: -TCMalloc (part of google-perftools) - -Use of any of this software is governed by the terms of the license below: - -# Copyright (c) 1998-2006, Google Inc. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google Inc. nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -Additional License(s) - -*** File src/tests/ptmalloc/thread-m.h contains this GPLv2 (or later) -text: - -/* Basic platform-independent macro definitions for mutexes and - thread-specific data. - Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Wolfram Gloger , 1996. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite - 330, Boston, MA 02111-1307, USA. */ - - - -*** File src/tests/ptmalloc/malloc-machine.h contains this BSD like text: - -/* Basic platform-independent macro definitions for mutexes, - thread-specific data and parameters for malloc. - Posix threads (pthreads) version. - Copyright (C) 2004 Wolfram Gloger . - -Permission to use, copy, modify, distribute, and sell this software -and its documentation for any purpose is hereby granted without fee, -provided that (i) the above copyright notices and this permission -notice appear in all copies of the software and related documentation, -and (ii) the name of Wolfram Gloger may not be used in any advertising -or publicity relating to the software. - -THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, -EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY -WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - -IN NO EVENT SHALL WOLFRAM GLOGER BE LIABLE FOR ANY SPECIAL, -INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY -DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY -OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -*/ - -*************************************************************************** - -%%The following software may be included in this product: -The tz database - -Use of any of this software is governed by the terms of the license below: - -Sources for Time Zone and Daylight Saving Time Data -@(#)tz-link.htm 7.54 - -Please send corrections to this web page to the time zone mailing list. -The tz database - -The public-domain time zone database contains code and data that represent the -history of local time for many representative locations around the globe. It is -updated periodically to reflect changes made by political bodies to time zone -boundaries, UTC offsets, and daylight-saving rules. This database (often called -tz or zoneinfo) is used by several implementations, including the GNU C Library -used in GNU/Linux, FreeBSD, NetBSD, OpenBSD, Cygwin, DJGPP, HP-UX, IRIX, Mac OS -X, OpenVMS, Solaris, Tru64, and UnixWare. - -Each location in the database represents a national region where all clocks -keeping local time have agreed since 1970. Locations are identified by continent -or ocean and then by the name of the location, which is typically the largest -city within the region. For example, America/New_York represents most of the US -eastern time zone; America/Phoenix represents most of Arizona, which uses -mountain time without daylight saving time (DST); America/Detroit represents -most of Michigan, which uses eastern time but with different DST rules in 1975; -and other entries represent smaller regions like Starke County, Indiana, which -switched from central to eastern time in 1991 and switched back in 2006. To use -the database on an extended POSIX implementation set the TZ environment variable -to the location's full name, e.g., TZ="America/New_York". - -In the tz database's FTP distribution the code is in the file tzcodeC.tar.gz, -where C is the code's version; similarly, the data are in tzdataD.tar.gz, where -D is the data's version. The following shell commands download these files to a -GNU/Linux or similar host; see the downloaded README file for what to do next. - -wget 'ftp://elsie.nci.nih.gov/pub/tz*.tar.gz' -gzip -dc tzcode*.tar.gz | tar -xf - -gzip -dc tzdata*.tar.gz | tar -xf - - -The code lets you compile the tz source files into machine-readable binary -files, one for each location. It also lets you read a tz binary file and -interpret time stamps for that location. - -The data are by no means authoritative. If you find errors, please send changes -to the time zone mailing list. You can also subscribe to the mailing list, -retrieve the archive of old messages (in gzip compressed format), or retrieve -archived older versions of code and data; there is also a smaller HTTP mirror. - -*************************************************************************** - -%%The following software may be included in this product: -UnicodeData.txt - -Use of any of this software is governed by the terms of the license below: - -Unicode Terms of Use - - For the general privacy policy governing access to this site, see the - Unicode Privacy Policy. For trademark usage, see the Unicode - Consortium (R) Trademarks and Logo Policy. - Notice to End User: Terms of Use - Carefully read the following legal agreement ("Agreement"). Use or - copying of the software and/or codes provided with this agreement (The - "Software") constitutes your acceptance of these terms - - 1. Unicode Copyright. - 1. Copyright (c) 1991-2008 Unicode, Inc. All rights reserved. - 2. Certain documents and files on this website contain a - legend indicating that "Modification is permitted." Any person - is hereby authorized, without fee, to modify such documents - and files to create derivative works conforming to the - Unicode (R) Standard, subject to Terms and Conditions herein. - 3. Any person is hereby authorized, without fee, to view, use, - reproduce, and distribute all documents and files solely for - informational purposes in the creation of products supporting - the Unicode Standard, subject to the Terms and Conditions - herein. - 4. Further specifications of rights and restrictions - pertaining to the use of the particular set of data files - known as the "Unicode Character Database" can be found in - Exhibit 1. - 5. Each version of the Unicode Standard has further - specifications of rights and restrictions of use. For the book - editions, these are found on the back of the title page. For - the online edition, certain files (such as the PDF files for - book chapters and code charts) carry specific restrictions. - All other files are covered under these general Terms of Use. - To request a permission to reproduce any part of the Unicode - Standard, please contact the Unicode Consortium. - 6. No license is granted to "mirror" the Unicode website where - a fee is charged for access to the "mirror" site. - 7. Modification is not permitted with respect to this - document. All copies of this document must be verbatim. - 2. Restricted Rights Legend. Any technical data or software which is - licensed to the United States of America, its agencies and/or - instrumentalities under this Agreement is commercial technical data - or commercial computer software developed exclusively at private - expense as defined in FAR 2.101, or DFARS 252.227-7014 (June 1995), - as applicable. For technical data, use, duplication, or disclosure - by the Government is subject to restrictions as set forth in DFARS - 202.227-7015 Technical Data, Commercial and Items (Nov 1995) and - this Agreement. For Software, in accordance with FAR 12-212 or DFARS - 227-7202, as applicable, use, duplication or disclosure by the - Government is subject to the restrictions set forth in this - Agreement. - 3. Warranties and Disclaimers. - 1. This publication and/or website may include technical or - typographical errors or other inaccuracies . Changes are - periodically added to the information herein; these changes - will be incorporated in new editions of the publication and/or - website. Unicode may make improvements and/or changes in the - product(s) and/or program(s) described in this publication - and/or website at any time. - 2. If this file has been purchased on magnetic or optical - media from Unicode, Inc. the sole and exclusive remedy for any - claim will be exchange of the defective media within ninety - (90) days of original purchase. - 3. EXCEPT AS PROVIDED IN SECTION C.2, THIS PUBLICATION AND/OR - SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND - EITHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT - LIMITED TO, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UNICODE AND ITS - LICENSORS ASSUME NO RESPONSIBILITY FOR ERRORS OR OMISSIONS IN - THIS PUBLICATION AND/OR SOFTWARE OR OTHER DOCUMENTS WHICH ARE - REFERENCED BY OR LINKED TO THIS PUBLICATION OR THE UNICODE - WEBSITE. - 4. Waiver of Damages. In no event shall Unicode or its licensors be - liable for any special, incidental, indirect or consequential - damages of any kind, or any damages whatsoever, whether or not - Unicode was advised of the possibility of the damage, including, - without limitation, those resulting from the following: loss of use, - data or profits, in connection with the use, modification or - distribution of this information or its derivatives. - 5. Trademarks. - 1. Unicode and the Unicode logo are registered trademarks of - Unicode, Inc. - 2. This site contains product names and corporate names of - other companies. All product names and company names and logos - mentioned herein are the trademarks or registered trademarks - of their respective owners. Other products and corporate names - mentioned herein which are trademarks of a third party are - used only for explanation and for the owners' benefit and with - no intent to infringe. - 3. Use of third party products or information referred to - herein is at the user's risk. - 6. Miscellaneous. - 1. Jurisdiction and Venue. This server is operated from a - location in the State of California, United States of America. - Unicode makes no representation that the materials are - appropriate for use in other locations. If you access this - server from other locations, you are responsible for - compliance with local laws. This Agreement, all use of this - site and any claims and damages resulting from use of this - site are governed solely by the laws of the State of - California without regard to any principles which would apply - the laws of a different jurisdiction. The user agrees that any - disputes regarding this site shall be resolved solely in the - courts located in Santa Clara County, California. The user - agrees said courts have personal jurisdiction and agree to - waive any right to transfer the dispute to any other forum. - 2. Modification by Unicode Unicode shall have the right to - modify this Agreement at any time by posting it to this site. - The user may not assign any part of this Agreement without - Unicode's prior written consent. - 3. Taxes. The user agrees to pay any taxes arising from access - to this website or use of the information herein, except for - those based on Unicode's net income. - 4. Severability. If any provision of this Agreement is - declared invalid or unenforceable, the remaining provisions of - this Agreement shall remain in effect. - 5. Entire Agreement. This Agreement constitutes the entire - agreement between the parties. - -EXHIBIT 1 -UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE - - Unicode Data Files include all data files under the directories -http://www.unicode.org/Public/, http://www.unicode.org/reports/, and -http://www.unicode.org/cldr/data/ . Unicode Software includes any source code -published in the Unicode Standard or under the directories -http://www.unicode.org/Public/, http://www.unicode.org/reports/, and -http://www.unicode.org/cldr/data/. - - NOTICE TO USER: Carefully read the following legal agreement. BY -DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S DATA FILES -("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), YOU UNEQUIVOCALLY ACCEPT, AND -AGREE TO BE BOUND BY, ALL OF THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU -DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES -OR SOFTWARE. - - COPYRIGHT AND PERMISSION NOTICE - - Copyright (c) 1991-2008 Unicode, Inc. All rights reserved. Distributed under -the Terms of Use in http://www.unicode.org/copyright.html. - - Permission is hereby granted, free of charge, to any person obtaining a copy -of the Unicode data files and any associated documentation (the "Data Files") or -Unicode software and any associated documentation (the "Software") to deal in -the Data Files or Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, and/or sell copies of -the Data Files or Software, and to permit persons to whom the Data Files or -Software are furnished to do so, provided that (a) the above copyright notice(s) -and this permission notice appear with all copies of the Data Files or Software, -(b) both the above copyright notice(s) and this permission notice appear in -associated documentation, and (c) there is clear notice in each modified Data -File or in the Software as well as in the documentation associated with the Data -File(s) or Software that the data or software has been modified. - - THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD -PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS -NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL -DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING -OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR SOFTWARE. - - Except as contained in this notice, the name of a copyright holder shall not -be used in advertising or otherwise to promote the sale, use or other dealings -in these Data Files or Software without prior written authorization of the -copyright holder. - - Unicode and the Unicode logo are trademarks of Unicode, Inc., and may be -registered in some jurisdictions. All other trademarks and registered trademarks -mentioned herein are the property of their respective owners. - -*************************************************************************** - -%%The following software may be included in this product: -zlib - -Use of any of this software is governed by the terms of the license below: - -/* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.3, July 18th, 2005 - - Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - Jean-loup Gailly jloup@gzip.org - Mark Adler madler@alumni.caltech.edu - -*/ - -*************************************************************************** - -%%The following software may be included in this product: -dtoa.c - -Use of any of this software is governed by the terms of the license below: - -/**************************************************************** - - This file incorporates work covered by the following copyright and - permission notice: - - The author of this software is David M. Gay. - - Copyright (c) 1991, 2000, 2001 by Lucent Technologies. - - Permission to use, copy, modify, and distribute this software for any - purpose without fee is hereby granted, provided that this entire - notice is included in all copies of any software which is or includes a copy - or modification of this software and in all copies of the supporting - documentation for such software. - - THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED - WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR LUCENT MAKES ANY - REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY - OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. - - ***************************************************************/ - -*************************************************************************** - -%%The following software may be included in this product: -getarg.{c,h} - -Use of any of this software is governed by the terms of the license below: - -/* Copyright (C) 2003 MySQL AB - - 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 - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -/* - * Copyright (c) 1997, 1999 Kungliga Tekniska H366gskolan - * (Royal Institute of Technology, Stockholm, Sweden). - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -*************************************************************************** - -%%The following software may be included in this product: -MD5 message-digest algorithm (md5_hash.cpp) - -Use of any of this software is governed by the terms of the license below: - -/* - * This code implements the MD5 message-digest algorithm. - * The algorithm is due to Ron Rivest. This code was - * written by Colin Plumb in 1993, no copyright is claimed. - * This code is in the public domain; do with it what you wish. - * - * Equivalent code is available from RSA Data Security, Inc. - * This code has been tested against that, and is equivalent, - * except that you don't need to include two pages of legalese - * with every copy. - * - * The code has been modified by Mikael Ronstroem to handle - * calculating a hash value of a key that is always a multiple - * of 4 bytes long. Word 0 of the calculated 4-word hash value - * is returned as the hash value. - */ - -*************************************************************************** - -%%The following software may be included in this product: -nt_servc.{cc,h} - -Use of any of this software is governed by the terms of the license below: - -/** - @file - - @brief - Windows NT Service class library. - - Copyright Abandoned 1998 Irena Pancirov - Irnet Snc - This file is public domain and comes with NO WARRANTY of any kind -*/ - -*************************************************************************** - -%%The following software may be included in this product: -GNU Readline - -Use of any of this software is governed by the terms of the license below: - -GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - 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 - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. - -*************************************************************************** - -%%The following software may be included in this product: -pstack (part of GNU Binutils) - -Use of any of this software is governed by the terms of the license below: - -pstack is comprised of various .c and .h files; all begin like this: - -/* bucomm.h -- binutils common include file. - Copyright (C) 1992, 93, 94, 95, 96, 1997 Free Software Foundation, Inc. - -This file is part of GNU Binutils. - -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 -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. */ - -*************************************************************************** - -%%The following software may be included in this product: -libiberty.h (part of pstack GNU Binutils) - -Use of any of this software is governed by the terms of the license below: - -See -http://www.koders.com/c/fid99F596804BBE22C076522B848D5575F142079064.aspx - -/* Function declarations for libiberty. - Written by Cygnus Support, 1994. - - The libiberty library provides a number of functions which are - missing on some operating systems. We do not declare those here, - to avoid conflicts with the system header files on operating - systems that do support those functions. In this file we only - declare those functions which are specific to libiberty. */ - -*************************************************************************** - -%%The following software may be included in this product: -ieee.h (part of pstack GNU Binutils) - -Use of any of this software is governed by the terms of the license below: - -See -http://src.opensolaris.org/source/xref//sfw/usr/src/cmd/gdb/gdb-6.3/include/ieee.h - - -/* IEEE Standard 695-1980 "Universal Format for Object Modules" - header file - Contributed by Cygnus Support. */ - -*************************************************************************** - -%%The following software may be included in this product: -pstack.c (part of pstack GNU Binutils) - -Use of any of this software is governed by the terms of the license below: - -/* - pstack.c -- asynchronous stack trace of a running process - Copyright (c) 1999 Ross Thompson - Author: Ross Thompson - Critical bug fix: Tim Waugh -*/ - -/* - This file is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -********************************************************************** From c0613a9fd7ea2e40610ab1927aff2ec2feaa5b9a Mon Sep 17 00:00:00 2001 From: Sven Sandberg Date: Thu, 17 Mar 2011 11:31:42 +0100 Subject: [PATCH 029/192] BUG#11877618: rpl_slave_net_timeout fails in rpl_sync.inc (at sync_slave_with_master) Problem: the test had not been updated after BUG#49978 was pushed Fix: add 'set $rpl_only_running_threads= 1' to the end of the test and update the result file. Also, use include/assert.inc for an assertion (instead of relying on result file comparison). Also, move 'set @@global.slave_net_timeout' forwards, to get rid of a warning. --- .../large_tests/r/rpl_slave_net_timeout.result | 15 +++++---------- .../large_tests/t/rpl_slave_net_timeout.test | 17 +++++++---------- 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/mysql-test/suite/large_tests/r/rpl_slave_net_timeout.result b/mysql-test/suite/large_tests/r/rpl_slave_net_timeout.result index 81de6e228e0..4dcc2e6295f 100644 --- a/mysql-test/suite/large_tests/r/rpl_slave_net_timeout.result +++ b/mysql-test/suite/large_tests/r/rpl_slave_net_timeout.result @@ -1,25 +1,20 @@ -stop slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -reset master; -reset slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -start slave; +include/master-slave.inc +[connection master] set @save_general_log = @@global.general_log; set @save_log_output = @@global.log_output; set @save_slave_net_timeout = @@global.slave_net_timeout; set @@global.general_log = ON; set @@global.log_output = 'table,file'; include/stop_slave.inc -set @@global.slave_net_timeout = @@global.net_read_timeout * 2; change master to master_host = '127.0.0.1',master_port = MASTER_PORT, master_user = 'root', master_heartbeat_period = 0; +set @@global.slave_net_timeout = @@global.net_read_timeout * 2; include/start_slave.inc include/stop_slave.inc select event_time from (select event_time from mysql.general_log as t_1 where command_type like 'Connect' order by event_time desc limit 2) as t_2 order by event_time desc limit 1 into @ts_last; select event_time from (select event_time from mysql.general_log as t_1 where command_type like 'Connect' order by event_time desc limit 2) as t_2 order by event_time asc limit 1 into @ts_prev; -select @result as 'Must be 1'; -Must be 1 -1 +include/assert.inc [time between last reconnection and the reconnection before that should be >= slave_net_timeout] set @@global.general_log = @save_general_log; set @@global.log_output = @save_log_output; set @@global.slave_net_timeout = @save_slave_net_timeout; +include/rpl_end.inc diff --git a/mysql-test/suite/large_tests/t/rpl_slave_net_timeout.test b/mysql-test/suite/large_tests/t/rpl_slave_net_timeout.test index bfe7f712a20..238146cdaaa 100644 --- a/mysql-test/suite/large_tests/t/rpl_slave_net_timeout.test +++ b/mysql-test/suite/large_tests/t/rpl_slave_net_timeout.test @@ -21,11 +21,6 @@ set @@global.log_output = 'table,file'; connection slave; --source include/stop_slave.inc ---disable_warnings -set @@global.slave_net_timeout = @@global.net_read_timeout * 2; ---enable_warnings -let $idle_time=`select @@global.slave_net_timeout * 2`; - # # if heartbeat is disabled then reconnecting to the idle master # should happen with `slave_net_timeout' period. @@ -42,6 +37,9 @@ let $idle_time=`select @@global.slave_net_timeout * 2`; eval change master to master_host = '127.0.0.1',master_port = $MASTER_MYPORT, master_user = 'root', master_heartbeat_period = 0; +set @@global.slave_net_timeout = @@global.net_read_timeout * 2; +let $idle_time=`select @@global.slave_net_timeout * 2`; + let $slave_net_timeout = `select @@global.slave_net_timeout`; --source include/start_slave.inc @@ -64,11 +62,9 @@ connection master; select event_time from (select event_time from mysql.general_log as t_1 where command_type like 'Connect' order by event_time desc limit 2) as t_2 order by event_time desc limit 1 into @ts_last; select event_time from (select event_time from mysql.general_log as t_1 where command_type like 'Connect' order by event_time desc limit 2) as t_2 order by event_time asc limit 1 into @ts_prev; ---disable_query_log -eval select time_to_sec(@ts_last) - $slave_net_timeout >= time_to_sec(@ts_prev) into @result; ---enable_query_log - -select @result as 'Must be 1'; +--let $assert_cond= time_to_sec(@ts_last) - time_to_sec(@ts_prev) >= $slave_net_timeout +--let $assert_text= time between last reconnection and the reconnection before that should be >= slave_net_timeout +--source include/assert.inc # cleanup @@ -79,4 +75,5 @@ set @@global.log_output = @save_log_output; connection slave; set @@global.slave_net_timeout = @save_slave_net_timeout; +--let $rpl_only_running_threads= 1 --source include/rpl_end.inc From da70b67a417cf522338c3df33ff6d5e4e012527e Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Thu, 17 Mar 2011 16:28:16 +0530 Subject: [PATCH 030/192] Minor fix in mysqldump test. --- mysql-test/r/mysqldump.result | 1 + mysql-test/t/mysqldump.test | 2 ++ 2 files changed, 3 insertions(+) diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index fb70e0f1731..a337c0384f6 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -4626,6 +4626,7 @@ DELIMITER ; /*!50003 SET collation_connection = @saved_col_connection */ ; ALTER DATABASE `test-database` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; DROP DATABASE `test-database`; +USE `test`; # # End of 5.1 tests # diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 0b533284ffa..8ecf8187ff9 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -2193,6 +2193,8 @@ ALTER DATABASE `test-database` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; --exec $MYSQL_DUMP --quote-names --compact test-database DROP DATABASE `test-database`; +# Switching back to test database. +USE `test`; --echo # --echo # End of 5.1 tests From f9756a6c16ea3343cef50ae8fafc0528896b0c6c Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Thu, 17 Mar 2011 13:29:59 +0200 Subject: [PATCH 031/192] Fixed a post-merge embedded compilation error --- sql/sql_acl.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 09609a7fa0c..9f8510cab03 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -8397,6 +8397,7 @@ static bool parse_com_change_user_packet(MPVIO_EXT *mpvio, uint packet_length) DBUG_RETURN (0); } +#ifndef EMBEDDED_LIBRARY /** Get a null character terminated string from a user-supplied buffer. @@ -8481,6 +8482,7 @@ char *get_length_encoded_string(char **buffer, *buffer+= *string_length + 1; return str; } +#endif /* the packet format is described in send_client_reply_packet() */ From 5a3586b1c31fefbb985f82a24e9dda875b423d7d Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Thu, 17 Mar 2011 14:07:18 +0200 Subject: [PATCH 032/192] Fixed the test cleanup code post-merge --- mysql-test/r/mysqldump.result | 1 + mysql-test/t/mysqldump.test | 1 + 2 files changed, 2 insertions(+) diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 124a0d364ce..8f6add75fd3 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -4626,6 +4626,7 @@ DELIMITER ; /*!50003 SET collation_connection = @saved_col_connection */ ; ALTER DATABASE `test-database` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; DROP DATABASE `test-database`; +USE test; # # End of 5.1 tests # diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 5ed66646432..4eed3f1d4a6 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -2198,6 +2198,7 @@ ALTER DATABASE `test-database` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; --exec $MYSQL_DUMP --quote-names --compact test-database DROP DATABASE `test-database`; +USE test; --echo # --echo # End of 5.1 tests From bb0c50c7b146b0096bf098f495854636668cc7b8 Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Thu, 17 Mar 2011 18:01:06 +0530 Subject: [PATCH 033/192] BUG#11766184 - 59234 : cmdline clients crash --defaults-extra-file with no .cnf or .ini extension. Fix for this bug was pushed as part of Bug#11765482. --- mysql-test/r/mysqladmin.result | 7 +++++++ mysql-test/t/mysqladmin.test | 14 ++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/mysql-test/r/mysqladmin.result b/mysql-test/r/mysqladmin.result index 748152bffcc..8a9b009946b 100644 --- a/mysql-test/r/mysqladmin.result +++ b/mysql-test/r/mysqladmin.result @@ -10,3 +10,10 @@ mysqld is alive # Displaying the output : mysqld is alive mysqld is alive +# +# BUG#11766184 - 59234: cmdline clients crash --defaults-extra-file +# with no .cnf or .ini extension. +# +# Creating an empty file 'cnf_file' +# Using --defaults-extra-file option with 'cnf_file'. +mysqld is alive diff --git a/mysql-test/t/mysqladmin.test b/mysql-test/t/mysqladmin.test index c3bfc585289..4811c5fdbc6 100644 --- a/mysql-test/t/mysqladmin.test +++ b/mysql-test/t/mysqladmin.test @@ -45,3 +45,17 @@ remove_file $MYSQLTEST_VARDIR/tmp/bug10608.cnf; --cat_file $MYSQLTEST_VARDIR/tmp/mysqladmin.tmp --remove_file $MYSQLTEST_VARDIR/tmp/mysqladmin.tmp + +--echo # +--echo # BUG#11766184 - 59234: cmdline clients crash --defaults-extra-file +--echo # with no .cnf or .ini extension. +--echo # + +--echo # Creating an empty file 'cnf_file' +--write_file $MYSQLTEST_VARDIR/tmp/cnf_file +EOF + +--echo # Using --defaults-extra-file option with 'cnf_file'. +--exec $MYSQLADMIN --defaults-extra-file=$MYSQLTEST_VARDIR/tmp/cnf_file -uroot -S $MASTER_MYSOCK -P $MASTER_MYPORT ping 2>&1 + +--remove_file $MYSQLTEST_VARDIR/tmp/cnf_file From cc1b046c3e68374de3f947a7f6bde253ca0a5956 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Thu, 17 Mar 2011 15:52:49 +0200 Subject: [PATCH 034/192] Bug #11766854: 60075: MYSQL_LOAD_CLIENT_PLUGIN DOESN'T CLEAR ERROR Added the cleanup code. Extended mysql_client_test to take --plugin-dir and --default_auth. Added a C test case. --- mysql-test/t/mysql_client_test.test | 2 +- sql-common/client_plugin.c | 1 + tests/mysql_client_test.c | 41 +++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/mysql-test/t/mysql_client_test.test b/mysql-test/t/mysql_client_test.test index 2c19671d11b..cf1ea70e404 100644 --- a/mysql-test/t/mysql_client_test.test +++ b/mysql-test/t/mysql_client_test.test @@ -12,7 +12,7 @@ SET @old_slow_query_log= @@global.slow_query_log; # var/log/mysql_client_test.trace --exec echo "$MYSQL_CLIENT_TEST" > $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1 ---exec $MYSQL_CLIENT_TEST --getopt-ll-test=25600M >> $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1 +--exec $MYSQL_CLIENT_TEST --getopt-ll-test=25600M $PLUGIN_AUTH_CLIENT_OPT >> $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1 # End of 4.1 tests echo ok; diff --git a/sql-common/client_plugin.c b/sql-common/client_plugin.c index 6b4cca8aeea..47409e34d9a 100644 --- a/sql-common/client_plugin.c +++ b/sql-common/client_plugin.c @@ -163,6 +163,7 @@ add_plugin(MYSQL *mysql, struct st_mysql_client_plugin *plugin, void *dlhandle, p->next= plugin_list[plugin->type]; plugin_list[plugin->type]= p; + net_clear_error(&mysql->net); return plugin; diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 7911393758c..b5326c5bee9 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -34,6 +34,7 @@ #include #include #include +#include #define VER "2.1" #define MAX_TEST_QUERY_LENGTH 300 /* MAX QUERY BUFFER LENGTH */ @@ -59,6 +60,7 @@ static unsigned int test_count= 0; static unsigned int opt_count= 0; static unsigned int iter_count= 0; static my_bool have_innodb= FALSE; +static char *opt_plugin_dir= 0, *opt_default_auth= 0; static const char *opt_basedir= "./"; static const char *opt_vardir= "mysql-test/var"; @@ -245,6 +247,11 @@ static MYSQL *mysql_client_init(MYSQL* con) if (res && shared_memory_base_name) mysql_options(res, MYSQL_SHARED_MEMORY_BASE_NAME, shared_memory_base_name); #endif + if (opt_plugin_dir && *opt_plugin_dir) + mysql_options(res, MYSQL_PLUGIN_DIR, opt_plugin_dir); + + if (opt_default_auth && *opt_default_auth) + mysql_options(res, MYSQL_DEFAULT_AUTH, opt_default_auth); return res; } @@ -326,6 +333,11 @@ static MYSQL* client_connect(ulong flag, uint protocol, my_bool auto_reconnect) /* enable local infile, in non-binary builds often disabled by default */ mysql_options(mysql, MYSQL_OPT_LOCAL_INFILE, 0); mysql_options(mysql, MYSQL_OPT_PROTOCOL, &protocol); + if (opt_plugin_dir && *opt_plugin_dir) + mysql_options(mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir); + + if (opt_default_auth && *opt_default_auth) + mysql_options(mysql, MYSQL_DEFAULT_AUTH, opt_default_auth); if (!(mysql_real_connect(mysql, opt_host, opt_user, opt_password, opt_db ? opt_db:"test", opt_port, @@ -19552,6 +19564,28 @@ static void test_bug57058() } +/** + Bug#11766854: 60075: MYSQL_LOAD_CLIENT_PLUGIN DOESN'T CLEAR ERROR +*/ + +static void test_bug11766854() +{ + struct st_mysql_client_plugin *plugin; + + DBUG_ENTER("test_bug11766854"); + myheader("test_bug11766854"); + + plugin= mysql_load_plugin(mysql, "foo", -1, 0); + DIE_UNLESS(plugin == 0); + + plugin= mysql_load_plugin(mysql, "qa_auth_client", -1, 0); + DIE_UNLESS(plugin != 0); + DIE_IF(mysql_errno(mysql)); + + DBUG_VOID_RETURN; +} + + /* Read and parse arguments and MySQL options from my.cnf */ @@ -19609,6 +19643,12 @@ static struct my_option client_test_long_options[] = {"getopt-ll-test", 'g', "Option for testing bug in getopt library", &opt_getopt_ll_test, &opt_getopt_ll_test, 0, GET_LL, REQUIRED_ARG, 0, 0, LONGLONG_MAX, 0, 0, 0}, + {"plugin_dir", 0, "Directory for client-side plugins.", + (uchar**) &opt_plugin_dir, (uchar**) &opt_plugin_dir, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"default_auth", 0, "Default authentication client-side plugin to use.", + (uchar**) &opt_default_auth, (uchar**) &opt_default_auth, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; @@ -19889,6 +19929,7 @@ static struct my_tests_st my_tests[]= { { "test_bug58036", test_bug58036 }, { "test_bug57058", test_bug57058 }, { "test_bug56976", test_bug56976 }, + { "test_bug11766854", test_bug11766854 }, { 0, 0 } }; From 6dc00a08bc71e8eb9b030e749b7f6277bdf144d2 Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Fri, 18 Mar 2011 09:37:08 +0300 Subject: [PATCH 035/192] BUG#11867985 - export symbols needed for auditing --- include/m_ctype.h | 2 +- sql/mysqld.h | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/m_ctype.h b/include/m_ctype.h index bb7f5ddfb3d..a35aea31a71 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -346,7 +346,7 @@ extern CHARSET_INFO my_charset_utf32_bin; extern CHARSET_INFO my_charset_utf32_general_ci; extern CHARSET_INFO my_charset_utf32_unicode_ci; -extern CHARSET_INFO my_charset_utf8_general_ci; +extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_utf8_general_ci; extern CHARSET_INFO my_charset_utf8_unicode_ci; extern CHARSET_INFO my_charset_utf8_bin; extern CHARSET_INFO my_charset_utf8mb4_bin; diff --git a/sql/mysqld.h b/sql/mysqld.h index 2099e57e96d..fab28767d45 100644 --- a/sql/mysqld.h +++ b/sql/mysqld.h @@ -73,7 +73,7 @@ void flush_thread_cache(); void refresh_status(THD *thd); bool is_secure_file_path(char *path); -extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *system_charset_info; +extern "C" MYSQL_PLUGIN_IMPORT CHARSET_INFO *system_charset_info; extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *files_charset_info ; extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *national_charset_info; extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *table_alias_charset; @@ -181,7 +181,8 @@ extern ulong opt_binlog_rows_event_max_size; extern ulong rpl_recovery_rank, thread_cache_size; extern ulong back_log; extern char language[FN_REFLEN]; -extern ulong server_id, concurrency; +extern "C" MYSQL_PLUGIN_IMPORT ulong server_id; +extern ulong concurrency; extern time_t server_start_time, flush_status_time; extern char *opt_mysql_tmpdir, mysql_charsets_dir[]; extern int mysql_unpacked_real_data_home_len; @@ -202,8 +203,8 @@ extern handlerton *heap_hton; extern const char *load_default_groups[]; extern struct my_option my_long_options[]; extern int mysqld_server_started; -extern int orig_argc; -extern char **orig_argv; +extern "C" MYSQL_PLUGIN_IMPORT int orig_argc; +extern "C" MYSQL_PLUGIN_IMPORT char **orig_argv; extern pthread_attr_t connection_attrib; extern MYSQL_FILE *bootstrap_file; extern my_bool old_mode; @@ -306,7 +307,7 @@ extern uint mysql_real_data_home_len; extern const char *mysql_real_data_home_ptr; extern ulong thread_handling; extern MYSQL_PLUGIN_IMPORT char *mysql_data_home; -extern char server_version[SERVER_VERSION_LENGTH]; +extern "C" MYSQL_PLUGIN_IMPORT char server_version[SERVER_VERSION_LENGTH]; extern MYSQL_PLUGIN_IMPORT char mysql_real_data_home[]; extern char mysql_unpacked_real_data_home[]; extern MYSQL_PLUGIN_IMPORT struct system_variables global_system_variables; From 0ded0c6f60e46e418f7bf7d0c180678c03107e2a Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Fri, 18 Mar 2011 10:31:39 +0100 Subject: [PATCH 036/192] Bug #11766854 addendum : Fixed test suite failures when the auth plugin is not compiled in. --- mysql-test/include/have_plugin_auth.inc | 1 + mysql-test/t/mysql_client_test-master.opt | 5 ++++- mysql-test/t/mysql_client_test.test | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/mysql-test/include/have_plugin_auth.inc b/mysql-test/include/have_plugin_auth.inc index 41f11419c64..44ff4c2520d 100644 --- a/mysql-test/include/have_plugin_auth.inc +++ b/mysql-test/include/have_plugin_auth.inc @@ -2,3 +2,4 @@ disable_query_log; --require r/true.require select (PLUGIN_LIBRARY LIKE 'auth_test_plugin%') as `TRUE` FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME='test_plugin_server'; +enable_query_log; diff --git a/mysql-test/t/mysql_client_test-master.opt b/mysql-test/t/mysql_client_test-master.opt index 4c683f7f0a2..3dfaf15666f 100644 --- a/mysql-test/t/mysql_client_test-master.opt +++ b/mysql-test/t/mysql_client_test-master.opt @@ -1 +1,4 @@ ---log=$MYSQLTEST_VARDIR/log/master.log --log-output=FILE,TABLE +--log=$MYSQLTEST_VARDIR/log/master.log +--log-output=FILE,TABLE +$PLUGIN_AUTH_OPT +$PLUGIN_AUTH_LOAD diff --git a/mysql-test/t/mysql_client_test.test b/mysql-test/t/mysql_client_test.test index cf1ea70e404..529d60517c0 100644 --- a/mysql-test/t/mysql_client_test.test +++ b/mysql-test/t/mysql_client_test.test @@ -1,5 +1,7 @@ # This test should work in embedded server after we fix mysqltest -- source include/not_embedded.inc +# need to have the dynamic loading turned on for the client plugin tests +--source include/have_plugin_auth.inc SET @old_general_log= @@global.general_log; SET @old_slow_query_log= @@global.slow_query_log; From be59ccd6a970b40b0de3e4d38bb3139eb1becb94 Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Fri, 18 Mar 2011 11:03:54 +0100 Subject: [PATCH 037/192] Bug#11867664: SERVER CRASHES ON UPDATE WITH JOIN ON PARTITIONED TABLE Regression from bug#11766232. m_last_part could be set beyond the last partition. Fixed by only setting it if within the limit. Also added check in print_error. --- sql/ha_partition.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 0e70ae60068..59b904aceac 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -4448,7 +4448,8 @@ int ha_partition::index_read_idx_map(uchar *buf, uint index, break; } } - m_last_part= part; + if (part <= m_part_spec.end_part) + m_last_part= part; } else { @@ -6391,7 +6392,14 @@ void ha_partition::print_error(int error, myf errflag) { /* In case m_file has not been initialized, like in bug#42438 */ if (m_file) + { + if (m_last_part >= m_tot_parts) + { + DBUG_ASSERT(0); + m_last_part= 0; + } m_file[m_last_part]->print_error(error, errflag); + } else handler::print_error(error, errflag); } From e8ad8f4fd86ba66c43b6aae4c7ddddcd83aa333f Mon Sep 17 00:00:00 2001 From: Vinay Fisrekar Date: Fri, 18 Mar 2011 16:35:57 +0530 Subject: [PATCH 038/192] Bug#11766500 - 59624: FUNCS_1 SUITE TESTS FAILING WITH RESULT DIFFERENCE WHEN RUN USING EMBEDDED MODE Updating result files --- .../funcs_1/r/is_columns_is_embedded.result | 68 +++++++++---------- .../r/is_columns_myisam_embedded.result | 12 ++-- .../r/is_columns_mysql_embedded.result | 16 ++--- 3 files changed, 48 insertions(+), 48 deletions(-) diff --git a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result index 59ad695c413..e64dc27078c 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result @@ -15,8 +15,8 @@ NULL information_schema COLLATIONS IS_DEFAULT 4 NO varchar 3 9 NULL NULL utf8 u NULL information_schema COLLATIONS SORTLEN 6 0 NO bigint NULL NULL 19 0 NULL NULL bigint(3) NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME 2 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME 1 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) -NULL information_schema COLUMNS CHARACTER_MAXIMUM_LENGTH 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -NULL information_schema COLUMNS CHARACTER_OCTET_LENGTH 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +NULL information_schema COLUMNS CHARACTER_MAXIMUM_LENGTH 9 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +NULL information_schema COLUMNS CHARACTER_OCTET_LENGTH 10 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned NULL information_schema COLUMNS CHARACTER_SET_NAME 13 NULL YES varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) NULL information_schema COLUMNS COLLATION_NAME 14 NULL YES varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) NULL information_schema COLUMNS COLUMN_COMMENT 19 NO varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255) @@ -27,9 +27,9 @@ NULL information_schema COLUMNS COLUMN_TYPE 15 NULL NO longtext 4294967295 42949 NULL information_schema COLUMNS DATA_TYPE 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) NULL information_schema COLUMNS EXTRA 17 NO varchar 27 81 NULL NULL utf8 utf8_general_ci varchar(27) NULL information_schema COLUMNS IS_NULLABLE 7 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) -NULL information_schema COLUMNS NUMERIC_PRECISION 11 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -NULL information_schema COLUMNS NUMERIC_SCALE 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -NULL information_schema COLUMNS ORDINAL_POSITION 5 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +NULL information_schema COLUMNS NUMERIC_PRECISION 11 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +NULL information_schema COLUMNS NUMERIC_SCALE 12 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +NULL information_schema COLUMNS ORDINAL_POSITION 5 0 NO bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned NULL information_schema COLUMNS PRIVILEGES 18 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) NULL information_schema COLUMNS TABLE_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) NULL information_schema COLUMNS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) @@ -71,14 +71,14 @@ NULL information_schema EVENTS SQL_MODE 12 NO varchar 8192 24576 NULL NULL utf8 NULL information_schema EVENTS STARTS 13 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime NULL information_schema EVENTS STATUS 15 NO varchar 18 54 NULL NULL utf8 utf8_general_ci varchar(18) NULL information_schema EVENTS TIME_ZONE 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) -NULL information_schema FILES AUTOEXTEND_SIZE 19 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -NULL information_schema FILES AVG_ROW_LENGTH 28 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -NULL information_schema FILES CHECKSUM 36 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +NULL information_schema FILES AUTOEXTEND_SIZE 19 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +NULL information_schema FILES AVG_ROW_LENGTH 28 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +NULL information_schema FILES CHECKSUM 36 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned NULL information_schema FILES CHECK_TIME 35 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime NULL information_schema FILES CREATE_TIME 33 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime NULL information_schema FILES CREATION_TIME 20 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime -NULL information_schema FILES DATA_FREE 32 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -NULL information_schema FILES DATA_LENGTH 29 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +NULL information_schema FILES DATA_FREE 32 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +NULL information_schema FILES DATA_LENGTH 29 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned NULL information_schema FILES DELETED_ROWS 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) NULL information_schema FILES ENGINE 10 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) NULL information_schema FILES EXTENT_SIZE 16 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4) @@ -88,27 +88,27 @@ NULL information_schema FILES FILE_NAME 2 NULL YES varchar 64 192 NULL NULL utf8 NULL information_schema FILES FILE_TYPE 3 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) NULL information_schema FILES FREE_EXTENTS 14 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) NULL information_schema FILES FULLTEXT_KEYS 11 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) -NULL information_schema FILES INDEX_LENGTH 31 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -NULL information_schema FILES INITIAL_SIZE 17 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +NULL information_schema FILES INDEX_LENGTH 31 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +NULL information_schema FILES INITIAL_SIZE 17 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned NULL information_schema FILES LAST_ACCESS_TIME 22 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime NULL information_schema FILES LAST_UPDATE_TIME 21 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime NULL information_schema FILES LOGFILE_GROUP_NAME 8 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) NULL information_schema FILES LOGFILE_GROUP_NUMBER 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) -NULL information_schema FILES MAXIMUM_SIZE 18 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -NULL information_schema FILES MAX_DATA_LENGTH 30 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +NULL information_schema FILES MAXIMUM_SIZE 18 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +NULL information_schema FILES MAX_DATA_LENGTH 30 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned NULL information_schema FILES RECOVER_TIME 23 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) NULL information_schema FILES ROW_FORMAT 26 NULL YES varchar 10 30 NULL NULL utf8 utf8_general_ci varchar(10) NULL information_schema FILES STATUS 37 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) NULL information_schema FILES TABLESPACE_NAME 4 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) NULL information_schema FILES TABLE_CATALOG 5 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) NULL information_schema FILES TABLE_NAME 7 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) -NULL information_schema FILES TABLE_ROWS 27 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +NULL information_schema FILES TABLE_ROWS 27 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned NULL information_schema FILES TABLE_SCHEMA 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) NULL information_schema FILES TOTAL_EXTENTS 15 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) NULL information_schema FILES TRANSACTION_COUNTER 24 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) NULL information_schema FILES UPDATE_COUNT 13 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) NULL information_schema FILES UPDATE_TIME 34 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime -NULL information_schema FILES VERSION 25 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +NULL information_schema FILES VERSION 25 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned NULL information_schema GLOBAL_STATUS VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) NULL information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL utf8 utf8_general_ci varchar(1024) NULL information_schema GLOBAL_VARIABLES VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) @@ -125,29 +125,29 @@ NULL information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_SCHEMA 10 NULL YES var NULL information_schema KEY_COLUMN_USAGE TABLE_CATALOG 4 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) NULL information_schema KEY_COLUMN_USAGE TABLE_NAME 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) NULL information_schema KEY_COLUMN_USAGE TABLE_SCHEMA 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) -NULL information_schema PARTITIONS AVG_ROW_LENGTH 14 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -NULL information_schema PARTITIONS CHECKSUM 22 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +NULL information_schema PARTITIONS AVG_ROW_LENGTH 14 0 NO bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +NULL information_schema PARTITIONS CHECKSUM 22 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned NULL information_schema PARTITIONS CHECK_TIME 21 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime NULL information_schema PARTITIONS CREATE_TIME 19 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime -NULL information_schema PARTITIONS DATA_FREE 18 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -NULL information_schema PARTITIONS DATA_LENGTH 15 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -NULL information_schema PARTITIONS INDEX_LENGTH 17 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -NULL information_schema PARTITIONS MAX_DATA_LENGTH 16 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +NULL information_schema PARTITIONS DATA_FREE 18 0 NO bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +NULL information_schema PARTITIONS DATA_LENGTH 15 0 NO bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +NULL information_schema PARTITIONS INDEX_LENGTH 17 0 NO bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +NULL information_schema PARTITIONS MAX_DATA_LENGTH 16 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned NULL information_schema PARTITIONS NODEGROUP 24 NO varchar 12 36 NULL NULL utf8 utf8_general_ci varchar(12) NULL information_schema PARTITIONS PARTITION_COMMENT 23 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) NULL information_schema PARTITIONS PARTITION_DESCRIPTION 12 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext NULL information_schema PARTITIONS PARTITION_EXPRESSION 10 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext NULL information_schema PARTITIONS PARTITION_METHOD 8 NULL YES varchar 12 36 NULL NULL utf8 utf8_general_ci varchar(12) NULL information_schema PARTITIONS PARTITION_NAME 4 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) -NULL information_schema PARTITIONS PARTITION_ORDINAL_POSITION 6 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +NULL information_schema PARTITIONS PARTITION_ORDINAL_POSITION 6 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned NULL information_schema PARTITIONS SUBPARTITION_EXPRESSION 11 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext NULL information_schema PARTITIONS SUBPARTITION_METHOD 9 NULL YES varchar 12 36 NULL NULL utf8 utf8_general_ci varchar(12) NULL information_schema PARTITIONS SUBPARTITION_NAME 5 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) -NULL information_schema PARTITIONS SUBPARTITION_ORDINAL_POSITION 7 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +NULL information_schema PARTITIONS SUBPARTITION_ORDINAL_POSITION 7 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned NULL information_schema PARTITIONS TABLESPACE_NAME 25 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) NULL information_schema PARTITIONS TABLE_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) NULL information_schema PARTITIONS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) -NULL information_schema PARTITIONS TABLE_ROWS 13 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +NULL information_schema PARTITIONS TABLE_ROWS 13 0 NO bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned NULL information_schema PARTITIONS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) NULL information_schema PARTITIONS UPDATE_TIME 20 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime NULL information_schema PLUGINS PLUGIN_AUTHOR 8 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) @@ -231,27 +231,27 @@ NULL information_schema STATISTICS SUB_PART 11 NULL YES bigint NULL NULL 19 0 NU NULL information_schema STATISTICS TABLE_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) NULL information_schema STATISTICS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) NULL information_schema STATISTICS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) -NULL information_schema TABLES AUTO_INCREMENT 14 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -NULL information_schema TABLES AVG_ROW_LENGTH 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -NULL information_schema TABLES CHECKSUM 19 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +NULL information_schema TABLES AUTO_INCREMENT 14 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +NULL information_schema TABLES AVG_ROW_LENGTH 9 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +NULL information_schema TABLES CHECKSUM 19 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned NULL information_schema TABLES CHECK_TIME 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime NULL information_schema TABLES CREATE_OPTIONS 20 NULL YES varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255) NULL information_schema TABLES CREATE_TIME 15 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime -NULL information_schema TABLES DATA_FREE 13 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -NULL information_schema TABLES DATA_LENGTH 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +NULL information_schema TABLES DATA_FREE 13 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +NULL information_schema TABLES DATA_LENGTH 10 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned NULL information_schema TABLES ENGINE 5 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) -NULL information_schema TABLES INDEX_LENGTH 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned -NULL information_schema TABLES MAX_DATA_LENGTH 11 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +NULL information_schema TABLES INDEX_LENGTH 12 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned +NULL information_schema TABLES MAX_DATA_LENGTH 11 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned NULL information_schema TABLES ROW_FORMAT 7 NULL YES varchar 10 30 NULL NULL utf8 utf8_general_ci varchar(10) NULL information_schema TABLES TABLE_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) NULL information_schema TABLES TABLE_COLLATION 18 NULL YES varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) NULL information_schema TABLES TABLE_COMMENT 21 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) NULL information_schema TABLES TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) -NULL information_schema TABLES TABLE_ROWS 8 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +NULL information_schema TABLES TABLE_ROWS 8 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned NULL information_schema TABLES TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) NULL information_schema TABLES TABLE_TYPE 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) NULL information_schema TABLES UPDATE_TIME 16 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime -NULL information_schema TABLES VERSION 6 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned +NULL information_schema TABLES VERSION 6 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned NULL information_schema TABLE_CONSTRAINTS CONSTRAINT_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) NULL information_schema TABLE_CONSTRAINTS CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) NULL information_schema TABLE_CONSTRAINTS CONSTRAINT_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) diff --git a/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result index 2721dcf3c6e..739f62e371a 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result @@ -479,9 +479,9 @@ NULL test tb1 f27 27 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned zero NULL test tb1 f28 28 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill NULL test tb1 f29 29 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) NULL test tb1 f3 3 NULL YES char 1 1 NULL NULL latin1 latin1_swedish_ci char(1) -NULL test tb1 f30 30 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned -NULL test tb1 f31 31 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill -NULL test tb1 f32 32 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill +NULL test tb1 f30 30 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned +NULL test tb1 f31 31 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned zerofill +NULL test tb1 f32 32 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned zerofill NULL test tb1 f33 33 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) NULL test tb1 f34 34 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned NULL test tb1 f35 35 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill @@ -602,9 +602,9 @@ NULL test tb3 f143 26 99999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned NULL test tb3 f144 27 0000099999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill NULL test tb3 f145 28 0000099999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill NULL test tb3 f146 29 999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) -NULL test tb3 f147 30 999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned -NULL test tb3 f148 31 00000000000000999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill -NULL test tb3 f149 32 00000000000000999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill +NULL test tb3 f147 30 999999 NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned +NULL test tb3 f148 31 00000000000000999999 NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned zerofill +NULL test tb3 f149 32 00000000000000999999 NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned zerofill NULL test tb3 f150 33 1000 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) NULL test tb3 f151 34 999 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned NULL test tb3 f152 35 0000001000 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill diff --git a/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result index 9c9d3cd26de..983f9dd833e 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result @@ -97,13 +97,13 @@ NULL mysql host Select_priv 3 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum( NULL mysql host Show_view_priv 16 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') NULL mysql host Trigger_priv 20 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') NULL mysql host Update_priv 5 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') -NULL mysql ndb_binlog_index deletes 6 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned -NULL mysql ndb_binlog_index epoch 3 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned PRI +NULL mysql ndb_binlog_index deletes 6 NULL NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned +NULL mysql ndb_binlog_index epoch 3 NULL NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned PRI NULL mysql ndb_binlog_index File 2 NULL NO varchar 255 255 NULL NULL latin1 latin1_swedish_ci varchar(255) -NULL mysql ndb_binlog_index inserts 4 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned -NULL mysql ndb_binlog_index Position 1 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned -NULL mysql ndb_binlog_index schemaops 7 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned -NULL mysql ndb_binlog_index updates 5 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned +NULL mysql ndb_binlog_index inserts 4 NULL NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned +NULL mysql ndb_binlog_index Position 1 NULL NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned +NULL mysql ndb_binlog_index schemaops 7 NULL NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned +NULL mysql ndb_binlog_index updates 5 NULL NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned NULL mysql plugin dl 2 NO char 128 384 NULL NULL utf8 utf8_bin char(128) NULL mysql plugin name 1 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI NULL mysql proc body 11 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL longblob @@ -130,7 +130,7 @@ NULL mysql procs_priv Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI NULL mysql procs_priv Grantor 6 NO char 77 231 NULL NULL utf8 utf8_bin char(77) MUL NULL mysql procs_priv Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI NULL mysql procs_priv Proc_priv 7 NO set 27 81 NULL NULL utf8 utf8_general_ci set('Execute','Alter Routine','Grant') -NULL mysql procs_priv Routine_name 4 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI +NULL mysql procs_priv Routine_name 4 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) PRI NULL mysql procs_priv Routine_type 5 NULL NO enum 9 27 NULL NULL utf8 utf8_bin enum('FUNCTION','PROCEDURE') PRI NULL mysql procs_priv Timestamp 8 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP NULL mysql procs_priv User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI @@ -411,7 +411,7 @@ NULL mysql proc modified timestamp NULL NULL NULL NULL timestamp 3.0000 mysql procs_priv Host char 60 180 utf8 utf8_bin char(60) 3.0000 mysql procs_priv Db char 64 192 utf8 utf8_bin char(64) 3.0000 mysql procs_priv User char 16 48 utf8 utf8_bin char(16) -3.0000 mysql procs_priv Routine_name char 64 192 utf8 utf8_bin char(64) +3.0000 mysql procs_priv Routine_name char 64 192 utf8 utf8_general_ci char(64) 3.0000 mysql procs_priv Routine_type enum 9 27 utf8 utf8_bin enum('FUNCTION','PROCEDURE') 3.0000 mysql procs_priv Grantor char 77 231 utf8 utf8_bin char(77) 3.0000 mysql procs_priv Proc_priv set 27 81 utf8 utf8_general_ci set('Execute','Alter Routine','Grant') From f4ac6eb117347075ad0d859ca640f13c869a23d9 Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Fri, 18 Mar 2011 12:13:54 +0100 Subject: [PATCH 039/192] Bug #11885854 MYSQLTEST: PS-PROTOCOL IMPLIED BY CURSOR-PROTOCOL LOST AFTER ENABLE_PS_PROTOCOL The condition cursor-protocol => ps-protocol was done at "current setting" level" Moved it to "set by command line" level --- client/mysqltest.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/client/mysqltest.cc b/client/mysqltest.cc index a94dba90979..52c76b8c68e 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -8032,13 +8032,15 @@ int main(int argc, char **argv) cur_file->lineno= 1; } init_re(); + + /* Cursor protcol implies ps protocol */ + if (cursor_protocol) + ps_protocol= 1; + ps_protocol_enabled= ps_protocol; sp_protocol_enabled= sp_protocol; view_protocol_enabled= view_protocol; cursor_protocol_enabled= cursor_protocol; - /* Cursor protcol implies ps protocol */ - if (cursor_protocol_enabled) - ps_protocol_enabled= 1; st_connection *con= connections; if (!( mysql_init(&con->mysql))) From 52edb4a5b95de617d0627e8476785e404f380eeb Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Fri, 18 Mar 2011 16:16:17 +0200 Subject: [PATCH 040/192] Bug # 11766011: mysql.user.authentication_string column causes configuration wizard to fail Made the fields mysql.user.plugin and mysql.user.authentication_string nullable to conform with some older clients doing inserts instead of using the commands. --- mysql-test/r/grant.result | 7 +- mysql-test/r/grant2.result | 2 - mysql-test/r/plugin_auth.result | 58 ++++++++++++++++ mysql-test/r/plugin_auth_qa.result | 30 ++++----- mysql-test/r/plugin_auth_qa_1.result | 38 +++++------ mysql-test/r/plugin_auth_qa_2.result | 22 +++---- mysql-test/r/sp_notembedded.result | 2 - mysql-test/r/system_mysql_db.result | 4 +- .../suite/funcs_1/r/is_columns_mysql.result | 4 +- .../suite/funcs_1/r/is_user_privileges.result | 66 +++++++++---------- .../suite/rpl/r/rpl_ignore_table.result | 1 - mysql-test/suite/rpl/r/rpl_stm_000001.result | 1 - mysql-test/t/plugin_auth.test | 57 ++++++++++++++++ scripts/mysql_system_tables.sql | 2 +- scripts/mysql_system_tables_fix.sql | 4 +- sql/sql_acl.cc | 2 + 16 files changed, 205 insertions(+), 95 deletions(-) diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index 49db157f35f..7603e4b1b1c 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -54,7 +54,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL show grants for mysqltest_1@localhost; Grants for mysqltest_1@localhost GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE CIPHER 'EDH-RSA-DES-CBC3-SHA' @@ -125,7 +125,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL show grants for mysqltest_1@localhost; Grants for mysqltest_1@localhost GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10 @@ -172,7 +172,7 @@ max_updates 20 max_connections 30 max_user_connections 0 plugin -authentication_string +authentication_string NULL show grants for mysqltest_1@localhost; Grants for mysqltest_1@localhost GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10 MAX_UPDATES_PER_HOUR 20 MAX_CONNECTIONS_PER_HOUR 30 @@ -284,7 +284,6 @@ Warnings: Warning 1364 Field 'ssl_cipher' doesn't have a default value Warning 1364 Field 'x509_issuer' doesn't have a default value Warning 1364 Field 'x509_subject' doesn't have a default value -Warning 1364 Field 'authentication_string' doesn't have a default value insert into mysql.db (host, db, user, select_priv) values ('localhost', 'a%', 'test11', 'Y'), ('localhost', 'ab%', 'test11', 'Y'); alter table mysql.db order by db asc; diff --git a/mysql-test/r/grant2.result b/mysql-test/r/grant2.result index b5e82794658..70388b06daf 100644 --- a/mysql-test/r/grant2.result +++ b/mysql-test/r/grant2.result @@ -287,7 +287,6 @@ Warnings: Warning 1364 Field 'ssl_cipher' doesn't have a default value Warning 1364 Field 'x509_issuer' doesn't have a default value Warning 1364 Field 'x509_subject' doesn't have a default value -Warning 1364 Field 'authentication_string' doesn't have a default value create user mysqltest_A@'%'; rename user mysqltest_B@'%' to mysqltest_C@'%'; drop user mysqltest_C@'%'; @@ -355,7 +354,6 @@ Warnings: Warning 1364 Field 'ssl_cipher' doesn't have a default value Warning 1364 Field 'x509_issuer' doesn't have a default value Warning 1364 Field 'x509_subject' doesn't have a default value -Warning 1364 Field 'authentication_string' doesn't have a default value INSERT INTO mysql.db (host, db, user, select_priv) VALUES ('%','TESTDB','mysqltest_1','Y'); FLUSH PRIVILEGES; diff --git a/mysql-test/r/plugin_auth.result b/mysql-test/r/plugin_auth.result index 7f26cdf447a..591a403a0c5 100644 --- a/mysql-test/r/plugin_auth.result +++ b/mysql-test/r/plugin_auth.result @@ -342,4 +342,62 @@ select USER(),CURRENT_USER(); USER() CURRENT_USER() uplain@localhost uplain@localhost DROP USER uplain@localhost; +# +# Bug #59038 : mysql.user.authentication_string column +# causes configuration wizard to fail +INSERT INTO mysql.user( +Host, +User, +Password, +Select_priv, +Insert_priv, +Update_priv, +Delete_priv, +Create_priv, +Drop_priv, +Reload_priv, +Shutdown_priv, +Process_priv, +File_priv, +Grant_priv, +References_priv, +Index_priv, +Alter_priv, +Show_db_priv, +Super_priv, +Create_tmp_table_priv, +Lock_tables_priv, +Execute_priv, +Repl_slave_priv, +Repl_client_priv, +/*!50001 +Create_view_priv, +Show_view_priv, +Create_routine_priv, +Alter_routine_priv, +Create_user_priv, +*/ +ssl_type, +ssl_cipher, +x509_issuer, +x509_subject, +max_questions, +max_updates, +max_connections) +VALUES ( +'localhost', +'inserttest', '', +'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', +'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', +/*!50001 'Y', 'Y', 'Y', 'Y', 'Y', */'', '', '', '', '0', '0', '0'); +FLUSH PRIVILEGES; +DROP USER inserttest@localhost; +SELECT IS_NULLABLE, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE +COLUMN_NAME IN ('authentication_string', 'plugin') AND +TABLE_NAME='user' AND +TABLE_SCHEMA='mysql' +ORDER BY COLUMN_NAME; +IS_NULLABLE COLUMN_NAME +YES authentication_string +YES plugin End of 5.5 tests diff --git a/mysql-test/r/plugin_auth_qa.result b/mysql-test/r/plugin_auth_qa.result index d1ecf6a6470..d1128cf04ee 100644 --- a/mysql-test/r/plugin_auth_qa.result +++ b/mysql-test/r/plugin_auth_qa.result @@ -105,7 +105,7 @@ CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string plug test_plugin_server plug_dest -plug_dest +plug_dest NULL DROP USER plug, plug_dest; CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; @@ -115,7 +115,7 @@ DROP USER plug; CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -plug_dest +plug_dest NULL DROP USER plug_dest; GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; @@ -125,7 +125,7 @@ CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string plug test_plugin_server plug_dest -plug_dest +plug_dest NULL DROP USER plug, plug_dest; GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server AS 'plug_dest'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; @@ -135,7 +135,7 @@ DROP USER plug; CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -plug_dest +plug_dest NULL DROP USER plug_dest; CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; @@ -145,7 +145,7 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_dest_pas SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string plug test_plugin_server plug_dest -plug_dest +plug_dest NULL DROP USER plug, plug_dest; CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; @@ -155,7 +155,7 @@ DROP USER plug; GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -plug_dest +plug_dest NULL DROP USER plug_dest; CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; @@ -210,7 +210,7 @@ DROP USER plüg; CREATE USER plüg_dest IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -plüg_dest +plüg_dest NULL DROP USER plüg_dest; SET NAMES ascii; CREATE USER 'plüg' IDENTIFIED WITH 'test_plugin_server' AS 'plüg_dest'; @@ -221,7 +221,7 @@ DROP USER 'plüg'; CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -pl??g_dest +pl??g_dest NULL DROP USER 'plüg_dest'; SET NAMES latin1; ========== test 1.1.1.5 ==================================== @@ -235,7 +235,7 @@ DROP USER 'plug'; CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -plüg_dest +plüg_dest NULL DROP USER 'plüg_dest'; SET NAMES utf8; CREATE USER plüg IDENTIFIED WITH 'test_plügin_server' AS 'plüg_dest'; @@ -248,7 +248,7 @@ DROP USER 'plüg'; CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -plüg_dest +plüg_dest NULL DROP USER 'plüg_dest'; CREATE USER plüg IDENTIFIED WITH test_plugin_server AS 'plüg_dest'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; @@ -258,7 +258,7 @@ DROP USER plüg; CREATE USER plüg_dest IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -plüg_dest +plüg_dest NULL DROP USER plüg_dest; ========== test 1.1.1.2/1.1.2.2============================= SET @auth_name= 'test_plugin_server'; @@ -278,7 +278,7 @@ DROP USER plug; CREATE USER 'hh''s_plug_dest' IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -hh's_plug_dest +hh's_plug_dest NULL DROP USER 'hh''s_plug_dest'; ========== test 1.1.1.4 ==================================== CREATE USER plug IDENTIFIED WITH hh''s_test_plugin_server AS 'plug_dest'; @@ -294,7 +294,7 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string grant_user test_plugin_server plug_dest -plug_dest +plug_dest NULL DROP USER grant_user,plug_dest; set @save_sql_mode= @@sql_mode; SET @@sql_mode=no_auto_create_user; @@ -315,13 +315,13 @@ CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; user plugin authentication_string password grant_user test_plugin_server plug_dest -plug_dest *939AEE68989794C0F408277411C26055CDF41119 +plug_dest NULL *939AEE68989794C0F408277411C26055CDF41119 DROP USER plug_dest; GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_user_passwd'; SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; user plugin authentication_string password grant_user test_plugin_server plug_dest -plug_dest *560881EB651416CEF77314D07D55EDCD5FC1BD6D +plug_dest NULL *560881EB651416CEF77314D07D55EDCD5FC1BD6D DROP USER grant_user,plug_dest; set @@sql_mode= @save_sql_mode; DROP DATABASE test_user_db; diff --git a/mysql-test/r/plugin_auth_qa_1.result b/mysql-test/r/plugin_auth_qa_1.result index 00ee47b56b3..51c7260d9ae 100644 --- a/mysql-test/r/plugin_auth_qa_1.result +++ b/mysql-test/r/plugin_auth_qa_1.result @@ -20,7 +20,7 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_dest_pas GRANT PROXY ON plug_dest TO plug_user; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -plug_dest +plug_dest NULL plug_user test_plugin_server plug_dest 1) current_user() @@ -73,7 +73,7 @@ GRANT PROXY ON new_dest TO plug_user; ERROR 1045 (28000): Access denied for user 'plug_user'@'localhost' (using password: YES) SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -new_dest +new_dest NULL plug_user test_plugin_server plug_dest DROP USER plug_user,new_dest; CREATE USER plug_user @@ -91,7 +91,7 @@ GRANT PROXY ON new_dest TO plug_user; ERROR 1045 (28000): Access denied for user 'plug_user'@'localhost' (using password: YES) SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -new_dest +new_dest NULL plug_user test_plugin_server plug_dest DROP USER plug_user,new_dest; CREATE USER plug_user @@ -113,13 +113,13 @@ connection default; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string new_user test_plugin_server plug_dest -plug_dest +plug_dest NULL disconnect plug_user; UPDATE mysql.user SET user='plug_user' WHERE user='new_user'; FLUSH PRIVILEGES; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -plug_dest +plug_dest NULL plug_user test_plugin_server plug_dest DROP USER plug_dest,plug_user; ========== test 1.3 ======================================== @@ -135,26 +135,26 @@ connection default; disconnect plug_user; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -plug_dest +plug_dest NULL plug_user test_plugin_server plug_dest UPDATE mysql.user SET user='new_user' WHERE user='plug_user'; FLUSH PRIVILEGES; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string new_user test_plugin_server plug_dest -plug_dest +plug_dest NULL UPDATE mysql.user SET authentication_string='new_dest' WHERE user='new_user'; FLUSH PRIVILEGES; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string new_user test_plugin_server new_dest -plug_dest +plug_dest NULL UPDATE mysql.user SET plugin='new_plugin_server' WHERE user='new_user'; FLUSH PRIVILEGES; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string new_user new_plugin_server new_dest -plug_dest +plug_dest NULL connect(plug_user,localhost,new_user,new_dest); ERROR HY000: Plugin 'new_plugin_server' is not loaded UPDATE mysql.user SET plugin='test_plugin_server' WHERE user='new_user'; @@ -163,7 +163,7 @@ FLUSH PRIVILEGES; GRANT PROXY ON new_dest TO new_user; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -new_dest +new_dest NULL new_user test_plugin_server new_dest connect(plug_user,localhost,new_user,new_dest); select USER(),CURRENT_USER(); @@ -176,9 +176,9 @@ FLUSH PRIVILEGES; CREATE USER new_dest IDENTIFIED BY 'new_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -new_dest +new_dest NULL new_user test_plugin_server new_dest -plug_dest +plug_dest NULL GRANT ALL PRIVILEGES ON test.* TO new_user; connect(plug_user,localhost,new_dest,new_dest_passwd); select USER(),CURRENT_USER(); @@ -193,7 +193,7 @@ CREATE USER proxied_user IDENTIFIED BY 'proxied_user_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string test_plugin_server proxied_user -proxied_user +proxied_user NULL connect(proxy_con,localhost,proxied_user,proxied_user_passwd); SELECT USER(),CURRENT_USER(); USER() CURRENT_USER() @@ -230,7 +230,7 @@ CREATE USER proxied_user IDENTIFIED BY 'proxied_user_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string test_plugin_server proxied_user -proxied_user +proxied_user NULL connect(proxy_con,localhost,proxied_user,proxied_user_passwd); SELECT USER(),CURRENT_USER(); USER() CURRENT_USER() @@ -273,11 +273,11 @@ GRANT PROXY ON proxied_user_5 TO ''@''; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string test_plugin_server proxied_user -proxied_user_1 -proxied_user_2 -proxied_user_3 -proxied_user_4 -proxied_user_5 +proxied_user_1 NULL +proxied_user_2 NULL +proxied_user_3 NULL +proxied_user_4 NULL +proxied_user_5 NULL connect(proxy_con_1,localhost,proxied_user_1,'proxied_user_1_pwd'); connect(proxy_con_2,localhost,proxied_user_2,proxied_user_2_pwd); connect(proxy_con_3,localhost,proxied_user_3,proxied_user_3_pwd); diff --git a/mysql-test/r/plugin_auth_qa_2.result b/mysql-test/r/plugin_auth_qa_2.result index 99fe9c6f5a9..f4706e5aa0b 100644 --- a/mysql-test/r/plugin_auth_qa_2.result +++ b/mysql-test/r/plugin_auth_qa_2.result @@ -7,7 +7,7 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_1_dest identified by 'dest_pas GRANT PROXY ON qa_test_1_dest TO qa_test_1_user; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -qa_test_1_dest +qa_test_1_dest NULL qa_test_1_user qa_auth_interface qa_test_1_dest SELECT @@proxy_user; @@proxy_user @@ -20,7 +20,7 @@ current_user() user() @@local.proxy_user @@local.external_user qa_test_1_user@% qa_test_1_user@localhost NULL NULL SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -qa_test_1_dest +qa_test_1_dest NULL qa_test_1_user qa_auth_interface qa_test_1_dest DROP USER qa_test_1_user; DROP USER qa_test_1_dest; @@ -33,8 +33,8 @@ GRANT PROXY ON qa_test_2_dest TO qa_test_2_user; GRANT PROXY ON authenticated_as TO qa_test_2_user; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -authenticated_as -qa_test_2_dest +authenticated_as NULL +qa_test_2_dest NULL qa_test_2_user qa_auth_interface qa_test_2_dest SELECT @@proxy_user; @@proxy_user @@ -47,8 +47,8 @@ current_user() user() @@local.proxy_user @@local.external_user authenticated_as@% user_name@localhost 'qa_test_2_user'@'%' 'qa_test_2_user'@'%' SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -authenticated_as -qa_test_2_dest +authenticated_as NULL +qa_test_2_dest NULL qa_test_2_user qa_auth_interface qa_test_2_dest DROP USER qa_test_2_user; DROP USER qa_test_2_dest; @@ -83,8 +83,8 @@ GRANT PROXY ON qa_test_5_dest TO qa_test_5_user; GRANT PROXY ON qa_test_5_dest TO ''@'localhost'; SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; user plugin authentication_string password - *DFCACE76914AD7BD801FC1A1ECF6562272621A22 -qa_test_5_dest *DFCACE76914AD7BD801FC1A1ECF6562272621A22 + NULL *DFCACE76914AD7BD801FC1A1ECF6562272621A22 +qa_test_5_dest NULL *DFCACE76914AD7BD801FC1A1ECF6562272621A22 qa_test_5_user qa_auth_interface qa_test_5_dest exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT --user=qa_test_5_user --password=qa_test_5_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 ERROR 1045 (28000): Access denied for user 'qa_test_5_user'@'localhost' (using password: YES) @@ -98,7 +98,7 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_6_dest identified by 'dest_pas GRANT PROXY ON qa_test_6_dest TO qa_test_6_user; SELECT user,plugin,authentication_string,password FROM mysql.user; user plugin authentication_string password -qa_test_6_dest *DFCACE76914AD7BD801FC1A1ECF6562272621A22 +qa_test_6_dest NULL *DFCACE76914AD7BD801FC1A1ECF6562272621A22 qa_test_6_user qa_auth_interface qa_test_6_dest root root @@ -109,7 +109,7 @@ ERROR 1045 (28000): Access denied for user 'qa_test_6_user'@'localhost' (using p GRANT PROXY ON qa_test_6_dest TO root IDENTIFIED WITH qa_auth_interface AS 'qa_test_6_dest'; SELECT user,plugin,authentication_string,password FROM mysql.user; user plugin authentication_string password -qa_test_6_dest *DFCACE76914AD7BD801FC1A1ECF6562272621A22 +qa_test_6_dest NULL *DFCACE76914AD7BD801FC1A1ECF6562272621A22 qa_test_6_user qa_auth_interface qa_test_6_dest root root @@ -121,7 +121,7 @@ ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: Y REVOKE PROXY ON qa_test_6_dest FROM root; SELECT user,plugin,authentication_string FROM mysql.user; user plugin authentication_string -qa_test_6_dest +qa_test_6_dest NULL qa_test_6_user qa_auth_interface qa_test_6_dest root root diff --git a/mysql-test/r/sp_notembedded.result b/mysql-test/r/sp_notembedded.result index 7da95416e29..6b6c98ea226 100644 --- a/mysql-test/r/sp_notembedded.result +++ b/mysql-test/r/sp_notembedded.result @@ -249,8 +249,6 @@ max_updates, max_connections, max_user_connections) VALUES('%', 'mysqltest_1', password(''), 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'N', 'N', 'N', 'N', 'N', 'N', 'Y', 'Y', 'N', 'N', 'Y', 'Y', 'N', 'N', 'N', 'N', 'N', 'Y', 'Y', 'N', '', '', '', '', '0', '0', '0', '0'); -Warnings: -Warning 1364 Field 'authentication_string' doesn't have a default value FLUSH PRIVILEGES; CREATE PROCEDURE p1(i INT) BEGIN END; DROP PROCEDURE p1; diff --git a/mysql-test/r/system_mysql_db.result b/mysql-test/r/system_mysql_db.result index b24f0186506..0e0d555d492 100644 --- a/mysql-test/r/system_mysql_db.result +++ b/mysql-test/r/system_mysql_db.result @@ -120,8 +120,8 @@ user CREATE TABLE `user` ( `max_updates` int(11) unsigned NOT NULL DEFAULT '0', `max_connections` int(11) unsigned NOT NULL DEFAULT '0', `max_user_connections` int(11) unsigned NOT NULL DEFAULT '0', - `plugin` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', - `authentication_string` text COLLATE utf8_bin NOT NULL, + `plugin` char(64) COLLATE utf8_bin DEFAULT '', + `authentication_string` text COLLATE utf8_bin, PRIMARY KEY (`Host`,`User`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Users and global privileges' show create table func; diff --git a/mysql-test/suite/funcs_1/r/is_columns_mysql.result b/mysql-test/suite/funcs_1/r/is_columns_mysql.result index 1d20dca9903..95ffd62fbb8 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_mysql.result +++ b/mysql-test/suite/funcs_1/r/is_columns_mysql.result @@ -185,7 +185,7 @@ def mysql time_zone_transition_type Time_zone_id 1 NULL NO int NULL NULL 10 0 NU def mysql time_zone_transition_type Transition_type_id 2 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI select,insert,update,references def mysql user Alter_priv 17 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references def mysql user Alter_routine_priv 28 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references -def mysql user authentication_string 42 NULL NO text 65535 65535 NULL NULL utf8 utf8_bin text select,insert,update,references +def mysql user authentication_string 42 NULL YES text 65535 65535 NULL NULL utf8 utf8_bin text select,insert,update,references def mysql user Create_priv 8 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references def mysql user Create_routine_priv 27 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references def mysql user Create_tablespace_priv 32 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references @@ -207,7 +207,7 @@ def mysql user max_questions 37 0 NO int NULL NULL 10 0 NULL NULL int(11) unsign def mysql user max_updates 38 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned select,insert,update,references def mysql user max_user_connections 40 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned select,insert,update,references def mysql user Password 3 NO char 41 41 NULL NULL latin1 latin1_bin char(41) select,insert,update,references -def mysql user plugin 41 NO char 64 192 NULL NULL utf8 utf8_bin char(64) select,insert,update,references +def mysql user plugin 41 YES char 64 192 NULL NULL utf8 utf8_bin char(64) select,insert,update,references def mysql user Process_priv 12 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references def mysql user References_priv 15 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references def mysql user Reload_priv 10 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references diff --git a/mysql-test/suite/funcs_1/r/is_user_privileges.result b/mysql-test/suite/funcs_1/r/is_user_privileges.result index 1ec1ffc4ce1..b269da53a3d 100644 --- a/mysql-test/suite/funcs_1/r/is_user_privileges.result +++ b/mysql-test/suite/funcs_1/r/is_user_privileges.result @@ -128,7 +128,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL Host localhost User testuser2 Password @@ -170,7 +170,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL Host localhost User testuser3 Password @@ -212,7 +212,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL # # Add GRANT OPTION db_datadict.* to testuser1; GRANT UPDATE ON db_datadict.* TO 'testuser1'@'localhost' WITH GRANT OPTION; @@ -278,7 +278,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL Host localhost User testuser2 Password @@ -320,7 +320,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL Host localhost User testuser3 Password @@ -362,7 +362,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL # Establish connection testuser1 (user=testuser1) SELECT * FROM information_schema.user_privileges WHERE grantee LIKE '''testuser%''' @@ -414,7 +414,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL Host localhost User testuser2 Password @@ -456,7 +456,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL Host localhost User testuser3 Password @@ -498,7 +498,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL SHOW GRANTS; Grants for testuser1@localhost GRANT USAGE ON *.* TO 'testuser1'@'localhost' @@ -572,7 +572,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL Host localhost User testuser2 Password @@ -614,7 +614,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL Host localhost User testuser3 Password @@ -656,7 +656,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string +authentication_string NULL GRANT SELECT ON *.* TO 'testuser1'@'localhost' WITH GRANT OPTION; # # Here