Commit d5cac14e authored by Paul McCullagh's avatar Paul McCullagh

Merged with MariaDB trunk

parents 4ba94920 a0c440b2
...@@ -83,7 +83,7 @@ extern "C" { ...@@ -83,7 +83,7 @@ extern "C" {
#include <term.h> #include <term.h>
#endif #endif
#endif #endif
#endif #endif /* defined(HAVE_CURSES_H) && defined(HAVE_TERM_H) */
#undef bcmp // Fix problem with new readline #undef bcmp // Fix problem with new readline
#if defined(__WIN__) #if defined(__WIN__)
...@@ -92,7 +92,6 @@ extern "C" { ...@@ -92,7 +92,6 @@ extern "C" {
#include <readline/readline.h> #include <readline/readline.h>
#define HAVE_READLINE #define HAVE_READLINE
#endif #endif
//int vidattr(long unsigned int attrs); // Was missing in sun curses
} }
#if !defined(HAVE_VIDATTR) #if !defined(HAVE_VIDATTR)
...@@ -1024,7 +1023,7 @@ static const char *load_default_groups[]= { "mysql","client",0 }; ...@@ -1024,7 +1023,7 @@ static const char *load_default_groups[]= { "mysql","client",0 };
static int embedded_server_arg_count= 0; static int embedded_server_arg_count= 0;
static char *embedded_server_args[MAX_SERVER_ARGS]; static char *embedded_server_args[MAX_SERVER_ARGS];
static const char *embedded_server_groups[]= static const char *embedded_server_groups[]=
{ "server", "embedded", "mysql_SERVER", 0 }; { "server", "embedded", "mysql_SERVER", "mariadb_SERVER", 0 };
#ifdef HAVE_READLINE #ifdef HAVE_READLINE
/* /*
......
...@@ -63,8 +63,9 @@ extern const char * NEAR globerrs[]; /* my_error_messages is here */ ...@@ -63,8 +63,9 @@ extern const char * NEAR globerrs[]; /* my_error_messages is here */
#define EE_FILENOTFOUND 29 #define EE_FILENOTFOUND 29
#define EE_FILE_NOT_CLOSED 30 #define EE_FILE_NOT_CLOSED 30
#define EE_CANT_CHMOD 31 #define EE_CANT_CHMOD 31
#define EE_CANT_COPY_OWNERSHIP 32 #define EE_CANT_SEEK 32
#define EE_ERROR_LAST 32 /* Copy last error nr */ #define EE_CANT_COPY_OWNERSHIP 33
#define EE_ERROR_LAST 33 /* Copy last error nr */
/* Add error numbers before EE_ERROR_LAST and change it accordingly. */ /* Add error numbers before EE_ERROR_LAST and change it accordingly. */
/* exit codes for all MySQL programs */ /* exit codes for all MySQL programs */
......
...@@ -51,6 +51,7 @@ const char * NEAR globerrs[GLOBERRS]= ...@@ -51,6 +51,7 @@ const char * NEAR globerrs[GLOBERRS]=
"File '%s' not found (Errcode: %d)", "File '%s' not found (Errcode: %d)",
"File '%s' (fileno: %d) was not closed", "File '%s' (fileno: %d) was not closed",
"Can't change mode for file '%s' to 0x%lx (Error: %d)", "Can't change mode for file '%s' to 0x%lx (Error: %d)",
"Can't do seek on file '%s' (Errcode: %d)",
"Warning: Can't copy ownership for file '%s' (Error: %d)" "Warning: Can't copy ownership for file '%s' (Error: %d)"
}; };
...@@ -93,6 +94,7 @@ void init_glob_errs() ...@@ -93,6 +94,7 @@ void init_glob_errs()
EE(EE_FILENOTFOUND) = "File '%s' not found (Errcode: %d)"; EE(EE_FILENOTFOUND) = "File '%s' not found (Errcode: %d)";
EE(EE_FILE_NOT_CLOSED) = "File '%s' (fileno: %d) was not closed"; EE(EE_FILE_NOT_CLOSED) = "File '%s' (fileno: %d) was not closed";
EE(EE_CANT_CHMOD) = "Can't change mode for file '%s' to 0x%lx (Error: %d)"; EE(EE_CANT_CHMOD) = "Can't change mode for file '%s' to 0x%lx (Error: %d)";
EE(EE_CANT_SEEK) = "Can't do seek on file '%s' (Errcode: %d)";
EE(EE_CANT_COPY_OWNERSHIP)= "Warning: Can't copy ownership for file '%s' (Error: %d)"; EE(EE_CANT_COPY_OWNERSHIP)= "Warning: Can't copy ownership for file '%s' (Error: %d)";
} }
#endif #endif
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "mysys_priv.h" #include "mysys_priv.h"
#include "mysys_err.h"
/* /*
Seek to a position in a file. Seek to a position in a file.
...@@ -42,8 +43,7 @@ ...@@ -42,8 +43,7 @@
actual error. actual error.
*/ */
my_off_t my_seek(File fd, my_off_t pos, int whence, my_off_t my_seek(File fd, my_off_t pos, int whence, myf MyFlags)
myf MyFlags __attribute__((unused)))
{ {
reg1 os_off_t newpos= -1; reg1 os_off_t newpos= -1;
DBUG_ENTER("my_seek"); DBUG_ENTER("my_seek");
...@@ -68,7 +68,9 @@ my_off_t my_seek(File fd, my_off_t pos, int whence, ...@@ -68,7 +68,9 @@ my_off_t my_seek(File fd, my_off_t pos, int whence,
newpos= lseek(fd, pos, whence); newpos= lseek(fd, pos, whence);
if (newpos == (os_off_t) -1) if (newpos == (os_off_t) -1)
{ {
my_errno=errno; my_errno= errno;
if (MyFlags & MY_WME)
my_error(EE_CANT_SEEK, MYF(0), my_filename(fd), my_errno);
DBUG_PRINT("error",("lseek: %lu errno: %d", (ulong) newpos,errno)); DBUG_PRINT("error",("lseek: %lu errno: %d", (ulong) newpos,errno));
DBUG_RETURN(MY_FILEPOS_ERROR); DBUG_RETURN(MY_FILEPOS_ERROR);
} }
...@@ -83,7 +85,7 @@ my_off_t my_seek(File fd, my_off_t pos, int whence, ...@@ -83,7 +85,7 @@ my_off_t my_seek(File fd, my_off_t pos, int whence,
/* Tell current position of file */ /* Tell current position of file */
/* ARGSUSED */ /* ARGSUSED */
my_off_t my_tell(File fd, myf MyFlags __attribute__((unused))) my_off_t my_tell(File fd, myf MyFlags)
{ {
os_off_t pos; os_off_t pos;
DBUG_ENTER("my_tell"); DBUG_ENTER("my_tell");
...@@ -95,7 +97,11 @@ my_off_t my_tell(File fd, myf MyFlags __attribute__((unused))) ...@@ -95,7 +97,11 @@ my_off_t my_tell(File fd, myf MyFlags __attribute__((unused)))
pos=lseek(fd, 0L, MY_SEEK_CUR); pos=lseek(fd, 0L, MY_SEEK_CUR);
#endif #endif
if (pos == (os_off_t) -1) if (pos == (os_off_t) -1)
my_errno=errno; {
my_errno= errno;
if (MyFlags & MY_WME)
my_error(EE_CANT_SEEK, MYF(0), my_filename(fd), my_errno);
}
DBUG_PRINT("exit",("pos: %lu", (ulong) pos)); DBUG_PRINT("exit",("pos: %lu", (ulong) pos));
DBUG_RETURN((my_off_t) pos); DBUG_RETURN((my_off_t) pos);
} /* my_tell */ } /* my_tell */
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#undef pthread_mutex_init #undef pthread_mutex_init
#undef pthread_mutex_lock #undef pthread_mutex_lock
#undef pthread_mutex_unlock #undef pthread_mutex_unlock
#undef pthread_mutex_trylock
#undef pthread_mutex_destroy #undef pthread_mutex_destroy
#undef pthread_cond_wait #undef pthread_cond_wait
#undef pthread_cond_timedwait #undef pthread_cond_timedwait
...@@ -838,31 +839,9 @@ static void print_deadlock_warning(safe_mutex_t *new_mutex, ...@@ -838,31 +839,9 @@ static void print_deadlock_warning(safe_mutex_t *new_mutex,
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
#elif defined(MY_PTHREAD_FASTMUTEX)
#endif /* THREAD && SAFE_MUTEX */ static ulong mutex_delay(ulong delayloops)
#if defined(THREAD) && defined(MY_PTHREAD_FASTMUTEX) && !defined(SAFE_MUTEX)
#include "mysys_priv.h"
#include "my_static.h"
#include <m_string.h>
#include <m_ctype.h>
#include <hash.h>
#include <myisampack.h>
#include <mysys_err.h>
#include <my_sys.h>
#undef pthread_mutex_t
#undef pthread_mutex_init
#undef pthread_mutex_lock
#undef pthread_mutex_trylock
#undef pthread_mutex_unlock
#undef pthread_mutex_destroy
#undef pthread_cond_wait
#undef pthread_cond_timedwait
ulong mutex_delay(ulong delayloops)
{ {
ulong i; ulong i;
volatile ulong j; volatile ulong j;
...@@ -943,6 +922,6 @@ void fastmutex_global_init(void) ...@@ -943,6 +922,6 @@ void fastmutex_global_init(void)
cpu_count= sysconf(_SC_NPROCESSORS_CONF); cpu_count= sysconf(_SC_NPROCESSORS_CONF);
#endif #endif
} }
#endif /* SAFE_MUTEX_DEFINED */ #endif /* defined(MY_PTHREAD_FASTMUTEX) */
#endif /* THREAD */ #endif /* THREAD */
...@@ -2133,8 +2133,8 @@ void Query_log_event::pack_info(Protocol *protocol) ...@@ -2133,8 +2133,8 @@ void Query_log_event::pack_info(Protocol *protocol)
/** /**
Utility function for the next method (Query_log_event::write()) . Utility function for the next method (Query_log_event::write()) .
*/ */
static void write_str_with_code_and_len(char **dst, const char *src, static void write_str_with_code_and_len(uchar **dst, const char *src,
int len, uint code) uint len, uint code)
{ {
/* /*
only 1 byte to store the length of catalog, so it should not only 1 byte to store the length of catalog, so it should not
...@@ -2229,7 +2229,7 @@ bool Query_log_event::write(IO_CACHE* file) ...@@ -2229,7 +2229,7 @@ bool Query_log_event::write(IO_CACHE* file)
} }
if (catalog_len) // i.e. this var is inited (false for 4.0 events) if (catalog_len) // i.e. this var is inited (false for 4.0 events)
{ {
write_str_with_code_and_len((char **)(&start), write_str_with_code_and_len(&start,
catalog, catalog_len, Q_CATALOG_NZ_CODE); catalog, catalog_len, Q_CATALOG_NZ_CODE);
/* /*
In 5.0.x where x<4 masters we used to store the end zero here. This was In 5.0.x where x<4 masters we used to store the end zero here. This was
...@@ -2267,7 +2267,7 @@ bool Query_log_event::write(IO_CACHE* file) ...@@ -2267,7 +2267,7 @@ bool Query_log_event::write(IO_CACHE* file)
{ {
/* In the TZ sys table, column Name is of length 64 so this should be ok */ /* In the TZ sys table, column Name is of length 64 so this should be ok */
DBUG_ASSERT(time_zone_len <= MAX_TIME_ZONE_NAME_LENGTH); DBUG_ASSERT(time_zone_len <= MAX_TIME_ZONE_NAME_LENGTH);
write_str_with_code_and_len((char **)(&start), write_str_with_code_and_len(&start,
time_zone_str, time_zone_len, Q_TIME_ZONE_CODE); time_zone_str, time_zone_len, Q_TIME_ZONE_CODE);
} }
if (lc_time_names_number) if (lc_time_names_number)
......
...@@ -3437,10 +3437,12 @@ static TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info, ...@@ -3437,10 +3437,12 @@ static TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
Create_field *cr_field; Create_field *cr_field;
Field *field, *def_field; Field *field, *def_field;
if (item->type() == Item::FUNC_ITEM) if (item->type() == Item::FUNC_ITEM)
{
if (item->result_type() != STRING_RESULT) if (item->result_type() != STRING_RESULT)
field= item->tmp_table_field(&tmp_table); field= item->tmp_table_field(&tmp_table);
else else
field= item->tmp_table_field_from_field_type(&tmp_table, 0); field= item->tmp_table_field_from_field_type(&tmp_table, 0);
}
else else
field= create_tmp_field(thd, &tmp_table, item, item->type(), field= create_tmp_field(thd, &tmp_table, item, item->type(),
(Item ***) 0, &tmp_field, &def_field, 0, 0, 0, 0, (Item ***) 0, &tmp_field, &def_field, 0, 0, 0, 0,
......
...@@ -3341,7 +3341,7 @@ mysql_declare_plugin(maria) ...@@ -3341,7 +3341,7 @@ mysql_declare_plugin(maria)
MYSQL_STORAGE_ENGINE_PLUGIN, MYSQL_STORAGE_ENGINE_PLUGIN,
&maria_storage_engine, &maria_storage_engine,
"MARIA", "MARIA",
"MySQL AB", "Monty Program Ab",
"Crash-safe tables with MyISAM heritage", "Crash-safe tables with MyISAM heritage",
PLUGIN_LICENSE_GPL, PLUGIN_LICENSE_GPL,
ha_maria_init, /* Plugin Init */ ha_maria_init, /* Plugin Init */
......
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