Below is the list of changes that have just been committed into a local
5.1 repository of msvensson. When msvensson 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, 2007-02-06 15:46:17+01:00, msvensson@neptunus.(none) +47 -0
Merge neptunus.(none):/home/msvensson/mysql/mysql-5.1
into neptunus.(none):/home/msvensson/mysql/mysql-5.1-maint
MERGE: 1.2414.1.8
BitKeeper/etc/ignore@stripped, 2007-02-06 15:12:02+01:00, msvensson@neptunus.(none) +0 -0
auto-union
MERGE: 1.270.1.2
Makefile.am@stripped, 2007-02-06 15:12:09+01:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.113.1.1
cmd-line-utils/readline/display.c@stripped, 2007-02-06 15:12:09+01:00,
msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.15.1.1
configure.in@stripped, 2007-02-06 15:12:09+01:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.420.1.5
extra/yassl/include/buffer.hpp@stripped, 2007-02-06 15:12:09+01:00, msvensson@neptunus.(none)
+0 -0
Auto merged
MERGE: 1.6.1.1
extra/yassl/include/crypto_wrapper.hpp@stripped, 2007-02-06 15:12:09+01:00,
msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.5.1.1
extra/yassl/include/yassl_imp.hpp@stripped, 2007-02-06 15:12:09+01:00,
msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.7.1.1
extra/yassl/include/yassl_int.hpp@stripped, 2007-02-06 15:12:10+01:00,
msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.16.1.1
extra/yassl/src/crypto_wrapper.cpp@stripped, 2007-02-06 15:12:10+01:00,
msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.9.1.1
extra/yassl/taocrypt/include/algebra.hpp@stripped, 2007-02-06 15:12:10+01:00,
msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.8.1.1
extra/yassl/taocrypt/include/des.hpp@stripped, 2007-02-06 15:12:10+01:00,
msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.5.1.1
extra/yassl/taocrypt/include/hash.hpp@stripped, 2007-02-06 15:12:10+01:00,
msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.6.1.1
extra/yassl/taocrypt/include/hmac.hpp@stripped, 2007-02-06 15:12:10+01:00,
msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.6.1.1
extra/yassl/taocrypt/include/modarith.hpp@stripped, 2007-02-06 15:12:10+01:00,
msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.3.1.1
extra/yassl/taocrypt/include/modes.hpp@stripped, 2007-02-06 15:12:10+01:00,
msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.8.1.1
extra/yassl/taocrypt/include/rsa.hpp@stripped, 2007-02-06 15:12:10+01:00,
msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.4.1.1
extra/yassl/taocrypt/include/type_traits.hpp@stripped, 2007-02-06 15:12:10+01:00,
msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.3.1.1
extra/yassl/taocrypt/mySTL/list.hpp@stripped, 2007-02-06 15:12:10+01:00,
msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.1.1.1
extra/yassl/taocrypt/src/aes.cpp@stripped, 2007-02-06 15:12:10+01:00,
msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.5.1.1
extra/yassl/taocrypt/src/algebra.cpp@stripped, 2007-02-06 15:12:10+01:00,
msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.12.1.1
extra/yassl/taocrypt/src/asn.cpp@stripped, 2007-02-06 15:12:10+01:00,
msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.11.1.2
extra/yassl/taocrypt/test/test.cpp@stripped, 2007-02-06 15:46:13+01:00,
msvensson@neptunus.(none) +0 -0
Manual merge
MERGE: 1.4.1.1
extra/yassl/testsuite/testsuite.cpp@stripped, 2007-02-06 15:12:10+01:00,
msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.4.1.1
mysql-test/mysql-test-run.pl@stripped, 2007-02-06 15:12:10+01:00, msvensson@neptunus.(none)
+0 -0
Auto merged
MERGE: 1.261.1.3
mysql-test/r/grant.result@stripped, 2007-02-06 15:46:13+01:00, msvensson@neptunus.(none) +0
-0
Manual merge
MERGE: 1.62.1.1
mysql-test/r/mysqltest.result@stripped, 2007-02-06 15:12:10+01:00, msvensson@neptunus.(none)
+0 -0
Auto merged
MERGE: 1.50.1.1
mysql-test/r/select.result@stripped, 2007-02-06 15:46:13+01:00, msvensson@neptunus.(none)
+0 -0
Manual merge
MERGE: 1.143.1.3
mysql-test/t/grant.test@stripped, 2007-02-06 15:46:13+01:00, msvensson@neptunus.(none) +0 -1
Manual merge
MERGE: 1.47.1.3
mysql-test/t/mysqltest.test@stripped, 2007-02-06 15:12:10+01:00, msvensson@neptunus.(none)
+0 -0
Auto merged
MERGE: 1.62.1.1
mysql-test/t/select.test@stripped, 2007-02-06 15:46:13+01:00, msvensson@neptunus.(none) +0
-1
Manual merge
MERGE: 1.114.1.3
mysys/default.c@stripped, 2007-02-06 15:12:11+01:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.86.1.1
sql-common/client.c@stripped, 2007-02-06 15:12:13+01:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.122.1.1
sql/field.cc@stripped, 2007-02-06 15:12:11+01:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.368.1.1
sql/field.h@stripped, 2007-02-06 15:46:13+01:00, msvensson@neptunus.(none) +0 -0
Manual merge
MERGE: 1.205.1.3
sql/item.cc@stripped, 2007-02-06 15:12:11+01:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.230.2.4
sql/item_cmpfunc.cc@stripped, 2007-02-06 15:12:11+01:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.234.1.5
sql/item_cmpfunc.h@stripped, 2007-02-06 15:12:11+01:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.141.1.2
sql/item_sum.cc@stripped, 2007-02-06 15:12:11+01:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.211.1.1
sql/mysql_priv.h@stripped, 2007-02-06 15:12:11+01:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.473.1.2
sql/mysqld.cc@stripped, 2007-02-06 15:46:13+01:00, msvensson@neptunus.(none) +0 -0
Manual merge
MERGE: 1.610.3.2
sql/net_serv.cc@stripped, 2007-02-06 15:12:12+01:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.102.1.1
sql/repl_failsafe.cc@stripped, 2007-02-06 15:12:12+01:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.70.1.1
sql/set_var.cc@stripped, 2007-02-06 15:12:12+01:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.211.1.1
sql/set_var.h@stripped, 2007-02-06 15:12:12+01:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.97.1.1
sql/slave.cc@stripped, 2007-02-06 15:12:12+01:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.302.1.3
sql/sql_parse.cc@stripped, 2007-02-06 15:12:12+01:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.620.1.1
sql/sql_select.cc@stripped, 2007-02-06 15:12:13+01:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.485.2.2
# 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: msvensson
# Host: neptunus.(none)
# Root: /home/msvensson/mysql/mysql-5.1-maint/RESYNC
--- 1.430/configure.in 2007-02-06 15:46:27 +01:00
+++ 1.431/configure.in 2007-02-06 15:46:27 +01:00
@@ -973,7 +973,7 @@ case $SYSTEM_TYPE in
*darwin6*)
if test "$ac_cv_prog_gcc" = "yes"
then
- FLAGS="-D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ
-DHAVE_BROKEN_REALPATH"
+ FLAGS="-D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ
-DHAVE_BROKEN_REALPATH -DDONT_DECLARE_CXA_PURE_VIRTUAL "
CFLAGS="$CFLAGS $FLAGS"
CXXFLAGS="$CXXFLAGS $FLAGS"
MAX_C_OPTIMIZE="-O"
@@ -2357,6 +2357,7 @@ readline_basedir=""
readline_dir=""
readline_h_ln_cmd=""
readline_link=""
+want_to_use_readline="no"
if expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null
then
@@ -2382,6 +2383,7 @@ then
readline_link="\$(top_builddir)/cmd-line-utils/readline/libreadline.a"
readline_h_ln_cmd="\$(LN) -s \$(top_srcdir)/cmd-line-utils/readline readline"
compile_readline=yes
+ want_to_use_readline="yes"
AC_DEFINE_UNQUOTED(USE_NEW_READLINE_INTERFACE, 1)
else
# Use system readline library
@@ -2391,10 +2393,12 @@ else
MYSQL_CHECK_NEW_RL_INTERFACE
MYSQL_CHECK_READLINE_DECLARES_HIST_ENTRY
AC_LANG_RESTORE
- if [test "$mysql_cv_new_rl_interface" = "yes"]
+ if [test "$mysql_cv_new_rl_interface" = "yes"] && [test -d
"./cmd-line-utils/readline"]
then
- # Use the new readline interface
+ # Use the new readline interface, but only if the package includes a bundled
libreadline
+ # this way we avoid linking commercial source with GPL readline
readline_link="-lreadline"
+ want_to_use_readline="yes"
elif [test "$mysql_cv_libedit_interface" = "yes"]
then
# Use libedit
@@ -2405,6 +2409,15 @@ else
versions of libedit or readline])
fi
fi
+
+# if there is no readline, but we want to build with readline, we fail
+if [test "$want_to_use_readline" = "yes"] && [test ! -d
"./cmd-line-utils/readline"]
+then
+ AC_MSG_ERROR([This commercially licensed MySQL source package can't
+ be built with libreadline. Please use --with-libedit to use
+ the bundled version of libedit instead.])
+fi
+
#
# if either readline or libedit is enabled - generate Makefile's for both
# (to make sure both are included in 'make dist')
@@ -2534,7 +2547,8 @@ AC_CONFIG_FILES(Makefile extra/Makefile
sql/sql_builtin.cc sql-common/Makefile dnl
dbug/Makefile scripts/Makefile include/Makefile dnl
tests/Makefile Docs/Makefile support-files/Makefile dnl
- support-files/MacOSX/Makefile mysql-test/Makefile dnl
+ support-files/MacOSX/Makefile support-files/RHEL4-SElinux/Makefile dnl
+ mysql-test/Makefile dnl
mysql-test/ndb/Makefile netware/Makefile sql-bench/Makefile dnl
include/mysql_version.h plugin/Makefile win/Makefile)
--- 1.16/cmd-line-utils/readline/display.c 2007-02-06 15:46:27 +01:00
+++ 1.17/cmd-line-utils/readline/display.c 2007-02-06 15:46:27 +01:00
@@ -524,14 +524,26 @@ rl_redisplay ()
wrap_offset = prompt_invis_chars_first_line = 0;
}
+#if defined (HANDLE_MULTIBYTE)
#define CHECK_INV_LBREAKS() \
do { \
if (newlines >= (inv_lbsize - 2)) \
{ \
inv_lbsize *= 2; \
inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \
+ _rl_wrapped_line = (int *)xrealloc (_rl_wrapped_line, inv_lbsize * sizeof
(int)); \
} \
} while (0)
+#else
+#define CHECK_INV_LBREAKS() \
+ do { \
+ if (newlines >= (inv_lbsize - 2)) \
+ { \
+ inv_lbsize *= 2; \
+ inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \
+ } \
+ } while (0)
+#endif
#if defined (HANDLE_MULTIBYTE)
#define CHECK_LPOS() \
--- 1.370/sql/field.cc 2007-02-06 15:46:27 +01:00
+++ 1.371/sql/field.cc 2007-02-06 15:46:27 +01:00
@@ -4144,7 +4144,7 @@ int Field_double::store(double nr)
else
{
double max_value;
- if (dec >= NOT_FIXED_DEC)
+ if (not_fixed)
{
max_value= DBL_MAX;
}
--- 1.206/sql/field.h 2007-02-06 15:46:27 +01:00
+++ 1.207/sql/field.h 2007-02-06 15:46:27 +01:00
@@ -789,18 +789,27 @@ public:
class Field_double :public Field_real {
public:
+ my_bool not_fixed;
Field_double(char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg,
enum utype unireg_check_arg, const char *field_name_arg,
uint8 dec_arg,bool zero_arg,bool unsigned_arg)
:Field_real(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
unireg_check_arg, field_name_arg,
- dec_arg, zero_arg, unsigned_arg)
+ dec_arg, zero_arg, unsigned_arg),
+ not_fixed(dec_arg >= NOT_FIXED_DEC)
{}
Field_double(uint32 len_arg, bool maybe_null_arg, const char *field_name_arg,
uint8 dec_arg)
- :Field_real((char*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0, (uint) 0,
- NONE, field_name_arg, dec_arg, 0, 0)
+ :Field_real((char*) 0, len_arg, maybe_null_arg ? (uchar*) "" : 0, (uint) 0,
+ NONE, field_name_arg, dec_arg, 0, 0),
+ not_fixed(dec_arg >= NOT_FIXED_DEC)
+ {}
+ Field_double(uint32 len_arg, bool maybe_null_arg, const char *field_name_arg,
+ uint8 dec_arg, my_bool not_fixed_srg)
+ :Field_real((char*) 0, len_arg, maybe_null_arg ? (uchar*) "" : 0, (uint) 0,
+ NONE, field_name_arg, dec_arg, 0, 0),
+ not_fixed(not_fixed_srg)
{}
enum_field_types type() const { return MYSQL_TYPE_DOUBLE;}
enum ha_base_keytype key_type() const { return HA_KEYTYPE_DOUBLE; }
@@ -816,6 +825,7 @@ public:
void sort_string(char *buff,uint length);
uint32 pack_length() const { return sizeof(double); }
void sql_type(String &str) const;
+ uint size_of() const { return sizeof(*this); }
uint32 max_display_length() { return 53; }
};
--- 1.235/sql/item.cc 2007-02-06 15:46:27 +01:00
+++ 1.236/sql/item.cc 2007-02-06 15:46:27 +01:00
@@ -25,10 +25,6 @@
#include "sql_trigger.h"
#include "sql_select.h"
-static void mark_as_dependent(THD *thd,
- SELECT_LEX *last, SELECT_LEX *current,
- Item_ident *item);
-
const String my_null_string("NULL", 4, default_charset_info);
/****************************************************************************/
@@ -1270,7 +1266,10 @@ void Item::split_sum_func2(THD *thd, Ite
if (type() == SUM_FUNC_ITEM && skip_registered &&
((Item_sum *) this)->ref_by)
return;
- if (type() != SUM_FUNC_ITEM && with_sum_func)
+ if ((type() != SUM_FUNC_ITEM && with_sum_func) ||
+ (type() == FUNC_ITEM &&
+ (((Item_func *) this)->functype() == Item_func::ISNOTNULLTEST_FUNC ||
+ ((Item_func *) this)->functype() == Item_func::TRIG_COND_FUNC)))
{
/* Will split complicated items and ignore simple ones */
split_sum_func(thd, ref_pointer_array, fields);
@@ -1715,7 +1714,7 @@ void Item_field::set_field(Field *field_
field=result_field=field_par; // for easy coding with fields
maybe_null=field->maybe_null();
decimals= field->decimals();
- max_length= field_par->max_length();
+ max_length= field_par->max_display_length();
table_name= *field_par->table_name;
field_name= field_par->field_name;
db_name= field_par->table->s->db.str;
@@ -2424,21 +2423,22 @@ void Item_param::set_decimal(const char
the fact that even wrong value sent over binary protocol fits into
MAX_DATE_STRING_REP_LENGTH buffer.
*/
-void Item_param::set_time(TIME *tm, timestamp_type type, uint32 max_length_arg)
+void Item_param::set_time(TIME *tm, timestamp_type time_type,
+ uint32 max_length_arg)
{
DBUG_ENTER("Item_param::set_time");
value.time= *tm;
- value.time.time_type= type;
+ value.time.time_type= time_type;
if (value.time.year > 9999 || value.time.month > 12 ||
value.time.day > 31 ||
- type != MYSQL_TIMESTAMP_TIME && value.time.hour > 23 ||
+ time_type != MYSQL_TIMESTAMP_TIME && value.time.hour > 23 ||
value.time.minute > 59 || value.time.second > 59)
{
char buff[MAX_DATE_STRING_REP_LENGTH];
uint length= my_TIME_to_str(&value.time, buff);
- make_truncated_value_warning(current_thd, buff, length, type, 0);
+ make_truncated_value_warning(current_thd, buff, length, time_type, 0);
set_zero_time(&value.time, MYSQL_TIMESTAMP_ERROR);
}
@@ -2904,7 +2904,7 @@ bool Item_param::basic_const_item() cons
Item *
-Item_param::new_item()
+Item_param::clone_item()
{
/* see comments in the header file */
switch (state) {
@@ -3521,28 +3521,29 @@ Item_field::fix_outer_field(THD *thd, Fi
thd->lex->in_sum_func->nest_level ==
thd->lex->current_select->nest_level)
{
- Item::Type type= (*reference)->type();
+ Item::Type ref_type= (*reference)->type();
set_if_bigger(thd->lex->in_sum_func->max_arg_level,
select->nest_level);
set_field(*from_field);
fixed= 1;
mark_as_dependent(thd, last_checked_context->select_lex,
context->select_lex, this,
- ((type == REF_ITEM || type == FIELD_ITEM) ?
+ ((ref_type == REF_ITEM ||
+ ref_type == FIELD_ITEM) ?
(Item_ident*) (*reference) : 0));
return 0;
}
}
else
{
- Item::Type type= (*reference)->type();
+ Item::Type ref_type= (*reference)->type();
prev_subselect_item->used_tables_cache|=
(*reference)->used_tables();
prev_subselect_item->const_item_cache&=
(*reference)->const_item();
mark_as_dependent(thd, last_checked_context->select_lex,
context->select_lex, this,
- ((type == REF_ITEM || type == FIELD_ITEM) ?
+ ((ref_type == REF_ITEM || ref_type == FIELD_ITEM) ?
(Item_ident*) (*reference) :
0));
/*
@@ -4085,7 +4086,7 @@ Item *Item_field::replace_equal_field(by
void Item::init_make_field(Send_field *tmp_field,
- enum enum_field_types field_type)
+ enum enum_field_types field_type_arg)
{
char *empty_name= (char*) "";
tmp_field->db_name= empty_name;
@@ -4097,7 +4098,7 @@ void Item::init_make_field(Send_field *t
tmp_field->flags= (maybe_null ? 0 : NOT_NULL_FLAG) |
(my_binary_compare(collation.collation) ?
BINARY_FLAG : 0);
- tmp_field->type=field_type;
+ tmp_field->type= field_type_arg;
tmp_field->length=max_length;
tmp_field->decimals=decimals;
if (unsigned_flag)
@@ -4112,12 +4113,12 @@ void Item::make_field(Send_field *tmp_fi
enum_field_types Item::string_field_type() const
{
- enum_field_types type= MYSQL_TYPE_VAR_STRING;
+ enum_field_types f_type= MYSQL_TYPE_VAR_STRING;
if (max_length >= 16777216)
- type= MYSQL_TYPE_LONG_BLOB;
+ f_type= MYSQL_TYPE_LONG_BLOB;
else if (max_length >= 65536)
- type= MYSQL_TYPE_MEDIUM_BLOB;
- return type;
+ f_type= MYSQL_TYPE_MEDIUM_BLOB;
+ return f_type;
}
@@ -4487,7 +4488,7 @@ bool Item_int::eq(const Item *arg, bool
}
-Item *Item_int_with_ref::new_item()
+Item *Item_int_with_ref::clone_item()
{
DBUG_ASSERT(ref->const_item());
/*
@@ -4765,10 +4766,10 @@ bool Item_null::send(Protocol *protocol,
bool Item::send(Protocol *protocol, String *buffer)
{
bool result;
- enum_field_types type;
+ enum_field_types f_type;
LINT_INIT(result); // Will be set if null_value == 0
- switch ((type=field_type())) {
+ switch ((f_type=field_type())) {
default:
case MYSQL_TYPE_NULL:
case MYSQL_TYPE_DECIMAL:
@@ -4847,7 +4848,7 @@ bool Item::send(Protocol *protocol, Stri
get_date(&tm, TIME_FUZZY_DATE);
if (!null_value)
{
- if (type == MYSQL_TYPE_DATE)
+ if (f_type == MYSQL_TYPE_DATE)
return protocol->store_date(&tm);
else
result= protocol->store(&tm);
@@ -5060,7 +5061,7 @@ bool Item_ref::fix_fields(THD *thd, Item
goto error;
if (from_field == view_ref_found)
{
- Item::Type type= (*reference)->type();
+ Item::Type refer_type= (*reference)->type();
prev_subselect_item->used_tables_cache|=
(*reference)->used_tables();
prev_subselect_item->const_item_cache&=
@@ -5068,7 +5069,8 @@ bool Item_ref::fix_fields(THD *thd, Item
DBUG_ASSERT((*reference)->type() == REF_ITEM);
mark_as_dependent(thd, last_checked_context->select_lex,
context->select_lex, this,
- ((type == REF_ITEM || type == FIELD_ITEM) ?
+ ((refer_type == REF_ITEM ||
+ refer_type == FIELD_ITEM) ?
(Item_ident*) (*reference) :
0));
/*
@@ -5814,8 +5816,8 @@ bool Item_trigger_field::fix_fields(THD
{
table_grants->want_privilege= want_privilege;
- if (check_grant_column(thd, table_grants, triggers->table->s->db.str,
- triggers->table->s->table_name.str, field_name,
+ if (check_grant_column(thd, table_grants,
triggers->trigger_table->s->db.str,
+ triggers->trigger_table->s->table_name.str,
field_name,
strlen(field_name), thd->security_ctx))
return TRUE;
}
@@ -5928,7 +5930,8 @@ void resolve_const_item(THD *thd, Item *
DBUG_ASSERT(item_row->cols() == comp_item_row->cols());
col= item_row->cols();
while (col-- > 0)
- resolve_const_item(thd, item_row->addr(col), comp_item_row->el(col));
+ resolve_const_item(thd, item_row->addr(col),
+ comp_item_row->element_index(col));
break;
}
/* Fallthrough */
@@ -6196,7 +6199,7 @@ bool Item_cache_row::setup(Item * item)
return 1;
for (uint i= 0; i < item_count; i++)
{
- Item *el= item->el(i);
+ Item *el= item->element_index(i);
Item_cache *tmp;
if (!(tmp= values[i]= Item_cache::get_cache(el->result_type())))
return 1;
@@ -6212,7 +6215,7 @@ void Item_cache_row::store(Item * item)
item->bring_value();
for (uint i= 0; i < item_count; i++)
{
- values[i]->store(item->el(i));
+ values[i]->store(item->element_index(i));
null_value|= values[i]->null_value;
}
}
--- 1.238/sql/item_cmpfunc.cc 2007-02-06 15:46:27 +01:00
+++ 1.239/sql/item_cmpfunc.cc 2007-02-06 15:46:27 +01:00
@@ -328,7 +328,7 @@ static bool convert_constant_item(THD *t
void Item_bool_func2::fix_length_and_dec()
{
max_length= 1; // Function returns 0 or 1
- THD *thd= current_thd;
+ THD *thd;
/*
As some compare functions are generated after sql_yacc,
@@ -366,12 +366,13 @@ void Item_bool_func2::fix_length_and_dec
return;
}
+ thd= current_thd;
if (!thd->is_context_analysis_only())
{
- Item *real_item= args[0]->real_item();
- if (real_item->type() == FIELD_ITEM)
+ Item *arg_real_item= args[0]->real_item();
+ if (arg_real_item->type() == FIELD_ITEM)
{
- Field *field=((Item_field*) real_item)->field;
+ Field *field=((Item_field*) arg_real_item)->field;
if (field->can_be_compared_as_longlong())
{
if (convert_constant_item(thd, field,&args[1]))
@@ -383,10 +384,10 @@ void Item_bool_func2::fix_length_and_dec
}
}
}
- real_item= args[1]->real_item();
- if (real_item->type() == FIELD_ITEM /* && !real_item->const_item() */)
+ arg_real_item= args[1]->real_item();
+ if (arg_real_item->type() == FIELD_ITEM)
{
- Field *field=((Item_field*) real_item)->field;
+ Field *field=((Item_field*) arg_real_item)->field;
if (field->can_be_compared_as_longlong())
{
if (convert_constant_item(thd, field,&args[0]))
@@ -422,9 +423,9 @@ int Arg_comparator::set_compare_func(Ite
return 1;
for (uint i=0; i < n; i++)
{
- if ((*a)->el(i)->cols() != (*b)->el(i)->cols())
+ if ((*a)->element_index(i)->cols() != (*b)->element_index(i)->cols())
{
- my_error(ER_OPERAND_COLUMNS, MYF(0), (*a)->el(i)->cols());
+ my_error(ER_OPERAND_COLUMNS, MYF(0), (*a)->element_index(i)->cols());
return 1;
}
comparators[i].set_cmp_func(owner, (*a)->addr(i), (*b)->addr(i));
@@ -858,10 +859,10 @@ bool Item_in_optimizer::fix_left(THD *th
uint n= cache->cols();
for (uint i= 0; i < n; i++)
{
- if (args[0]->el(i)->used_tables())
- ((Item_cache *)cache->el(i))->set_used_tables(OUTER_REF_TABLE_BIT);
+ if (args[0]->element_index(i)->used_tables())
+ ((Item_cache *)cache->element_index(i))->set_used_tables(OUTER_REF_TABLE_BIT);
else
- ((Item_cache *)cache->el(i))->set_used_tables(0);
+ ((Item_cache *)cache->element_index(i))->set_used_tables(0);
}
used_tables_cache= args[0]->used_tables();
}
@@ -936,7 +937,7 @@ longlong Item_in_optimizer::val_int()
if (cache->cols() == 1)
{
item_subs->set_cond_guard_var(0, FALSE);
- longlong tmp= args[1]->val_bool_result();
+ (void) args[1]->val_bool_result();
result_for_null_param= null_value= !item_subs->engine->no_rows();
item_subs->set_cond_guard_var(0, TRUE);
}
@@ -950,11 +951,11 @@ longlong Item_in_optimizer::val_int()
*/
for (i= 0; i < ncols; i++)
{
- if (cache->el(i)->null_value)
+ if (cache->element_index(i)->null_value)
item_subs->set_cond_guard_var(i, FALSE);
}
- longlong tmp= args[1]->val_bool_result();
+ (void) args[1]->val_bool_result();
result_for_null_param= null_value= !item_subs->engine->no_rows();
/* Turn all predicates back on */
@@ -1074,15 +1075,17 @@ longlong Item_func_strcmp::val_int()
void Item_func_interval::fix_length_and_dec()
{
- use_decimal_comparison= (row->el(0)->result_type() == DECIMAL_RESULT) ||
- (row->el(0)->result_type() == INT_RESULT);
+ use_decimal_comparison= ((row->element_index(0)->result_type() ==
+ DECIMAL_RESULT) ||
+ (row->element_index(0)->result_type() ==
+ INT_RESULT));
if (row->cols() > 8)
{
bool consts=1;
for (uint i=1 ; consts && i < row->cols() ; i++)
{
- consts&= row->el(i)->const_item();
+ consts&= row->element_index(i)->const_item();
}
if (consts &&
@@ -1093,7 +1096,7 @@ void Item_func_interval::fix_length_and_
{
for (uint i=1 ; i < row->cols(); i++)
{
- Item *el= row->el(i);
+ Item *el= row->element_index(i);
interval_range *range= intervals + (i-1);
if ((el->result_type() == DECIMAL_RESULT) ||
(el->result_type() == INT_RESULT))
@@ -1118,7 +1121,7 @@ void Item_func_interval::fix_length_and_
{
for (uint i=1 ; i < row->cols(); i++)
{
- intervals[i-1].dbl= row->el(i)->val_real();
+ intervals[i-1].dbl= row->element_index(i)->val_real();
}
}
}
@@ -1158,15 +1161,15 @@ longlong Item_func_interval::val_int()
if (use_decimal_comparison)
{
- dec= row->el(0)->val_decimal(&dec_buf);
- if (row->el(0)->null_value)
+ dec= row->element_index(0)->val_decimal(&dec_buf);
+ if (row->element_index(0)->null_value)
return -1;
my_decimal2double(E_DEC_FATAL_ERROR, dec, &value);
}
else
{
- value= row->el(0)->val_real();
- if (row->el(0)->null_value)
+ value= row->element_index(0)->val_real();
+ if (row->element_index(0)->null_value)
return -1;
}
@@ -1202,16 +1205,16 @@ longlong Item_func_interval::val_int()
for (i=1 ; i < row->cols() ; i++)
{
- Item *el= row->el(i);
+ Item *el= row->element_index(i);
if (use_decimal_comparison &&
((el->result_type() == DECIMAL_RESULT) ||
(el->result_type() == INT_RESULT)))
{
- my_decimal e_dec_buf, *e_dec= row->el(i)->val_decimal(&e_dec_buf);
+ my_decimal e_dec_buf, *e_dec=
row->element_index(i)->val_decimal(&e_dec_buf);
if (my_decimal_cmp(e_dec, dec) > 0)
return i-1;
}
- else if (row->el(i)->val_real() > value)
+ else if (row->element_index(i)->val_real() > value)
return i-1;
}
return i-1;
@@ -1905,7 +1908,9 @@ bool Item_func_case::fix_fields(THD *thd
buff should match stack usage from
Item_func_case::val_int() -> Item_func_case::find_item()
*/
+#ifndef EMBEDDED_LIBRARY
char
buff[MAX_FIELD_WIDTH*2+sizeof(String)*2+sizeof(String*)*2+sizeof(double)*2+sizeof(longlong)*2];
+#endif
bool res= Item_func::fix_fields(thd, ref);
/*
Call check_stack_overrun after fix_fields to be sure that stack variable
@@ -1922,7 +1927,6 @@ void Item_func_case::fix_length_and_dec(
{
Item **agg;
uint nagg;
- THD *thd= current_thd;
uint found_types= 0;
if (!(agg= (Item**) sql_alloc(sizeof(Item*)*(ncases+1))))
return;
@@ -2383,11 +2387,11 @@ void cmp_item_row::store_value(Item *ite
{
if (!comparators[i])
if (!(comparators[i]=
- cmp_item::get_comparator(item->el(i)->result_type(),
- item->el(i)->collation.collation)))
+ cmp_item::get_comparator(item->element_index(i)->result_type(),
+
item->element_index(i)->collation.collation)))
break; // new failed
- comparators[i]->store_value(item->el(i));
- item->null_value|= item->el(i)->null_value;
+ comparators[i]->store_value(item->element_index(i));
+ item->null_value|= item->element_index(i)->null_value;
}
}
DBUG_VOID_RETURN;
@@ -2412,8 +2416,8 @@ void cmp_item_row::store_value_by_templa
if (!(comparators[i]= tmpl->comparators[i]->make_same()))
break; // new failed
comparators[i]->store_value_by_template(tmpl->comparators[i],
- item->el(i));
- item->null_value|= item->el(i)->null_value;
+ item->element_index(i));
+ item->null_value|= item->element_index(i)->null_value;
}
}
}
@@ -2431,9 +2435,9 @@ int cmp_item_row::cmp(Item *arg)
arg->bring_value();
for (uint i=0; i < n; i++)
{
- if (comparators[i]->cmp(arg->el(i)))
+ if (comparators[i]->cmp(arg->element_index(i)))
{
- if (!arg->el(i)->null_value)
+ if (!arg->element_index(i)->null_value)
return 1;
was_null= 1;
}
@@ -2444,11 +2448,11 @@ int cmp_item_row::cmp(Item *arg)
int cmp_item_row::compare(cmp_item *c)
{
- cmp_item_row *cmp= (cmp_item_row *) c;
+ cmp_item_row *l_cmp= (cmp_item_row *) c;
for (uint i=0; i < n; i++)
{
int res;
- if ((res= comparators[i]->compare(cmp->comparators[i])))
+ if ((res= comparators[i]->compare(l_cmp->comparators[i])))
return res;
}
return 0;
@@ -2475,8 +2479,8 @@ int cmp_item_decimal::cmp(Item *arg)
int cmp_item_decimal::compare(cmp_item *arg)
{
- cmp_item_decimal *cmp= (cmp_item_decimal*) arg;
- return my_decimal_cmp(&value, &cmp->value);
+ cmp_item_decimal *l_cmp= (cmp_item_decimal*) arg;
+ return my_decimal_cmp(&value, &l_cmp->value);
}
--- 1.143/sql/item_cmpfunc.h 2007-02-06 15:46:27 +01:00
+++ 1.144/sql/item_cmpfunc.h 2007-02-06 15:46:27 +01:00
@@ -34,6 +34,7 @@ class Arg_comparator: public Sql_alloc
arg_cmp_func func;
Item_bool_func2 *owner;
Arg_comparator *comparators; // used only for compare_row()
+ double precision;
public:
DTCollation cmp_collation;
@@ -80,6 +81,8 @@ public:
int compare_e_int(); // compare args[0] & args[1]
int compare_e_int_diff_signedness();
int compare_e_row(); // compare args[0] & args[1]
+ int compare_real_fixed();
+ int compare_e_real_fixed();
static arg_cmp_func comparator_matrix [5][2];
--- 1.212/sql/item_sum.cc 2007-02-06 15:46:27 +01:00
+++ 1.213/sql/item_sum.cc 2007-02-06 15:46:27 +01:00
@@ -400,7 +400,7 @@ Field *Item_sum::create_tmp_field(bool g
Field *field;
switch (result_type()) {
case REAL_RESULT:
- field= new Field_double(max_length, maybe_null, name, decimals);
+ field= new Field_double(max_length, maybe_null, name, decimals, TRUE);
break;
case INT_RESULT:
field= new Field_longlong(max_length, maybe_null, name, unsigned_flag);
@@ -1135,7 +1135,7 @@ Field *Item_sum_avg::create_tmp_field(bo
field= new Field_new_decimal(max_length, maybe_null, name,
decimals, unsigned_flag);
else
- field= new Field_double(max_length, maybe_null, name, decimals);
+ field= new Field_double(max_length, maybe_null, name, decimals, TRUE);
if (field)
field->init(table);
return field;
@@ -1334,7 +1334,7 @@ Field *Item_sum_variance::create_tmp_fie
field= new Field_string(sizeof(double)*2 + sizeof(longlong), 0, name,
&my_charset_bin);
}
else
- field= new Field_double(max_length, maybe_null, name, decimals);
+ field= new Field_double(max_length, maybe_null, name, decimals, TRUE);
if (field != NULL)
field->init(table);
--- 1.475/sql/mysql_priv.h 2007-02-06 15:46:27 +01:00
+++ 1.476/sql/mysql_priv.h 2007-02-06 15:46:27 +01:00
@@ -87,6 +87,9 @@ void sql_kill(THD *thd, ulong id, bool o
bool net_request_file(NET* net, const char* fname);
char* query_table_status(THD *thd,const char *db,const char *table_name);
+void net_set_write_timeout(NET *net, uint timeout);
+void net_set_read_timeout(NET *net, uint timeout);
+
#define x_free(A) { my_free((gptr) (A),MYF(MY_WME | MY_FAE | MY_ALLOW_ZERO_PTR)); }
#define safeFree(x) { if(x) { my_free((gptr) x,MYF(0)); x = NULL; } }
#define PREV_BITS(type,A) ((type) (((type) 1 << (A)) -1))
@@ -307,54 +310,55 @@ MY_LOCALE *my_locale_by_number(uint numb
TODO: separate three contexts above, move them to separate bitfields.
*/
-#define SELECT_DISTINCT (ULL(1) << 0) // SELECT, user
-#define SELECT_STRAIGHT_JOIN (ULL(1) << 1) // SELECT, user
-#define SELECT_DESCRIBE (ULL(1) << 2) // SELECT, user
-#define SELECT_SMALL_RESULT (ULL(1) << 3) // SELECT, user
-#define SELECT_BIG_RESULT (ULL(1) << 4) // SELECT, user
-#define OPTION_FOUND_ROWS (ULL(1) << 5) // SELECT, user
-#define OPTION_TO_QUERY_CACHE (ULL(1) << 6) // SELECT, user
-#define SELECT_NO_JOIN_CACHE (ULL(1) << 7) // intern
-#define OPTION_BIG_TABLES (ULL(1) << 8) // THD, user
-#define OPTION_BIG_SELECTS (ULL(1) << 9) // THD, user
-#define OPTION_LOG_OFF (ULL(1) << 10) // THD, user
-#define OPTION_QUOTE_SHOW_CREATE (ULL(1) << 11) // THD, user
-#define TMP_TABLE_ALL_COLUMNS (ULL(1) << 12) // SELECT, intern
-#define OPTION_WARNINGS (ULL(1) << 13) // THD, user
-#define OPTION_AUTO_IS_NULL (ULL(1) << 14) // THD, user, binlog
-#define OPTION_FOUND_COMMENT (ULL(1) << 15) // SELECT, intern, parser
-#define OPTION_SAFE_UPDATES (ULL(1) << 16) // THD, user
-#define OPTION_BUFFER_RESULT (ULL(1) << 17) // SELECT, user
-#define OPTION_BIN_LOG (ULL(1) << 18) // THD, user
-#define OPTION_NOT_AUTOCOMMIT (ULL(1) << 19) // THD, user
-#define OPTION_BEGIN (ULL(1) << 20) // THD, intern
-#define OPTION_TABLE_LOCK (ULL(1) << 21) // THD, intern
-#define OPTION_QUICK (ULL(1) << 22) // SELECT (for DELETE)
-#define OPTION_KEEP_LOG (ULL(1) << 23) // Keep binlog on rollback
+#define SELECT_DISTINCT (1ULL << 0) // SELECT, user
+#define SELECT_STRAIGHT_JOIN (1ULL << 1) // SELECT, user
+#define SELECT_DESCRIBE (1ULL << 2) // SELECT, user
+#define SELECT_SMALL_RESULT (1ULL << 3) // SELECT, user
+#define SELECT_BIG_RESULT (1ULL << 4) // SELECT, user
+#define OPTION_FOUND_ROWS (1ULL << 5) // SELECT, user
+#define OPTION_TO_QUERY_CACHE (1ULL << 6) // SELECT, user
+#define SELECT_NO_JOIN_CACHE (1ULL << 7) // intern
+#define OPTION_BIG_TABLES (1ULL << 8) // THD, user
+#define OPTION_BIG_SELECTS (1ULL << 9) // THD, user
+#define OPTION_LOG_OFF (1ULL << 10) // THD, user
+#define OPTION_QUOTE_SHOW_CREATE (1ULL << 11) // THD, user, unused
+#define TMP_TABLE_ALL_COLUMNS (1ULL << 12) // SELECT, intern
+#define OPTION_WARNINGS (1ULL << 13) // THD, user
+#define OPTION_AUTO_IS_NULL (1ULL << 14) // THD, user, binlog
+#define OPTION_FOUND_COMMENT (1ULL << 15) // SELECT, intern, parser
+#define OPTION_SAFE_UPDATES (1ULL << 16) // THD, user
+#define OPTION_BUFFER_RESULT (1ULL << 17) // SELECT, user
+#define OPTION_BIN_LOG (1ULL << 18) // THD, user
+#define OPTION_NOT_AUTOCOMMIT (1ULL << 19) // THD, user
+#define OPTION_BEGIN (1ULL << 20) // THD, intern
+#define OPTION_TABLE_LOCK (1ULL << 21) // THD, intern
+#define OPTION_QUICK (1ULL << 22) // SELECT (for DELETE)
+#define OPTION_KEEP_LOG (1ULL << 23) // THD, user
/* The following is used to detect a conflict with DISTINCT */
-#define SELECT_ALL (ULL(1) << 24) // SELECT, user, parser
+#define SELECT_ALL (1ULL << 24) // SELECT, user, parser
/* Set if we are updating a non-transaction safe table */
-#define OPTION_STATUS_NO_TRANS_UPDATE (ULL(1) << 25) // THD, intern
+#define OPTION_STATUS_NO_TRANS_UPDATE (1ULL << 25) // THD, intern
/* The following can be set when importing tables in a 'wrong order'
to suppress foreign key checks */
-#define OPTION_NO_FOREIGN_KEY_CHECKS (ULL(1) << 26) // THD, user, binlog
+#define OPTION_NO_FOREIGN_KEY_CHECKS (1ULL << 26) // THD, user, binlog
/* The following speeds up inserts to InnoDB tables by suppressing unique
key checks in some cases */
-#define OPTION_RELAXED_UNIQUE_CHECKS (ULL(1) << 27) // THD, user, binlog
-#define SELECT_NO_UNLOCK (ULL(1) << 28) // SELECT, intern
-#define OPTION_SCHEMA_TABLE (ULL(1) << 29) // SELECT, intern
+#define OPTION_RELAXED_UNIQUE_CHECKS (1ULL << 27) // THD, user, binlog
+#define SELECT_NO_UNLOCK (1ULL << 28) // SELECT, intern
+#define OPTION_SCHEMA_TABLE (1ULL << 29) // SELECT, intern
/* Flag set if setup_tables already done */
-#define OPTION_SETUP_TABLES_DONE (ULL(1) << 30) // intern
+#define OPTION_SETUP_TABLES_DONE (1ULL << 30) // intern
/* If not set then the thread will ignore all warnings with level notes. */
-#define OPTION_SQL_NOTES (ULL(1) << 31) // THD, user
-/*
+#define OPTION_SQL_NOTES (1ULL << 31) // THD, user
+/*
Force the used temporary table to be a MyISAM table (because we will use
fulltext functions when reading from it.
*/
-#define TMP_TABLE_FORCE_MYISAM (ULL(1) << 32)
+#define TMP_TABLE_FORCE_MYISAM (1ULL << 32)
+
/*
Maximum length of time zone name that we support
@@ -1548,6 +1552,7 @@ extern char glob_hostname[FN_REFLEN], my
extern char pidfile_name[FN_REFLEN], system_time_zone[30], *opt_init_file;
extern char log_error_file[FN_REFLEN], *opt_tc_log_file;
extern double log_10[32];
+extern double log_01[32];
extern ulonglong log_10_int[20];
extern ulonglong keybuff_size;
extern ulonglong thd_startup_options;
--- 1.613/sql/mysqld.cc 2007-02-06 15:46:28 +01:00
+++ 1.614/sql/mysqld.cc 2007-02-06 15:46:28 +01:00
@@ -496,6 +496,7 @@ ulong rpl_recovery_rank=0;
const char *log_output_str= "TABLE";
double log_10[32]; /* 10 potences */
+double log_01[32];
time_t server_start_time;
char mysql_home[FN_REFLEN], pidfile_name[FN_REFLEN], system_time_zone[30];
@@ -4076,10 +4077,9 @@ static bool read_init_file(char *file_na
static void create_new_thread(THD *thd)
{
+ NET *net=&thd->net;
DBUG_ENTER("create_new_thread");
- NET *net=&thd->net; // For easy ref
- net->read_timeout = (uint) connect_timeout;
if (protocol_version > 9)
net->return_errno=1;
@@ -4373,12 +4373,7 @@ pthread_handler_t handle_connections_soc
}
if (sock == unix_sock)
thd->security_ctx->host=(char*) my_localhost;
-#ifdef __WIN__
- /* Set default wait_timeout */
- ulong wait_timeout= global_system_variables.net_wait_timeout * 1000;
- (void) setsockopt(new_sock, SOL_SOCKET, SO_RCVTIMEO, (char*)&wait_timeout,
- sizeof(wait_timeout));
-#endif
+
create_new_thread(thd);
}
--- 1.103/sql/net_serv.cc 2007-02-06 15:46:28 +01:00
+++ 1.104/sql/net_serv.cc 2007-02-06 15:46:28 +01:00
@@ -615,7 +615,7 @@ net_real_write(NET *net,const char *pack
thr_alarm(&alarmed,(uint) net->write_timeout,&alarm_buff);
#else
alarmed=0;
- vio_timeout(net->vio, 1, net->write_timeout);
+ /* Write timeout is set in net_set_write_timeout */
#endif /* NO_ALARM */
pos=(char*) packet; end=pos+len;
@@ -808,7 +808,7 @@ my_real_read(NET *net, ulong *complen)
if (net_blocking)
thr_alarm(&alarmed,net->read_timeout,&alarm_buff);
#else
- vio_timeout(net->vio, 0, net->read_timeout);
+ /* Read timeout is set in net_set_read_timeout */
#endif /* NO_ALARM */
pos = net->buff + net->where_b; /* net->packet -4 */
@@ -1119,3 +1119,26 @@ my_net_read(NET *net)
return len;
}
+
+void net_set_read_timeout(NET *net, uint timeout)
+{
+ DBUG_ENTER("net_set_read_timeout");
+ DBUG_PRINT("enter", ("timeout: %d", timeout));
+ net->read_timeout= timeout;
+#ifdef NO_ALARM
+ vio_timeout(net->vio, 0, timeout);
+#endif
+ DBUG_VOID_RETURN;
+}
+
+
+void net_set_write_timeout(NET *net, uint timeout)
+{
+ DBUG_ENTER("net_set_write_timeout");
+ DBUG_PRINT("enter", ("timeout: %d", timeout));
+ net->write_timeout= timeout;
+#ifdef NO_ALARM
+ vio_timeout(net->vio, 1, timeout);
+#endif
+ DBUG_VOID_RETURN;
+}
--- 1.304/sql/slave.cc 2007-02-06 15:46:28 +01:00
+++ 1.305/sql/slave.cc 2007-02-06 15:46:28 +01:00
@@ -1422,7 +1422,6 @@ static int init_slave_thread(THD* thd, S
*/
thd->variables.max_allowed_packet= global_system_variables.max_allowed_packet
+ MAX_LOG_EVENT_HEADER; /* note, incr over the global not session var */
- thd->net.read_timeout = slave_net_timeout;
thd->slave_thread = 1;
set_slave_thread_options(thd);
thd->client_capabilities = CLIENT_LOCAL_FILES;
@@ -3326,7 +3325,13 @@ static Log_event* next_event(RELAY_LOG_I
hot_log=0; // Using old binary log
}
}
-
+ /*
+ As there is no guarantee that the relay is open (for example, an I/O
+ error during a write by the slave I/O thread may have closed it), we
+ have to test it.
+ */
+ if (!my_b_inited(cur_log))
+ goto err;
#ifndef DBUG_OFF
{
/* This is an assertion which sometimes fails, let's try to track it */
--- 1.623/sql/sql_parse.cc 2007-02-06 15:46:28 +01:00
+++ 1.624/sql/sql_parse.cc 2007-02-06 15:46:28 +01:00
@@ -1009,7 +1009,7 @@ static int check_connection(THD *thd)
return(ER_HANDSHAKE_ERROR);
}
DBUG_PRINT("info", ("IO layer change in progress..."));
- if (sslaccept(ssl_acceptor_fd, net->vio, thd->variables.net_wait_timeout))
+ if (sslaccept(ssl_acceptor_fd, net->vio, net->read_timeout))
{
DBUG_PRINT("error", ("Failed to accept new SSL connection"));
inc_host_errors(&thd->remote.sin_addr);
@@ -1038,7 +1038,6 @@ static int check_connection(THD *thd)
if ((thd->client_capabilities & CLIENT_TRANSACTIONS) &&
opt_using_transactions)
net->return_status= &thd->server_status;
- net->read_timeout=(uint) thd->variables.net_read_timeout;
char *user= end;
char *passwd= strend(user)+1;
@@ -1185,6 +1184,10 @@ pthread_handler_t handle_one_connection(
Security_context *sctx= thd->security_ctx;
net->no_send_error= 0;
+ /* Use "connect_timeout" value during connection phase */
+ net_set_read_timeout(net, connect_timeout);
+ net_set_write_timeout(net, connect_timeout);
+
if ((error=check_connection(thd)))
{ // Wrong permissions
if (error > 0)
@@ -1227,6 +1230,10 @@ pthread_handler_t handle_one_connection(
thd->init_for_queries();
}
+ /* Connect completed, set read/write timeouts back to tdefault */
+ net_set_read_timeout(net, thd->variables.net_read_timeout);
+ net_set_write_timeout(net, thd->variables.net_write_timeout);
+
while (!net->error && net->vio != 0 &&
!(thd->killed == THD::KILL_CONNECTION))
{
@@ -1558,7 +1565,7 @@ int end_trans(THD *thd, enum enum_mysql_
#ifndef EMBEDDED_LIBRARY
/*
- Read one command from socket and execute it (query or simple command).
+ Read one command from connection and execute it (query or simple command).
This function is called in loop from thread function.
SYNOPSIS
do_command()
@@ -1569,24 +1576,26 @@ int end_trans(THD *thd, enum enum_mysql_
bool do_command(THD *thd)
{
- char *packet;
- uint old_timeout;
+ char *packet= 0;
ulong packet_length;
- NET *net;
+ NET *net= &thd->net;
enum enum_server_command command;
DBUG_ENTER("do_command");
- net= &thd->net;
/*
indicator of uninitialized lex => normal flow of errors handling
(see my_message_sql)
*/
thd->lex->current_select= 0;
- packet=0;
- old_timeout=net->read_timeout;
- /* Wait max for 8 hours */
- net->read_timeout=(uint) thd->variables.net_wait_timeout;
+ /*
+ This thread will do a blocking read from the client which
+ will be interrupted when the next command is received from
+ the client, the connection is closed or "net_wait_timeout"
+ number of seconds has passed
+ */
+ net_set_read_timeout(net, thd->variables.net_wait_timeout);
+
thd->clear_error(); // Clear error message
net_new_transaction(net);
@@ -1615,7 +1624,10 @@ bool do_command(THD *thd)
vio_description(net->vio), command,
command_name[command].str));
}
- net->read_timeout=old_timeout; // restore it
+
+ /* Restore read timeout value */
+ net_set_read_timeout(net, thd->variables.net_read_timeout);
+
/*
packet_length contains length of data, as it was stored in packet
header. In case of malformed header, packet_length can be zero.
--- 1.487/sql/sql_select.cc 2007-02-06 15:46:28 +01:00
+++ 1.488/sql/sql_select.cc 2007-02-06 15:46:28 +01:00
@@ -8821,6 +8821,8 @@ Field *create_tmp_field_from_field(THD *
if (org_field->type() == MYSQL_TYPE_VAR_STRING ||
org_field->type() == MYSQL_TYPE_VARCHAR)
table->s->db_create_options|= HA_OPTION_PACK_RECORD;
+ else if (org_field->type() == FIELD_TYPE_DOUBLE)
+ ((Field_double *) new_field)->not_fixed= TRUE;
}
return new_field;
}
@@ -8861,7 +8863,7 @@ static Field *create_tmp_field_from_item
switch (item->result_type()) {
case REAL_RESULT:
new_field= new Field_double(item->max_length, maybe_null,
- item->name, item->decimals);
+ item->name, item->decimals, TRUE);
break;
case INT_RESULT:
/* Select an integer type with the minimal fit precision */
--- 1.124/sql-common/client.c 2007-02-06 15:46:28 +01:00
+++ 1.125/sql-common/client.c 2007-02-06 15:46:28 +01:00
@@ -2044,11 +2044,17 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,cons
goto error;
}
vio_keepalive(net->vio,TRUE);
- /* Override local client variables */
+
+ /* If user set read_timeout, let it override the default */
if (mysql->options.read_timeout)
net->read_timeout= mysql->options.read_timeout;
+ vio_timeout(net->vio, 0, net->read_timeout);
+
+ /* If user set write_timeout, let it override the default */
if (mysql->options.write_timeout)
net->write_timeout= mysql->options.write_timeout;
+ vio_timeout(net->vio, 1, net->write_timeout);
+
if (mysql->options.max_allowed_packet)
net->max_packet_size= mysql->options.max_allowed_packet;
--- 1.51/mysql-test/r/mysqltest.result 2007-02-06 15:46:28 +01:00
+++ 1.52/mysql-test/r/mysqltest.result 2007-02-06 15:46:28 +01:00
@@ -422,6 +422,8 @@ mysqltest: In included file "MYSQLTEST_V
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest.sql": At line 3: connection
'test_con1' not found in connection pool
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest.sql": At line 2: Connection
test_con1 already exists
connect(localhost,root,,test,MASTER_PORT,MASTER_SOCKET);
+show tables;
+ERROR 3D000: No database selected
Output from mysqltest-x.inc
Output from mysqltest-x.inc
Output from mysqltest-x.inc
--- 1.63/mysql-test/t/mysqltest.test 2007-02-06 15:46:28 +01:00
+++ 1.64/mysql-test/t/mysqltest.test 2007-02-06 15:46:28 +01:00
@@ -1276,8 +1276,16 @@ EOF
connect (con1,localhost,root,,);
connection default;
connection con1;
+disconnect con1;
--enable_abort_on_error
+# Test connect without a database
+connect (con2,localhost,root,,*NO-ONE*);
+--error ER_NO_DB_ERROR
+show tables;
+disconnect con2;
+connection default;
+
# ----------------------------------------------------------------------------
# Test mysqltest arguments
# ----------------------------------------------------------------------------
@@ -1635,5 +1643,17 @@ EOF
--exec echo "echo Some output; exit; echo Not this;" | $MYSQL_TEST 2>&1
+# ----------------------------------------------------------------------------
+# Some coverage tests
+# ----------------------------------------------------------------------------
+
+--disable_query_log
+--exec $MYSQL_TEST --help 2>&1 > /dev/null
+--exec $MYSQL_TEST --version 2>&1 > /dev/null
+--enable_quary_log
+--disable_abort_on_error
+--error 1
+--exec $MYSQL_TEST a b c 2>&1 > /dev/null
+--enable_abort_on_error
--echo End of tests
--- 1.147/mysql-test/r/select.result 2007-02-06 15:46:28 +01:00
+++ 1.148/mysql-test/r/select.result 2007-02-06 15:46:28 +01:00
@@ -3642,6 +3642,92 @@ INSERT into t1 values (1), (2), (3);
SELECT * FROM t1 LIMIT 2, -1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near '-1' at line 1
DROP TABLE t1;
+CREATE TABLE t1 (
+ID_with_null int NULL,
+ID_better int NOT NULL,
+INDEX idx1 (ID_with_null),
+INDEX idx2 (ID_better)
+);
+INSERT INTO t1 VALUES (1,1), (2,1), (null,3), (null,3), (null,3), (null,3);
+INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL;
+INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL;
+INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL;
+INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL;
+INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL;
+SELECT COUNT(*) FROM t1 WHERE ID_with_null IS NULL;
+COUNT(*)
+128
+SELECT COUNT(*) FROM t1 WHERE ID_better=1;
+COUNT(*)
+2
+EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID_with_null IS NULL;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref idx1,idx2 idx2 4 const 1 Using where
+DROP INDEX idx1 ON t1;
+CREATE UNIQUE INDEX idx1 ON t1(ID_with_null);
+EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID_with_null IS NULL;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref idx1,idx2 idx2 4 const 1 Using where
+DROP TABLE t1;
+CREATE TABLE t1 (
+ID1_with_null int NULL,
+ID2_with_null int NULL,
+ID_better int NOT NULL,
+INDEX idx1 (ID1_with_null, ID2_with_null),
+INDEX idx2 (ID_better)
+);
+INSERT INTO t1 VALUES (1,1,1), (2,2,1), (3,null,3), (null,3,3), (null,null,3),
+(3,null,3), (null,3,3), (null,null,3), (3,null,3), (null,3,3), (null,null,3);
+INSERT INTO t1 SELECT * FROM t1 WHERE ID1_with_null IS NULL;
+INSERT INTO t1 SELECT * FROM t1 WHERE ID2_with_null IS NULL;
+INSERT INTO t1 SELECT * FROM t1 WHERE ID1_with_null IS NULL;
+INSERT INTO t1 SELECT * FROM t1 WHERE ID2_with_null IS NULL;
+INSERT INTO t1 SELECT * FROM t1 WHERE ID1_with_null IS NULL;
+INSERT INTO t1 SELECT * FROM t1 WHERE ID2_with_null IS NULL;
+SELECT COUNT(*) FROM t1 WHERE ID1_with_null IS NULL AND ID2_with_null=3;
+COUNT(*)
+24
+SELECT COUNT(*) FROM t1 WHERE ID1_with_null=3 AND ID2_with_null IS NULL;
+COUNT(*)
+24
+SELECT COUNT(*) FROM t1 WHERE ID1_with_null IS NULL AND ID2_with_null IS NULL;
+COUNT(*)
+192
+SELECT COUNT(*) FROM t1 WHERE ID_better=1;
+COUNT(*)
+2
+EXPLAIN SELECT * FROM t1
+WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null=3 ;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref idx1,idx2 idx2 4 const 1 Using where
+EXPLAIN SELECT * FROM t1
+WHERE ID_better=1 AND ID1_with_null=3 AND ID2_with_null=3 IS NULL ;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref idx1,idx2 idx2 4 const 1 Using where
+EXPLAIN SELECT * FROM t1
+WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null IS NULL;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref idx1,idx2 idx2 4 const 1 Using where
+DROP INDEX idx1 ON t1;
+CREATE UNIQUE INDEX idx1 ON t1(ID1_with_null,ID2_with_null);
+EXPLAIN SELECT * FROM t1
+WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null=3 ;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref idx1,idx2 idx2 4 const 1 Using where
+EXPLAIN SELECT * FROM t1
+WHERE ID_better=1 AND ID1_with_null=3 AND ID2_with_null IS NULL ;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref idx1,idx2 idx2 4 const 1 Using where
+EXPLAIN SELECT * FROM t1
+WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null IS NULL;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref idx1,idx2 idx2 4 const 1 Using where
+EXPLAIN SELECT * FROM t1
+WHERE ID_better=1 AND ID1_with_null IS NULL AND
+(ID2_with_null=1 OR ID2_with_null=2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref idx1,idx2 idx2 4 const 1 Using where
+DROP TABLE t1;
create table t1 (a bigint unsigned);
insert into t1 values
(if(1, 9223372036854775808, 1)),
--- 1.117/mysql-test/t/select.test 2007-02-06 15:46:28 +01:00
+++ 1.118/mysql-test/t/select.test 2007-02-06 15:46:28 +01:00
@@ -3135,6 +3135,79 @@ SELECT * FROM t1 LIMIT 2, -1;
DROP TABLE t1;
#
+# 25407: wrong estimate of NULL keys for unique indexes
+#
+
+CREATE TABLE t1 (
+ ID_with_null int NULL,
+ ID_better int NOT NULL,
+ INDEX idx1 (ID_with_null),
+ INDEX idx2 (ID_better)
+);
+
+INSERT INTO t1 VALUES (1,1), (2,1), (null,3), (null,3), (null,3), (null,3);
+INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL;
+INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL;
+INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL;
+INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL;
+INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL;
+
+SELECT COUNT(*) FROM t1 WHERE ID_with_null IS NULL;
+SELECT COUNT(*) FROM t1 WHERE ID_better=1;
+
+EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID_with_null IS NULL;
+
+DROP INDEX idx1 ON t1;
+CREATE UNIQUE INDEX idx1 ON t1(ID_with_null);
+
+EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID_with_null IS NULL;
+
+DROP TABLE t1;
+
+CREATE TABLE t1 (
+ ID1_with_null int NULL,
+ ID2_with_null int NULL,
+ ID_better int NOT NULL,
+ INDEX idx1 (ID1_with_null, ID2_with_null),
+ INDEX idx2 (ID_better)
+);
+
+INSERT INTO t1 VALUES (1,1,1), (2,2,1), (3,null,3), (null,3,3), (null,null,3),
+ (3,null,3), (null,3,3), (null,null,3), (3,null,3), (null,3,3), (null,null,3);
+
+INSERT INTO t1 SELECT * FROM t1 WHERE ID1_with_null IS NULL;
+INSERT INTO t1 SELECT * FROM t1 WHERE ID2_with_null IS NULL;
+INSERT INTO t1 SELECT * FROM t1 WHERE ID1_with_null IS NULL;
+INSERT INTO t1 SELECT * FROM t1 WHERE ID2_with_null IS NULL;
+INSERT INTO t1 SELECT * FROM t1 WHERE ID1_with_null IS NULL;
+INSERT INTO t1 SELECT * FROM t1 WHERE ID2_with_null IS NULL;
+
+SELECT COUNT(*) FROM t1 WHERE ID1_with_null IS NULL AND ID2_with_null=3;
+SELECT COUNT(*) FROM t1 WHERE ID1_with_null=3 AND ID2_with_null IS NULL;
+SELECT COUNT(*) FROM t1 WHERE ID1_with_null IS NULL AND ID2_with_null IS NULL;
+SELECT COUNT(*) FROM t1 WHERE ID_better=1;
+
+EXPLAIN SELECT * FROM t1
+ WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null=3 ;
+EXPLAIN SELECT * FROM t1
+ WHERE ID_better=1 AND ID1_with_null=3 AND ID2_with_null=3 IS NULL ;
+EXPLAIN SELECT * FROM t1
+ WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null IS NULL;
+
+DROP INDEX idx1 ON t1;
+CREATE UNIQUE INDEX idx1 ON t1(ID1_with_null,ID2_with_null);
+
+EXPLAIN SELECT * FROM t1
+ WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null=3 ;
+EXPLAIN SELECT * FROM t1
+ WHERE ID_better=1 AND ID1_with_null=3 AND ID2_with_null IS NULL ;
+EXPLAIN SELECT * FROM t1
+ WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null IS NULL;
+EXPLAIN SELECT * FROM t1
+ WHERE ID_better=1 AND ID1_with_null IS NULL AND
+ (ID2_with_null=1 OR ID2_with_null=2);
+
+DROP TABLE t1;
# Bug #22026: Warning when using IF statement and large unsigned bigint
#
--- 1.63/mysql-test/r/grant.result 2007-02-06 15:46:28 +01:00
+++ 1.64/mysql-test/r/grant.result 2007-02-06 15:46:28 +01:00
@@ -1039,4 +1039,24 @@ REVOKE EXECUTE ON PROCEDURE t1 FROM some
ERROR HY000: String '1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY'
is too long for host name (should be no longer than 60)
GRANT PROCESS ON * TO user@localhost;
ERROR 3D000: No database selected
+CREATE USER bug23556@localhost;
+CREATE DATABASE bug23556;
+GRANT SELECT ON bug23556.* TO bug23556@localhost;
+USE bug23556;
+CREATE TABLE t1 (a INT PRIMARY KEY);
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
+GRANT DELETE ON t1 TO bug23556@localhost;
+USE bug23556;
+TRUNCATE t1;
+ERROR 42000: DROP command denied to user 'bug23556'@'localhost' for table 't1'
+USE bug23556;
+REVOKE DELETE ON t1 FROM bug23556@localhost;
+GRANT DROP ON t1 TO bug23556@localhost;
+USE bug23556;
+TRUNCATE t1;
+USE bug23556;
+DROP TABLE t1;
+USE test;
+DROP DATABASE bug23556;
+DROP USER bug23556@localhost;
End of 5.0 tests
--- 1.49/mysql-test/t/grant.test 2007-02-06 15:46:28 +01:00
+++ 1.50/mysql-test/t/grant.test 2007-02-06 15:46:28 +01:00
@@ -974,4 +974,15 @@ DROP TABLE t1;
USE test;
DROP DATABASE bug23556;
DROP USER bug23556@localhost;
+#
+# Bug #6774: Replication fails with Wrong usage of DB GRANT and GLOBAL PRIVILEGES
+#
+# Check if GRANT ... ON * ... fails when no database is selected
+connect (con1, localhost, root,,*NO-ONE*)
+connection con1;
+--error ER_NO_DB_ERROR
+GRANT PROCESS ON * TO user@localhost;
+disconnect con1;
+connection default;
+
--echo End of 5.0 tests
--- 1.213/sql/set_var.cc 2007-02-06 15:46:28 +01:00
+++ 1.214/sql/set_var.cc 2007-02-06 15:46:28 +01:00
@@ -1218,14 +1218,14 @@ static int check_completion_type(THD *th
static void fix_net_read_timeout(THD *thd, enum_var_type type)
{
if (type != OPT_GLOBAL)
- thd->net.read_timeout=thd->variables.net_read_timeout;
+ net_set_read_timeout(&thd->net, thd->variables.net_read_timeout);
}
static void fix_net_write_timeout(THD *thd, enum_var_type type)
{
if (type != OPT_GLOBAL)
- thd->net.write_timeout=thd->variables.net_write_timeout;
+ net_set_write_timeout(&thd->net, thd->variables.net_write_timeout);
}
static void fix_net_retry_count(THD *thd, enum_var_type type)
--- 1.99/sql/set_var.h 2007-02-06 15:46:28 +01:00
+++ 1.100/sql/set_var.h 2007-02-06 15:46:28 +01:00
@@ -480,11 +480,11 @@ class sys_var_thd_bit :public sys_var_th
sys_check_func check_func;
sys_update_func update_func;
public:
- ulong bit_flag;
+ ulonglong bit_flag;
bool reverse;
sys_var_thd_bit(const char *name_arg,
sys_check_func c_func, sys_update_func u_func,
- ulong bit, bool reverse_arg=0)
+ ulonglong bit, bool reverse_arg=0)
:sys_var_thd(name_arg), check_func(c_func), update_func(u_func),
bit_flag(bit), reverse(reverse_arg)
{}
--- 1.2/extra/yassl/taocrypt/mySTL/list.hpp 2007-02-06 15:46:28 +01:00
+++ 1.3/extra/yassl/taocrypt/mySTL/list.hpp 2007-02-06 15:46:28 +01:00
@@ -1,27 +1,20 @@
-/* mySTL list.hpp
- *
- * Copyright (C) 2003 Sawtooth Consulting Ltd.
- *
- * This file is part of yaSSL.
- *
- * yaSSL 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.
- *
- * There are special exceptions to the terms and conditions of the GPL as it
- * is applied to yaSSL. View the full text of the exception in the file
- * FLOSS-EXCEPTIONS in the directory of this software distribution.
- *
- * yaSSL 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) 2000-2007 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; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
/* mySTL list implements a simple list
--- 1.5/extra/yassl/taocrypt/test/test.cpp 2007-02-06 15:46:28 +01:00
+++ 1.6/extra/yassl/taocrypt/test/test.cpp 2007-02-06 15:46:28 +01:00
@@ -74,7 +74,8 @@ using TaoCrypt::EncodeDSA_Signature;
using TaoCrypt::DecodeDSA_Signature;
using TaoCrypt::PBKDF2_HMAC;
using TaoCrypt::tcArrayDelete;
-
+using TaoCrypt::GetCert;
+using TaoCrypt::GetPKCS_Cert;
struct testVector {
@@ -103,6 +104,7 @@ int rsa_test();
int dsa_test();
int dh_test();
int pwdbased_test();
+int pkcs12_test();
TaoCrypt::RandomNumberGenerator rng;
@@ -228,6 +230,13 @@ void taocrypt_test(void* args)
else
printf( "PBKDF2 test passed!\n");
+ /* not ready yet
+ if ( (ret = pkcs12_test()) )
+ err_sys("PKCS12 test failed!\n", ret);
+ else
+ printf( "PKCS12 test passed!\n");
+ */
+
tcArrayDelete(global_cipher);
tcArrayDelete(global_plain);
tcArrayDelete(global_msg);
@@ -994,3 +1003,38 @@ int pwdbased_test()
return 0;
}
+
+
+int pkcs12_test()
+{
+ Source cert;
+ FileSource("../certs/server-cert.pem", cert);
+ if (cert.size() == 0) {
+ FileSource("../../certs/server-cert.pem", cert); // for testsuite
+ if (cert.size() == 0) {
+ FileSource("../../../certs/server-cert.pem", cert); // Debug dir
+ if (cert.size() == 0)
+ err_sys("where's your certs dir?", -109);
+ }
+ }
+
+ if (GetCert(cert) != 0)
+ return -110;
+
+ Source source;
+ FileSource("../certs/server.p12", source);
+ if (source.size() == 0) {
+ FileSource("../../certs/server.p12", source); // for testsuite
+ if (source.size() == 0) {
+ FileSource("../../../certs/server.p12", source); // Debug dir
+ if (source.size() == 0)
+ err_sys("where's your certs dir?", -111);
+ }
+ }
+
+ if (GetPKCS_Cert("password", source) != 0)
+ return -112;
+
+ return 0;
+}
+
--- 1.5/extra/yassl/testsuite/testsuite.cpp 2007-02-06 15:46:28 +01:00
+++ 1.6/extra/yassl/testsuite/testsuite.cpp 2007-02-06 15:46:28 +01:00
@@ -86,8 +86,8 @@ int main(int argc, char** argv)
// input output compare
byte input[TaoCrypt::MD5::DIGEST_SIZE];
byte output[TaoCrypt::MD5::DIGEST_SIZE];
- file_test((char*) "input", input);
- file_test((char*) "output", output);
+ file_test("input", input);
+ file_test("output", output);
assert(memcmp(input, output, sizeof(input)) == 0);
printf("\nAll tests passed!\n");
--- 1.273/BitKeeper/etc/ignore 2007-02-06 15:46:28 +01:00
+++ 1.274/BitKeeper/etc/ignore 2007-02-06 15:46:28 +01:00
@@ -2081,6 +2081,7 @@ storage/archive/.deps/ha_archive_la-azio
storage/archive/.deps/ha_archive_la-ha_archive.Plo
storage/archive/.deps/libarchive_a-azio.Po
storage/archive/.deps/libarchive_a-ha_archive.Po
+storage/archive/archive_reader
storage/archive/archive_test
storage/bdb/*.ds?
storage/bdb/*.vcproj
--- 1.71/sql/repl_failsafe.cc 2007-02-06 15:46:28 +01:00
+++ 1.72/sql/repl_failsafe.cc 2007-02-06 15:46:28 +01:00
@@ -57,6 +57,7 @@ static Slave_log_event* find_slave_event
functions like register_slave()) are working.
*/
+#if NOT_USED
static int init_failsafe_rpl_thread(THD* thd)
{
DBUG_ENTER("init_failsafe_rpl_thread");
@@ -98,7 +99,7 @@ static int init_failsafe_rpl_thread(THD*
thd->set_time();
DBUG_RETURN(0);
}
-
+#endif
void change_rpl_status(RPL_STATUS from_status, RPL_STATUS to_status)
{
@@ -572,12 +573,14 @@ err:
}
+#if NOT_USED
int find_recovery_captain(THD* thd, MYSQL* mysql)
{
return 0;
}
+#endif
-
+#if NOT_USED
pthread_handler_t handle_failsafe_rpl(void *arg)
{
DBUG_ENTER("handle_failsafe_rpl");
@@ -625,7 +628,7 @@ err:
pthread_exit(0);
DBUG_RETURN(0);
}
-
+#endif
bool show_slave_hosts(THD* thd)
{
--- 1.7/extra/yassl/include/buffer.hpp 2007-02-06 15:46:28 +01:00
+++ 1.8/extra/yassl/include/buffer.hpp 2007-02-06 15:46:28 +01:00
@@ -1,27 +1,20 @@
-/* buffer.hpp
- *
- * Copyright (C) 2003 Sawtooth Consulting Ltd.
- *
- * This file is part of yaSSL.
- *
- * yaSSL 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.
- *
- * There are special exceptions to the terms and conditions of the GPL as it
- * is applied to yaSSL. View the full text of the exception in the file
- * FLOSS-EXCEPTIONS in the directory of this software distribution.
- *
- * yaSSL 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) 2000-2007 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; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
/* yaSSL buffer header defines input and output buffers to simulate streaming
--- 1.6/extra/yassl/include/crypto_wrapper.hpp 2007-02-06 15:46:28 +01:00
+++ 1.7/extra/yassl/include/crypto_wrapper.hpp 2007-02-06 15:46:28 +01:00
@@ -1,27 +1,20 @@
-/* crypto_wrapper.hpp
- *
- * Copyright (C) 2003 Sawtooth Consulting Ltd.
- *
- * This file is part of yaSSL.
- *
- * yaSSL 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.
- *
- * There are special exceptions to the terms and conditions of the GPL as it
- * is applied to yaSSL. View the full text of the exception in the file
- * FLOSS-EXCEPTIONS in the directory of this software distribution.
- *
- * yaSSL 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) 2000-2007 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; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
/* The crypto wrapper header is used to define policies for the cipher
--- 1.8/extra/yassl/include/yassl_imp.hpp 2007-02-06 15:46:28 +01:00
+++ 1.9/extra/yassl/include/yassl_imp.hpp 2007-02-06 15:46:28 +01:00
@@ -1,27 +1,20 @@
-/* yassl_imp.hpp
- *
- * Copyright (C) 2003 Sawtooth Consulting Ltd.
- *
- * This file is part of yaSSL.
- *
- * yaSSL 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.
- *
- * There are special exceptions to the terms and conditions of the GPL as it
- * is applied to yaSSL. View the full text of the exception in the file
- * FLOSS-EXCEPTIONS in the directory of this software distribution.
- *
- * yaSSL 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) 2000-2007 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; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
/* yaSSL implementation header defines all strucutres from the SSL.v3
* specification "draft-freier-ssl-version3-02.txt"
--- 1.17/extra/yassl/include/yassl_int.hpp 2007-02-06 15:46:28 +01:00
+++ 1.18/extra/yassl/include/yassl_int.hpp 2007-02-06 15:46:28 +01:00
@@ -1,27 +1,20 @@
-/* yassl_int.hpp
- *
- * Copyright (C) 2003 Sawtooth Consulting Ltd.
- *
- * This file is part of yaSSL.
- *
- * yaSSL 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.
- *
- * There are special exceptions to the terms and conditions of the GPL as it
- * is applied to yaSSL. View the full text of the exception in the file
- * FLOSS-EXCEPTIONS in the directory of this software distribution.
- *
- * yaSSL 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) 2000-2007 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; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
/* yaSSL internal header defines SSL supporting types not specified in the
@@ -592,6 +585,9 @@ class SSL {
Socket socket_; // socket wrapper
Buffers buffers_; // buffered handshakes and data
Log log_; // logger
+
+ // optimization variables
+ bool has_data_; // buffered data ready?
public:
SSL(SSL_CTX* ctx);
@@ -613,6 +609,8 @@ public:
Socket& useSocket();
Log& useLog();
Buffers& useBuffers();
+
+ bool HasData() const;
// sets
void set_pending(Cipher suite);
--- 1.10/extra/yassl/src/crypto_wrapper.cpp 2007-02-06 15:46:28 +01:00
+++ 1.11/extra/yassl/src/crypto_wrapper.cpp 2007-02-06 15:46:28 +01:00
@@ -1,27 +1,20 @@
-/* crypto_wrapper.cpp
- *
- * Copyright (C) 2003 Sawtooth Consulting Ltd.
- *
- * This file is part of yaSSL.
- *
- * yaSSL 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.
- *
- * There are special exceptions to the terms and conditions of the GPL as it
- * is applied to yaSSL. View the full text of the exception in the file
- * FLOSS-EXCEPTIONS in the directory of this software distribution.
- *
- * yaSSL 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) 2000-2007 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; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
/* The crypto wrapper source implements the policies for the cipher
* components used by SSL.
--- 1.9/extra/yassl/taocrypt/include/algebra.hpp 2007-02-06 15:46:28 +01:00
+++ 1.10/extra/yassl/taocrypt/include/algebra.hpp 2007-02-06 15:46:28 +01:00
@@ -1,27 +1,20 @@
-/* algebra.hpp
- *
- * Copyright (C) 2003 Sawtooth Consulting Ltd.
- *
- * This file is part of yaSSL.
- *
- * yaSSL 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.
- *
- * There are special exceptions to the terms and conditions of the GPL as it
- * is applied to yaSSL. View the full text of the exception in the file
- * FLOSS-EXCEPTIONS in the directory of this software distribution.
- *
- * yaSSL 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) 2000-2007 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; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
/* based on Wei Dai's algebra.h from CryptoPP */
--- 1.6/extra/yassl/taocrypt/include/des.hpp 2007-02-06 15:46:28 +01:00
+++ 1.7/extra/yassl/taocrypt/include/des.hpp 2007-02-06 15:46:28 +01:00
@@ -1,27 +1,20 @@
-/* des.hpp
- *
- * Copyright (C) 2003 Sawtooth Consulting Ltd.
- *
- * This file is part of yaSSL.
- *
- * yaSSL 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.
- *
- * There are special exceptions to the terms and conditions of the GPL as it
- * is applied to yaSSL. View the full text of the exception in the file
- * FLOSS-EXCEPTIONS in the directory of this software distribution.
- *
- * yaSSL 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) 2000-2007 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; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
/* des.hpp defines DES, DES_EDE2, and DES_EDE3
see FIPS 46-2 and FIPS 81
--- 1.7/extra/yassl/taocrypt/include/hash.hpp 2007-02-06 15:46:28 +01:00
+++ 1.8/extra/yassl/taocrypt/include/hash.hpp 2007-02-06 15:46:28 +01:00
@@ -1,27 +1,20 @@
-/* hash.hpp
- *
- * Copyright (C) 2003 Sawtooth Consulting Ltd.
- *
- * This file is part of yaSSL.
- *
- * yaSSL 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.
- *
- * There are special exceptions to the terms and conditions of the GPL as it
- * is applied to yaSSL. View the full text of the exception in the file
- * FLOSS-EXCEPTIONS in the directory of this software distribution.
- *
- * yaSSL 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) 2000-2007 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; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
/* hash.hpp provides a base for digest types
*/
--- 1.7/extra/yassl/taocrypt/include/hmac.hpp 2007-02-06 15:46:28 +01:00
+++ 1.8/extra/yassl/taocrypt/include/hmac.hpp 2007-02-06 15:46:28 +01:00
@@ -1,27 +1,20 @@
-/* hmac.hpp
- *
- * Copyright (C) 2003 Sawtooth Consulting Ltd.
- *
- * This file is part of yaSSL.
- *
- * yaSSL 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.
- *
- * There are special exceptions to the terms and conditions of the GPL as it
- * is applied to yaSSL. View the full text of the exception in the file
- * FLOSS-EXCEPTIONS in the directory of this software distribution.
- *
- * yaSSL 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) 2000-2007 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; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
/* hamc.hpp implements HMAC, see RFC 2104
*/
--- 1.4/extra/yassl/taocrypt/include/modarith.hpp 2007-02-06 15:46:28 +01:00
+++ 1.5/extra/yassl/taocrypt/include/modarith.hpp 2007-02-06 15:46:28 +01:00
@@ -1,27 +1,20 @@
-/* modarith.hpp
- *
- * Copyright (C) 2003 Sawtooth Consulting Ltd.
- *
- * This file is part of yaSSL.
- *
- * yaSSL 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.
- *
- * There are special exceptions to the terms and conditions of the GPL as it
- * is applied to yaSSL. View the full text of the exception in the file
- * FLOSS-EXCEPTIONS in the directory of this software distribution.
- *
- * yaSSL 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) 2000-2007 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; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
/* based on Wei Dai's modarith.h from CryptoPP */
--- 1.9/extra/yassl/taocrypt/include/modes.hpp 2007-02-06 15:46:28 +01:00
+++ 1.10/extra/yassl/taocrypt/include/modes.hpp 2007-02-06 15:46:28 +01:00
@@ -1,27 +1,20 @@
-/* modes.hpp
- *
- * Copyright (C) 2003 Sawtooth Consulting Ltd.
- *
- * This file is part of yaSSL.
- *
- * yaSSL 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.
- *
- * There are special exceptions to the terms and conditions of the GPL as it
- * is applied to yaSSL. View the full text of the exception in the file
- * FLOSS-EXCEPTIONS in the directory of this software distribution.
- *
- * yaSSL 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) 2000-2007 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; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
/* modes.hpp provides ECB and CBC modes for block cipher encryption/decryption
*/
--- 1.5/extra/yassl/taocrypt/include/rsa.hpp 2007-02-06 15:46:28 +01:00
+++ 1.6/extra/yassl/taocrypt/include/rsa.hpp 2007-02-06 15:46:28 +01:00
@@ -1,27 +1,20 @@
-/* rsa.hpp
- *
- * Copyright (C) 2003 Sawtooth Consulting Ltd.
- *
- * This file is part of yaSSL.
- *
- * yaSSL 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.
- *
- * There are special exceptions to the terms and conditions of the GPL as it
- * is applied to yaSSL. View the full text of the exception in the file
- * FLOSS-EXCEPTIONS in the directory of this software distribution.
- *
- * yaSSL 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) 2000-2007 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; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
/* rsa.hpp provides RSA ES encrypt/decrypt, SSL (block type 1) sign and verify
*/
--- 1.4/extra/yassl/taocrypt/include/type_traits.hpp 2007-02-06 15:46:28 +01:00
+++ 1.5/extra/yassl/taocrypt/include/type_traits.hpp 2007-02-06 15:46:28 +01:00
@@ -1,27 +1,20 @@
-/* type_traits.hpp
- *
- * Copyright (C) 2003 Sawtooth Consulting Ltd.
- *
- * This file is part of yaSSL.
- *
- * yaSSL 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.
- *
- * There are special exceptions to the terms and conditions of the GPL as it
- * is applied to yaSSL. View the full text of the exception in the file
- * FLOSS-EXCEPTIONS in the directory of this software distribution.
- *
- * yaSSL 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) 2000-2007 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; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
/* type_traits defines fundamental types
* see discussion in C++ Templates, $19.1
--- 1.6/extra/yassl/taocrypt/src/aes.cpp 2007-02-06 15:46:28 +01:00
+++ 1.7/extra/yassl/taocrypt/src/aes.cpp 2007-02-06 15:46:28 +01:00
@@ -1,27 +1,20 @@
-/* aes.cpp
- *
- * Copyright (C) 2003 Sawtooth Consulting Ltd.
- *
- * This file is part of yaSSL.
- *
- * yaSSL 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.
- *
- * There are special exceptions to the terms and conditions of the GPL as it
- * is applied to yaSSL. View the full text of the exception in the file
- * FLOSS-EXCEPTIONS in the directory of this software distribution.
- *
- * yaSSL 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) 2000-2007 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; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
/* C++ based on Wei Dai's aes.cpp from CryptoPP */
/* x86 asm original */
--- 1.13/extra/yassl/taocrypt/src/algebra.cpp 2007-02-06 15:46:28 +01:00
+++ 1.14/extra/yassl/taocrypt/src/algebra.cpp 2007-02-06 15:46:28 +01:00
@@ -1,27 +1,20 @@
-/* algebra.cpp
- *
- * Copyright (C) 2003 Sawtooth Consulting Ltd.
- *
- * This file is part of yaSSL.
- *
- * yaSSL 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.
- *
- * There are special exceptions to the terms and conditions of the GPL as it
- * is applied to yaSSL. View the full text of the exception in the file
- * FLOSS-EXCEPTIONS in the directory of this software distribution.
- *
- * yaSSL 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) 2000-2007 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; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
/* based on Wei Dai's algebra.cpp from CryptoPP */
#undef NDEBUG
--- 1.12/extra/yassl/taocrypt/src/asn.cpp 2007-02-06 15:46:28 +01:00
+++ 1.13/extra/yassl/taocrypt/src/asn.cpp 2007-02-06 15:46:28 +01:00
@@ -1,27 +1,20 @@
- /* asn.cpp
- *
- * Copyright (C) 2003 Sawtooth Consulting Ltd.
- *
- * This file is part of yaSSL.
- *
- * yaSSL 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.
- *
- * There are special exceptions to the terms and conditions of the GPL as it
- * is applied to yaSSL. View the full text of the exception in the file
- * FLOSS-EXCEPTIONS in the directory of this software distribution.
- *
- * yaSSL 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) 2000-2007 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; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
/* asn.cpp implements ASN1 BER, PublicKey, and x509v3 decoding
*/
@@ -1096,6 +1089,85 @@ word32 DecodeDSA_Signature(byte* decoded
return 40;
}
+
+
+// Get Cert in PEM format from BEGIN to END
+int GetCert(Source& source)
+{
+ char header[] = "-----BEGIN CERTIFICATE-----";
+ char footer[] = "-----END CERTIFICATE-----";
+
+ char* begin = strstr((char*)source.get_buffer(), header);
+ char* end = strstr((char*)source.get_buffer(), footer);
+
+ if (!begin || !end || begin >= end) return -1;
+
+ end += strlen(footer);
+ if (*end == '\r') end++;
+
+ Source tmp((byte*)begin, end - begin + 1);
+ source.Swap(tmp);
+
+ return 0;
+}
+
+
+
+// Decode a BER encoded PKCS12 structure
+void PKCS12_Decoder::Decode()
+{
+ ReadHeader();
+ if (source_.GetError().What()) return;
+
+ // Get AuthSafe
+
+ GetSequence();
+
+ // get object id
+ byte obj_id = source_.next();
+ if (obj_id != OBJECT_IDENTIFIER) {
+ source_.SetError(OBJECT_ID_E);
+ return;
+ }
+
+ word32 length = GetLength(source_);
+
+ word32 algo_sum = 0;
+ while (length--)
+ algo_sum += source_.next();
+
+
+
+
+
+
+ // Get MacData optional
+ /*
+ mac digestInfo like certdecoder::getdigest?
+ macsalt octet string
+ iter integer
+
+ */
+}
+
+
+void PKCS12_Decoder::ReadHeader()
+{
+ // Gets Version
+ GetSequence();
+ GetVersion();
+}
+
+
+// Get Cert in PEM format from pkcs12 file
+int GetPKCS_Cert(const char* password, Source& source)
+{
+ PKCS12_Decoder pkcs12(source);
+ pkcs12.Decode();
+
+ return 0;
+}
+
} // namespace
| Thread |
|---|
| • bk commit into 5.1 tree (msvensson:1.2420) | msvensson | 6 Feb |