Commit 9caff206 authored by ian@zim.(none)'s avatar ian@zim.(none)

Merge zim.(none):/home/ian/workspace/mysql-5.0

into  zim.(none):/home/ian/workspace/mysql-5.1-new

Updated bug message in disabled file -Brian
parents 1ec1587c 34b54fa8
......@@ -683,18 +683,24 @@ mysql-test/r/*.out
mysql-test/r/*.reject
mysql-test/r/alter_table.err
mysql-test/r/archive.err
mysql-test/r/backup.log
mysql-test/r/bdb-alter-table-1.err
mysql-test/r/bdb-alter-table-2.err
mysql-test/r/bdb-crash.err
mysql-test/r/bdb-deadlock.err
mysql-test/r/bdb.err
mysql-test/r/bdb.log
mysql-test/r/bdb_cache.err
mysql-test/r/client_test.err
mysql-test/r/csv.err
mysql-test/r/ctype_ucs.err
mysql-test/r/derived.err
mysql-test/r/events.log
mysql-test/r/events_bugs.log
mysql-test/r/events_logs_tests.log
mysql-test/r/exampledb.err
mysql-test/r/func_encrypt.err
mysql-test/r/im_client_port.log
mysql-test/r/index_merge_load.result
mysql-test/r/isam.err
mysql-test/r/lowercase_table2.err
......@@ -704,6 +710,7 @@ mysql-test/r/mysqlbinlog.err
mysql-test/r/mysqlbinlog2.err
mysql-test/r/mysqldump.err
mysql-test/r/mysqltest.err
mysql-test/r/mysqltest.log
mysql-test/r/ndb_alter_table.err
mysql-test/r/ndb_autodiscover.err
mysql-test/r/ndb_autodiscover2.err
......@@ -743,6 +750,9 @@ mysql-test/r/rpl000016.eval
mysql-test/r/rpl_log.eval
mysql-test/r/slave-running.eval
mysql-test/r/slave-stopped.eval
mysql-test/r/symlink.log
mysql-test/r/system_mysql_db.log
mysql-test/r/udf.log
mysql-test/share/mysql
mysql-test/std_data/*.pem
mysql-test/t/index_merge.load
......@@ -1748,10 +1758,3 @@ vio/viotest-sslconnect.cpp
vio/viotest.cpp
zlib/*.ds?
zlib/*.vcproj
mysql-test/r/backup.log
mysql-test/r/events.log
mysql-test/r/events_bugs.log
mysql-test/r/events_logs_tests.log
mysql-test/r/mysqltest.log
mysql-test/r/symlink.log
mysql-test/r/system_mysql_db.log
......@@ -653,7 +653,7 @@ static struct my_option my_long_options[] =
"Base name of shared memory.", (gptr*) &shared_memory_base_name, (gptr*) &shared_memory_base_name,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"socket", 'S', "Socket file to use for connection.",
{"socket", 'S', "Socket file to use for connection. (This will override --port unless --protocol=TCP is specified.)",
(gptr*) &opt_mysql_unix_port, (gptr*) &opt_mysql_unix_port, 0, GET_STR_ALLOC,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#include "sslopt-longopts.h"
......@@ -940,6 +940,13 @@ static int get_options(int argc, char **argv)
connect_flag= 0; /* Not in interactive mode */
}
if (opt_mysql_port && (!opt_protocol) && (!opt_mysql_unix_port))
{
/* Not checking return type since we are using a constant value */
/* straight from the initialization of sql_protocol_typelib. */
opt_protocol= find_type("TCP", &sql_protocol_typelib, 0);
}
if (strcmp(default_charset, charset_info->csname) &&
!(charset_info= get_charset_by_csname(default_charset,
MY_CS_PRIMARY, MYF(MY_WME))))
......
......@@ -287,8 +287,10 @@ typedef struct st_mysql
from mysql_stmt_close if close had to cancel result set of this object.
*/
my_bool *unbuffered_fetch_owner;
#if defined(EMBEDDED_LIBRARY) || defined(EMBEDDED_LIBRARY_COMPATIBLE) || MYSQL_VERSION_ID >= 50100
/* needed for embedded server - no net buffer to store the 'info' */
char *info_buffer;
#endif
} MYSQL;
typedef struct st_mysql_res {
......
......@@ -42,4 +42,4 @@ rpl_sp : Bug#16456
rpl_until : Unstable test case, bug#15886
sp-goto : GOTO is currently is disabled - will be fixed in the future
mysqldump : BUG#18078
udf : Need to check if udf_example.so has been built
udf : Bug#18564 (Permission by Brian)
......@@ -92,17 +92,14 @@ port='@MYSQL_TCP_PORT@'
ldflags='@LDFLAGS@'
# Create options
libs="$ldflags -L$pkglibdir -lmysqlclient @ZLIB_DEPS@ @NON_THREADED_LIBS@"
# We intentionally add a space to the beginning of lib strings, simplifies replace later
libs=" $ldflags -L$pkglibdir -lmysqlclient @ZLIB_DEPS@ @NON_THREADED_LIBS@"
libs="$libs @openssl_libs@ @STATIC_NSS_FLAGS@"
libs=`echo "$libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'`
libs_r=" $ldflags -L$pkglibdir -lmysqlclient_r @ZLIB_DEPS@ @LIBS@ @openssl_libs@"
embedded_libs=" $ldflags -L$pkglibdir -lmysqld @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @innodb_system_libs@"
libs_r="$ldflags -L$pkglibdir -lmysqlclient_r @ZLIB_DEPS@ @LIBS@ @openssl_libs@"
libs_r=`echo "$libs_r" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'`
cflags="-I$pkgincludedir @CFLAGS@ " #note: end space!
include="-I$pkgincludedir"
embedded_libs="$ldflags -L$pkglibdir -lmysqld @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @innodb_system_libs@"
embedded_libs=`echo "$embedded_libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'`
# Remove some options that a client doesn't have to care about
# FIXME until we have a --cxxflags, we need to remove -Xa
......@@ -110,7 +107,7 @@ embedded_libs=`echo "$embedded_libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' |
for remove in DDBUG_OFF DSAFEMALLOC USAFEMALLOC DSAFE_MUTEX \
DPEDANTIC_SAFEMALLOC DUNIV_MUST_NOT_INLINE DFORCE_INIT_OF_VARS \
DEXTRA_DEBUG DHAVE_purify 'O[0-9]' 'W[-A-Za-z]*' \
Xa xstrconst
Xa xstrconst "xc99=none"
do
# The first option we might strip will always have a space before it because
# we set -I$pkgincludedir as the first option
......@@ -118,6 +115,20 @@ do
done
cflags=`echo "$cflags"|sed -e 's/ *\$//'`
# Same for --libs(_r)
for remove in lmtmalloc
do
# We know the strings starts with a space
libs=`echo "$libs"|sed -e "s/ -$remove */ /g"`
libs_r=`echo "$libs_r"|sed -e "s/ -$remove */ /g"`
embedded_libs=`echo "$embedded_libs"|sed -e "s/ -$remove */ /g"`
done
# Strip trailing and ending space if any, and '+' (FIXME why?)
libs=`echo "$libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'`
libs_r=`echo "$libs_r" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'`
embedded_libs=`echo "$embedded_libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'`
usage () {
cat <<EOF
Usage: $0 [OPTIONS]
......
......@@ -1428,13 +1428,7 @@ mysql_init(MYSQL *mysql)
mysql->free_me=1;
}
else
{
#if defined(EMBEDDED_LIBRARY) || MYSQL_VERSION_ID >= 50100
bzero((char*) (mysql), sizeof(*(mysql)));
#else
bzero((char*) (mysql), offsetof(MYSQL, info_buffer));
#endif
}
mysql->options.connect_timeout= CONNECT_TIMEOUT;
mysql->last_used_con= mysql->next_slave= mysql->master = mysql;
mysql->charset=default_charset_info;
......
......@@ -546,7 +546,7 @@ parse_string(char *ptr, char *end, MEM_ROOT *mem_root, LEX_STRING *str)
read escaped string from ptr to eol in already allocated str
SYNOPSIS
parse_escaped_string()
read_escaped_string()
ptr - pointer on string beginning
eol - pointer on character after end of string
str - target string
......@@ -617,7 +617,7 @@ read_escaped_string(char *ptr, char *eol, LEX_STRING *str)
# - pointer on symbol after string
*/
static char *
char *
parse_escaped_string(char *ptr, char *end, MEM_ROOT *mem_root, LEX_STRING *str)
{
char *eol= strchr(ptr, '\n');
......@@ -635,7 +635,7 @@ parse_escaped_string(char *ptr, char *end, MEM_ROOT *mem_root, LEX_STRING *str)
parse '' delimited escaped string
SYNOPSIS
parse_escaped_string()
parse_quoted_escaped_string()
ptr - pointer on string beginning
end - pointer on symbol after parsed string end (still owned
by buffer and can be accessed
......
......@@ -72,6 +72,9 @@ bool get_file_options_ulllist(char *&ptr, char *end, char *line,
gptr base, File_option *parameter,
MEM_ROOT *mem_root);
char *
parse_escaped_string(char *ptr, char *end, MEM_ROOT *mem_root, LEX_STRING *str);
class File_parser;
File_parser *sql_parse_prepare(const LEX_STRING *file_name,
MEM_ROOT *mem_root, bool bad_format_errors);
......
......@@ -109,10 +109,6 @@ const LEX_STRING trg_event_type_names[]=
static TABLE_LIST *add_table_for_trigger(THD *thd, sp_name *trig);
bool handle_old_incorrect_sql_modes(char *&unknown_key, gptr base,
MEM_ROOT *mem_root,
char *end, gptr hook_data);
class Handle_old_incorrect_sql_modes_hook: public Unknown_key_hook
{
private:
......@@ -125,6 +121,20 @@ public:
MEM_ROOT *mem_root, char *end);
};
class Handle_old_incorrect_trigger_table_hook: public Unknown_key_hook
{
public:
Handle_old_incorrect_trigger_table_hook(char *file_path,
LEX_STRING *trigger_table_arg)
:path(file_path), trigger_table_value(trigger_table_arg)
{};
virtual bool process_unknown_string(char *&unknown_key, gptr base,
MEM_ROOT *mem_root, char *end);
private:
char *path;
LEX_STRING *trigger_table_value;
};
/*
Create or drop trigger for table.
......@@ -1126,6 +1136,9 @@ static TABLE_LIST *add_table_for_trigger(THD *thd, sp_name *trig)
LEX_STRING path;
File_parser *parser;
struct st_trigname trigname;
Handle_old_incorrect_trigger_table_hook trigger_table_hook(
path_buff, &trigname.trigger_table);
DBUG_ENTER("add_table_for_trigger");
path.length= build_table_filename(path_buff, FN_REFLEN-1,
......@@ -1151,7 +1164,7 @@ static TABLE_LIST *add_table_for_trigger(THD *thd, sp_name *trig)
if (parser->parse((gptr)&trigname, thd->mem_root,
trigname_file_parameters, 1,
&file_parser_dummy_hook))
&trigger_table_hook))
DBUG_RETURN(0);
/* We need to reset statement table list to be PS/SP friendly. */
......@@ -1541,7 +1554,7 @@ Handle_old_incorrect_sql_modes_hook::process_unknown_string(char *&unknown_key,
MEM_ROOT *mem_root,
char *end)
{
DBUG_ENTER("handle_old_incorrect_sql_modes");
DBUG_ENTER("Handle_old_incorrect_sql_modes_hook::process_unknown_string");
DBUG_PRINT("info", ("unknown key:%60s", unknown_key));
if (unknown_key + INVALID_SQL_MODES_LENGTH + 1 < end &&
......@@ -1570,3 +1583,44 @@ Handle_old_incorrect_sql_modes_hook::process_unknown_string(char *&unknown_key,
}
DBUG_RETURN(FALSE);
}
/*
Trigger BUG#15921 compatibility hook. For details see
Handle_old_incorrect_sql_modes_hook::process_unknown_string().
*/
#define INVALID_TRIGGER_TABLE_LENGTH 15
bool
Handle_old_incorrect_trigger_table_hook::
process_unknown_string(char *&unknown_key, gptr base, MEM_ROOT *mem_root,
char *end)
{
DBUG_ENTER("Handle_old_incorrect_trigger_table_hook::process_unknown_string");
DBUG_PRINT("info", ("unknown key:%60s", unknown_key));
if (unknown_key + INVALID_TRIGGER_TABLE_LENGTH + 1 < end &&
unknown_key[INVALID_TRIGGER_TABLE_LENGTH] == '=' &&
!memcmp(unknown_key, STRING_WITH_LEN("trigger_table")))
{
char *ptr= unknown_key + INVALID_TRIGGER_TABLE_LENGTH + 1;
DBUG_PRINT("info", ("trigger_table affected by BUG#15921 detected"));
push_warning_printf(current_thd,
MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_OLD_FILE_FORMAT,
ER(ER_OLD_FILE_FORMAT),
(char *)path, "TRIGGER");
if (!(ptr= parse_escaped_string(ptr, end, mem_root, trigger_table_value)))
{
my_error(ER_FPARSER_ERROR_IN_PARAMETER, MYF(0), "trigger_table",
unknown_key);
DBUG_RETURN(TRUE);
}
/* Set parsing pointer to the last symbol of string (\n). */
unknown_key= ptr-1;
}
DBUG_RETURN(FALSE);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment