summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <paul@teton.kitebird.com>2004-03-01 14:35:52 -0600
committerunknown <paul@teton.kitebird.com>2004-03-01 14:35:52 -0600
commit8bdada3e44289789b076350198cccafb6b2de91b (patch)
tree129a7553f33a79b01f599cf2da67c2c4ca0c3383 /sql
parenta1def0c2ab2d8a910b9b0759eb7bff58aa2afc72 (diff)
parent722e0ec37827de7fc8bc17030cac43a9f27c35d7 (diff)
downloadmariadb-git-8bdada3e44289789b076350198cccafb6b2de91b.tar.gz
Merge paul@bk-internal.mysql.com:/home/bk/mysql-4.1
into teton.kitebird.com:/home/paul/mysql-4.1 sql/share/czech/errmsg.txt: Auto merged sql/share/danish/errmsg.txt: Auto merged sql/share/dutch/errmsg.txt: Auto merged sql/share/english/errmsg.txt: Auto merged sql/share/estonian/errmsg.txt: Auto merged sql/share/french/errmsg.txt: Auto merged sql/share/german/errmsg.txt: Auto merged sql/share/greek/errmsg.txt: Auto merged sql/share/hungarian/errmsg.txt: Auto merged sql/share/italian/errmsg.txt: Auto merged sql/share/japanese/errmsg.txt: Auto merged sql/share/korean/errmsg.txt: Auto merged sql/share/norwegian-ny/errmsg.txt: Auto merged sql/share/norwegian/errmsg.txt: Auto merged sql/share/polish/errmsg.txt: Auto merged sql/share/portuguese/errmsg.txt: Auto merged sql/share/romanian/errmsg.txt: Auto merged sql/share/russian/errmsg.txt: Auto merged sql/share/serbian/errmsg.txt: Auto merged sql/share/slovak/errmsg.txt: Auto merged sql/share/spanish/errmsg.txt: Auto merged sql/share/swedish/errmsg.txt: Auto merged sql/share/ukrainian/errmsg.txt: Auto merged
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_innodb.cc6
-rw-r--r--sql/ha_myisam.h1
-rw-r--r--sql/hostname.cc3
-rw-r--r--sql/item.h2
-rw-r--r--sql/item_create.cc11
-rw-r--r--sql/item_create.h1
-rw-r--r--sql/item_strfunc.cc114
-rw-r--r--sql/item_strfunc.h25
-rw-r--r--sql/lex.h3
-rw-r--r--sql/log.cc41
-rw-r--r--sql/mysql_priv.h12
-rw-r--r--sql/mysqld.cc56
-rw-r--r--sql/set_var.cc2
-rw-r--r--sql/share/czech/errmsg.txt4
-rw-r--r--sql/share/danish/errmsg.txt4
-rw-r--r--sql/share/dutch/errmsg.txt4
-rw-r--r--sql/share/english/errmsg.txt10
-rw-r--r--sql/share/estonian/errmsg.txt4
-rw-r--r--sql/share/french/errmsg.txt4
-rw-r--r--sql/share/german/errmsg.txt2
-rw-r--r--sql/share/greek/errmsg.txt4
-rw-r--r--sql/share/hungarian/errmsg.txt4
-rw-r--r--sql/share/italian/errmsg.txt4
-rw-r--r--sql/share/japanese/errmsg.txt4
-rw-r--r--sql/share/korean/errmsg.txt4
-rw-r--r--sql/share/norwegian-ny/errmsg.txt4
-rw-r--r--sql/share/norwegian/errmsg.txt4
-rw-r--r--sql/share/polish/errmsg.txt6
-rw-r--r--sql/share/portuguese/errmsg.txt2
-rw-r--r--sql/share/romanian/errmsg.txt4
-rw-r--r--sql/share/russian/errmsg.txt4
-rw-r--r--sql/share/serbian/errmsg.txt4
-rw-r--r--sql/share/slovak/errmsg.txt4
-rw-r--r--sql/share/spanish/errmsg.txt4
-rw-r--r--sql/share/swedish/errmsg.txt2
-rw-r--r--sql/share/ukrainian/errmsg.txt4
-rw-r--r--sql/sql_acl.cc70
-rw-r--r--sql/sql_base.cc2
-rw-r--r--sql/sql_class.cc8
-rw-r--r--sql/sql_class.h2
-rw-r--r--sql/sql_delete.cc6
-rw-r--r--sql/sql_list.h2
-rw-r--r--sql/sql_load.cc6
-rw-r--r--sql/sql_parse.cc18
-rw-r--r--sql/sql_yacc.yy4
-rw-r--r--sql/table.cc2
-rw-r--r--sql/unireg.cc4
47 files changed, 331 insertions, 164 deletions
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index 40ba7ab1cef..3d226e42d82 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -883,7 +883,7 @@ innobase_init(void)
and consequently we do not need to know the ordering internally in
InnoDB. */
- ut_a(0 == ut_strcmp((char*)my_charset_latin1.name,
+ ut_a(0 == strcmp((char*)my_charset_latin1.name,
(char*)"latin1_swedish_ci"));
memcpy(srv_latin1_ordering, my_charset_latin1.sort_order, 256);
@@ -3826,6 +3826,10 @@ innobase_drop_database(
trx->mysql_thd = current_thd;
trx->mysql_query_str = &((*current_thd).query);
+ if (current_thd->options & OPTION_NO_FOREIGN_KEY_CHECKS) {
+ trx->check_foreigns = FALSE;
+ }
+
error = row_drop_database_for_mysql(namebuf, trx);
/* Flush the log to reduce probability that the .frm files and
diff --git a/sql/ha_myisam.h b/sql/ha_myisam.h
index 06663516011..ddffcfecc29 100644
--- a/sql/ha_myisam.h
+++ b/sql/ha_myisam.h
@@ -65,6 +65,7 @@ class ha_myisam: public handler
uint max_keys() const { return MI_MAX_KEY; }
uint max_key_parts() const { return MAX_REF_PARTS; }
uint max_key_length() const { return MI_MAX_KEY_LENGTH; }
+ uint max_key_part_length() { return MI_MAX_KEY_LENGTH; }
uint checksum() const;
int open(const char *name, int mode, uint test_if_locked);
diff --git a/sql/hostname.cc b/sql/hostname.cc
index c9cb2a43963..c74d230bbcb 100644
--- a/sql/hostname.cc
+++ b/sql/hostname.cc
@@ -27,9 +27,6 @@
extern "C" { // Because of SCO 3.2V4.2
#endif
#if !defined( __WIN__) && !defined(OS2)
-#if !defined(__NETWARE__)
-#include <sys/resource.h>
-#endif /* __NETWARE__ */
#ifdef HAVE_SYS_UN_H
#include <sys/un.h>
#endif
diff --git a/sql/item.h b/sql/item.h
index b06bc85d573..fb93e0ef8ab 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -252,7 +252,7 @@ public:
st_select_lex *depended_from;
Item_ident(const char *db_name_par,const char *table_name_par,
const char *field_name_par);
- Item_ident::Item_ident(THD *thd, Item_ident *item);
+ Item_ident(THD *thd, Item_ident *item);
const char *full_name() const;
bool remove_dependence_processor(byte * arg);
diff --git a/sql/item_create.cc b/sql/item_create.cc
index 4ed8182305d..eda3d43afdc 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -34,14 +34,14 @@ Item *create_func_acos(Item* a)
Item *create_func_aes_encrypt(Item* a, Item* b)
{
- return new Item_func_aes_encrypt(a, b);
+ return new Item_func_aes_encrypt(a, b);
}
-
+
Item *create_func_aes_decrypt(Item* a, Item* b)
{
return new Item_func_aes_decrypt(a, b);
}
-
+
Item *create_func_ascii(Item* a)
{
return new Item_func_ascii(a);
@@ -426,6 +426,11 @@ Item *create_func_ucase(Item* a)
return new Item_func_ucase(a);
}
+Item *create_func_uuid(void)
+{
+ return new Item_func_uuid();
+}
+
Item *create_func_version(void)
{
return new Item_string(NullS,server_version,
diff --git a/sql/item_create.h b/sql/item_create.h
index 773fdffbaf2..a6a3c9e1841 100644
--- a/sql/item_create.h
+++ b/sql/item_create.h
@@ -92,6 +92,7 @@ Item *create_func_time_format(Item *a, Item *b);
Item *create_func_time_to_sec(Item* a);
Item *create_func_to_days(Item* a);
Item *create_func_ucase(Item* a);
+Item *create_func_uuid(void);
Item *create_func_version(void);
Item *create_func_weekday(Item* a);
Item *create_load_file(Item* a);
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index ed6e44262c7..216df5c17d6 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -1599,10 +1599,8 @@ String *Item_func_format::val_str(String *str)
dec= decimals ? decimals+1 : 0;
/* Here default_charset() is right as this is not an automatic conversion */
str->set(nr,decimals, default_charset());
-#ifdef HAVE_ISNAN
if (isnan(nr))
return str;
-#endif
str_length=str->length();
if (nr < 0)
str_length--; // Don't count sign
@@ -2556,7 +2554,7 @@ String *Item_func_compress::val_str(String *str)
size of the destination buffer, which must be at least 0.1% larger than
sourceLen plus 12 bytes.
- Proportion 120/100 founded by Sinica with help of procedure
+ Proportion 120/100 founded by Sinisa with help of procedure
compress(compress(compress(...)))
I.e. zlib give number 'at least'..
*/
@@ -2632,3 +2630,113 @@ err:
return 0;
}
#endif
+
+/*
+ UUID, as in
+ DCE 1.1: Remote Procedure Call,
+ Open Group Technical Standard Document Number C706, October 1997,
+ (supersedes C309 DCE: Remote Procedure Call 8/1994,
+ which was basis for ISO/IEC 11578:1996 specification)
+*/
+
+static struct rand_struct uuid_rand;
+static uint nanoseq;
+static ulonglong uuid_time=0;
+static char clock_seq_and_node_str[]="-0000-000000000000";
+
+/* we cannot use _dig_vec[] as letters should be lowercase */
+static const char hex[] = "0123456789abcdef";
+
+/* number of 100-nanosecond intervals between
+ 1582-10-15 00:00:00.00 and 1970-01-01 00:00:00.00 */
+#define UUID_TIME_OFFSET ((ulonglong) 141427 * 24 * 60 * 60 * 1000 * 10 )
+
+#define UUID_VERSION 0x1000
+#define UUID_VARIANT 0x8000
+
+static ulonglong get_uuid_time()
+{
+ struct timeval tv;
+ gettimeofday(&tv,NULL);
+ return (ulonglong)tv.tv_sec*10000000 +
+ (ulonglong)tv.tv_usec*10 + UUID_TIME_OFFSET + nanoseq;
+}
+
+static void tohex(char *to, uint from, uint len)
+{
+ to+= len;
+ while (len--)
+ {
+ *--to= hex[from & 15];
+ from >>= 4;
+ }
+}
+
+static void set_clock_seq_str()
+{
+ uint16 clock_seq= ((uint)(my_rnd(&uuid_rand)*16383)) | UUID_VARIANT;
+ tohex(clock_seq_and_node_str+1, clock_seq, 4);
+ nanoseq= 0;
+}
+
+String *Item_func_uuid::val_str(String *str)
+{
+ char *s;
+ pthread_mutex_lock(&LOCK_uuid_generator);
+ if (! uuid_time) /* first UUID() call. initializing data */
+ {
+ ulong tmp=sql_rnd_with_mutex();
+ uchar mac[6];
+ int i;
+ if (my_gethwaddr(mac))
+ {
+ /*
+ generating random "hardware addr"
+ and because specs explicitly specify that it should NOT correlate
+ with a clock_seq value (initialized random below), we use a separate
+ randominit() here
+ */
+ randominit(&uuid_rand, tmp + (ulong)current_thd, tmp + query_id);
+ for (i=0; i < sizeof(mac); i++)
+ mac[i]=(uchar)(my_rnd(&uuid_rand)*255);
+ }
+ s=clock_seq_and_node_str+sizeof(clock_seq_and_node_str)-1;
+ for (i=sizeof(mac)-1 ; i>=0 ; i--)
+ {
+ *--s=hex[mac[i] & 15];
+ *--s=hex[mac[i] >> 4];
+ }
+ randominit(&uuid_rand, tmp + (ulong)start_time, tmp + bytes_sent);
+ set_clock_seq_str();
+ }
+
+ ulonglong tv=get_uuid_time();
+ if (unlikely(tv < uuid_time))
+ set_clock_seq_str();
+ else
+ if (unlikely(tv == uuid_time))
+ { /* special protection from low-res system clocks */
+ nanoseq++;
+ tv++;
+ }
+ else
+ nanoseq=0;
+ uuid_time=tv;
+ pthread_mutex_unlock(&LOCK_uuid_generator);
+
+ uint32 time_low= tv & 0xFFFFFFFF;
+ uint16 time_mid= (tv >> 32) & 0xFFFF;
+ uint16 time_hi_and_version= (tv >> 48) | UUID_VERSION;
+
+ str->realloc(UUID_LENGTH+1);
+ str->length(UUID_LENGTH);
+ str->set_charset(system_charset_info);
+ s=(char *) str->ptr();
+ s[8]=s[13]='-';
+ tohex(s, time_low, 8);
+ tohex(s+9, time_mid, 4);
+ tohex(s+14, time_hi_and_version, 4);
+ strmov(s+18, clock_seq_and_node_str);
+ return str;
+}
+
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h
index 4832ddbd1b1..7eb0750711f 100644
--- a/sql/item_strfunc.h
+++ b/sql/item_strfunc.h
@@ -153,7 +153,7 @@ class Item_str_conv :public Item_str_func
public:
Item_str_conv(Item *item) :Item_str_func(item) {}
void fix_length_and_dec()
- {
+ {
collation.set(args[0]->collation);
max_length = args[0]->max_length;
}
@@ -589,10 +589,10 @@ public:
Item_func_quote(Item *a) :Item_str_func(a) {}
const char *func_name() const { return "quote"; }
String *val_str(String *);
- void fix_length_and_dec()
- {
+ void fix_length_and_dec()
+ {
collation.set(args[0]->collation);
- max_length= args[0]->max_length * 2 + 2;
+ max_length= args[0]->max_length * 2 + 2;
}
};
@@ -600,7 +600,7 @@ class Item_func_conv_charset :public Item_str_func
{
CHARSET_INFO *conv_charset;
public:
- Item_func_conv_charset(Item *a, CHARSET_INFO *cs) :Item_str_func(a)
+ Item_func_conv_charset(Item *a, CHARSET_INFO *cs) :Item_str_func(a)
{ conv_charset=cs; }
String *val_str(String *);
void fix_length_and_dec();
@@ -625,7 +625,7 @@ public:
Item_func_charset(Item *a) :Item_str_func(a) {}
String *val_str(String *);
const char *func_name() const { return "charset"; }
- void fix_length_and_dec()
+ void fix_length_and_dec()
{
collation.set(system_charset_info);
max_length= 64 * collation.collation->mbmaxlen; // should be enough
@@ -691,3 +691,16 @@ public:
String *val_str(String *) ZLIB_DEPENDED_FUNCTION
};
+#define UUID_LENGTH (8+1+4+1+4+1+4+1+12)
+class Item_func_uuid: public Item_str_func
+{
+public:
+ Item_func_uuid(): Item_str_func() {}
+ void fix_length_and_dec() {
+ collation.set(system_charset_info);
+ max_length= UUID_LENGTH;
+ }
+ const char *func_name() const{ return "uuid"; }
+ String *val_str(String *);
+};
+
diff --git a/sql/lex.h b/sql/lex.h
index 029a8ac4218..9cdb1067d91 100644
--- a/sql/lex.h
+++ b/sql/lex.h
@@ -654,7 +654,7 @@ static SYMBOL sql_functions[] = {
{ "STDDEV", SYM(STD_SYM)},
{ "STR_TO_DATE", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_str_to_date)},
{ "STRCMP", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_strcmp)},
- { "SUBSTR", SYM(SUBSTRING)},
+ { "SUBSTR", SYM(SUBSTRING)},
{ "SUBSTRING", SYM(SUBSTRING)},
{ "SUBSTRING_INDEX", SYM(SUBSTRING_INDEX)},
{ "SUBTIME", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_subtime)},
@@ -674,6 +674,7 @@ static SYMBOL sql_functions[] = {
{ "UNIQUE_USERS", SYM(UNIQUE_USERS)},
{ "UNIX_TIMESTAMP", SYM(UNIX_TIMESTAMP)},
{ "UPPER", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ucase)},
+ { "UUID", F_SYM(FUNC_ARG0),0,CREATE_FUNC(create_func_uuid)},
{ "VARIANCE", SYM(VARIANCE_SYM)},
{ "VERSION", F_SYM(FUNC_ARG0),0,CREATE_FUNC(create_func_version)},
{ "WEEK", SYM(WEEK_SYM)},
diff --git a/sql/log.cc b/sql/log.cc
index b490845c256..e25d853e2b6 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -203,7 +203,7 @@ bool MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg,
open_flags |= O_RDWR;
else
open_flags |= O_WRONLY;
-
+
db[0]=0;
open_count++;
if ((file=my_open(log_file_name,open_flags,
@@ -216,14 +216,19 @@ bool MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg,
case LOG_NORMAL:
{
char *end;
+ int len=my_snprintf(buff, sizeof(buff), "%s, Version: %s. "
#ifdef EMBEDDED_LIBRARY
- sprintf(buff, "%s, Version: %s, embedded library\n", my_progname, server_version);
+ "embedded library\n", my_progname, server_version
#elif __NT__
- sprintf(buff, "%s, Version: %s, started with:\nTCP Port: %d, Named Pipe: %s\n", my_progname, server_version, mysqld_port, mysqld_unix_port);
+ "started with:\nTCP Port: %d, Named Pipe: %s\n",
+ my_progname, server_version, mysqld_port, mysqld_unix_port
#else
- sprintf(buff, "%s, Version: %s, started with:\nTcp port: %d Unix socket: %s\n", my_progname,server_version,mysqld_port,mysqld_unix_port);
+ "started with:\nTcp port: %d Unix socket: %s\n",
+ my_progname,server_version,mysqld_port,mysqld_unix_port
#endif
- end=strmov(strend(buff),"Time Id Command Argument\n");
+ );
+ end=strnmov(buff+len,"Time Id Command Argument\n",
+ sizeof(buff)-len);
if (my_b_write(&log_file, (byte*) buff,(uint) (end-buff)) ||
flush_io_cache(&log_file))
goto err;
@@ -231,21 +236,21 @@ bool MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg,
}
case LOG_NEW:
{
+ uint len;
time_t skr=time(NULL);
struct tm tm_tmp;
+
localtime_r(&skr,&tm_tmp);
- ulong length;
- length= my_sprintf(buff,
- (buff,
- "# %s, Version: %s at %02d%02d%02d %2d:%02d:%02d\n",
- my_progname,server_version,
- tm_tmp.tm_year % 100,
- tm_tmp.tm_mon+1,
- tm_tmp.tm_mday,
- tm_tmp.tm_hour,
- tm_tmp.tm_min,
- tm_tmp.tm_sec));
- if (my_b_write(&log_file, (byte*) buff, length) ||
+ len= my_snprintf(buff,sizeof(buff),
+ "# %s, Version: %s at %02d%02d%02d %2d:%02d:%02d\n",
+ my_progname,server_version,
+ tm_tmp.tm_year % 100,
+ tm_tmp.tm_mon+1,
+ tm_tmp.tm_mday,
+ tm_tmp.tm_hour,
+ tm_tmp.tm_min,
+ tm_tmp.tm_sec);
+ if (my_b_write(&log_file, (byte*) buff, len) ||
flush_io_cache(&log_file))
goto err;
break;
@@ -260,7 +265,7 @@ bool MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg,
index_file_name_arg= name; // Use same basename for index file
opt= MY_UNPACK_FILENAME | MY_REPLACE_EXT;
}
-
+
if (!my_b_filelength(&log_file))
{
/*
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index f5031f926af..535c1cb16be 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -802,7 +802,7 @@ extern char log_error_file[FN_REFLEN];
extern double log_10[32];
extern ulonglong keybuff_size;
extern ulong refresh_version,flush_version, thread_id,query_id,opened_tables;
-extern ulong created_tmp_tables, created_tmp_disk_tables;
+extern ulong created_tmp_tables, created_tmp_disk_tables, bytes_sent;
extern ulong aborted_threads,aborted_connects;
extern ulong delayed_insert_timeout;
extern ulong delayed_insert_limit, delayed_queue_size;
@@ -857,7 +857,7 @@ extern FILE *bootstrap_file;
extern pthread_key(MEM_ROOT*,THR_MALLOC);
extern pthread_mutex_t LOCK_mysql_create_db,LOCK_Acl,LOCK_open,
LOCK_thread_count,LOCK_mapped_file,LOCK_user_locks, LOCK_status,
- LOCK_error_log, LOCK_delayed_insert,
+ LOCK_error_log, LOCK_delayed_insert, LOCK_uuid_generator,
LOCK_delayed_status, LOCK_delayed_create, LOCK_crypt, LOCK_timezone,
LOCK_slave_list, LOCK_active_mi, LOCK_manager,
LOCK_global_system_variables, LOCK_user_conn;
@@ -1085,6 +1085,14 @@ inline const char *table_case_name(HA_CREATE_INFO *info, const char *name)
return ((lower_case_table_names == 2 && info->alias) ? info->alias : name);
}
+inline ulong sql_rnd_with_mutex()
+{
+ pthread_mutex_lock(&LOCK_thread_count);
+ ulong tmp=(ulong) (my_rnd(&sql_rand) * 0xffffffff); /* make all bits random */
+ pthread_mutex_unlock(&LOCK_thread_count);
+ return tmp;
+}
+
Comp_creator *comp_eq_creator(bool invert);
Comp_creator *comp_ge_creator(bool invert);
Comp_creator *comp_gt_creator(bool invert);
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index af61d624464..5071cfaff6b 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -188,7 +188,6 @@ inline void reset_floating_point_exceptions()
extern "C" int gethostname(char *name, int namelen);
#endif
-
/* Set prefix for windows binary */
#ifdef __WIN__
#undef MYSQL_SERVER_SUFFIX
@@ -370,7 +369,7 @@ pthread_key(MEM_ROOT*,THR_MALLOC);
pthread_key(THD*, THR_THD);
pthread_mutex_t LOCK_mysql_create_db, LOCK_Acl, LOCK_open, LOCK_thread_count,
LOCK_mapped_file, LOCK_status,
- LOCK_error_log,
+ LOCK_error_log, LOCK_uuid_generator,
LOCK_delayed_insert, LOCK_delayed_status, LOCK_delayed_create,
LOCK_crypt, LOCK_bytes_sent, LOCK_bytes_received,
LOCK_global_system_variables,
@@ -430,7 +429,7 @@ static NTService Service; // Service object for WinNT
#endif /* __WIN__ */
#ifdef __NT__
-static char szPipeName [ 257 ];
+static char pipe_name[512];
static SECURITY_ATTRIBUTES saPipeSecurity;
static SECURITY_DESCRIPTOR sdPipeDescriptor;
static HANDLE hPipe = INVALID_HANDLE_VALUE;
@@ -573,7 +572,7 @@ static void close_connections(void)
DBUG_PRINT( "quit", ("Closing named pipes") );
/* Create connection to the handle named pipe handler to break the loop */
- if ((temp = CreateFile(szPipeName,
+ if ((temp = CreateFile(pipe_name,
GENERIC_READ | GENERIC_WRITE,
0,
NULL,
@@ -581,7 +580,7 @@ static void close_connections(void)
0,
NULL )) != INVALID_HANDLE_VALUE)
{
- WaitNamedPipe(szPipeName, 1000);
+ WaitNamedPipe(pipe_name, 1000);
DWORD dwMode = PIPE_READMODE_BYTE | PIPE_WAIT;
SetNamedPipeHandleState(temp, &dwMode, NULL, NULL);
CancelIo(temp);
@@ -1185,11 +1184,14 @@ static void server_init(void)
if (Service.IsNT() && mysqld_unix_port[0] && !opt_bootstrap &&
opt_enable_named_pipe)
{
- sprintf(szPipeName, "\\\\.\\pipe\\%s", mysqld_unix_port );
- ZeroMemory( &saPipeSecurity, sizeof(saPipeSecurity) );
- ZeroMemory( &sdPipeDescriptor, sizeof(sdPipeDescriptor) );
- if ( !InitializeSecurityDescriptor(&sdPipeDescriptor,
- SECURITY_DESCRIPTOR_REVISION) )
+
+ pipe_name[sizeof(pipe_name)-1]= 0; /* Safety if too long string */
+ strxnmov(pipe_name, sizeof(pipe_name)-1, "\\\\.\\pipe\\",
+ unix_socket, NullS);
+ bzero((char*) &saPipeSecurity, sizeof(saPipeSecurity));
+ bzero((char*) &sdPipeDescriptor, sizeof(sdPipeDescriptor));
+ if (!InitializeSecurityDescriptor(&sdPipeDescriptor,
+ SECURITY_DESCRIPTOR_REVISION))
{
sql_perror("Can't start server : Initialize security descriptor");
unireg_abort(1);
@@ -1202,16 +1204,16 @@ static void server_init(void)
saPipeSecurity.nLength = sizeof( SECURITY_ATTRIBUTES );
saPipeSecurity.lpSecurityDescriptor = &sdPipeDescriptor;
saPipeSecurity.bInheritHandle = FALSE;
- if ((hPipe = CreateNamedPipe(szPipeName,
- PIPE_ACCESS_DUPLEX,
- PIPE_TYPE_BYTE |
- PIPE_READMODE_BYTE |
- PIPE_WAIT,
- PIPE_UNLIMITED_INSTANCES,
- (int) global_system_variables.net_buffer_length,
- (int) global_system_variables.net_buffer_length,
- NMPWAIT_USE_DEFAULT_WAIT,
- &saPipeSecurity )) == INVALID_HANDLE_VALUE)
+ if ((hPipe= CreateNamedPipe(pipe_name,
+ PIPE_ACCESS_DUPLEX,
+ PIPE_TYPE_BYTE |
+ PIPE_READMODE_BYTE |
+ PIPE_WAIT,
+ PIPE_UNLIMITED_INSTANCES,
+ (int) global_system_variables.net_buffer_length,
+ (int) global_system_variables.net_buffer_length,
+ NMPWAIT_USE_DEFAULT_WAIT,
+ &saPipeSecurity)) == INVALID_HANDLE_VALUE)
{
LPVOID lpMsgBuf;
int error=GetLastError();
@@ -2204,6 +2206,7 @@ static int init_thread_environment()
(void) pthread_mutex_init(&LOCK_user_conn, MY_MUTEX_INIT_FAST);
(void) pthread_mutex_init(&LOCK_active_mi, MY_MUTEX_INIT_FAST);
(void) pthread_mutex_init(&LOCK_global_system_variables, MY_MUTEX_INIT_FAST);
+ (void) pthread_mutex_init(&LOCK_uuid_generator, MY_MUTEX_INIT_FAST);
(void) my_rwlock_init(&LOCK_sys_init_connect, NULL);
(void) my_rwlock_init(&LOCK_sys_init_slave, NULL);
(void) my_rwlock_init(&LOCK_grant, NULL);
@@ -2948,8 +2951,6 @@ static void create_new_thread(THD *thd)
DBUG_VOID_RETURN;
}
pthread_mutex_lock(&LOCK_thread_count);
- if (thread_count-delayed_insert_threads > max_used_connections)
- max_used_connections=thread_count-delayed_insert_threads;
thd->thread_id=thread_id++;
thd->real_id=pthread_self(); // Keep purify happy
@@ -2978,6 +2979,8 @@ static void create_new_thread(THD *thd)
thread_count++;
thread_created++;
threads.append(thd);
+ if (thread_count-delayed_insert_threads > max_used_connections)
+ max_used_connections=thread_count-delayed_insert_threads;
DBUG_PRINT("info",(("creating thread %d"), thd->thread_id));
thd->connect_time = time(NULL);
if ((error=pthread_create(&thd->real_id,&connection_attrib,
@@ -3270,7 +3273,7 @@ extern "C" pthread_handler_decl(handle_connections_namedpipes,arg)
if (!fConnected)
{
CloseHandle( hPipe );
- if ((hPipe = CreateNamedPipe(szPipeName,
+ if ((hPipe = CreateNamedPipe(pipe_name,
PIPE_ACCESS_DUPLEX,
PIPE_TYPE_BYTE |
PIPE_READMODE_BYTE |
@@ -3288,7 +3291,7 @@ extern "C" pthread_handler_decl(handle_connections_namedpipes,arg)
}
hConnectedPipe = hPipe;
/* create new pipe for new connection */
- if ((hPipe = CreateNamedPipe(szPipeName,
+ if ((hPipe = CreateNamedPipe(pipe_name,
PIPE_ACCESS_DUPLEX,
PIPE_TYPE_BYTE |
PIPE_READMODE_BYTE |
@@ -4180,7 +4183,7 @@ replicating a LOAD DATA INFILE command.",
0, 0, 0, 0, 0},
{"tmpdir", 't',
"Path for temporary files. Several paths may be specified, separated by a "
-#if defined( __WIN__) || defined(OS2)
+#if defined( __WIN__) || defined(OS2) || defined(__NETWARE__)
"semicolon (;)"
#else
"colon (:)"
@@ -5612,9 +5615,10 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
}
global_system_variables.sql_mode= fix_sql_mode(global_system_variables.
sql_mode);
+ break;
}
case OPT_FT_BOOLEAN_SYNTAX:
- if (ft_boolean_check_syntax_string(argument))
+ if (ft_boolean_check_syntax_string((byte*) argument))
{
fprintf(stderr, "Invalid ft-boolean-syntax string: %s\n", argument);
exit(1);
diff --git a/sql/set_var.cc b/sql/set_var.cc
index f3728ce9e5d..12be0225421 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -860,7 +860,7 @@ static void sys_default_init_slave(THD* thd, enum_var_type type)
static int sys_check_ftb_syntax(THD *thd, set_var *var)
{
if (thd->master_access & SUPER_ACL)
- return ft_boolean_check_syntax_string(var->value->str_value.c_ptr()) ?
+ return ft_boolean_check_syntax_string((byte*) var->value->str_value.c_ptr()) ?
-1 : 0;
else
{
diff --git a/sql/share/czech/errmsg.txt b/sql/share/czech/errmsg.txt
index d0d5b8a584f..074aa71fb4e 100644
--- a/sql/share/czech/errmsg.txt
+++ b/sql/share/czech/errmsg.txt
@@ -274,7 +274,7 @@ character-set=latin2
"Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns",
-"Row %ld was truncated; It contained more data than there where input columns",
+"Row %ld was truncated; It contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld",
@@ -302,4 +302,4 @@ character-set=latin2
"'%s' is deprecated, use '%s' instead",
"The target table %-.100s of the %s is not updatable",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
-"MySQL is started in --skip-grant-tables mode. You can't use this command",
+"The MySQL server is running with the %s option so it cannot execute this statement",
diff --git a/sql/share/danish/errmsg.txt b/sql/share/danish/errmsg.txt
index 9178441fa1a..eef22418fe6 100644
--- a/sql/share/danish/errmsg.txt
+++ b/sql/share/danish/errmsg.txt
@@ -268,7 +268,7 @@ character-set=latin1
"Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns",
-"Row %ld was truncated; It contained more data than there where input columns",
+"Row %ld was truncated; It contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld",
@@ -296,4 +296,4 @@ character-set=latin1
"'%s' is deprecated, use '%s' instead",
"The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
-"MySQL is started in --skip-grant-tables mode. You can't use this command",
+"The MySQL server is running with the %s option so it cannot execute this statement",
diff --git a/sql/share/dutch/errmsg.txt b/sql/share/dutch/errmsg.txt
index d6311775ef3..7b9eeb5f7f9 100644
--- a/sql/share/dutch/errmsg.txt
+++ b/sql/share/dutch/errmsg.txt
@@ -276,7 +276,7 @@ character-set=latin1
"Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns",
-"Row %ld was truncated; It contained more data than there where input columns",
+"Row %ld was truncated; It contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld",
@@ -304,4 +304,4 @@ character-set=latin1
"'%s' is deprecated, use '%s' instead",
"The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
-"MySQL is started in --skip-grant-tables mode. You can't use this command",
+"The MySQL server is running with the %s option so it cannot execute this statement",
diff --git a/sql/share/english/errmsg.txt b/sql/share/english/errmsg.txt
index 49d74165dbd..c1ed2ec050c 100644
--- a/sql/share/english/errmsg.txt
+++ b/sql/share/english/errmsg.txt
@@ -260,12 +260,12 @@ character-set=latin1
"Slave is already running",
"Slave has already been stopped",
"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)",
-"ZLIB: Not enough memory available for zlib",
-"ZLIB: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)",
-"ZLIB: Input data was corrupted for zlib",
+"ZLIB: Not enough memory",
+"ZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)",
+"ZLIB: Input data corrupted",
"%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns",
-"Row %ld was truncated; It contained more data than there where input columns",
+"Row %ld was truncated; It contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld",
@@ -293,4 +293,4 @@ character-set=latin1
"'%s' is deprecated, use '%s' instead",
"The target table %-.100s of the %s is not updatable",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
-"MySQL is started in --skip-grant-tables mode. You can't use this command",
+"The MySQL server is running with the %s option so it cannot execute this statement",
diff --git a/sql/share/estonian/errmsg.txt b/sql/share/estonian/errmsg.txt
index d898a045877..5b2a8bd5edb 100644
--- a/sql/share/estonian/errmsg.txt
+++ b/sql/share/estonian/errmsg.txt
@@ -270,7 +270,7 @@ character-set=latin7
"Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns",
-"Row %ld was truncated; It contained more data than there where input columns",
+"Row %ld was truncated; It contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld",
@@ -298,4 +298,4 @@ character-set=latin7
"'%s' is deprecated, use '%s' instead",
"The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
-"MySQL is started in --skip-grant-tables mode. You can't use this command",
+"The MySQL server is running with the %s option so it cannot execute this statement",
diff --git a/sql/share/french/errmsg.txt b/sql/share/french/errmsg.txt
index 1f8e5378783..a0f8926c5a8 100644
--- a/sql/share/french/errmsg.txt
+++ b/sql/share/french/errmsg.txt
@@ -265,7 +265,7 @@ character-set=latin1
"Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns",
-"Row %ld was truncated; It contained more data than there where input columns",
+"Row %ld was truncated; It contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld",
@@ -293,4 +293,4 @@ character-set=latin1
"'%s' is deprecated, use '%s' instead",
"The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
-"MySQL is started in --skip-grant-tables mode. You can't use this command",
+"The MySQL server is running with the %s option so it cannot execute this statement",
diff --git a/sql/share/german/errmsg.txt b/sql/share/german/errmsg.txt
index 7f35e35de9c..12e0b7d1cd2 100644
--- a/sql/share/german/errmsg.txt
+++ b/sql/share/german/errmsg.txt
@@ -305,4 +305,4 @@ character-set=latin1
"'%s' is deprecated, use '%s' instead",
"The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
-"MySQL is started in --skip-grant-tables mode. You can't use this command",
+"The MySQL server is running with the %s option so it cannot execute this statement",
diff --git a/sql/share/greek/errmsg.txt b/sql/share/greek/errmsg.txt
index c1891abe34a..f2e3fe617a3 100644
--- a/sql/share/greek/errmsg.txt
+++ b/sql/share/greek/errmsg.txt
@@ -265,7 +265,7 @@ character-set=greek
"Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns",
-"Row %ld was truncated; It contained more data than there where input columns",
+"Row %ld was truncated; It contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld",
@@ -293,4 +293,4 @@ character-set=greek
"'%s' is deprecated, use '%s' instead",
"The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
-"MySQL is started in --skip-grant-tables mode. You can't use this command",
+"The MySQL server is running with the %s option so it cannot execute this statement",
diff --git a/sql/share/hungarian/errmsg.txt b/sql/share/hungarian/errmsg.txt
index 698f1dfa8f8..bf2d1d6316c 100644
--- a/sql/share/hungarian/errmsg.txt
+++ b/sql/share/hungarian/errmsg.txt
@@ -267,7 +267,7 @@ character-set=latin2
"Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns",
-"Row %ld was truncated; It contained more data than there where input columns",
+"Row %ld was truncated; It contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld",
@@ -295,4 +295,4 @@ character-set=latin2
"'%s' is deprecated, use '%s' instead",
"The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
-"MySQL is started in --skip-grant-tables mode. You can't use this command",
+"The MySQL server is running with the %s option so it cannot execute this statement",
diff --git a/sql/share/italian/errmsg.txt b/sql/share/italian/errmsg.txt
index 2b7f0ce5935..8a70fdb09e5 100644
--- a/sql/share/italian/errmsg.txt
+++ b/sql/share/italian/errmsg.txt
@@ -265,7 +265,7 @@ character-set=latin1
"Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns",
-"Row %ld was truncated; It contained more data than there where input columns",
+"Row %ld was truncated; It contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld",
@@ -293,4 +293,4 @@ character-set=latin1
"'%s' is deprecated, use '%s' instead",
"The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
-"MySQL is started in --skip-grant-tables mode. You can't use this command",
+"The MySQL server is running with the %s option so it cannot execute this statement",
diff --git a/sql/share/japanese/errmsg.txt b/sql/share/japanese/errmsg.txt
index 12fdc8d2ed0..e3589fdd287 100644
--- a/sql/share/japanese/errmsg.txt
+++ b/sql/share/japanese/errmsg.txt
@@ -267,7 +267,7 @@ character-set=ujis
"Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns",
-"Row %ld was truncated; It contained more data than there where input columns",
+"Row %ld was truncated; It contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld",
@@ -295,4 +295,4 @@ character-set=ujis
"'%s' is deprecated, use '%s' instead",
"The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
-"MySQL is started in --skip-grant-tables mode. You can't use this command",
+"The MySQL server is running with the %s option so it cannot execute this statement",
diff --git a/sql/share/korean/errmsg.txt b/sql/share/korean/errmsg.txt
index 3cba9d0510f..1857aca10ff 100644
--- a/sql/share/korean/errmsg.txt
+++ b/sql/share/korean/errmsg.txt
@@ -265,7 +265,7 @@ character-set=euckr
"Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns",
-"Row %ld was truncated; It contained more data than there where input columns",
+"Row %ld was truncated; It contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld",
@@ -293,4 +293,4 @@ character-set=euckr
"'%s' is deprecated, use '%s' instead",
"The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
-"MySQL is started in --skip-grant-tables mode. You can't use this command",
+"The MySQL server is running with the %s option so it cannot execute this statement",
diff --git a/sql/share/norwegian-ny/errmsg.txt b/sql/share/norwegian-ny/errmsg.txt
index 2734d37a753..3959f270012 100644
--- a/sql/share/norwegian-ny/errmsg.txt
+++ b/sql/share/norwegian-ny/errmsg.txt
@@ -267,7 +267,7 @@ character-set=latin1
"Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns",
-"Row %ld was truncated; It contained more data than there where input columns",
+"Row %ld was truncated; It contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld",
@@ -295,4 +295,4 @@ character-set=latin1
"'%s' is deprecated, use '%s' instead",
"The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
-"MySQL is started in --skip-grant-tables mode. You can't use this command",
+"The MySQL server is running with the %s option so it cannot execute this statement",
diff --git a/sql/share/norwegian/errmsg.txt b/sql/share/norwegian/errmsg.txt
index 1c51673ed91..96aeb9cdae6 100644
--- a/sql/share/norwegian/errmsg.txt
+++ b/sql/share/norwegian/errmsg.txt
@@ -267,7 +267,7 @@ character-set=latin1
"Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns",
-"Row %ld was truncated; It contained more data than there where input columns",
+"Row %ld was truncated; It contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld",
@@ -295,4 +295,4 @@ character-set=latin1
"'%s' is deprecated, use '%s' instead",
"The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
-"MySQL is started in --skip-grant-tables mode. You can't use this command",
+"The MySQL server is running with the %s option so it cannot execute this statement",
diff --git a/sql/share/polish/errmsg.txt b/sql/share/polish/errmsg.txt
index c03b84656ee..5994a5e0b0f 100644
--- a/sql/share/polish/errmsg.txt
+++ b/sql/share/polish/errmsg.txt
@@ -269,7 +269,7 @@ character-set=latin2
"Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns",
-"Row %ld was truncated; It contained more data than there where input columns",
+"Row %ld was truncated; It contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld",
@@ -295,6 +295,6 @@ character-set=latin2
"MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work",
"Unknown table engine '%s'",
"'%s' is deprecated, use '%s' instead",
-"The target table %-.100s of the %s is not updateble",
+"The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
-"MySQL is started in --skip-grant-tables mode. You can't use this command",
+"The MySQL server is running with the %s option so it cannot execute this statement",
diff --git a/sql/share/portuguese/errmsg.txt b/sql/share/portuguese/errmsg.txt
index 7bccddc04a8..2ebee11237d 100644
--- a/sql/share/portuguese/errmsg.txt
+++ b/sql/share/portuguese/errmsg.txt
@@ -294,4 +294,4 @@ character-set=latin1
"'%s' И desatualizado. Use '%s' em seu lugar",
"The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
-"MySQL is started in --skip-grant-tables mode. You can't use this command",
+"The MySQL server is running with the %s option so it cannot execute this statement",
diff --git a/sql/share/romanian/errmsg.txt b/sql/share/romanian/errmsg.txt
index 4b230279bf9..7e1dcb9eddd 100644
--- a/sql/share/romanian/errmsg.txt
+++ b/sql/share/romanian/errmsg.txt
@@ -269,7 +269,7 @@ character-set=latin2
"Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns",
-"Row %ld was truncated; It contained more data than there where input columns",
+"Row %ld was truncated; It contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld",
@@ -297,4 +297,4 @@ character-set=latin2
"'%s' is deprecated, use '%s' instead",
"The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
-"MySQL is started in --skip-grant-tables mode. You can't use this command",
+"The MySQL server is running with the %s option so it cannot execute this statement",
diff --git a/sql/share/russian/errmsg.txt b/sql/share/russian/errmsg.txt
index 4282c5326af..cd32d591712 100644
--- a/sql/share/russian/errmsg.txt
+++ b/sql/share/russian/errmsg.txt
@@ -267,7 +267,7 @@ character-set=koi8r
"Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns",
-"Row %ld was truncated; It contained more data than there where input columns",
+"Row %ld was truncated; It contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld",
@@ -295,4 +295,4 @@ character-set=koi8r
"'%s' is deprecated, use '%s' instead",
"Таблица %-.100s в %s не может изменятся",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
-"MySQL is started in --skip-grant-tables mode. You can't use this command",
+"The MySQL server is running with the %s option so it cannot execute this statement",
diff --git a/sql/share/serbian/errmsg.txt b/sql/share/serbian/errmsg.txt
index ea1b200aa32..58d8db4df13 100644
--- a/sql/share/serbian/errmsg.txt
+++ b/sql/share/serbian/errmsg.txt
@@ -259,7 +259,7 @@ character-set=cp1250
"Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns",
-"Row %ld was truncated; It contained more data than there where input columns",
+"Row %ld was truncated; it contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld",
@@ -287,4 +287,4 @@ character-set=cp1250
"'%s' is deprecated, use '%s' instead",
"The target table %-.100s of the %s is not updatable",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working"
-"MySQL is started in --skip-grant-tables mode. You can't use this command"
+"The MySQL server is running with the %s option so it cannot execute this statement"
diff --git a/sql/share/slovak/errmsg.txt b/sql/share/slovak/errmsg.txt
index 7ab88f44626..78048c9e34b 100644
--- a/sql/share/slovak/errmsg.txt
+++ b/sql/share/slovak/errmsg.txt
@@ -273,7 +273,7 @@ character-set=latin2
"Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns",
-"Row %ld was truncated; It contained more data than there where input columns",
+"Row %ld was truncated; It contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld",
@@ -301,4 +301,4 @@ character-set=latin2
"'%s' is deprecated, use '%s' instead",
"The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
-"MySQL is started in --skip-grant-tables mode. You can't use this command",
+"The MySQL server is running with the %s option so it cannot execute this statement",
diff --git a/sql/share/spanish/errmsg.txt b/sql/share/spanish/errmsg.txt
index f2f439cdb4f..f9336272162 100644
--- a/sql/share/spanish/errmsg.txt
+++ b/sql/share/spanish/errmsg.txt
@@ -267,7 +267,7 @@ character-set=latin1
"Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns",
-"Row %ld was truncated; It contained more data than there where input columns",
+"Row %ld was truncated; It contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld",
@@ -295,4 +295,4 @@ character-set=latin1
"'%s' is deprecated, use '%s' instead",
"The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
-"MySQL is started in --skip-grant-tables mode. You can't use this command",
+"The MySQL server is running with the %s option so it cannot execute this statement",
diff --git a/sql/share/swedish/errmsg.txt b/sql/share/swedish/errmsg.txt
index 251e4d84d8e..dac3c2d8d10 100644
--- a/sql/share/swedish/errmsg.txt
+++ b/sql/share/swedish/errmsg.txt
@@ -265,7 +265,7 @@ character-set=latin1
"Z_DATA_ERROR: Input data was corrupted for zlib",
"%d rad(er) kapades av group_concat()",
"Row %ld doesn't contain data for all columns",
-"Row %ld was truncated; It contained more data than there where input columns",
+"Row %ld was truncated; It contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld",
diff --git a/sql/share/ukrainian/errmsg.txt b/sql/share/ukrainian/errmsg.txt
index fa312fcc4b4..1c9101d5173 100644
--- a/sql/share/ukrainian/errmsg.txt
+++ b/sql/share/ukrainian/errmsg.txt
@@ -270,7 +270,7 @@ character-set=koi8u
"Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns",
-"Row %ld was truncated; It contained more data than there where input columns",
+"Row %ld was truncated; It contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld",
@@ -298,4 +298,4 @@ character-set=koi8u
"'%s' is deprecated, use '%s' instead",
"Таблиця %-.100s у %s не може оновлюватись",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
-"MySQL is started in --skip-grant-tables mode. You can't use this command",
+"The MySQL server is running with the %s option so it cannot execute this statement",
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 9329ea3fd28..59a96e28d77 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -829,8 +829,8 @@ static void acl_update_user(const char *user, const char *host,
acl_user->x509_subject= (x509_subject ?
strdup_root(&mem,x509_subject) : 0);
}
-
- set_user_salt(acl_user, password, password_len);
+ if (password)
+ set_user_salt(acl_user, password, password_len);
/* search complete: */
break;
}
@@ -1115,7 +1115,8 @@ bool check_change_password(THD *thd, const char *host, const char *user)
{
if (!initialized)
{
- send_error(thd, ER_SKIP_GRANT_TABLES); /* purecov: inspected */
+ net_printf(thd,ER_OPTION_PREVENTS_STATEMENT,
+ "--skip-grant-tables"); /* purecov: inspected */
return(1); /* purecov: inspected */
}
if (!thd->slave_thread &&
@@ -1433,13 +1434,10 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo,
if (!create_user)
{
if (what == 'N')
- my_printf_error(ER_NONEXISTING_GRANT,ER(ER_NONEXISTING_GRANT),
- MYF(0),combo.user.str,combo.host.str);
+ my_error(ER_NONEXISTING_GRANT, MYF(0), combo.user.str, combo.host.str);
else
- my_printf_error(ER_NO_PERMISSION_TO_CREATE_USER,
- ER(ER_NO_PERMISSION_TO_CREATE_USER),
- MYF(0),thd->user,
- thd->host_or_ip);
+ my_error(ER_NO_PERMISSION_TO_CREATE_USER, MYF(0),
+ thd->user, thd->host_or_ip);
error= -1;
goto end;
}
@@ -1458,6 +1456,11 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo,
store_record(table,record[1]); // Save copy for update
if (combo.password.str) // If password given
table->field[2]->store(password, password_len, &my_charset_latin1);
+ else if (!rights && !revoke_grant && thd->lex->ssl_type == SSL_TYPE_NOT_SPECIFIED &&
+ !thd->lex->mqh.bits)
+ {
+ DBUG_RETURN(0);
+ }
}
/* Update table columns with new privileges */
@@ -1593,7 +1596,7 @@ static int replace_db_table(TABLE *table, const char *db,
if (!initialized)
{
- my_error(ER_SKIP_GRANT_TABLES, MYF(0));
+ my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--skip-grant-tables");
DBUG_RETURN(-1);
}
@@ -1613,8 +1616,7 @@ static int replace_db_table(TABLE *table, const char *db,
{
if (what == 'N')
{ // no row, no revoke
- my_printf_error(ER_NONEXISTING_GRANT,ER(ER_NONEXISTING_GRANT),MYF(0),
- combo.user.str,combo.host.str);
+ my_error(ER_NONEXISTING_GRANT, MYF(0), combo.user.str, combo.host.str);
goto abort;
}
old_row_exists = 0;
@@ -1903,9 +1905,8 @@ static int replace_column_table(GRANT_TABLE *g_t,
{
if (revoke_grant)
{
- my_printf_error(ER_NONEXISTING_TABLE_GRANT,
- ER(ER_NONEXISTING_TABLE_GRANT),MYF(0),
- combo.user.str, combo.host.str,table_name); /* purecov: inspected */
+ my_error(ER_NONEXISTING_TABLE_GRANT, MYF(0),
+ combo.user.str, combo.host.str, table_name); /* purecov: inspected */
result= -1; /* purecov: inspected */
continue; /* purecov: inspected */
}
@@ -2071,10 +2072,9 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table,
*/
if (revoke_grant)
{ // no row, no revoke
- my_printf_error(ER_NONEXISTING_TABLE_GRANT,
- ER(ER_NONEXISTING_TABLE_GRANT),MYF(0),
- combo.user.str,combo.host.str,
- table_name); /* purecov: deadcode */
+ my_error(ER_NONEXISTING_TABLE_GRANT, MYF(0),
+ combo.user.str, combo.host.str,
+ table_name); /* purecov: deadcode */
DBUG_RETURN(-1); /* purecov: deadcode */
}
old_row_exists = 0;
@@ -2174,8 +2174,9 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list,
if (!initialized)
{
- send_error(thd, ER_SKIP_GRANT_TABLES); /* purecov: inspected */
- DBUG_RETURN(1); /* purecov: inspected */
+ my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0),
+ "--skip-grant-tables"); /* purecov: inspected */
+ DBUG_RETURN(-1); /* purecov: inspected */
}
if (rights & ~TABLE_ACLS)
{
@@ -2196,8 +2197,8 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list,
if (!find_field_in_table(thd,table,column->column.ptr(),
column->column.length(),0,0))
{
- my_printf_error(ER_BAD_FIELD_ERROR,ER(ER_BAD_FIELD_ERROR),MYF(0),
- column->column.c_ptr(), table_list->alias);
+ my_error(ER_BAD_FIELD_ERROR, MYF(0),
+ column->column.c_ptr(), table_list->alias);
DBUG_RETURN(-1);
}
column_priv|= column->rights;
@@ -2212,7 +2213,7 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list,
fn_format(buf,buf,"","",4+16+32);
if (access(buf,F_OK))
{
- my_error(ER_NO_SUCH_TABLE,MYF(0),table_list->db, table_list->alias);
+ my_error(ER_NO_SUCH_TABLE, MYF(0), table_list->db, table_list->alias);
DBUG_RETURN(-1);
}
}
@@ -2291,9 +2292,8 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list,
{
if (revoke_grant)
{
- my_printf_error(ER_NONEXISTING_TABLE_GRANT,
- ER(ER_NONEXISTING_TABLE_GRANT),MYF(0),
- Str->user.str, Str->host.str, table_list->real_name);
+ my_error(ER_NONEXISTING_TABLE_GRANT, MYF(0),
+ Str->user.str, Str->host.str, table_list->real_name);
result= -1;
continue;
}
@@ -2384,7 +2384,8 @@ int mysql_grant(THD *thd, const char *db, List <LEX_USER> &list,
DBUG_ENTER("mysql_grant");
if (!initialized)
{
- my_error(ER_SKIP_GRANT_TABLES, MYF(0)); /* purecov: tested */
+ my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0),
+ "--skip-grant-tables"); /* purecov: tested */
DBUG_RETURN(-1); /* purecov: tested */
}
@@ -2463,8 +2464,7 @@ int mysql_grant(THD *thd, const char *db, List <LEX_USER> &list,
}
else
{
- my_printf_error(ER_WRONG_USAGE, ER(ER_WRONG_USAGE), MYF(0),
- "DB GRANT","GLOBAL PRIVILEGES");
+ my_error(ER_WRONG_USAGE, MYF(0), "DB GRANT", "GLOBAL PRIVILEGES");
result= -1;
}
}
@@ -2990,8 +2990,8 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
LINT_INIT(acl_user);
if (!initialized)
{
- send_error(thd, ER_SKIP_GRANT_TABLES);
- DBUG_RETURN(1);
+ my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--skip-grant-tables");
+ DBUG_RETURN(-1);
}
if (lex_user->host.length > HOSTNAME_LENGTH ||
lex_user->user.length > USERNAME_LENGTH)
@@ -3014,8 +3014,8 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
}
if (counter == acl_users.elements)
{
- my_printf_error(ER_NONEXISTING_GRANT,ER(ER_NONEXISTING_GRANT),
- MYF(0),lex_user->user.str,lex_user->host.str);
+ my_error(ER_NONEXISTING_GRANT, MYF(0),
+ lex_user->user.str, lex_user->host.str);
DBUG_RETURN(-1);
}
@@ -3343,7 +3343,7 @@ int open_grant_tables(THD *thd, TABLE_LIST *tables)
if (!initialized)
{
- send_error(thd, ER_SKIP_GRANT_TABLES);
+ net_printf(thd,ER_OPTION_PREVENTS_STATEMENT, "--skip-grant-tables");
DBUG_RETURN(-1);
}
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 5cfe6f7a870..37767c555e8 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -2038,7 +2038,7 @@ find_item_in_list(Item *find, List<Item> &items, uint *counter,
{
if (!strcmp(item_field->table_name,table_name) &&
(!db_name || (db_name && item_field->db_name &&
- !strcmp(item_field->table_name,table_name))))
+ !strcmp(item_field->db_name, db_name))))
{
found= li.ref();
*counter= i;
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 9ed604033ab..6fe0521b07a 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -179,14 +179,8 @@ THD::THD():user_time(0), current_statement(0), is_fatal_error(0),
transaction.trans_log.end_of_file= max_binlog_cache_size;
}
#endif
- /*
- We need good random number initialization for new thread
- Just coping global one will not work
- */
{
- pthread_mutex_lock(&LOCK_thread_count);
- ulong tmp=(ulong) (my_rnd(&sql_rand) * 0xffffffff); /* make all bits random */
- pthread_mutex_unlock(&LOCK_thread_count);
+ ulong tmp=sql_rnd_with_mutex();
randominit(&rand, tmp + (ulong) &rand, tmp + (ulong) ::query_id);
}
}
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 6816d141dac..d0ad8a4e681 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -528,7 +528,7 @@ public:
void set_n_backup_item_arena(Statement *set, Statement *backup);
void restore_backup_item_arena(Statement *set, Statement *backup);
- void Statement::set_item_arena(Statement *set);
+ void set_item_arena(Statement *set);
};
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 46dd4d7996e..fe7d881a863 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -370,7 +370,7 @@ bool multi_delete::send_data(List<Item> &values)
table->status|= STATUS_DELETED;
if (!(error=table->file->delete_row(table->record[0])))
deleted++;
- else if (!table_being_deleted->next)
+ else if (!table_being_deleted->next || table_being_deleted->table->file->has_transactions())
{
table->file->print_error(error,MYF(0));
DBUG_RETURN(1);
@@ -473,6 +473,10 @@ int multi_delete::do_deletes(bool from_send_error)
if ((local_error=table->file->delete_row(table->record[0])))
{
table->file->print_error(local_error,MYF(0));
+ if (transactional_tables)
+ {
+ DBUG_RETURN(local_error);
+ }
break;
}
deleted++;
diff --git a/sql/sql_list.h b/sql/sql_list.h
index c7faef88358..0bbc0f87944 100644
--- a/sql/sql_list.h
+++ b/sql/sql_list.h
@@ -286,7 +286,7 @@ protected:
inline T** ref(void) { return (T**) 0; }
public:
- List_iterator_fast(List<T> &a) : base_list_iterator(a) {}
+ inline List_iterator_fast(List<T> &a) : base_list_iterator(a) {}
inline T* operator++(int) { return (T*) base_list_iterator::next_fast(); }
inline void rewind(void) { base_list_iterator::rewind(); }
void sublist(List<T> &list_arg, uint el_arg)
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index 56a78bfd589..58a9b9c588d 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -93,7 +93,11 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
LOAD_FILE_INFO lf_info;
#endif
char *db = table_list->db; // This is never null
- /* If no current database, use database where table is located */
+ /*
+ If path for file is not defined, we will use the current database.
+ If this is not set, we will use the directory where the table to be
+ loaded is located
+ */
char *tdb= thd->db ? thd->db : db; // Result is never null
bool transactional_table, log_delayed;
ulong skip_lines= ex->skip_lines;
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 6acb5901efc..a09f3d28a0f 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1835,7 +1835,7 @@ mysql_execute_command(THD *thd)
!(thd->slave_thread || (thd->master_access & SUPER_ACL)) &&
(uc_update_queries[lex->sql_command] > 0))
{
- send_error(thd, ER_CANT_UPDATE_WITH_READLOCK);
+ net_printf(thd, ER_OPTION_PREVENTS_STATEMENT, "--read-only");
DBUG_VOID_RETURN;
}
@@ -3053,6 +3053,22 @@ mysql_execute_command(THD *thd)
net_printf(thd, ER_WRONG_DB_NAME, lex->name);
break;
}
+ /*
+ If in a slave thread :
+ ALTER DATABASE DB may not be preceded by USE DB.
+ For that reason, maybe db_ok() in sql/slave.cc did not check the
+ do_db/ignore_db. And as this query involves no tables, tables_ok()
+ above was not called. So we have to check rules again here.
+ */
+#ifdef HAVE_REPLICATION
+ if (thd->slave_thread &&
+ (!db_ok(lex->name, replicate_do_db, replicate_ignore_db) ||
+ !db_ok_with_wild_table(lex->name)))
+ {
+ my_error(ER_SLAVE_IGNORED_TABLE, MYF(0));
+ break;
+ }
+#endif
if (check_access(thd,ALTER_ACL,lex->name,0,1,0))
break;
if (thd->locked_tables || thd->active_transaction())
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 009840b03b8..4a098cc6fc0 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -572,7 +572,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%token BEFORE_SYM
%left SET_VAR
-%left OR_OR_CONCAT OR
+%left OR_OR_CONCAT OR XOR
%left AND
%left BETWEEN_SYM CASE_SYM WHEN_SYM THEN_SYM ELSE
%left EQ EQUAL_SYM GE GT_SYM LE LT NE IS LIKE REGEXP IN_SYM
@@ -581,7 +581,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%left SHIFT_LEFT SHIFT_RIGHT
%left '-' '+'
%left '*' '/' '%' DIV_SYM MOD_SYM
-%left XOR
%left '^'
%left NEG '~'
%right NOT
@@ -4802,6 +4801,7 @@ keyword:
| MASTER_LOG_POS_SYM {}
| MASTER_USER_SYM {}
| MASTER_PASSWORD_SYM {}
+ | MASTER_SERVER_ID_SYM {}
| MASTER_CONNECT_RETRY_SYM {}
| MASTER_SSL_SYM {}
| MASTER_SSL_CA_SYM {}
diff --git a/sql/table.cc b/sql/table.cc
index dfd0529f62a..d9f832cf8bb 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -101,7 +101,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
if (!outparam->real_name || !outparam->table_name)
goto err_end;
- if ((file=my_open(fn_format(index_file,name,"",reg_ext,4),
+ if ((file=my_open(fn_format(index_file,name,"",reg_ext,MY_UNPACK_FILENAME),
O_RDONLY | O_SHARE,
MYF(0)))
< 0)
diff --git a/sql/unireg.cc b/sql/unireg.cc
index 357ba016fcb..6f127b57f64 100644
--- a/sql/unireg.cc
+++ b/sql/unireg.cc
@@ -151,7 +151,9 @@ int rea_create_table(THD *thd, my_string file_name,
my_free((gptr) screen_buff,MYF(0));
my_free((gptr) keybuff, MYF(0));
- if (opt_sync_frm && my_sync(file, MYF(MY_WME)))
+
+ if (opt_sync_frm && !(create_info->options & HA_LEX_CREATE_TMP_TABLE) &&
+ my_sync(file, MYF(MY_WME)))
goto err2;
if (my_close(file,MYF(MY_WME)) ||
ha_create_table(file_name,create_info,0))