Commit d0b32f1a authored by unknown's avatar unknown

Automerge mariadb 5.1 -> mariadb 5.2

parents 02ed15db 1f6a936d
[MYSQL] [MYSQL]
tree_location = lp:maria/5.2 tree_location = lp:maria/5.2
post_commit_to = maria-developers@lists.launchpad.net post_commit_to = commits@mariadb.org
post_commit_url = lp:maria/5.2 post_commit_url = lp:maria/5.2
tree_name = maria/5.2 tree_name = maria/5.2
project_name = "Mariadb 5.2, with Maria 2.0" project_name = "Mariadb 5.2, with Maria 2.0"
...@@ -74,7 +74,6 @@ struct event_base { ...@@ -74,7 +74,6 @@ struct event_base {
Copyright (c) 1991, 1993, The Regents of the University of California. Copyright (c) 1991, 1993, The Regents of the University of California.
All rights reserved. All rights reserved.
*/ */
#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL)
#define TAILQ_FIRST(head) ((head)->tqh_first) #define TAILQ_FIRST(head) ((head)->tqh_first)
#define TAILQ_END(head) NULL #define TAILQ_END(head) NULL
#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) #define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
/* based on Wei Dai's algebra.cpp from CryptoPP */ /* based on Wei Dai's algebra.cpp from CryptoPP */
#undef NDEBUG #undef NDEBUG
#define DEBUG // GCC 4.0 bug if NDEBUG and Optimize > 1
#include "runtime.hpp" #include "runtime.hpp"
#include "algebra.hpp" #include "algebra.hpp"
......
...@@ -25,3 +25,8 @@ ...@@ -25,3 +25,8 @@
#include "mysql_priv.h" #include "mysql_priv.h"
#include "hash_filo.h" #include "hash_filo.h"
#ifdef __WIN__
// Remove linker warning 4221 about empty file
namespace { char dummy; };
#endif // __WIN__
...@@ -85,6 +85,12 @@ int _my_b_net_read(register IO_CACHE *info, uchar *Buffer, ...@@ -85,6 +85,12 @@ int _my_b_net_read(register IO_CACHE *info, uchar *Buffer,
} }
} /* extern "C" */ } /* extern "C" */
#elif defined(__WIN__)
// Remove linker warning 4221 about empty file
namespace { char dummy; };
#endif /* HAVE_REPLICATION */ #endif /* HAVE_REPLICATION */
...@@ -2683,9 +2683,11 @@ bugs.\n"); ...@@ -2683,9 +2683,11 @@ bugs.\n");
end: end:
#ifndef __WIN__ #ifndef __WIN__
/* Terminate */
exit(1); exit(1);
#else #else
/* On Windows, do not terminate, but pass control to the exception filter */; /* On Windows, do not terminate, but pass control to exception filter */
;
#endif #endif
} }
......
...@@ -1036,5 +1036,10 @@ bool load_master_data(THD* thd) ...@@ -1036,5 +1036,10 @@ bool load_master_data(THD* thd)
return error; return error;
} }
#elif defined(__WIN__)
// Remove linker warning 4221 about empty file
namespace { char dummy; };
#endif /* HAVE_REPLICATION */ #endif /* HAVE_REPLICATION */
...@@ -233,8 +233,12 @@ static void check_unused(void) ...@@ -233,8 +233,12 @@ static void check_unused(void)
uint create_table_def_key(THD *thd, char *key, TABLE_LIST *table_list, uint create_table_def_key(THD *thd, char *key, TABLE_LIST *table_list,
bool tmp_table) bool tmp_table)
{ {
uint key_length= (uint) (strmov(strmov(key, table_list->db)+1, char *db_end= strnmov(key, table_list->db, MAX_DBKEY_LENGTH - 2);
table_list->table_name)-key)+1; *db_end++= '\0';
char *table_end= strnmov(db_end, table_list->table_name,
key + MAX_DBKEY_LENGTH - 1 - db_end);
*table_end++= '\0';
uint key_length= (uint) (table_end-key);
if (tmp_table) if (tmp_table)
{ {
int4store(key + key_length, thd->server_id); int4store(key + key_length, thd->server_id);
......
...@@ -1240,10 +1240,12 @@ bool dispatch_command(enum enum_server_command command, THD *thd, ...@@ -1240,10 +1240,12 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
break; break;
#else #else
{ {
char *fields, *packet_end= packet + packet_length, *arg_end; char *fields, *packet_end= packet + packet_length, *wildcard;
/* Locked closure of all tables */ /* Locked closure of all tables */
TABLE_LIST table_list; TABLE_LIST table_list;
LEX_STRING conv_name; char db_buff[NAME_LEN+1];
uint32 db_length;
uint dummy_errors;
/* used as fields initializator */ /* used as fields initializator */
lex_start(thd); lex_start(thd);
...@@ -1255,11 +1257,22 @@ bool dispatch_command(enum enum_server_command command, THD *thd, ...@@ -1255,11 +1257,22 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
/* /*
We have name + wildcard in packet, separated by endzero We have name + wildcard in packet, separated by endzero
*/ */
arg_end= strend(packet); wildcard= strend(packet);
thd->convert_string(&conv_name, system_charset_info, db_length= wildcard - packet;
packet, (uint) (arg_end - packet), thd->charset()); wildcard++;
table_list.alias= table_list.table_name= conv_name.str; uint query_length= (uint) (packet_end - wildcard); // Don't count end \0
packet= arg_end + 1; if (db_length > NAME_LEN || query_length > NAME_LEN)
{
my_message(ER_UNKNOWN_COM_ERROR, ER(ER_UNKNOWN_COM_ERROR), MYF(0));
break;
}
db_length= copy_and_convert(db_buff, sizeof(db_buff)-1,
system_charset_info, packet, db_length,
thd->charset(), &dummy_errors);
db_buff[db_length]= '\0';
table_list.alias= table_list.table_name= db_buff;
if (!(fields= (char *) thd->memdup(wildcard, query_length + 1)))
break;
if (is_schema_db(table_list.db, table_list.db_length)) if (is_schema_db(table_list.db, table_list.db_length))
{ {
...@@ -1268,9 +1281,6 @@ bool dispatch_command(enum enum_server_command command, THD *thd, ...@@ -1268,9 +1281,6 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
table_list.schema_table= schema_table; table_list.schema_table= schema_table;
} }
uint query_length= (uint) (packet_end - packet); // Don't count end \0
if (!(fields= (char *) thd->memdup(packet, query_length + 1)))
break;
thd->set_query(fields, query_length); thd->set_query(fields, query_length);
general_log_print(thd, command, "%s %s", table_list.table_name, fields); general_log_print(thd, command, "%s %s", table_list.table_name, fields);
if (lower_case_table_names) if (lower_case_table_names)
......
...@@ -1835,6 +1835,11 @@ int init_replication_sys_vars() ...@@ -1835,6 +1835,11 @@ int init_replication_sys_vars()
return 0; return 0;
} }
#elif defined(__WIN__)
// Remove linker warning 4221 about empty file
namespace { char dummy; };
#endif /* HAVE_REPLICATION */ #endif /* HAVE_REPLICATION */
...@@ -1460,8 +1460,9 @@ LSN translog_get_file_max_lsn_stored(uint32 file) ...@@ -1460,8 +1460,9 @@ LSN translog_get_file_max_lsn_stored(uint32 file)
{ {
LOGHANDLER_FILE_INFO info; LOGHANDLER_FILE_INFO info;
File fd= open_logfile_by_number_no_cache(file); File fd;
LINT_INIT_STRUCT(info); LINT_INIT_STRUCT(info);
fd= open_logfile_by_number_no_cache(file);
if ((fd < 0) || if ((fd < 0) ||
(translog_read_file_header(&info, fd) | my_close(fd, MYF(MY_WME)))) (translog_read_file_header(&info, fd) | my_close(fd, MYF(MY_WME))))
{ {
......
...@@ -186,5 +186,10 @@ void xt_trace_thread_locks(XTThread *self) ...@@ -186,5 +186,10 @@ void xt_trace_thread_locks(XTThread *self)
} }
} }
#elif defined(__WIN__)
// Remove linker warning 4221 about empty file
namespace { char dummy; };
#endif #endif
...@@ -241,4 +241,9 @@ void pbms_completed(TABLE *table, bool ok) ...@@ -241,4 +241,9 @@ void pbms_completed(TABLE *table, bool ok)
return ; return ;
} }
#elif defined(__WIN__)
// Remove linker warning 4221 about empty file
namespace { char dummy; };
#endif // PBMS_ENABLED #endif // PBMS_ENABLED
...@@ -290,7 +290,7 @@ management to ensure correct alignment for doubles etc. */ ...@@ -290,7 +290,7 @@ management to ensure correct alignment for doubles etc. */
/* The 2-logarithm of UNIV_PAGE_SIZE: */ /* The 2-logarithm of UNIV_PAGE_SIZE: */
#define UNIV_PAGE_SIZE_SHIFT 14 #define UNIV_PAGE_SIZE_SHIFT 14
/* The universal page size of the database */ /* The universal page size of the database */
#define UNIV_PAGE_SIZE (1 << UNIV_PAGE_SIZE_SHIFT) #define UNIV_PAGE_SIZE (1u << UNIV_PAGE_SIZE_SHIFT)
/* Maximum number of parallel threads in a parallelized operation */ /* Maximum number of parallel threads in a parallelized operation */
#define UNIV_MAX_PARALLELISM 32 #define UNIV_MAX_PARALLELISM 32
......
...@@ -423,8 +423,11 @@ mutex_set_waiters( ...@@ -423,8 +423,11 @@ mutex_set_waiters(
mutex_t* mutex, /*!< in: mutex */ mutex_t* mutex, /*!< in: mutex */
ulint n) /*!< in: value to set */ ulint n) /*!< in: value to set */
{ {
#ifndef INNODB_RW_LOCKS_USE_ATOMICS
volatile ulint* ptr; /* declared volatile to ensure that volatile ulint* ptr; /* declared volatile to ensure that
the value is stored to memory */ the value is stored to memory */
#endif
ut_ad(mutex); ut_ad(mutex);
#ifdef INNODB_RW_LOCKS_USE_ATOMICS #ifdef INNODB_RW_LOCKS_USE_ATOMICS
......
...@@ -4114,6 +4114,10 @@ my_wc_mb_filename(CHARSET_INFO *cs __attribute__((unused)), ...@@ -4114,6 +4114,10 @@ my_wc_mb_filename(CHARSET_INFO *cs __attribute__((unused)),
{ {
int code; int code;
char hex[]= "0123456789abcdef"; char hex[]= "0123456789abcdef";
if (s >= e)
return MY_CS_TOOSMALL;
if (wc < 128 && filename_safe_char[wc]) if (wc < 128 && filename_safe_char[wc])
{ {
*s= (uchar) wc; *s= (uchar) wc;
......
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