Below is the list of changes that have just been committed into a local
5.1 repository of cmiller. When cmiller does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2006-11-29 22:49:00-05:00, cmiller@stripped +47 -0
Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-maint
into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1
MERGE: 1.2349.1.15
BitKeeper/etc/collapsed@stripped, 2006-11-29 22:43:27-05:00, cmiller@stripped +3 -7
auto-union
MERGE: 1.16.1.3
BitKeeper/etc/ignore@stripped, 2006-11-29 22:43:28-05:00, cmiller@stripped +0 -0
auto-union
MERGE: 1.262.1.2
Makefile.am@stripped, 2006-11-29 22:43:34-05:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.101.1.4
client/mysql.cc@stripped, 2006-11-29 22:43:34-05:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.243.1.2
client/mysql_upgrade.c@stripped, 2006-11-29 22:43:34-05:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.12.1.3
client/mysqltest.c@stripped, 2006-11-29 22:43:34-05:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.246.1.3
configure.in@stripped, 2006-11-29 22:43:34-05:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.396.1.5
extra/yassl/src/ssl.cpp@stripped, 2006-11-29 22:43:34-05:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.22.1.1
extra/yassl/taocrypt/include/algebra.hpp@stripped, 2006-11-29 22:44:03-05:00, cmiller@stripped +0 -1
MERGE: 1.4.1.1
include/my_sys.h@stripped, 2006-11-29 22:48:58-05:00, cmiller@stripped +1 -0
manual merge.
MERGE: 1.210.1.1
mysql-test/lib/mtr_io.pl@stripped, 2006-11-29 22:43:34-05:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.8.1.1
mysql-test/lib/mtr_report.pl@stripped, 2006-11-29 22:43:34-05:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.39.1.3
mysql-test/mysql-test-run-shell.sh@stripped, 2006-11-29 22:43:34-05:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.334.1.2
mysql-test/mysql-test-run.pl@stripped, 2006-11-29 22:43:34-05:00, cmiller@stripped +1 -0
Auto merged
MERGE: 1.227.1.11
mysql-test/r/information_schema.result@stripped, 2006-11-29 22:43:35-05:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.137.2.1
mysql-test/r/ps.result@stripped, 2006-11-29 22:43:35-05:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.87.1.3
mysql-test/r/query_cache.result@stripped, 2006-11-29 22:43:35-05:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.82.1.1
mysql-test/r/sp.result@stripped, 2006-11-29 22:48:58-05:00, cmiller@stripped +0 -0
manual merge.
MERGE: 1.232.1.2
mysql-test/r/udf.result@stripped, 2006-11-29 22:43:35-05:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.8.1.1
mysql-test/t/alter_table.test@stripped, 2006-11-29 22:43:35-05:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.51.1.1
mysql-test/t/disabled.def@stripped, 2006-11-29 22:43:35-05:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.212.2.1
mysql-test/t/events_bugs.test@stripped, 2006-11-29 22:48:58-05:00, cmiller@stripped +0 -1
manual merge.
MERGE: 1.19.1.1
mysql-test/t/information_schema.test@stripped, 2006-11-29 22:43:35-05:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.87.2.1
mysql-test/t/limit.test@stripped, 2006-11-29 22:43:35-05:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.11.1.1
mysql-test/t/mysql.test@stripped, 2006-11-29 22:43:35-05:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.27.1.3
mysql-test/t/mysqldump.test@stripped, 2006-11-29 22:43:35-05:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.124.1.1
mysql-test/t/ps.test@stripped, 2006-11-29 22:43:35-05:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.86.1.3
mysql-test/t/query_cache.test@stripped, 2006-11-29 22:43:35-05:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.63.1.1
mysql-test/t/sp.test@stripped, 2006-11-29 22:43:35-05:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.204.1.2
mysql-test/t/system_mysql_db_fix30020.test@stripped, 2006-11-29 22:43:35-05:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.26.1.2
mysql-test/t/system_mysql_db_fix30020.test@stripped, 2006-11-29 22:43:34-05:00, cmiller@stripped +0 -0
Merge rename: mysql-test/t/system_mysql_db_fix.test -> mysql-test/t/system_mysql_db_fix30020.test
mysql-test/t/udf.test@stripped, 2006-11-29 22:43:35-05:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.9.1.1
mysql-test/t/view_grant.test@stripped, 2006-11-29 22:43:35-05:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.22.1.1
mysys/Makefile.am@stripped, 2006-11-29 22:43:35-05:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.84.1.1
scripts/mysql_fix_privilege_tables.sql@stripped, 2006-11-29 22:43:35-05:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.45.2.1
sql-common/my_time.c@stripped, 2006-11-29 22:43:37-05:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.28.2.4
sql/ha_ndbcluster.cc@stripped, 2006-11-29 22:48:58-05:00, cmiller@stripped +19 -27
manual merge.
MERGE: 1.369.1.2
sql/item.cc@stripped, 2006-11-29 22:43:36-05:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.217.1.1
sql/item_func.cc@stripped, 2006-11-29 22:43:36-05:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.329.1.6
sql/item_func.h@stripped, 2006-11-29 22:43:36-05:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.152.2.2
sql/item_timefunc.cc@stripped, 2006-11-29 22:43:36-05:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.137.7.5
sql/mysql_priv.h@stripped, 2006-11-29 22:43:36-05:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.457.4.1
sql/mysqld.cc@stripped, 2006-11-29 22:43:36-05:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.589.1.4
sql/sql_base.cc@stripped, 2006-11-29 22:48:58-05:00, cmiller@stripped +0 -0
manual merge.
MERGE: 1.360.2.1
sql/sql_handler.cc@stripped, 2006-11-29 22:43:36-05:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.86.1.1
sql/sql_parse.cc@stripped, 2006-11-29 22:43:37-05:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.595.3.4
sql/sql_table.cc@stripped, 2006-11-29 22:43:37-05:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.372.1.2
support-files/mysql.spec.sh@stripped, 2006-11-29 22:43:37-05:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.170.1.1
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: cmiller
# Host: zippy.cornsilk.net
# Root: /home/cmiller/work/mysql/mysql-5.1/RESYNC
--- 1.102/Makefile.am 2006-11-29 22:49:08 -05:00
+++ 1.103/Makefile.am 2006-11-29 22:49:08 -05:00
@@ -142,10 +142,15 @@ test-force:
test-force-full:
$(MAKE) force=--force test-full
+#used by autopush.pl to run memory based tests
+test-force-mem:
+ $(MAKE) 'force=--force --mem' test
+
# Keep these for a while
test-pl: test
test-full-pl: test-full
test-force-pl: test-force
+test-force-pl-mem: test-force-mem
test-force-full-pl: test-force-full
# Don't update the files from bitkeeper
--- 1.244/client/mysql.cc 2006-11-29 22:49:08 -05:00
+++ 1.245/client/mysql.cc 2006-11-29 22:49:08 -05:00
@@ -830,9 +830,22 @@ get_one_option(int optid, const struct m
break;
case OPT_DELIMITER:
if (argument == disabled_my_option)
+ {
strmov(delimiter, DEFAULT_DELIMITER);
+ }
else
+ {
+ /* Check that delimiter does not contain a backslash */
+ if (!strstr(argument, "\\"))
+ {
strmake(delimiter, argument, sizeof(delimiter) - 1);
+ }
+ else
+ {
+ put_info("DELIMITER cannot contain a backslash character", INFO_ERROR);
+ return 0;
+ }
+ }
delimiter_length= (uint)strlen(delimiter);
delimiter_str= delimiter;
break;
@@ -3031,6 +3044,14 @@ com_delimiter(String *buffer __attribute
put_info("DELIMITER must be followed by a 'delimiter' character or string",
INFO_ERROR);
return 0;
+ }
+ else
+ {
+ if (strstr(tmp, "\\"))
+ {
+ put_info("DELIMITER cannot contain a backslash character", INFO_ERROR);
+ return 0;
+ }
}
strmake(delimiter, tmp, sizeof(delimiter) - 1);
delimiter_length= (int)strlen(delimiter);
--- 1.400/configure.in 2006-11-29 22:49:08 -05:00
+++ 1.401/configure.in 2006-11-29 22:49:08 -05:00
@@ -1953,7 +1953,7 @@ fi
# Check definition of gethostbyname_r (glibc2.0.100 is different from Solaris)
ac_save_CXXFLAGS="$CXXFLAGS"
-AC_CACHE_CHECK([style of gethostname_r routines], mysql_cv_gethostname_style,
+AC_CACHE_CHECK([style of gethostbyname_r routines], mysql_cv_gethostbyname_style,
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
if test "$ac_cv_prog_gxx" = "yes" -a "$with_other_libc" = "no"
@@ -1975,10 +1975,10 @@ AC_TRY_COMPILE(
skr = gethostbyname_r((const char *) 0,
(struct hostent*) 0, (char*) 0, 0, (struct hostent **) 0, &skr);],
-mysql_cv_gethostname_style=glibc2, mysql_cv_gethostname_style=other))
+mysql_cv_gethostbyname_style=glibc2, mysql_cv_gethostbyname_style=other))
AC_LANG_RESTORE
CXXFLAGS="$ac_save_CXXFLAGS"
-if test "$mysql_cv_gethostname_style" = "glibc2"
+if test "$mysql_cv_gethostbyname_style" = "glibc2"
then
AC_DEFINE([HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE], [1],
[Solaris define gethostbyname_r with 5 arguments. glibc2 defines this with 6 arguments])
@@ -1986,7 +1986,7 @@ fi
# Check 3rd argument of getthostbyname_r
ac_save_CXXFLAGS="$CXXFLAGS"
-AC_CACHE_CHECK([3 argument to gethostname_r routines], mysql_cv_gethostname_arg,
+AC_CACHE_CHECK([3 argument to gethostbyname_r routines], mysql_cv_gethostbyname_arg,
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
if test "$ac_cv_prog_gxx" = "yes" -a "$with_other_libc" = "no"
@@ -2007,13 +2007,13 @@ AC_TRY_COMPILE(
[int skr;
skr = gethostbyname_r((const char *) 0, (struct hostent*) 0, (struct hostent_data*) 0);],
-mysql_cv_gethostname_arg=hostent_data, mysql_cv_gethostname_arg=char))
+mysql_cv_gethostbyname_arg=hostent_data, mysql_cv_gethostbyname_arg=char))
AC_LANG_RESTORE
CXXFLAGS="$ac_save_CXXFLAGS"
-if test "$mysql_cv_gethostname_arg" = "hostent_data"
+if test "$mysql_cv_gethostbyname_arg" = "hostent_data"
then
AC_DEFINE([HAVE_GETHOSTBYNAME_R_RETURN_INT], [1],
- [In OSF 4.0f the 3'd argument to gethostname_r is hostent_data *])
+ [In OSF 4.0f the 3'd argument to gethostbyname_r is hostent_data *])
fi
@@ -2423,7 +2423,7 @@ then
sql_client_dirs="libmysql_r $sql_client_dirs"
linked_client_targets="$linked_client_targets linked_libmysql_r_sources"
AC_CONFIG_FILES(libmysql_r/Makefile)
- AC_DEFINE([THREAD_SAFE_CLIENT], [1], [Should be client be thread safe])
+ AC_DEFINE([THREAD_SAFE_CLIENT], [1], [Should the client be thread safe])
fi
CLIENT_LIBS="$NON_THREADED_LIBS $openssl_libs $ZLIB_LIBS $STATIC_NSS_FLAGS"
--- 1.211/include/my_sys.h 2006-11-29 22:49:08 -05:00
+++ 1.212/include/my_sys.h 2006-11-29 22:49:08 -05:00
@@ -873,6 +873,12 @@ extern int my_getncpus();
#define HAVE_MMAP
#endif
+#ifndef __NETWARE__
+int my_getpagesize(void);
+#else
+#define my_getpagesize() 8192
+#endif
+
void *my_mmap(void *, size_t, int, int, int, my_off_t);
int my_munmap(void *, size_t);
#endif
--- 1.85/mysys/Makefile.am 2006-11-29 22:49:08 -05:00
+++ 1.86/mysys/Makefile.am 2006-11-29 22:49:08 -05:00
@@ -20,7 +20,7 @@ MYSQLBASEdir= $(prefix)
INCLUDES = @ZLIB_INCLUDES@ -I$(top_builddir)/include \
-I$(top_srcdir)/include -I$(srcdir)
pkglib_LIBRARIES = libmysys.a
-LDADD = libmysys.a $(top_builddir)/strings/libmystrings.a
+LDADD = libmysys.a $(top_builddir)/strings/libmystrings.a $(top_builddir)/dbug/libdbug.a
noinst_HEADERS = mysys_priv.h my_static.h
libmysys_a_SOURCES = my_init.c my_getwd.c mf_getdate.c my_mmap.c \
mf_path.c mf_loadpath.c my_file.c \
--- 1.220/sql/item.cc 2006-11-29 22:49:08 -05:00
+++ 1.221/sql/item.cc 2006-11-29 22:49:08 -05:00
@@ -5566,6 +5566,7 @@ int Item_default_value::save_in_field(Fi
ER(ER_NO_DEFAULT_FOR_FIELD),
field_arg->field_name);
}
+ field_arg->set_default();
return 1;
}
field_arg->set_default();
--- 1.335/sql/item_func.cc 2006-11-29 22:49:08 -05:00
+++ 1.336/sql/item_func.cc 2006-11-29 22:49:08 -05:00
@@ -1353,6 +1353,10 @@ longlong Item_func_mod::int_op()
signal_divide_by_null();
return 0;
}
+
+ if (args[0]->unsigned_flag)
+ return ((ulonglong) value) % val2;
+
return value % val2;
}
@@ -2720,41 +2724,49 @@ udf_handler::fix_fields(THD *thd, Item_r
char *to=num_buffer;
for (uint i=0; i < arg_count; i++)
{
- f_args.args[i]=0;
+ /*
+ For a constant argument i, args->args[i] points to the argument value.
+ For non-constant, args->args[i] is NULL.
+ */
+ f_args.args[i]= NULL; /* Non-const unless updated below. */
+
f_args.lengths[i]= arguments[i]->max_length;
f_args.maybe_null[i]= (char) arguments[i]->maybe_null;
f_args.attributes[i]= arguments[i]->name;
f_args.attribute_lengths[i]= arguments[i]->name_length;
- switch(arguments[i]->type()) {
- case Item::STRING_ITEM: // Constant string !
+ if (arguments[i]->const_item())
{
- String *res=arguments[i]->val_str(&buffers[i]);
if (arguments[i]->null_value)
continue;
+
+ switch (arguments[i]->result_type())
+ {
+ case STRING_RESULT:
+ case DECIMAL_RESULT:
+ {
+ String *res= arguments[i]->val_str(&buffers[i]);
f_args.args[i]= (char*) res->ptr();
break;
}
- case Item::INT_ITEM:
+ case INT_RESULT:
*((longlong*) to) = arguments[i]->val_int();
- if (!arguments[i]->null_value)
- {
f_args.args[i]=to;
to+= ALIGN_SIZE(sizeof(longlong));
- }
break;
- case Item::REAL_ITEM:
+ case REAL_RESULT:
*((double*) to)= arguments[i]->val_real();
- if (!arguments[i]->null_value)
- {
f_args.args[i]=to;
to+= ALIGN_SIZE(sizeof(double));
- }
break;
- default: // Skip these
+ case ROW_RESULT:
+ default:
+ // This case should never be chosen
+ DBUG_ASSERT(0);
break;
}
}
+ }
thd->net.last_error[0]=0;
Udf_func_init init= u_d->func_init;
if ((error=(uchar) init(&initid, &f_args, thd->net.last_error)))
@@ -5014,6 +5026,18 @@ Item_func_sp::execute_impl(THD *thd, Fie
#endif
if (find_and_check_access(thd))
goto error;
+
+ /*
+ Throw an error if a non-deterministic function is called while
+ statement-based replication (SBR) is active.
+ */
+ if (!m_sp->m_chistics->detistic && !trust_function_creators &&
+ (mysql_bin_log.is_open() &&
+ thd->variables.binlog_format == BINLOG_FORMAT_STMT))
+ {
+ my_error(ER_BINLOG_ROW_RBR_TO_SBR, MYF(0));
+ goto error;
+ }
/*
Disable the binlogging if this is not a SELECT statement. If this is a
--- 1.154/sql/item_func.h 2006-11-29 22:49:08 -05:00
+++ 1.155/sql/item_func.h 2006-11-29 22:49:08 -05:00
@@ -1318,7 +1318,7 @@ public:
Item_func_inet_aton(Item *a) :Item_int_func(a) {}
longlong val_int();
const char *func_name() const { return "inet_aton"; }
- void fix_length_and_dec() { decimals = 0; max_length = 21; maybe_null=1;}
+ void fix_length_and_dec() { decimals= 0; max_length= 21; maybe_null= 1; unsigned_flag= 1;}
bool check_partition_func_processor(byte *int_arg) {return FALSE;}
};
--- 1.142/sql/item_timefunc.cc 2006-11-29 22:49:08 -05:00
+++ 1.143/sql/item_timefunc.cc 2006-11-29 22:49:08 -05:00
@@ -290,15 +290,16 @@ static bool extract_date_time(DATE_TIME_
for (; ptr != end && val != val_end; ptr++)
{
+ /* Skip pre-space between each argument */
+ while (val != val_end && my_isspace(cs, *val))
+ val++;
+
if (*ptr == '%' && ptr+1 != end)
{
int val_len;
char *tmp;
error= 0;
- /* Skip pre-space between each argument */
- while (val != val_end && my_isspace(cs, *val))
- val++;
val_len= (uint) (val_end - val);
switch (*++ptr) {
@@ -3194,7 +3195,9 @@ bool Item_func_str_to_date::get_date(TIM
date_time_format.format.str= (char*) format->ptr();
date_time_format.format.length= format->length();
if (extract_date_time(&date_time_format, val->ptr(), val->length(),
- ltime, cached_timestamp_type, 0, "datetime"))
+ ltime, cached_timestamp_type, 0, "datetime") ||
+ ((fuzzy_date & TIME_NO_ZERO_DATE) &&
+ (ltime->year == 0 || ltime->month == 0 || ltime->day == 0)))
goto null_date;
if (cached_timestamp_type == MYSQL_TIMESTAMP_TIME && ltime->day)
{
@@ -3231,8 +3234,13 @@ String *Item_func_str_to_date::val_str(S
bool Item_func_last_day::get_date(TIME *ltime, uint fuzzy_date)
{
- if (get_arg0_date(ltime, fuzzy_date & ~TIME_FUZZY_DATE))
+ if (get_arg0_date(ltime, fuzzy_date & ~TIME_FUZZY_DATE) ||
+ (ltime->month == 0))
+ {
+ null_value= 1;
return 1;
+ }
+ null_value= 0;
uint month_idx= ltime->month-1;
ltime->day= days_in_month[month_idx];
if ( month_idx == 1 && calc_days_in_year(ltime->year) == 366)
--- 1.461/sql/mysql_priv.h 2006-11-29 22:49:08 -05:00
+++ 1.462/sql/mysql_priv.h 2006-11-29 22:49:08 -05:00
@@ -1112,6 +1112,7 @@ bool mysql_ha_read(THD *, TABLE_LIST *,e
List<Item> *,enum ha_rkey_function,Item *,ha_rows,ha_rows);
int mysql_ha_flush(THD *thd, TABLE_LIST *tables, uint mode_flags,
bool is_locked);
+void mysql_ha_mark_tables_for_reopen(THD *thd, TABLE *table);
/* mysql_ha_flush mode_flags bits */
#define MYSQL_HA_CLOSE_FINAL 0x00
#define MYSQL_HA_REOPEN_ON_USAGE 0x01
--- 1.594/sql/mysqld.cc 2006-11-29 22:49:08 -05:00
+++ 1.595/sql/mysqld.cc 2006-11-29 22:49:08 -05:00
@@ -2149,6 +2149,17 @@ later when used with nscd), disable LDAP
mysqld that is not statically linked.\n");
#endif
+ if (locked_in_memory)
+ {
+ fprintf(stderr, "\n\
+The \"--memlock\" argument, which was enabled, uses system calls that are\n\
+unreliable and unstable on some operating systems and operating-system\n\
+versions (notably, some versions of Linux). This crash could be due to use\n\
+of those buggy OS calls. You should consider whether you really need the\n\
+\"--memlock\" parameter and/or consult the OS distributer about \"mlockall\"\n\
+bugs.\n");
+ }
+
if (test_flags & TEST_CORE_ON_SIGNAL)
{
fprintf(stderr, "Writing a core file\n");
@@ -5926,9 +5937,11 @@ The minimum value for this variable is 4
"If there is more than this number of interrupted connections from a host this host will be blocked from further connections.",
(gptr*) &max_connect_errors, (gptr*) &max_connect_errors, 0, GET_ULONG,
REQUIRED_ARG, MAX_CONNECT_ERRORS, 1, ~0L, 0, 1, 0},
+ // Default max_connections of 151 is larger than Apache's default max
+ // children, to avoid "too many connections" error in a common setup
{"max_connections", OPT_MAX_CONNECTIONS,
"The number of simultaneous clients allowed.", (gptr*) &max_connections,
- (gptr*) &max_connections, 0, GET_ULONG, REQUIRED_ARG, 100, 1, 16384, 0, 1,
+ (gptr*) &max_connections, 0, GET_ULONG, REQUIRED_ARG, 151, 1, 16384, 0, 1,
0},
{"max_delayed_threads", OPT_MAX_DELAYED_THREADS,
"Don't start more than this number of threads to handle INSERT DELAYED statements. If set to zero, which means INSERT DELAYED is not used.",
@@ -6617,6 +6630,7 @@ SHOW_VAR status_vars[]= {
{"Com_create_function", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_CREATE_FUNCTION]), SHOW_LONG_STATUS},
{"Com_create_index", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_CREATE_INDEX]), SHOW_LONG_STATUS},
{"Com_create_table", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_CREATE_TABLE]), SHOW_LONG_STATUS},
+ {"Com_create_user", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_CREATE_USER]), SHOW_LONG_STATUS},
{"Com_dealloc_sql", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_DEALLOCATE_PREPARE]), SHOW_LONG_STATUS},
{"Com_delete", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_DELETE]), SHOW_LONG_STATUS},
{"Com_delete_multi", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_DELETE_MULTI]), SHOW_LONG_STATUS},
--- 1.363/sql/sql_base.cc 2006-11-29 22:49:08 -05:00
+++ 1.364/sql/sql_base.cc 2006-11-29 22:49:08 -05:00
@@ -1089,6 +1089,13 @@ void close_thread_tables(THD *thd, bool
DBUG_PRINT("info", ("thd->open_tables: 0x%lx", (long) thd->open_tables));
+ /*
+ End open index scans and table scans and remove references to the tables
+ from the handler tables hash. After this preparation it is safe to close
+ the tables.
+ */
+ mysql_ha_mark_tables_for_reopen(thd, thd->open_tables);
+
found_old_table= 0;
while (thd->open_tables)
found_old_table|= close_thread_table(thd, &thd->open_tables);
--- 1.600/sql/sql_parse.cc 2006-11-29 22:49:08 -05:00
+++ 1.601/sql/sql_parse.cc 2006-11-29 22:49:08 -05:00
@@ -57,10 +57,6 @@
(LP)->sql_command == SQLCOM_DROP_FUNCTION ? \
"FUNCTION" : "PROCEDURE")
-#ifdef SOLARIS
-extern "C" int gethostname(char *name, int namelen);
-#endif
-
static void time_out_user_resource_limits(THD *thd, USER_CONN *uc);
#ifndef NO_EMBEDDED_ACCESS_CHECKS
static int check_for_max_user_connections(THD *thd, USER_CONN *uc);
@@ -2628,6 +2624,7 @@ mysql_execute_command(THD *thd)
(sql_command_flags[lex->sql_command] & CF_CHANGES_DATA) &&
!((lex->sql_command == SQLCOM_CREATE_TABLE) &&
(lex->create_info.options & HA_LEX_CREATE_TMP_TABLE)) &&
+ !((lex->sql_command == SQLCOM_DROP_TABLE) && lex->drop_temporary) &&
((lex->sql_command != SQLCOM_UPDATE_MULTI) &&
some_non_temp_table_to_be_updated(thd, all_tables)))
{
@@ -4434,6 +4431,30 @@ end_with_restore_list:
DBUG_ASSERT(lex->sphead != 0);
DBUG_ASSERT(lex->sphead->m_db.str); /* Must be initialized in the parser */
+ /*
+ Verify that the database name is allowed, optionally
+ lowercase it.
+ */
+ if (check_db_name(lex->sphead->m_db.str))
+ {
+ my_error(ER_WRONG_DB_NAME, MYF(0), lex->sphead->m_db.str);
+ delete lex->sphead;
+ lex->sphead= 0;
+ goto error;
+ }
+
+ /*
+ Check that a database with this name
+ exists.
+ */
+ if (check_db_dir_existence(lex->sphead->m_db.str))
+ {
+ my_error(ER_BAD_DB_ERROR, MYF(0), lex->sphead->m_db.str);
+ delete lex->sphead;
+ lex->sphead= 0;
+ goto error;
+ }
+
if (check_access(thd, CREATE_PROC_ACL, lex->sphead->m_db.str, 0, 0, 0,
is_schema_db(lex->sphead->m_db.str)))
{
@@ -4673,8 +4694,6 @@ end_with_restore_list:
select_limit= thd->variables.select_limit;
thd->variables.select_limit= HA_POS_ERROR;
- thd->row_count_func= 0;
-
/*
We never write CALL statements into binlog:
- If the mode is non-prelocked, each statement will be logged
--- 1.375/sql/sql_table.cc 2006-11-29 22:49:08 -05:00
+++ 1.376/sql/sql_table.cc 2006-11-29 22:49:08 -05:00
@@ -5442,13 +5442,35 @@ view_err:
if (!(alter_info->flags & ~(ALTER_RENAME | ALTER_KEYS_ONOFF)) &&
!table->s->tmp_table) // no need to touch frm
{
- error=0;
VOID(pthread_mutex_lock(&LOCK_open));
- if (new_name != table_name || new_db != db)
+
+ switch (alter_info->keys_onoff) {
+ case LEAVE_AS_IS:
+ error= 0;
+ break;
+ case ENABLE:
+ wait_while_table_is_used(thd, table, HA_EXTRA_FORCE_REOPEN);
+ error= table->file->enable_indexes(HA_KEY_SWITCH_NONUNIQ_SAVE);
+ /* COND_refresh will be signaled in close_thread_tables() */
+ break;
+ case DISABLE:
+ wait_while_table_is_used(thd, table, HA_EXTRA_FORCE_REOPEN);
+ error=table->file->disable_indexes(HA_KEY_SWITCH_NONUNIQ_SAVE);
+ /* COND_refresh will be signaled in close_thread_tables() */
+ break;
+ }
+ if (error == HA_ERR_WRONG_COMMAND)
+ {
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
+ ER_ILLEGAL_HA, ER(ER_ILLEGAL_HA),
+ table->alias);
+ error= 0;
+ }
+
+ if (!error && (new_name != table_name || new_db != db))
{
thd->proc_info="rename";
/* Then do a 'simple' rename of the table */
- error=0;
if (!access(new_name_buff,F_OK))
{
my_error(ER_TABLE_EXISTS_ERROR, MYF(0), new_name);
@@ -5471,24 +5493,6 @@ view_err:
}
}
- if (!error)
- {
- switch (alter_info->keys_onoff) {
- case LEAVE_AS_IS:
- break;
- case ENABLE:
- wait_while_table_is_used(thd, table, HA_EXTRA_FORCE_REOPEN);
- error= table->file->enable_indexes(HA_KEY_SWITCH_NONUNIQ_SAVE);
- /* COND_refresh will be signaled in close_thread_tables() */
- break;
- case DISABLE:
- wait_while_table_is_used(thd, table, HA_EXTRA_FORCE_REOPEN);
- error=table->file->disable_indexes(HA_KEY_SWITCH_NONUNIQ_SAVE);
- /* COND_refresh will be signaled in close_thread_tables() */
- break;
- }
- }
-
if (error == HA_ERR_WRONG_COMMAND)
{
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
@@ -5496,6 +5500,7 @@ view_err:
table->alias);
error=0;
}
+
if (!error)
{
write_bin_log(thd, TRUE, thd->query, thd->query_length);
@@ -5508,7 +5513,7 @@ view_err:
error= -1;
}
VOID(pthread_mutex_unlock(&LOCK_open));
- table_list->table=0; // For query cache
+ table_list->table= NULL; // For query cache
query_cache_invalidate3(thd, table_list, 0);
DBUG_RETURN(error);
}
--- 1.172/support-files/mysql.spec.sh 2006-11-29 22:49:08 -05:00
+++ 1.173/support-files/mysql.spec.sh 2006-11-29 22:49:08 -05:00
@@ -193,8 +193,6 @@ necessary to develop MySQL client applic
%package shared
Summary: MySQL - Shared libraries
Group: Applications/Databases
-Provides: mysql-shared
-Obsoletes: mysql-shared
%description shared
This package contains the shared libraries (*.so*) which certain
@@ -689,12 +687,6 @@ fi
# itself - note that they must be ordered by date (important when
# merging BK trees)
%changelog
-* Thu Nov 16 2006 Joerg Bruehe <joerg@stripped>
-
-- Explicitly note that the "MySQL-shared" RPMs (as built by MySQL AB)
- replace "mysql-shared" (as distributed by SuSE) to allow easy upgrading
- (bug#22081).
-
* Mon Nov 13 2006 Joerg Bruehe <joerg@stripped>
- Add "--with-partition" to all server builds.
--- 1.20/mysql-test/t/events_bugs.test 2006-11-29 22:49:08 -05:00
+++ 1.21/mysql-test/t/events_bugs.test 2006-11-29 22:49:08 -05:00
@@ -280,7 +280,7 @@ create event e22830_3 on schedule every
create event e22830_4 on schedule every 1 hour do alter event e22830_4 on schedule every (select f22830() from dual) hour;
select event_name, event_definition, interval_value, interval_field from information_schema.events order by event_name;
set global event_scheduler=on;
---sleep 2.0
+--sleep 2.4
set global event_scheduler=off;
select event_name, event_definition, interval_value, interval_field from information_schema.events order by event_name;
drop function f22830;
--- 1.20/BitKeeper/etc/collapsed 2006-11-29 22:49:08 -05:00
+++ 1.21/BitKeeper/etc/collapsed 2006-11-29 22:49:08 -05:00
@@ -15,8 +15,6 @@
45214442pBGT9KuZEGixBH71jTzbOA
45214a07hVsIGwvwa-WrO-jpeaSwVw
452a92d0-31-8wSzSfZi165fcGcXPA
-452c6c6dAjuNghfc1ObZ_UQ5SCl85g
-4538a7b0EbDHHkWPbIwxO6ZIDdg6Dg
454a7ef8gdvE_ddMlJyghvOAkKPNOQ
454bb488ijVLOUK_GFjcoISE0GxPUA
454bb9a8AwlGRC_wWLS2sNMoRBMRGw
@@ -29,3 +27,6 @@
4554a95d7txO1DuO9G3nAizI3SkFAA
4554b3722d71SbPiI2Gx-RhbZjmuIQ
4558b3d73Cxjlb7Wv1oytdSTthxDfw
+4561b2ecZbhuAc0TTDdCdultxUYaMw
+4561bde4qWhz1I8tkItXKex5uniipA
+4562ba016dYH0JzszOqZ8p6psbKfnQ
--- 1.140/mysql-test/r/information_schema.result 2006-11-29 22:49:08 -05:00
+++ 1.141/mysql-test/r/information_schema.result 2006-11-29 22:49:08 -05:00
@@ -1077,7 +1077,7 @@ CREATE PROCEDURE p1 ()
BEGIN
SELECT 'foo' FROM DUAL;
END |
-ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+ERROR 42000: Unknown database 'information_schema'
select ROUTINE_NAME from routines;
ROUTINE_NAME
grant all on information_schema.* to 'user1'@'localhost';
--- 1.89/mysql-test/t/information_schema.test 2006-11-29 22:49:08 -05:00
+++ 1.90/mysql-test/t/information_schema.test 2006-11-29 22:49:08 -05:00
@@ -721,7 +721,7 @@ create temporary table schemata(f1 char(
# Bug #10708 SP's can use INFORMATION_SCHEMA as ROUTINE_SCHEMA
#
delimiter |;
---error 1044
+--error ER_BAD_DB_ERROR
CREATE PROCEDURE p1 ()
BEGIN
SELECT 'foo' FROM DUAL;
--- 1.17/client/mysql_upgrade.c 2006-11-29 22:49:08 -05:00
+++ 1.18/client/mysql_upgrade.c 2006-11-29 22:49:08 -05:00
@@ -638,7 +638,7 @@ error:
if (upgrade_defaults_created)
my_delete(upgrade_defaults_path, MYF(0));
- my_end(info_flag ? MY_CHECK_ERROR | MY_GIVE_INFO : 0);
+ my_end(info_flag ? MY_CHECK_ERROR : 0);
return ret;
}
--- 1.23/mysql-test/t/view_grant.test 2006-11-29 22:49:08 -05:00
+++ 1.24/mysql-test/t/view_grant.test 2006-11-29 22:49:08 -05:00
@@ -806,7 +806,7 @@ DROP DATABASE mysqltest1;
CREATE TABLE t1 (a INT PRIMARY KEY);
INSERT INTO t1 VALUES (1), (2), (3);
CREATE DEFINER = 'no-such-user'@localhost VIEW v AS SELECT a from t1;
---warning 1448
+#--warning 1448
SHOW CREATE VIEW v;
--error 1449
SELECT * FROM v;
--- 1.9/mysql-test/lib/mtr_io.pl 2006-11-29 22:49:08 -05:00
+++ 1.10/mysql-test/lib/mtr_io.pl 2006-11-29 22:49:08 -05:00
@@ -41,6 +41,7 @@ sub mtr_get_pid_from_file ($) {
# Read pid number from file
my $pid= <FILE>;
+ chomp $pid;
close FILE;
return $pid if $pid=~ /^(\d+)/;
--- 1.40/mysql-test/lib/mtr_report.pl 2006-11-29 22:49:08 -05:00
+++ 1.41/mysql-test/lib/mtr_report.pl 2006-11-29 22:49:08 -05:00
@@ -43,7 +43,7 @@ sub mtr_show_failed_diff ($) {
my $reject_file= "r/$tname.reject";
my $result_file= "r/$tname.result";
- my $log_file= "r/$tname.log";
+ my $log_file= "$::opt_vardir/log/$tname.log";
my $eval_file= "r/$tname.eval";
if ( $::opt_suite ne "main" )
@@ -94,10 +94,14 @@ sub mtr_report_test_skipped ($) {
{
print "[ disabled ] $tinfo->{'comment'}\n";
}
- else
+ elsif ( $tinfo->{'comment'} )
{
print "[ skipped ] $tinfo->{'comment'}\n";
}
+ else
+ {
+ print "[ skipped ]\n";
+ }
}
sub mtr_report_tests_not_skipped_though_disabled ($) {
@@ -248,6 +252,7 @@ sub mtr_report_stats ($) {
foreach my $pattern ( "^Warning:", "^Error:", "^==.* at 0x",
"InnoDB: Warning", "missing DBUG_RETURN",
"mysqld: Warning",
+ "allocated at line",
"Attempting backtrace", "Assertion .* failed" )
{
foreach my $errlog ( sort glob("$::opt_vardir/log/*.err") )
--- 1.242/mysql-test/mysql-test-run.pl 2006-11-29 22:49:08 -05:00
+++ 1.243/mysql-test/mysql-test-run.pl 2006-11-29 22:49:08 -05:00
@@ -63,10 +63,8 @@ use Getopt::Long;
use Sys::Hostname;
use IO::Socket;
use IO::Socket::INET;
-use Data::Dumper;
use strict;
use warnings;
-use diagnostics;
select(STDOUT);
$| = 1; # Automatically flush STDOUT
@@ -88,6 +86,7 @@ require "lib/mtr_diff.pl";
require "lib/mtr_match.pl";
require "lib/mtr_misc.pl";
require "lib/mtr_stress.pl";
+require "lib/mtr_unique.pl";
$Devel::Trace::TRACE= 1;
@@ -203,6 +202,7 @@ our $opt_client_ddd;
our $opt_manual_gdb;
our $opt_manual_ddd;
our $opt_manual_debug;
+our $opt_mtr_build_thread=0;
our $opt_debugger;
our $opt_client_debugger;
@@ -217,6 +217,11 @@ our $clusters;
our $instance_manager;
+our $opt_master_myport;
+our $opt_slave_myport;
+our $im_port;
+our $im_mysqld1_port;
+our $im_mysqld2_port;
our $opt_ndbcluster_port;
our $opt_ndbconnectstring;
our $opt_ndbcluster_port_slave;
@@ -311,6 +316,7 @@ my $source_dist= 0;
sub main ();
sub initial_setup ();
sub command_line_setup ();
+sub set_mtr_build_thread_ports($);
sub datadir_setup ();
sub executable_setup ();
sub environment_setup ();
@@ -439,7 +445,6 @@ sub main () {
mtr_exit(0);
}
-
##############################################################################
#
# Default settings
@@ -453,45 +458,17 @@ sub command_line_setup () {
$opt_suite= "main"; # Special default suite
my $opt_comment;
- my $opt_master_myport= 9306;
- my $opt_slave_myport= 9308;
+ $opt_master_myport= 9306;
+ $opt_slave_myport= 9308;
$opt_ndbcluster_port= 9310;
$opt_ndbcluster_port_slave= 9311;
- my $im_port= 9312;
- my $im_mysqld1_port= 9313;
- my $im_mysqld2_port= 9314;
+ $im_port= 9312;
+ $im_mysqld1_port= 9313;
+ $im_mysqld2_port= 9314;
- #
- # To make it easier for different devs to work on the same host,
- # an environment variable can be used to control all ports. A small
- # number is to be used, 0 - 16 or similar.
- #
- # Note the MASTER_MYPORT has to be set the same in all 4.x and 5.x
- # versions of this script, else a 4.0 test run might conflict with a
- # 5.1 test run, even if different MTR_BUILD_THREAD is used. This means
- # all port numbers might not be used in this version of the script.
- #
- # Also note the limiteation of ports we are allowed to hand out. This
- # differs between operating systems and configuration, see
- # http://www.ncftp.com/ncftpd/doc/misc/ephemeral_ports.html
- # But a fairly safe range seems to be 5001 - 32767
if ( $ENV{'MTR_BUILD_THREAD'} )
{
- # Up to two masters, up to three slaves
- $opt_master_myport= $ENV{'MTR_BUILD_THREAD'} * 10 + 10000; # and 1
- $opt_slave_myport= $opt_master_myport + 2; # and 3 4
- $opt_ndbcluster_port= $opt_master_myport + 5;
- $opt_ndbcluster_port_slave= $opt_master_myport + 6;
- $im_port= $opt_master_myport + 7;
- $im_mysqld1_port= $opt_master_myport + 8;
- $im_mysqld2_port= $opt_master_myport + 9;
- }
-
- if ( $opt_master_myport < 5001 or $opt_master_myport + 10 >= 32767 )
- {
- mtr_error("MTR_BUILD_THREAD number results in a port",
- "outside 5001 - 32767",
- "($opt_master_myport - $opt_master_myport + 10)");
+ set_mtr_build_thread_ports($ENV{'MTR_BUILD_THREAD'});
}
# This is needed for test log evaluation in "gen-build-status-page"
@@ -543,6 +520,7 @@ sub command_line_setup () {
'im-port=i' => \$im_port, # Instance Manager port.
'im-mysqld1-port=i' => \$im_mysqld1_port, # Port of mysqld, controlled by IM
'im-mysqld2-port=i' => \$im_mysqld2_port, # Port of mysqld, controlled by IM
+ 'mtr-build-thread=i' => \$opt_mtr_build_thread,
# Test case authoring
'record' => \$opt_record,
@@ -623,6 +601,15 @@ sub command_line_setup () {
$glob_scriptname= basename($0);
+ if ($opt_mtr_build_thread != 0)
+ {
+ set_mtr_build_thread_ports($opt_mtr_build_thread)
+ }
+ elsif ($ENV{'MTR_BUILD_THREAD'})
+ {
+ $opt_mtr_build_thread= $ENV{'MTR_BUILD_THREAD'};
+ }
+
# We require that we are in the "mysql-test" directory
# to run mysql-test-run
if (! -f $glob_scriptname)
@@ -771,7 +758,7 @@ sub command_line_setup () {
{
mtr_report("Using tmpfs in $fs");
$opt_mem= "$fs/var";
- $opt_mem .= $ENV{'MTR_BUILD_THREAD'} if $ENV{'MTR_BUILD_THREAD'};
+ $opt_mem .= $opt_mtr_build_thread if $opt_mtr_build_thread;
last;
}
}
@@ -1216,6 +1203,43 @@ sub command_line_setup () {
$path_snapshot= "$opt_tmpdir/snapshot_$opt_master_myport/";
}
+#
+# To make it easier for different devs to work on the same host,
+# an environment variable can be used to control all ports. A small
+# number is to be used, 0 - 16 or similar.
+#
+# Note the MASTER_MYPORT has to be set the same in all 4.x and 5.x
+# versions of this script, else a 4.0 test run might conflict with a
+# 5.1 test run, even if different MTR_BUILD_THREAD is used. This means
+# all port numbers might not be used in this version of the script.
+#
+# Also note the limitation of ports we are allowed to hand out. This
+# differs between operating systems and configuration, see
+# http://www.ncftp.com/ncftpd/doc/misc/ephemeral_ports.html
+# But a fairly safe range seems to be 5001 - 32767
+#
+
+sub set_mtr_build_thread_ports($) {
+ my $mtr_build_thread= shift;
+
+ # Up to two masters, up to three slaves
+ $opt_master_myport= $mtr_build_thread * 10 + 10000; # and 1
+ $opt_slave_myport= $opt_master_myport + 2; # and 3 4
+ $opt_ndbcluster_port= $opt_master_myport + 5;
+ $opt_ndbcluster_port_slave= $opt_master_myport + 6;
+ $im_port= $opt_master_myport + 7;
+ $im_mysqld1_port= $opt_master_myport + 8;
+ $im_mysqld2_port= $opt_master_myport + 9;
+
+ if ( $opt_master_myport < 5001 or $opt_master_myport + 10 >= 32767 )
+ {
+ mtr_error("MTR_BUILD_THREAD number results in a port",
+ "outside 5001 - 32767",
+ "($opt_master_myport - $opt_master_myport + 10)");
+ }
+}
+
+
sub datadir_setup () {
# Make a list of all data_dirs
@@ -1505,7 +1529,7 @@ sub executable_setup () {
sub generate_cmdline_mysqldump ($) {
my($mysqld) = @_;
return
- "$exe_mysqldump --no-defaults -uroot " .
+ "$exe_mysqldump --no-defaults --debug-info -uroot " .
"--port=$mysqld->{'port'} " .
"--socket=$mysqld->{'path_sock'} --password=";
}
@@ -1601,7 +1625,8 @@ sub environment_setup () {
if ( $source_dist )
{
push(@ld_library_paths, "$glob_basedir/libmysql/.libs/",
- "$glob_basedir/libmysql_r/.libs/");
+ "$glob_basedir/libmysql_r/.libs/",
+ "$glob_basedir/zlib.libs/");
}
else
{
@@ -1680,7 +1705,7 @@ sub environment_setup () {
$ENV{'IM_PATH_SOCK'}= $instance_manager->{path_sock};
$ENV{'IM_USERNAME'}= $instance_manager->{admin_login};
$ENV{'IM_PASSWORD'}= $instance_manager->{admin_password};
- $ENV{MTR_BUILD_THREAD}= 0 unless $ENV{MTR_BUILD_THREAD}; # Set if not set
+ $ENV{MTR_BUILD_THREAD}= $opt_mtr_build_thread;
$ENV{'EXE_MYSQL'}= $exe_mysql;
@@ -1741,7 +1766,7 @@ sub environment_setup () {
# Setup env so childs can execute mysqlcheck
# ----------------------------------------------------
my $cmdline_mysqlcheck=
- "$exe_mysqlcheck --no-defaults -uroot " .
+ "$exe_mysqlcheck --no-defaults --debug-info -uroot " .
"--port=$master->[0]->{'port'} " .
"--socket=$master->[0]->{'path_sock'} --password=";
@@ -1792,7 +1817,7 @@ sub environment_setup () {
# Setup env so childs can execute mysqlimport
# ----------------------------------------------------
my $cmdline_mysqlimport=
- "$exe_mysqlimport -uroot " .
+ "$exe_mysqlimport --debug-info -uroot " .
"--port=$master->[0]->{'port'} " .
"--socket=$master->[0]->{'path_sock'} --password=";
@@ -1808,7 +1833,7 @@ sub environment_setup () {
# Setup env so childs can execute mysqlshow
# ----------------------------------------------------
my $cmdline_mysqlshow=
- "$exe_mysqlshow -uroot " .
+ "$exe_mysqlshow --debug-info -uroot " .
"--port=$master->[0]->{'port'} " .
"--socket=$master->[0]->{'path_sock'} --password=";
@@ -1824,7 +1849,7 @@ sub environment_setup () {
# ----------------------------------------------------
my $cmdline_mysqlbinlog=
"$exe_mysqlbinlog" .
- " --no-defaults --local-load=$opt_tmpdir";
+ " --no-defaults --debug-info --local-load=$opt_tmpdir";
if ( $mysql_version_id >= 50000 )
{
$cmdline_mysqlbinlog .=" --character-sets-dir=$path_charsetsdir";
@@ -1841,7 +1866,7 @@ sub environment_setup () {
# Setup env so childs can execute mysql
# ----------------------------------------------------
my $cmdline_mysql=
- "$exe_mysql --no-defaults --host=localhost --user=root --password= " .
+ "$exe_mysql --no-defaults --debug-info --host=localhost --user=root --password= " .
"--port=$master->[0]->{'port'} " .
"--socket=$master->[0]->{'path_sock'} ".
"--character-sets-dir=$path_charsetsdir";
@@ -2087,6 +2112,12 @@ sub cleanup_stale_files () {
}
closedir(DIR);
}
+
+ # Remove old log files
+ foreach my $name (glob("r/*.progress r/*.log r/*.warnings"))
+ {
+ unlink($name);
+ }
}
@@ -2467,8 +2498,8 @@ sub ndbcluster_start ($$) {
sub rm_ndbcluster_tables ($) {
my $dir= shift;
- foreach my $bin ( glob("$dir/cluster/apply_status*"),
- glob("$dir/cluster/schema*") )
+ foreach my $bin ( glob("$dir/mysql/apply_status*"),
+ glob("$dir/mysql/schema*"))
{
unlink($bin);
}
@@ -3020,10 +3051,6 @@ sub do_after_run_mysqltest($)
# Save info from this testcase run to mysqltest.log
mtr_appendfile_to_file($path_timefile, $path_mysqltest_log)
if -f $path_timefile;
-
- # Remove the file that mysqltest writes info to
- unlink($path_timefile);
-
}
@@ -3031,14 +3058,14 @@ sub find_testcase_skipped_reason($)
{
my ($tinfo)= @_;
- # Open mysqltest.log
+ # Open mysqltest-time
my $F= IO::File->new($path_timefile) or
mtr_error("can't open file \"$path_timefile\": $!");
my $reason;
while ( my $line= <$F> )
{
- # Look for "reason: <reason fo skiping test>"
+ # Look for "reason: <reason for skipping test>"
if ( $line =~ /reason: (.*)/ )
{
$reason= $1;
@@ -3173,6 +3200,9 @@ sub run_testcase ($) {
my $res= run_mysqltest($tinfo);
mtr_report_test_name($tinfo);
+
+ do_after_run_mysqltest($tinfo);
+
if ( $res == 0 )
{
mtr_report_test_passed($tinfo);
@@ -3206,10 +3236,11 @@ sub run_testcase ($) {
"mysqltest returned unexpected code $res, it has probably crashed";
report_failure_and_restart($tinfo);
}
-
- do_after_run_mysqltest($tinfo);
}
+ # Remove the file that mysqltest writes info to
+ unlink($path_timefile);
+
# ----------------------------------------------------------------------
# Stop Instance Manager if we are processing an IM-test case.
# ----------------------------------------------------------------------
@@ -4138,12 +4169,12 @@ sub run_testcase_start_servers($) {
# tables ok FIXME This is a workaround so that only one mysqld
# create the tables
if ( ! sleep_until_file_created(
- "$master->[0]->{'path_myddir'}/cluster/apply_status.ndb",
+ "$master->[0]->{'path_myddir'}/mysql/apply_status.ndb",
$master->[0]->{'start_timeout'},
$master->[0]->{'pid'}))
{
- $tinfo->{'comment'}= "Failed to create 'cluster/apply_status' table";
+ $tinfo->{'comment'}= "Failed to create 'mysql/apply_status' table";
return 1;
}
}
@@ -4342,6 +4373,7 @@ sub run_mysqltest ($) {
mtr_add_arg($args, "--skip-safemalloc");
mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir);
mtr_add_arg($args, "--character-sets-dir=%s", $path_charsetsdir);
+ mtr_add_arg($args, "--logdir=%s/log", $opt_vardir);
if ($tinfo->{'component_id'} eq 'im')
{
@@ -4791,6 +4823,8 @@ Options that specify ports
slave_port=PORT Specify the port number used by the first slave
ndbcluster-port=PORT Specify the port number used by cluster
ndbcluster-port-slave=PORT Specify the port number used by slave cluster
+ mtr-build-thread=# Specify unique collection of ports. Can also be set by
+ setting the environment variable MTR_BUILD_THREAD.
Options for test case authoring
@@ -4869,4 +4903,3 @@ HERE
mtr_exit(1);
}
-
--- 1.217/mysql-test/t/disabled.def 2006-11-29 22:49:08 -05:00
+++ 1.218/mysql-test/t/disabled.def 2006-11-29 22:49:08 -05:00
@@ -28,7 +28,6 @@ rpl_ndb_ddl : BUG#18946 res
rpl_ndb_innodb2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement
rpl_ndb_myisam2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement
rpl_row_blob_innodb : BUG#18980 2006-04-10 kent Test fails randomly
-rpl_sp : BUG#16456 2006-02-16 jmiller
rpl_multi_engine : BUG#22583 2006-09-23 lars
synchronization : Bug#24529 Test 'synchronization' fails on Mac pushbuild; Also on Linux 64 bit.
--- 1.33/sql-common/my_time.c 2006-11-29 22:49:08 -05:00
+++ 1.34/sql-common/my_time.c 2006-11-29 22:49:08 -05:00
@@ -411,7 +411,9 @@ str_to_datetime(const char *str, uint le
if (number_of_fields < 3 ||
l_time->year > 9999 || l_time->month > 12 ||
l_time->day > 31 || l_time->hour > 23 ||
- l_time->minute > 59 || l_time->second > 59)
+ l_time->minute > 59 || l_time->second > 59 ||
+ (l_time->year == 0 && l_time->month == 0 && l_time->day == 0 &&
+ (l_time->hour != 0 || l_time->minute != 0 || l_time->second != 0)))
{
/* Only give warning for a zero date if there is some garbage after */
if (!not_zero_date) /* If zero date */
--- 1.372/sql/ha_ndbcluster.cc 2006-11-29 22:49:08 -05:00
+++ 1.373/sql/ha_ndbcluster.cc 2006-11-29 22:49:08 -05:00
@@ -413,7 +413,8 @@ Thd_ndb::get_open_table(THD *thd, const
thd_ndb_share->stat.no_uncommitted_rows_count= 0;
thd_ndb_share->stat.records= ~(ha_rows)0;
}
- DBUG_PRINT("exit", ("thd_ndb_share: %p key: %p", thd_ndb_share, key));
+ DBUG_PRINT("exit", ("thd_ndb_share: 0x%lx key: 0x%lx",
+ (long) thd_ndb_share, (long) key));
DBUG_RETURN(thd_ndb_share);
}
@@ -761,8 +762,8 @@ int ha_ndbcluster::set_ndb_value(NdbOper
blob_ptr= (char*)"";
}
- DBUG_PRINT("value", ("set blob ptr=%p len=%u",
- blob_ptr, blob_len));
+ DBUG_PRINT("value", ("set blob ptr: 0x%lx len: %u",
+ (long) blob_ptr, blob_len));
DBUG_DUMP("value", (char*)blob_ptr, min(blob_len, 26));
if (set_blob_value)
@@ -847,8 +848,8 @@ int get_ndb_blobs_value(TABLE* table, Nd
uint32 len= 0xffffffff; // Max uint32
if (ndb_blob->readData(buf, len) != 0)
ERR_RETURN(ndb_blob->getNdbError());
- DBUG_PRINT("info", ("[%u] offset=%u buf=%p len=%u [ptrdiff=%d]",
- i, offset, buf, len, (int)ptrdiff));
+ DBUG_PRINT("info", ("[%u] offset: %u buf: 0x%lx len=%u [ptrdiff=%d]",
+ i, offset, (long) buf, len, (int)ptrdiff));
DBUG_ASSERT(len == len64);
// Ugly hack assumes only ptr needs to be changed
field_blob->ptr+= ptrdiff;
@@ -1171,8 +1172,8 @@ int ha_ndbcluster::add_index_handle(THD
index= dict->getIndexGlobal(index_name, *m_table);
if (!index)
ERR_RETURN(dict->getNdbError());
- DBUG_PRINT("info", ("index: %p id: %d version: %d.%d status: %d",
- index,
+ DBUG_PRINT("info", ("index: 0x%lx id: %d version: %d.%d status: %d",
+ (long) index,
index->getObjectId(),
index->getObjectVersion() & 0xFFFFFF,
index->getObjectVersion() >> 24,
@@ -1215,8 +1216,8 @@ int ha_ndbcluster::add_index_handle(THD
index= dict->getIndexGlobal(unique_index_name, *m_table);
if (!index)
ERR_RETURN(dict->getNdbError());
- DBUG_PRINT("info", ("index: %p id: %d version: %d.%d status: %d",
- index,
+ DBUG_PRINT("info", ("index: 0x%lx id: %d version: %d.%d status: %d",
+ (long) index,
index->getObjectId(),
index->getObjectVersion() & 0xFFFFFF,
index->getObjectVersion() >> 24,
@@ -2072,7 +2073,7 @@ inline int ha_ndbcluster::fetch_next(Ndb
all pending update or delete operations should
be sent to NDB
*/
- DBUG_PRINT("info", ("ops_pending: %llu", m_ops_pending));
+ DBUG_PRINT("info", ("ops_pending: %ld", (long) m_ops_pending));
if (m_ops_pending)
{
if (m_transaction_on)
@@ -2305,7 +2306,7 @@ int ha_ndbcluster::set_bounds(NdbIndexSc
// Set bound if not done with this key
if (p.key != NULL)
{
- DBUG_PRINT("info", ("key %d:%d offset=%d length=%d last=%d bound=%d",
+ DBUG_PRINT("info", ("key %d:%d offset: %d length: %d last: %d bound: %d",
j, i, tot_len, part_len, p.part_last, p.bound_type));
DBUG_DUMP("info", (const char*)p.part_ptr, part_store_len);
@@ -2462,7 +2463,7 @@ int ha_ndbcluster::full_table_scan(byte
part_spec.start_part= 0;
part_spec.end_part= m_part_info->get_tot_partitions() - 1;
prune_partition_set(table, &part_spec);
- DBUG_PRINT("info", ("part_spec.start_part = %u, part_spec.end_part = %u",
+ DBUG_PRINT("info", ("part_spec.start_part: %u part_spec.end_part: %u",
part_spec.start_part, part_spec.end_part));
/*
If partition pruning has found no partition in set
@@ -2658,7 +2659,7 @@ int ha_ndbcluster::write_row(byte *recor
{
// Send rows to NDB
DBUG_PRINT("info", ("Sending inserts to NDB, "\
- "rows_inserted:%d, bulk_insert_rows: %d",
+ "rows_inserted: %d bulk_insert_rows: %d",
(int)m_rows_inserted, (int)m_bulk_insert_rows));
m_bulk_insert_not_flushed= FALSE;
@@ -3108,7 +3109,8 @@ void ndb_unpack_record(TABLE *table, Ndb
char* ptr;
field_blob->get_ptr(&ptr, row_offset);
uint32 len= field_blob->get_length(row_offset);
- DBUG_PRINT("info",("[%u] SET ptr=%p len=%u", col_no, ptr, len));
+ DBUG_PRINT("info",("[%u] SET ptr: 0x%lx len: %u",
+ col_no, (long) ptr, len));
#endif
}
}
@@ -3350,7 +3352,7 @@ int ha_ndbcluster::read_range_first_to_b
if (m_use_partition_function)
{
get_partition_set(table, buf, active_index, start_key, &part_spec);
- DBUG_PRINT("info", ("part_spec.start_part = %u, part_spec.end_part = %u",
+ DBUG_PRINT("info", ("part_spec.start_part: %u part_spec.end_part: %u",
part_spec.start_part, part_spec.end_part));
/*
If partition pruning has found no partition in set
@@ -3480,7 +3482,7 @@ int ha_ndbcluster::close_scan()
Take over any pending transactions to the
deleteing/updating transaction before closing the scan
*/
- DBUG_PRINT("info", ("ops_pending: %llu", m_ops_pending));
+ DBUG_PRINT("info", ("ops_pending: %ld", (long) m_ops_pending));
if (execute_no_commit(this,trans,false) != 0) {
no_uncommitted_rows_execute_failure();
DBUG_RETURN(ndb_err(trans));
@@ -3876,7 +3878,7 @@ int ha_ndbcluster::end_bulk_insert()
NdbTransaction *trans= m_active_trans;
// Send rows to NDB
DBUG_PRINT("info", ("Sending inserts to NDB, "\
- "rows_inserted:%d, bulk_insert_rows: %d",
+ "rows_inserted: %d bulk_insert_rows: %d",
(int) m_rows_inserted, (int) m_bulk_insert_rows));
m_bulk_insert_not_flushed= FALSE;
if (m_transaction_on)
@@ -4286,8 +4288,8 @@ static int ndbcluster_commit(handlerton
while ((share= it++))
{
pthread_mutex_lock(&share->mutex);
- DBUG_PRINT("info", ("Invalidate commit_count for %s, commit_count: %llu ",
- share->key, share->commit_count));
+ DBUG_PRINT("info", ("Invalidate commit_count for %s, share->commit_count: %lu",
+ share->table_name, (ulong) share->commit_count));
share->commit_count= 0;
share->commit_count_lock++;
pthread_mutex_unlock(&share->mutex);
@@ -4690,8 +4692,7 @@ int ha_ndbcluster::create(const char *na
my_free((char*)data, MYF(0));
DBUG_RETURN(2);
}
-
- DBUG_PRINT("info", ("setFrm data=%p len=%d", pack_data, pack_length));
+ DBUG_PRINT("info", ("setFrm data: 0x%lx len: %d", (long) pack_data, pack_length));
tab.setFrm(pack_data, pack_length);
my_free((char*)data, MYF(0));
my_free((char*)pack_data, MYF(0));
@@ -5107,8 +5108,10 @@ int ha_ndbcluster::add_index(TABLE *tabl
table_arg->s->table_name.str));
int error= 0;
uint idx;
-
+ DBUG_ENTER("ha_ndbcluster::add_index");
+ DBUG_PRINT("enter", ("table %s", table_arg->s->table_name.str));
DBUG_ASSERT(m_share->state == NSS_ALTERED);
+
for (idx= 0; idx < num_of_keys; idx++)
{
KEY *key= key_info + idx;
@@ -6664,7 +6667,7 @@ static int ndbcluster_end(handlerton *ht
void ha_ndbcluster::print_error(int error, myf errflag)
{
DBUG_ENTER("ha_ndbcluster::print_error");
- DBUG_PRINT("enter", ("error = %d", error));
+ DBUG_PRINT("enter", ("error: %d", error));
if (error == HA_ERR_NO_PARTITION_FOUND)
m_part_info->print_no_partition_found(table);
@@ -7168,20 +7171,22 @@ static byte *ndbcluster_get_key(NDB_SHAR
static void print_share(const char* where, NDB_SHARE* share)
{
- fprintf(DBUG_FILE,
- "%s %s.%s: use_count: %u, commit_count: %llu\n",
- where, share->db, share->table_name, share->use_count,
- share->commit_count);
- fprintf(DBUG_FILE,
- " - key: %s, key_length: %d\n",
- share->key, share->key_length);
-
+ DBUG_ENTER("dbug_print_open_tables");
+ for (uint i= 0; i < ndbcluster_open_tables.records; i++)
+ {
+ NDB_SHARE *share= (NDB_SHARE*) hash_element(&ndbcluster_open_tables, i);
+ DBUG_PRINT("loop",
+ ("[%d] 0x%lx key: %s key_length: %d",
+ i, (long) share, share->key, share->key_length));
+ DBUG_PRINT("loop",
+ ("db.tablename: %s.%s use_count: %d commit_count: %lu",
+ share->db, share->table_name,
+ share->use_count, (ulong) share->commit_count));
#ifdef HAVE_NDB_BINLOG
if (share->table)
- fprintf(DBUG_FILE,
- " - share->table: %p %s.%s\n",
- share->table, share->table->s->db.str,
- share->table->s->table_name.str);
+ DBUG_PRINT("loop",
+ ("table->s->db.table_name: %s.%s",
+ share->table->s->db.str, share->table->s->table_name.str));
#endif
}
@@ -7353,7 +7358,13 @@ static int rename_share(NDB_SHARE *share
share->table_name= share->db + strlen(share->db) + 1;
ha_ndbcluster::set_tabname(new_key, share->table_name);
- dbug_print_share("rename_share:", share);
+ DBUG_PRINT("info",
+ ("share: 0x%lx key: %s key_length: %d",
+ (long) share, share->key, share->key_length));
+ DBUG_PRINT("info",
+ ("db.tablename: %s.%s use_count: %d commit_count: %lu",
+ share->db, share->table_name,
+ share->use_count, (ulong) share->commit_count));
if (share->table)
{
if (share->op == 0)
@@ -7383,7 +7394,14 @@ NDB_SHARE *ndbcluster_get_share(NDB_SHAR
share->use_count++;
dbug_print_open_tables();
- dbug_print_share("ndbcluster_get_share:", share);
+
+ DBUG_PRINT("info",
+ ("share: 0x%lx key: %s key_length: %d",
+ (long) share, share->key, share->key_length));
+ DBUG_PRINT("info",
+ ("db.tablename: %s.%s use_count: %d commit_count: %lu",
+ share->db, share->table_name,
+ share->use_count, (ulong) share->commit_count));
pthread_mutex_unlock(&ndbcluster_mutex);
return share;
}
@@ -7474,7 +7492,14 @@ NDB_SHARE *ndbcluster_get_share(const ch
share->use_count++;
dbug_print_open_tables();
- dbug_print_share("ndbcluster_get_share:", share);
+
+ DBUG_PRINT("info",
+ ("0x%lx key: %s key_length: %d key: %s",
+ (long) share, share->key, share->key_length, key));
+ DBUG_PRINT("info",
+ ("db.tablename: %s.%s use_count: %d commit_count: %lu",
+ share->db, share->table_name,
+ share->use_count, (ulong) share->commit_count));
if (!have_lock)
pthread_mutex_unlock(&ndbcluster_mutex);
DBUG_RETURN(share);
@@ -7484,7 +7509,12 @@ NDB_SHARE *ndbcluster_get_share(const ch
void ndbcluster_real_free_share(NDB_SHARE **share)
{
DBUG_ENTER("ndbcluster_real_free_share");
- dbug_print_share("ndbcluster_real_free_share:", *share);
+ DBUG_PRINT("enter",
+ ("share: 0x%lx key: %s key_length: %d "
+ "db.tablename: %s.%s use_count: %d commit_count: %lu",
+ (long) (*share), (*share)->key, (*share)->key_length,
+ (*share)->db, (*share)->table_name,
+ (*share)->use_count, (ulong) (*share)->commit_count));
hash_delete(&ndbcluster_open_tables, (byte*) *share);
thr_lock_delete(&(*share)->lock);
@@ -7527,7 +7557,13 @@ void ndbcluster_free_share(NDB_SHARE **s
else
{
dbug_print_open_tables();
- dbug_print_share("ndbcluster_free_share:", *share);
+ DBUG_PRINT("info",
+ ("share: 0x%lx key: %s key_length: %d",
+ (long) *share, (*share)->key, (*share)->key_length));
+ DBUG_PRINT("info",
+ ("db.tablename: %s.%s use_count: %d commit_count: %lu",
+ (*share)->db, (*share)->table_name,
+ (*share)->use_count, (ulong) (*share)->commit_count));
}
if (!have_lock)
pthread_mutex_unlock(&ndbcluster_mutex);
@@ -7797,7 +7833,7 @@ ha_ndbcluster::read_multi_range_first(KE
get_partition_set(table, curr, active_index,
&multi_range_curr->start_key,
&part_spec);
- DBUG_PRINT("info", ("part_spec.start_part = %u, part_spec.end_part = %u",
+ DBUG_PRINT("info", ("part_spec.start_part: %u part_spec.end_part: %u",
part_spec.start_part, part_spec.end_part));
/*
If partition pruning has found no partition in set
@@ -8247,7 +8283,7 @@ pthread_handler_t ndb_util_thread_func(v
&abstime);
pthread_mutex_unlock(&LOCK_ndb_util_thread);
#ifdef NDB_EXTRA_DEBUG_UTIL_THREAD
- DBUG_PRINT("ndb_util_thread", ("Started, ndb_cache_check_time: %d",
+ DBUG_PRINT("ndb_util_thread", ("Started, ndb_cache_check_time: %lu",
ndb_cache_check_time));
#endif
if (abort_loop)
@@ -8325,8 +8361,8 @@ pthread_handler_t ndb_util_thread_func(v
ndbtab_g.get_table(), &stat) == 0)
{
char buff[22], buff2[22];
- DBUG_PRINT("ndb_util_thread",
- ("Table: %s, commit_count: %s, rows: %s",
+ DBUG_PRINT("info",
+ ("Table: %s commit_count: %s rows: %s",
share->key,
llstr(stat.commit_count, buff),
llstr(stat.row_count, buff2)));
@@ -9167,7 +9203,7 @@ void ndb_serialize_cond(const Item *item
if (context->expecting(Item::INT_ITEM))
{
Item_int *int_item= (Item_int *) item;
- DBUG_PRINT("info", ("value %llu", int_item->value));
+ DBUG_PRINT("info", ("value %ld", (long) int_item->value));
NDB_ITEM_QUALIFICATION q;
q.value_type= Item::INT_ITEM;
curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item);
--- 1.52/mysql-test/t/alter_table.test 2006-11-29 22:49:08 -05:00
+++ 1.53/mysql-test/t/alter_table.test 2006-11-29 22:49:08 -05:00
@@ -402,6 +402,24 @@ alter table test.t1 rename test.t1;
use test;
drop table t1;
+#
+# Bug#24219 - ALTER TABLE ... RENAME TO ... , DISABLE KEYS leads to crash
+#
+--disable_warnings
+DROP TABLE IF EXISTS bug24219;
+DROP TABLE IF EXISTS bug24219_2;
+--enable_warnings
+
+CREATE TABLE bug24219 (a INT, INDEX(a));
+
+SHOW INDEX FROM bug24219;
+
+ALTER TABLE bug24219 RENAME TO bug24219_2, DISABLE KEYS;
+
+SHOW INDEX FROM bug24219_2;
+
+DROP TABLE bug24219_2;
+
# End of 4.1 tests
#
--- 1.12/mysql-test/t/limit.test 2006-11-29 22:49:08 -05:00
+++ 1.13/mysql-test/t/limit.test 2006-11-29 22:49:08 -05:00
@@ -7,7 +7,7 @@ drop table if exists t1;
--enable_warnings
create table t1 (a int not null default 0 primary key, b int not null default 0);
-insert into t1 () values (); -- Testing default values
+insert into t1 () values (); # Testing default values
insert into t1 values (1,1),(2,1),(3,1);
update t1 set a=4 where b=1 limit 1;
select * from t1;
--- 1.83/mysql-test/r/query_cache.result 2006-11-29 22:49:08 -05:00
+++ 1.84/mysql-test/r/query_cache.result 2006-11-29 22:49:08 -05:00
@@ -1278,3 +1278,51 @@ Variable_name Value
Last_query_cost 0.000000
drop table t1;
SET GLOBAL query_cache_size=0;
+set global query_cache_size=1024*1024;
+flush status;
+create table t1 (a int);
+insert into t1 (a) values (1), (2), (3);
+select * from t1;
+a
+1
+2
+3
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 0
+select * from t1;
+a
+1
+2
+3
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 1
+create table t2 like t1;
+select * from t1;
+a
+1
+2
+3
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 2
+insert into t2 select * from t1;
+select * from t1;
+a
+1
+2
+3
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 3
+drop table t1, t2;
+create table t1(c1 int);
+create table t2(c1 int);
+create table t3(c1 int);
+create view v1 as select t3.c1 as c1 from t3,t2 where t3.c1 = t2.c1;
+start transaction;
+insert into t1(c1) select c1 from v1;
+drop table t1, t2, t3;
+drop view v1;
+set global query_cache_size=0;
--- 1.64/mysql-test/t/query_cache.test 2006-11-29 22:49:08 -05:00
+++ 1.65/mysql-test/t/query_cache.test 2006-11-29 22:49:08 -05:00
@@ -879,3 +879,32 @@ select * from t1 where a > 3;
show status like 'last_query_cost';
drop table t1;
SET GLOBAL query_cache_size=0;
+
+#
+# Bug #20045: Server crash on INSERT ... SELECT ... FROM non-mergeable view
+#
+set global query_cache_size=1024*1024;
+flush status;
+create table t1 (a int);
+insert into t1 (a) values (1), (2), (3);
+select * from t1;
+show status like 'Qcache_hits';
+select * from t1;
+show status like 'Qcache_hits';
+create table t2 like t1;
+select * from t1;
+show status like 'Qcache_hits';
+insert into t2 select * from t1;
+select * from t1;
+show status like 'Qcache_hits';
+drop table t1, t2;
+
+create table t1(c1 int);
+create table t2(c1 int);
+create table t3(c1 int);
+create view v1 as select t3.c1 as c1 from t3,t2 where t3.c1 = t2.c1;
+start transaction;
+insert into t1(c1) select c1 from v1;
+drop table t1, t2, t3;
+drop view v1;
+set global query_cache_size=0;
--- 1.49/scripts/mysql_fix_privilege_tables.sql 2006-11-29 22:49:08 -05:00
+++ 1.50/scripts/mysql_fix_privilege_tables.sql 2006-11-29 22:49:08 -05:00
@@ -1,13 +1,13 @@
--- This script converts any old privilege tables to privilege tables suitable
--- for this version of MySQL
+# This script converts any old privilege tables to privilege tables suitable
+# for this version of MySQL
--- You can safely ignore all 'Duplicate column' and 'Unknown column' errors"
--- because these just mean that your tables are already up to date.
--- This script is safe to run even if your tables are already up to date!
-
--- On unix, you should use the mysql_fix_privilege_tables script to execute
--- this sql script.
--- On windows you should do 'mysql --force mysql < mysql_fix_privilege_tables.sql'
+# You can safely ignore all 'Duplicate column' and 'Unknown column' errors"
+# because these just mean that your tables are already up to date.
+# This script is safe to run even if your tables are already up to date!
+
+# On unix, you should use the mysql_fix_privilege_tables script to execute
+# this sql script.
+# On windows you should do 'mysql --force mysql < mysql_fix_privilege_tables.sql'
set storage_engine=MyISAM;
@@ -27,7 +27,7 @@ CREATE TABLE IF NOT EXISTS plugin (
ALTER TABLE user add File_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL;
--- Detect whether or not we had the Grant_priv column
+# Detect whether or not we had the Grant_priv column
SET @hadGrantPriv:=0;
SELECT @hadGrantPriv:=1 FROM user WHERE Grant_priv LIKE '%';
@@ -35,14 +35,14 @@ ALTER TABLE user add Grant_priv enum('N'
ALTER TABLE host add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL;
ALTER TABLE db add Grant_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL;
--- Fix privileges for old tables
+# Fix privileges for old tables
UPDATE user SET Grant_priv=File_priv,References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0;
UPDATE db SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0;
UPDATE host SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0;
---
--- The second alter changes ssl_type to new 4.0.2 format
--- Adding columns needed by GRANT .. REQUIRE (openssl)"
+#
+# The second alter changes ssl_type to new 4.0.2 format
+# Adding columns needed by GRANT .. REQUIRE (openssl)"
ALTER TABLE user
ADD ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci NOT NULL,
@@ -51,9 +51,9 @@ ADD x509_issuer BLOB NOT NULL,
ADD x509_subject BLOB NOT NULL;
ALTER TABLE user MODIFY ssl_type enum('','ANY','X509', 'SPECIFIED') NOT NULL;
---
--- Create tables_priv and columns_priv if they don't exists
---
+#
+# Create tables_priv and columns_priv if they don't exists
+#
CREATE TABLE IF NOT EXISTS tables_priv (
Host char(60) binary DEFAULT '' NOT NULL,
@@ -66,7 +66,7 @@ CREATE TABLE IF NOT EXISTS tables_priv (
Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL,
PRIMARY KEY (Host,Db,User,Table_name)
) CHARACTER SET utf8 COLLATE utf8_bin;
--- Fix collation of set fields
+# Fix collation of set fields
ALTER TABLE tables_priv
modify Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') COLLATE utf8_general_ci DEFAULT '' NOT NULL,
modify Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL;
@@ -88,26 +88,26 @@ CREATE TABLE IF NOT EXISTS columns_priv
Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL,
PRIMARY KEY (Host,Db,User,Table_name,Column_name)
) CHARACTER SET utf8 COLLATE utf8_bin;
--- Fix collation of set fields
+# Fix collation of set fields
ALTER TABLE columns_priv
MODIFY Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL;
---
--- Name change of Type -> Column_priv from MySQL 3.22.12
---
+#
+# Name change of Type -> Column_priv from MySQL 3.22.12
+#
ALTER TABLE columns_priv change Type Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL;
---
--- Add the new 'type' column to the func table.
---
+#
+# Add the new 'type' column to the func table.
+#
ALTER TABLE func add type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL;
---
--- Change the user,db and host tables to MySQL 4.0 format
---
+#
+# Change the user,db and host tables to MySQL 4.0 format
+#
# Detect whether we had Show_db_priv
SET @hadShowDbPriv:=0;
@@ -122,22 +122,22 @@ ADD Execute_priv enum('N','Y') COLLATE u
ADD Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Execute_priv,
ADD Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Repl_slave_priv;
--- Convert privileges so that users have similar privileges as before
+# Convert privileges so that users have similar privileges as before
UPDATE user SET Show_db_priv= Select_priv, Super_priv=Process_priv, Execute_priv=Process_priv, Create_tmp_table_priv='Y', Lock_tables_priv='Y', Repl_slave_priv=file_priv, Repl_client_priv=File_priv where user<>"" AND @hadShowDbPriv = 0;
--- Add fields that can be used to limit number of questions and connections
--- for some users.
+# Add fields that can be used to limit number of questions and connections
+# for some users.
ALTER TABLE user
ADD max_questions int(11) NOT NULL DEFAULT 0 AFTER x509_subject,
ADD max_updates int(11) unsigned NOT NULL DEFAULT 0 AFTER max_questions,
ADD max_connections int(11) unsigned NOT NULL DEFAULT 0 AFTER max_updates;
---
--- Add Create_tmp_table_priv and Lock_tables_priv to db and host
---
+#
+# Add Create_tmp_table_priv and Lock_tables_priv to db and host
+#
ALTER TABLE db
ADD Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
@@ -156,8 +156,8 @@ alter table func comment='User defined f
alter table tables_priv comment='Table privileges';
alter table columns_priv comment='Column privileges';
--- Convert all tables to UTF-8 with binary collation
--- and reset all char columns to correct width
+# Convert all tables to UTF-8 with binary collation
+# and reset all char columns to correct width
ALTER TABLE user
MODIFY Host char(60) NOT NULL default '',
MODIFY User char(16) NOT NULL default '',
@@ -412,7 +412,7 @@ Time_zone_id int unsigned NOT NULL auto_
Use_leap_seconds enum('Y','N') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
PRIMARY KEY TzId (Time_zone_id)
) CHARACTER SET utf8 comment='Time zones';
--- Make enum field case-insensitive
+# Make enum field case-insensitive
ALTER TABLE time_zone
MODIFY Use_leap_seconds enum('Y','N') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL;
@@ -554,9 +554,9 @@ ALTER TABLE proc MODIFY db
MODIFY comment
char(64) collate utf8_bin DEFAULT '' NOT NULL;
---
--- Create missing log tables (5.1)
---
+#
+# Create missing log tables (5.1)
+#
delimiter //
CREATE PROCEDURE create_log_tables()
@@ -704,9 +704,9 @@ ALTER TABLE event ADD sql_mode
UPDATE user SET Event_priv=Super_priv WHERE @hadEventPriv = 0;
ALTER TABLE event MODIFY name char(64) CHARACTER SET utf8 NOT NULL default '';
---
--- TRIGGER privilege
---
+#
+# TRIGGER privilege
+#
SET @hadTriggerPriv := 0;
SELECT @hadTriggerPriv :=1 FROM user WHERE Trigger_priv LIKE '%';
@@ -723,6 +723,8 @@ ALTER TABLE db MODIFY Trigger_priv enum(
ALTER TABLE tables_priv MODIFY Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') COLLATE utf8_general_ci DEFAULT '' NOT NULL;
UPDATE user SET Trigger_priv=Super_priv WHERE @hadTriggerPriv = 0;
+
+CREATE TABLE IF NOT EXISTS binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM;
# Activate the new, possible modified privilege tables
# This should not be needed, but gives us some extra testing that the above
--- 1.11/mysql-test/r/udf.result 2006-11-29 22:49:08 -05:00
+++ 1.12/mysql-test/r/udf.result 2006-11-29 22:49:09 -05:00
@@ -210,3 +210,38 @@ DROP FUNCTION sequence;
DROP FUNCTION lookup;
DROP FUNCTION reverse_lookup;
DROP FUNCTION avgcost;
+CREATE FUNCTION is_const RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
+select
+is_const(3) as const,
+is_const(3.14) as const,
+is_const('fnord') as const,
+is_const(2+3) as const,
+is_const(rand()) as 'nc rand()',
+is_const(sin(3.14)) as const,
+is_const(upper('test')) as const;
+const const const const nc rand() const const
+const const const const not const const const
+create table bug18761 (n int);
+insert into bug18761 values (null),(2);
+select
+is_const(3) as const,
+is_const(3.14) as const,
+is_const('fnord') as const,
+is_const(2+3) as const,
+is_const(2+n) as 'nc 2+n ',
+is_const(sin(n)) as 'nc sin(n)',
+is_const(sin(3.14)) as const,
+is_const(upper('test')) as const,
+is_const(rand()) as 'nc rand()',
+is_const(n) as 'nc n ',
+is_const(is_const(n)) as 'nc ic?(n)',
+is_const(is_const('c')) as const
+from
+bug18761;
+const const const const nc 2+n nc sin(n) const const nc rand() nc n nc ic?(n) const
+const const const const not const not const const const not const not const not const const
+const const const const not const not const const const not const not const not const const
+drop table bug18761;
+select is_const((1,2,3));
+ERROR 21000: Operand should contain 1 column(s)
+drop function if exists is_const;
--- 1.11/mysql-test/t/udf.test 2006-11-29 22:49:09 -05:00
+++ 1.12/mysql-test/t/udf.test 2006-11-29 22:49:09 -05:00
@@ -223,4 +223,41 @@ DROP FUNCTION lookup;
DROP FUNCTION reverse_lookup;
DROP FUNCTION avgcost;
+#
+# Bug#18761: constant expression as UDF parameters not passed in as constant
+#
+--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
+eval CREATE FUNCTION is_const RETURNS STRING SONAME "$UDF_EXAMPLE_LIB";
+select
+ is_const(3) as const,
+ is_const(3.14) as const,
+ is_const('fnord') as const,
+ is_const(2+3) as const,
+ is_const(rand()) as 'nc rand()',
+ is_const(sin(3.14)) as const,
+ is_const(upper('test')) as const;
+
+create table bug18761 (n int);
+insert into bug18761 values (null),(2);
+select
+ is_const(3) as const,
+ is_const(3.14) as const,
+ is_const('fnord') as const,
+ is_const(2+3) as const,
+ is_const(2+n) as 'nc 2+n ',
+ is_const(sin(n)) as 'nc sin(n)',
+ is_const(sin(3.14)) as const,
+ is_const(upper('test')) as const,
+ is_const(rand()) as 'nc rand()',
+ is_const(n) as 'nc n ',
+ is_const(is_const(n)) as 'nc ic?(n)',
+ is_const(is_const('c')) as const
+from
+ bug18761;
+drop table bug18761;
+
+--error 1241
+select is_const((1,2,3));
+
+drop function if exists is_const;
--- 1.28/mysql-test/t/mysql.test 2006-11-29 22:49:09 -05:00
+++ 1.29/mysql-test/t/mysql.test 2006-11-29 22:49:09 -05:00
@@ -241,4 +241,23 @@ drop table t17583;
--error 1
--exec $MYSQL test -e "\r test cyrils_superlonghostnameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" 2>&1
+
+#
+# Bug #21412: mysql cmdline client allows backslash(es)
+# as delimiter but can't recognize them
+#
+
+# This should work just fine...
+--exec echo "DELIMITER /" > $MYSQLTEST_VARDIR/tmp/bug21412.sql
+--exec echo "SELECT 1/" >> $MYSQLTEST_VARDIR/tmp/bug21412.sql
+--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug21412.sql 2>&1
+
+# This should give an error...
+--exec echo "DELIMITER \\" > $MYSQLTEST_VARDIR/tmp/bug21412.sql
+--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug21412.sql 2>&1
+
+# As should this...
+--exec echo "DELIMITER \\\\" > $MYSQLTEST_VARDIR/tmp/bug21412.sql
+--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug21412.sql 2>&1
+
--echo End of 5.0 tests
--- 1.250/client/mysqltest.c 2006-11-29 22:49:09 -05:00
+++ 1.251/client/mysqltest.c 2006-11-29 22:49:09 -05:00
@@ -4201,8 +4201,9 @@ void init_win_path_patterns()
/* List of string patterns to match in order to find paths */
const char* paths[] = { "$MYSQL_TEST_DIR",
"$MYSQL_TMP_DIR",
- "./test/", 0 };
- int num_paths= 3;
+ "$MYSQLTEST_VARDIR",
+ "./test/" };
+ int num_paths= sizeof(paths)/sizeof(char*);
int i;
char* p;
@@ -4222,6 +4223,13 @@ void init_win_path_patterns()
else
p= my_strdup(paths[i], MYF(MY_FAE));
+ /* Don't insert zero length strings in patterns array */
+ if (strlen(p) == 0)
+ {
+ my_free(p, MYF(0));
+ continue;
+ }
+
if (insert_dynamic(&patterns, (gptr) &p))
die(NullS);
@@ -4271,7 +4279,7 @@ void fix_win_paths(const char *val, int
{
const char** pattern= dynamic_element(&patterns, i, const char**);
DBUG_PRINT("info", ("pattern: %s", *pattern));
- if (strlen(*pattern) == 0) continue;
+
/* Search for the path in string */
while ((p= strstr(val, *pattern)))
{
@@ -6524,7 +6532,7 @@ int reg_replace(char** buf_p, int* buf_l
{
my_regex_t r;
my_regmatch_t *subs;
- char *buf_end, *replace_end;
+ char *replace_end;
char *buf= *buf_p;
int len;
int buf_len, need_buf_len;
@@ -6543,8 +6551,6 @@ int reg_replace(char** buf_p, int* buf_l
res_p= buf;
SECURE_REG_BUF
-
- buf_end= buf + buf_len;
if (icase)
cflags|= REG_ICASE;
--- 1.236/mysql-test/r/sp.result 2006-11-29 22:49:09 -05:00
+++ 1.237/mysql-test/r/sp.result 2006-11-29 22:49:09 -05:00
@@ -2178,6 +2178,7 @@ set @stamped_time=in_time;
set x=2;
end if;
end|
+set time_zone='+03:00';
call bug3426(1000, @i)|
select @i, from_unixtime(@stamped_time, '%d-%m-%Y %h:%i:%s') as time|
@i time
@@ -5627,6 +5628,113 @@ Called B
drop procedure proc_21462_a|
drop procedure proc_21462_b|
End of 5.0 tests
+Begin of 5.1 tests
+drop function if exists pi;
+create function pi() returns varchar(50)
+return "pie, my favorite desert.";
+Warnings:
+Note 1578 This function 'pi' has the same name as a native function.
+SET @save_sql_mode=@@sql_mode;
+SET SQL_MODE='IGNORE_SPACE';
+select pi(), pi ();
+pi() pi ()
+3.141593 3.141593
+select test.pi(), test.pi ();
+test.pi() test.pi ()
+pie, my favorite desert. pie, my favorite desert.
+SET SQL_MODE='';
+select pi(), pi ();
+pi() pi ()
+3.141593 3.141593
+select test.pi(), test.pi ();
+test.pi() test.pi ()
+pie, my favorite desert. pie, my favorite desert.
+SET @@sql_mode=@save_sql_mode;
+drop function pi;
+drop function if exists test.database;
+drop function if exists test.current_user;
+drop function if exists test.md5;
+create database nowhere;
+use nowhere;
+drop database nowhere;
+SET @save_sql_mode=@@sql_mode;
+SET SQL_MODE='IGNORE_SPACE';
+select database(), database ();
+database() database ()
+NULL NULL
+select current_user(), current_user ();
+current_user() current_user ()
+root@localhost root@localhost
+select md5("aaa"), md5 ("aaa");
+md5("aaa") md5 ("aaa")
+47bce5c74f589f4867dbd57e9ca9f808 47bce5c74f589f4867dbd57e9ca9f808
+SET SQL_MODE='';
+select database(), database ();
+database() database ()
+NULL NULL
+select current_user(), current_user ();
+current_user() current_user ()
+root@localhost root@localhost
+select md5("aaa"), md5 ("aaa");
+md5("aaa") md5 ("aaa")
+47bce5c74f589f4867dbd57e9ca9f808 47bce5c74f589f4867dbd57e9ca9f808
+use test;
+create function `database`() returns varchar(50)
+return "Stored function database";
+Warnings:
+Note 1578 This function 'database' has the same name as a native function.
+create function `current_user`() returns varchar(50)
+return "Stored function current_user";
+Warnings:
+Note 1578 This function 'current_user' has the same name as a native function.
+create function md5(x varchar(50)) returns varchar(50)
+return "Stored function md5";
+Warnings:
+Note 1578 This function 'md5' has the same name as a native function.
+SET SQL_MODE='IGNORE_SPACE';
+select database(), database ();
+database() database ()
+test test
+select current_user(), current_user ();
+current_user() current_user ()
+root@localhost root@localhost
+select md5("aaa"), md5 ("aaa");
+md5("aaa") md5 ("aaa")
+47bce5c74f589f4867dbd57e9ca9f808 47bce5c74f589f4867dbd57e9ca9f808
+select test.database(), test.database ();
+test.database() test.database ()
+Stored function database Stored function database
+select test.current_user(), test.current_user ();
+test.current_user() test.current_user ()
+Stored function current_user Stored function current_user
+select test.md5("aaa"), test.md5 ("aaa");
+test.md5("aaa") test.md5 ("aaa")
+Stored function md5 Stored function md5
+SET SQL_MODE='';
+select database(), database ();
+database() database ()
+test test
+select current_user(), current_user ();
+current_user() current_user ()
+root@localhost root@localhost
+select md5("aaa"), md5 ("aaa");
+md5("aaa") md5 ("aaa")
+47bce5c74f589f4867dbd57e9ca9f808 47bce5c74f589f4867dbd57e9ca9f808
+select test.database(), test.database ();
+test.database() test.database ()
+Stored function database Stored function database
+select test.current_user(), test.current_user ();
+test.current_user() test.current_user ()
+Stored function current_user Stored function current_user
+select test.md5("aaa"), test.md5 ("aaa");
+test.md5("aaa") test.md5 ("aaa")
+Stored function md5 Stored function md5
+SET @@sql_mode=@save_sql_mode;
+drop function test.database;
+drop function test.current_user;
+drop function md5;
+use test;
+End of 5.1 tests
DROP TABLE IF EXISTS bug23760|
DROP TABLE IF EXISTS bug23760_log|
DROP PROCEDURE IF EXISTS bug23760_update_log|
--- 1.207/mysql-test/t/sp.test 2006-11-29 22:49:09 -05:00
+++ 1.208/mysql-test/t/sp.test 2006-11-29 22:49:09 -05:00
@@ -11,6 +11,7 @@
# Tests that uses 'goto' to into sp-goto.test (currently disabled)
# Tests that destroys system tables (e.g. mysql.proc) for error testing
# go to sp-destruct.
+# Tests that require --with-geometry go into sp_gis.test
use test;
@@ -2584,6 +2585,9 @@ begin
end if;
end|
+# so that from_unixtime() has a deterministic result
+set time_zone='+03:00';
+
call bug3426(1000, @i)|
select @i, from_unixtime(@stamped_time, '%d-%m-%Y %h:%i:%s') as time|
call bug3426(NULL, @i)|
@@ -6585,6 +6589,122 @@ drop procedure proc_21462_b|
--echo End of 5.0 tests
+--echo Begin of 5.1 tests
+
+#
+# BUG#18239: Possible to overload internal functions with stored functions
+#
+
+delimiter ;|
+
+--disable_warnings
+drop function if exists pi;
+--enable_warnings
+
+create function pi() returns varchar(50)
+return "pie, my favorite desert.";
+
+SET @save_sql_mode=@@sql_mode;
+
+SET SQL_MODE='IGNORE_SPACE';
+
+select pi(), pi ();
+
+# Non deterministic warnings from db_load_routine
+--disable_warnings
+select test.pi(), test.pi ();
+--enable_warnings
+
+SET SQL_MODE='';
+
+select pi(), pi ();
+
+# Non deterministic warnings from db_load_routine
+--disable_warnings
+select test.pi(), test.pi ();
+--enable_warnings
+
+SET @@sql_mode=@save_sql_mode;
+
+drop function pi;
+# End of BUG#18239
+
+#
+# BUG#22619: Spaces considered harmful
+#
+
+--disable_warnings
+drop function if exists test.database;
+drop function if exists test.current_user;
+drop function if exists test.md5;
+--enable_warnings
+
+create database nowhere;
+use nowhere;
+drop database nowhere;
+
+SET @save_sql_mode=@@sql_mode;
+
+SET SQL_MODE='IGNORE_SPACE';
+
+select database(), database ();
+select current_user(), current_user ();
+select md5("aaa"), md5 ("aaa");
+
+SET SQL_MODE='';
+
+select database(), database ();
+select current_user(), current_user ();
+select md5("aaa"), md5 ("aaa");
+
+use test;
+
+create function `database`() returns varchar(50)
+return "Stored function database";
+
+create function `current_user`() returns varchar(50)
+return "Stored function current_user";
+
+create function md5(x varchar(50)) returns varchar(50)
+return "Stored function md5";
+
+SET SQL_MODE='IGNORE_SPACE';
+
+select database(), database ();
+select current_user(), current_user ();
+select md5("aaa"), md5 ("aaa");
+
+# Non deterministic warnings from db_load_routine
+--disable_warnings
+select test.database(), test.database ();
+select test.current_user(), test.current_user ();
+select test.md5("aaa"), test.md5 ("aaa");
+--enable_warnings
+
+SET SQL_MODE='';
+
+select database(), database ();
+select current_user(), current_user ();
+select md5("aaa"), md5 ("aaa");
+
+# Non deterministic warnings from db_load_routine
+--disable_warnings
+select test.database(), test.database ();
+select test.current_user(), test.current_user ();
+select test.md5("aaa"), test.md5 ("aaa");
+--enable_warnings
+
+SET @@sql_mode=@save_sql_mode;
+
+drop function test.database;
+drop function test.current_user;
+drop function md5;
+
+use test;
+delimiter |;
+# End of BUG#22619
+
+--echo End of 5.1 tests
#
# BUG#23760: ROW_COUNT() and store procedure not owrking together
--- 1.125/mysql-test/t/mysqldump.test 2006-11-29 22:49:09 -05:00
+++ 1.126/mysql-test/t/mysqldump.test 2006-11-29 22:49:09 -05:00
@@ -1394,6 +1394,9 @@ revoke all privileges on mysqldump_myDB.
drop user myDB_User@localhost;
drop database mysqldump_myDB;
use test;
+connection default;
+disconnect root;
+disconnect user1;
--echo #
--echo # BUG#13926: --order-by-primary fails if PKEY contains quote character
--- 1.263/BitKeeper/etc/ignore 2006-11-29 22:49:09 -05:00
+++ 1.264/BitKeeper/etc/ignore 2006-11-29 22:49:09 -05:00
@@ -379,6 +379,7 @@ client/sql_string.cpp
client/ssl_test
client/thimble
client/thread_test
+client/tmp.diff
client_debug/*
client_release/*
client_test
@@ -1325,10 +1326,12 @@ mysql-test/r/slave-running.eval
mysql-test/r/slave-stopped.eval
mysql-test/r/symlink.log
mysql-test/r/system_mysql_db.log
+mysql-test/r/tmp.result
mysql-test/r/udf.log
mysql-test/share/mysql
mysql-test/std_data/*.pem
mysql-test/t/index_merge.load
+mysql-test/t/tmp.test
mysql-test/var
mysql-test/var/*
mysql.kdevprj
--- 1.87/sql/sql_handler.cc 2006-11-29 22:49:09 -05:00
+++ 1.88/sql/sql_handler.cc 2006-11-29 22:49:09 -05:00
@@ -757,3 +757,41 @@ static int mysql_ha_flush_table(THD *thd
DBUG_RETURN(0);
}
+
+
+/*
+ Mark tables for reopen.
+
+ SYNOPSIS
+ mysql_ha_mark_tables_for_reopen()
+ thd Thread identifier.
+ table Table list to mark for reopen.
+
+ DESCRIPTION
+ For each table found in the handler hash mark it as closed
+ (ready for reopen) and end all index/table scans.
+
+ NOTE
+ The caller must lock LOCK_open.
+*/
+
+void mysql_ha_mark_tables_for_reopen(THD *thd, TABLE *table)
+{
+ DBUG_ENTER("mysql_ha_mark_tables_for_reopen");
+
+ safe_mutex_assert_owner(&LOCK_open);
+ for (; table; table= table->next)
+ {
+ TABLE_LIST *hash_tables;
+ if ((hash_tables= (TABLE_LIST*) hash_search(&thd->handler_tables_hash,
+ (byte*) table->alias,
+ strlen(table->alias) + 1)))
+ {
+ /* Mark table as ready for reopen. */
+ hash_tables->table= NULL;
+ /* End open index/table scans. */
+ table->file->ha_index_or_rnd_end();
+ }
+ }
+ DBUG_VOID_RETURN;
+}
--- 1.91/mysql-test/r/ps.result 2006-11-29 22:49:09 -05:00
+++ 1.92/mysql-test/r/ps.result 2006-11-29 22:49:09 -05:00
@@ -1509,9 +1509,9 @@ create procedure proc_1() reset query ca
call proc_1();
call proc_1();
call proc_1();
-create function func_1() returns int begin reset query cache; return 1; end|
+create function func_1() returns int deterministic begin reset query cache; return 1; end|
ERROR 0A000: RESET is not allowed in stored function or trigger
-create function func_1() returns int begin call proc_1(); return 1; end|
+create function func_1() returns int deterministic begin call proc_1(); return 1; end|
select func_1(), func_1(), func_1() from dual;
ERROR 0A000: RESET is not allowed in stored function or trigger
drop function func_1;
--- 1.90/mysql-test/t/ps.test 2006-11-29 22:49:09 -05:00
+++ 1.91/mysql-test/t/ps.test 2006-11-29 22:49:09 -05:00
@@ -1564,8 +1564,8 @@ call proc_1();
call proc_1();
delimiter |;
--error ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG
-create function func_1() returns int begin reset query cache; return 1; end|
-create function func_1() returns int begin call proc_1(); return 1; end|
+create function func_1() returns int deterministic begin reset query cache; return 1; end|
+create function func_1() returns int deterministic begin call proc_1(); return 1; end|
delimiter ;|
--error ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG
select func_1(), func_1(), func_1() from dual;
--- 1.23/extra/yassl/src/ssl.cpp 2006-11-29 22:49:09 -05:00
+++ 1.24/extra/yassl/src/ssl.cpp 2006-11-29 22:49:09 -05:00
@@ -184,10 +184,22 @@ SSL_METHOD* TLSv1_client_method()
}
+SSL_METHOD* TLSv1_1_server_method()
+{
+ return NEW_YS SSL_METHOD(server_end, ProtocolVersion(3,2));
+}
+
+
+SSL_METHOD* TLSv1_1_client_method()
+{
+ return NEW_YS SSL_METHOD(client_end, ProtocolVersion(3,2));
+}
+
+
SSL_METHOD* SSLv23_server_method()
{
// compatibility only, no version 2 support, but does SSL 3 and TLS 1
- return NEW_YS SSL_METHOD(server_end, ProtocolVersion(3,1), true);
+ return NEW_YS SSL_METHOD(server_end, ProtocolVersion(3,2), true);
}
@@ -196,7 +208,7 @@ SSL_METHOD* SSLv23_client_method()
// compatibility only, no version 2 support, but does SSL 3 and TLS 1
// though it sends TLS1 hello not SSLv2 so SSLv3 only servers will decline
// TODO: maybe add support to send SSLv2 hello ???
- return NEW_YS SSL_METHOD(client_end, ProtocolVersion(3,1), true);
+ return NEW_YS SSL_METHOD(client_end, ProtocolVersion(3,2), true);
}
@@ -407,7 +419,6 @@ int SSL_shutdown(SSL* ssl)
Alert alert(warning, close_notify);
sendAlert(*ssl, alert);
ssl->useLog().ShowTCP(ssl->getSocket().get_fd(), true);
- ssl->useSocket().closeSocket();
GetErrors().Remove();
@@ -415,8 +426,21 @@ int SSL_shutdown(SSL* ssl)
}
+/* on by default but allow user to turn off */
+long SSL_CTX_set_session_cache_mode(SSL_CTX* ctx, long mode)
+{
+ if (mode == SSL_SESS_CACHE_OFF)
+ ctx->SetSessionCacheOff();
+
+ return SSL_SUCCESS;
+}
+
+
SSL_SESSION* SSL_get_session(SSL* ssl)
{
+ if (ssl->getSecurity().GetContext()->GetSessionCacheOff())
+ return 0;
+
return GetSessions().lookup(
ssl->getSecurity().get_connection().sessionID_);
}
@@ -424,6 +448,9 @@ SSL_SESSION* SSL_get_session(SSL* ssl)
int SSL_set_session(SSL* ssl, SSL_SESSION* session)
{
+ if (ssl->getSecurity().GetContext()->GetSessionCacheOff())
+ return SSL_FAILURE;
+
ssl->set_session(session);
return SSL_SUCCESS;
}
@@ -512,6 +539,19 @@ int SSL_get_error(SSL* ssl, int /*previo
}
+
+/* turn on yaSSL zlib compression
+ returns 0 for success, else error (not built in)
+ only need to turn on for client, becuase server on by default if built in
+ but calling for server will tell you whether it's available or not
+*/
+int SSL_set_compression(SSL* ssl)
+{
+ return ssl->SetCompression();
+}
+
+
+
X509* SSL_get_peer_certificate(SSL* ssl)
{
return ssl->getCrypto().get_certManager().get_peerX509();
@@ -1359,6 +1399,56 @@ int SSL_pending(SSL* ssl)
}
+void SSL_CTX_set_default_passwd_cb(SSL_CTX* ctx, pem_password_cb cb)
+{
+ ctx->SetPasswordCb(cb);
+}
+
+
+int SSLeay_add_ssl_algorithms() // compatibility only
+{
+ return 1;
+}
+
+
+void ERR_remove_state(unsigned long)
+{
+ GetErrors().Remove();
+}
+
+
+int ERR_GET_REASON(int l)
+{
+ return l & 0xfff;
+}
+
+
+unsigned long err_helper(bool peek = false)
+{
+ int ysError = GetErrors().Lookup(peek);
+
+ // translate cert error for libcurl, it uses OpenSSL hex code
+ switch (ysError) {
+ case TaoCrypt::SIG_OTHER_E:
+ return CERTFICATE_ERROR;
+ break;
+ default :
+ return 0;
+ }
+}
+
+
+unsigned long ERR_peek_error()
+{
+ return err_helper(true);
+}
+
+
+unsigned long ERR_get_error()
+{
+ return err_helper();
+}
+
// functions for stunnel
@@ -1477,13 +1567,6 @@ int SSL_pending(SSL* ssl)
}
- long SSL_CTX_set_session_cache_mode(SSL_CTX*, long)
- {
- // TDOD:
- return SSL_SUCCESS;
- }
-
-
long SSL_CTX_set_timeout(SSL_CTX*, long)
{
// TDOD:
@@ -1498,12 +1581,6 @@ int SSL_pending(SSL* ssl)
}
- void SSL_CTX_set_default_passwd_cb(SSL_CTX* ctx, pem_password_cb cb)
- {
- ctx->SetPasswordCb(cb);
- }
-
-
int SSL_CTX_use_RSAPrivateKey_file(SSL_CTX*, const char*, int)
{
// TDOD:
@@ -1554,49 +1631,6 @@ int SSL_pending(SSL* ssl)
return 0;
}
-
- int SSLeay_add_ssl_algorithms() // compatibility only
- {
- return 1;
- }
-
-
- void ERR_remove_state(unsigned long)
- {
- GetErrors().Remove();
- }
-
-
- int ERR_GET_REASON(int l)
- {
- return l & 0xfff;
- }
-
- unsigned long err_helper(bool peek = false)
- {
- int ysError = GetErrors().Lookup(peek);
-
- // translate cert error for libcurl, it uses OpenSSL hex code
- switch (ysError) {
- case TaoCrypt::SIG_OTHER_E:
- return CERTFICATE_ERROR;
- break;
- default :
- return 0;
- }
- }
-
-
- unsigned long ERR_peek_error()
- {
- return err_helper(true);
- }
-
-
- unsigned long ERR_get_error()
- {
- return err_helper();
- }
// end stunnel needs
--- 1.5/extra/yassl/taocrypt/include/algebra.hpp 2006-11-29 22:49:09 -05:00
+++ 1.6/extra/yassl/taocrypt/include/algebra.hpp 2006-11-29 22:49:09 -05:00
@@ -75,7 +75,8 @@ public:
typedef Integer Element;
AbstractRing() : AbstractGroup() {m_mg.m_pRing = this;}
- AbstractRing(const AbstractRing &source) :AbstractGroup() {m_mg.m_pRing = this;}
+ AbstractRing(const AbstractRing &source) : AbstractGroup()
+ {m_mg.m_pRing = this;}
AbstractRing& operator=(const AbstractRing &source) {return *this;}
virtual bool IsUnit(const Element &a) const =0;
--- 1.26.1.1/mysql-test/t/system_mysql_db_fix.test 2006-11-29 22:49:09 -05:00
+++ 1.29/mysql-test/t/system_mysql_db_fix30020.test 2006-11-29 22:49:09 -05:00
@@ -10,9 +10,11 @@
#
# This is the test for mysql_fix_privilege_tables
+# It checks that a system tables from mysql 3.20
+# can be upgraded to current system table format
#
# Note: If this test fails, don't be confused about the errors reported
-# by mysql-test-run; This shows warnings from generated by
+# by mysql-test-run This shows warnings generated by
# mysql_fix_system_tables which should be ignored.
# Instead, concentrate on the errors in r/system_mysql_db.reject
@@ -85,7 +87,7 @@ INSERT INTO user VALUES ('localhost','ro
INSERT INTO user VALUES ('localhost','', '','N','N','N','N','N','N','N','N','N');
# Call the "shell script" $MYSQL_FIX_SYSTEM_TABLES using system
--- system $MYSQL_FIX_SYSTEM_TABLES --database=test > /dev/null
+-- system $MYSQL_FIX_SYSTEM_TABLES --database=test > $MYSQLTEST_VARDIR/log/system_mysql_db_fix30020.log 2>&1
-- enable_query_log
-- enable_result_log
| Thread |
|---|
| • bk commit into 5.1 tree (cmiller:1.2393) | Chad MILLER | 30 Nov |