[This commit e-mail is a repeat.]
#At file:///home/mysql_src/bzrrepos_new/5.5-2/ based on
revid:kent.boortz@stripped
3388 Guilhem Bichot 2011-05-17
Fix for BUG#11755168 '46895: test "outfile_loaddata" fails (reproducible)'.
This patch is specific of 5.5. It is the same as the patch for 5.1,
with few differences (for example the code fixed in sys_vars.cc does not exist
in 5.1; same for a piece of sql_acl.cc).
@ include/my_getopt.h
this function pointer is used only with "string literal" formats, so we can add
ATTRIBUTE_FORMAT.
@ mysql-test/collections/default.experimental
test should pass now
@ sql/derror.cc
by having a format as string literal, ATTRIBUTE_FORMAT check becomes effective.
@ sql/events.cc
Change justified by the following excerpt from sql/share/errmsg.txt:
ER_EVENT_SAME_NAME
eng "Same old and new event name"
@ sql/field.cc
ER_TOO_BIG_SCALE 42000 S1009
eng "Too big scale %d specified for column '%-.192s'. Maximum is %lu."
ER_TOO_BIG_PRECISION 42000 S1009
eng "Too big precision %d specified for column '%-.192s'. Maximum is %lu."
ER_TOO_BIG_DISPLAYWIDTH 42000 S1009
eng "Display width out of range for column '%-.192s' (max = %lu)"
@ sql/ha_ndbcluster.cc
ER_OUTOFMEMORY HY001 S1001
eng "Out of memory; restart server and try again (needed %d bytes)"
(sizeof() returns size_t)
@ sql/ha_ndbcluster_binlog.cc
Too many arguments for:
ER_GET_ERRMSG
eng "Got error %d '%-.100s' from %s"
Patch by Jonas Oreland.
@ sql/ha_partition.cc
print_admin_msg() is used only with a literal as format, so ATTRIBUTE_FORMAT
works.
@ sql/handler.cc
ER_OUTOFMEMORY HY001 S1001
eng "Out of memory; restart server and try again (needed %d bytes)"
(sizeof() returns size_t)
@ sql/item_create.cc
ER_TOO_BIG_SCALE 42000 S1009
eng "Too big scale %d specified for column '%-.192s'. Maximum is %lu."
ER_TOO_BIG_PRECISION 42000 S1009
eng "Too big precision %d specified for column '%-.192s'. Maximum is %lu."
'c_len' and 'c_dec' are char*, passed as %d !! We don't know their value
(as strtoul() failed), but they are likely big, so we use INT_MAX.
'len' is ulong.
@ sql/item_func.cc
ER_WARN_DATA_OUT_OF_RANGE 22003
eng "Out of range value for column '%s' at row %ld"
ER_CANT_FIND_UDF
eng "Can't load function '%-.192s'"
@ sql/item_strfunc.cc
ER_TOO_BIG_FOR_UNCOMPRESS
eng "Uncompressed data size too large; the maximum size is %d (probably,
length of uncompressed data was corrupted)"
max_allowed_packet is ulong.
@ sql/log.h
sql_print_message_func is a function _pointer_.
@ sql/set_var.cc
emphasize requirements
@ sql/sp_head.cc
ER_SP_RECURSION_LIMIT
eng "Recursive limit %d (as set by the max_sp_recursion_depth variable)
was exceeded for routine %.192s"
max_sp_recursion_depth is ulong
@ sql/sql_acl.cc
ER_PASSWORD_NO_MATCH 42000
eng "Can't find any matching row in the user table"
ER_CANT_CREATE_USER_WITH_GRANT 42000
eng "You are not allowed to create a user with GRANT"
ER_GRANT_PLUGIN_USER_EXISTS
eng "GRANT with IDENTIFIED WITH is illegal because the user %-.*s already
exists"
ER_HANDSHAKE_ERROR 08S01
eng "Bad handshake"
@ sql/sql_base.cc
ER_NOT_KEYFILE
eng "Incorrect key file for table '%-.200s'; try to repair it"
ER_TOO_MANY_TABLES
eng "Too many tables; MySQL can only use %d tables in a join"
MAX_TABLES is size_t.
@ sql/sql_binlog.cc
ER_UNKNOWN_ERROR
eng "Unknown error"
@ sql/sql_class.cc
ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
eng "Incorrect %-.32s value: '%-.128s' for column '%.192s' at row %ld"
WARN_DATA_TRUNCATED 01000
eng "Data truncated for column '%s' at row %ld"
@ sql/sql_connect.cc
ER_BAD_HOST_ERROR 08S01
eng "Can't get hostname for your address"
@ sql/sql_insert.cc
ER_WRONG_VALUE_COUNT_ON_ROW 21S01
eng "Column count doesn't match value count at row %ld"
@ sql/sql_parse.cc
ER_WARN_HOSTNAME_WONT_WORK
eng "MySQL is started in --skip-name-resolve mode; you must restart it
without this switch for this grant to work"
ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT
eng "Too high level of nesting for select"
@ sql/sql_partition.cc
ER_OUTOFMEMORY HY001 S1001
eng "Out of memory; restart server and try again (needed %d bytes)"
@ sql/sql_plugin.cc
ER_OUTOFMEMORY HY001 S1001
eng "Out of memory; restart server and try again (needed %d bytes)"
@ sql/sql_prepare.cc
ER_OUTOFMEMORY HY001 S1001
eng "Out of memory; restart server and try again (needed %d bytes)"
ER_UNKNOWN_STMT_HANDLER
eng "Unknown prepared statement handler (%.*s) given to %s"
length value (for '%.*s') must be 'int', per the doc of printf()
and the code of my_vsnprintf().
@ sql/sql_reload.cc
ER_UNKNOWN_ERROR
eng "Unknown error"
@ sql/sql_repl.cc
ER_SLAVE_IGNORE_SERVER_IDS
eng "The requested server id %d clashes with the slave startup option
--replicate-same-server-id"
s_id is ulong
@ sql/sql_table.cc
ER_TOO_BIG_FIELDLENGTH 42000 S1009
eng "Column length too big for column '%-.192s' (max = %lu); use BLOB or
TEXT instead"
ER_TOO_LONG_INDEX_COMMENT
eng "Comment for index '%-.64s' is too long (max = %lu)"
@ sql/sys_vars.cc
ER_EVENT_SET_VAR_ERROR
eng "Error during starting/stopping of the scheduler. Error code %u"
ER_NO_DEFAULT 42000
eng "Variable '%-.64s' doesn't have a default value"
var->var->name is LEX_CSTRING; the char* in it is the "str" member and
fortunately
it's 0-terminated (see set_var.cc).
@ sql/table.cc
ER_NOT_FORM_FILE
eng "Incorrect information in file: '%-.200s'"
ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE
eng "Column count of mysql.%s is wrong. Expected %d, found %d. Created
with MySQL %d, now running %d. Please use mysql_upgrade to fix this error."
table->s->mysql_version is ulong.
@ sql/unireg.cc
ER_TOO_LONG_TABLE_COMMENT
eng "Comment for table '%-.64s' is too long (max = %lu)"
ER_TOO_LONG_FIELD_COMMENT
eng "Comment for field '%-.64s' is too long (max = %lu)"
ER_TOO_BIG_ROWSIZE 42000
eng "Row size too large. The maximum row size for the used table type, not
counting BLOBs, is %ld. You have to change some columns to TEXT or BLOBs"
@ storage/example/ha_example.cc
srv_enum_var is ulong
modified:
include/my_getopt.h
mysql-test/collections/default.experimental
sql/derror.cc
sql/events.cc
sql/field.cc
sql/ha_ndbcluster.cc
sql/ha_ndbcluster_binlog.cc
sql/ha_partition.cc
sql/handler.cc
sql/item_create.cc
sql/item_func.cc
sql/item_strfunc.cc
sql/log.h
sql/set_var.cc
sql/sp_head.cc
sql/sql_acl.cc
sql/sql_base.cc
sql/sql_binlog.cc
sql/sql_class.cc
sql/sql_connect.cc
sql/sql_insert.cc
sql/sql_parse.cc
sql/sql_partition.cc
sql/sql_plugin.cc
sql/sql_prepare.cc
sql/sql_reload.cc
sql/sql_repl.cc
sql/sql_table.cc
sql/sys_vars.cc
sql/table.cc
sql/unireg.cc
storage/example/ha_example.cc
=== modified file 'include/my_getopt.h'
--- a/include/my_getopt.h 2010-10-25 12:30:07 +0000
+++ b/include/my_getopt.h 2011-05-17 09:56:41 +0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2004 MySQL AB
+/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -11,7 +11,7 @@
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 */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef _my_getopt_h
#define _my_getopt_h
@@ -86,7 +86,9 @@ struct my_option
typedef my_bool (*my_get_one_option)(int, const struct my_option *, char *);
-typedef void (*my_error_reporter)(enum loglevel level, const char *format, ...);
+typedef void (*my_error_reporter)(enum loglevel level, const char *format, ...)
+ ATTRIBUTE_FORMAT_FPTR(printf, 2, 3);
+
/**
Used to retrieve a reference to the object (variable) that holds the value
for the given option. For example, if var_type is GET_UINT, the function
=== modified file 'mysql-test/collections/default.experimental'
--- a/mysql-test/collections/default.experimental 2011-05-16 09:44:34 +0000
+++ b/mysql-test/collections/default.experimental 2011-05-17 09:56:41 +0000
@@ -9,7 +9,6 @@ funcs_1.charset_collation_1
main.func_math @freebsd # Bug#43020 2010-05-04 alik main.func_math fails
on FreeBSD in PB2
main.gis-rtree @freebsd # Bug#38965 2010-05-04 alik test cases
gis-rtree, type_float, type_newdecimal fail in embedded server
main.lock_multi_bug38499 # Bug#47448 2009-09-19 alik
main.lock_multi_bug38499 times out sporadically
-main.outfile_loaddata @solaris # Bug#46895 2010-01-20 alik Test
"outfile_loaddata" fails (reproducible)
main.signal_demo3 @solaris # Bug#47791 2010-01-20 alik Several test cases
fail on Solaris with error Thread stack overrun
main.sp @solaris # Bug#47791 2010-01-20 alik Several test cases
fail on Solaris with error Thread stack overrun
main.type_float @freebsd # Bug#38965 2010-05-04 alik test cases
gis-rtree, type_float, type_newdecimal fail in embedded server
=== modified file 'sql/derror.cc'
--- a/sql/derror.cc 2010-09-02 18:37:04 +0000
+++ b/sql/derror.cc 2011-05-17 09:56:41 +0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2005 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -11,8 +11,7 @@
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 */
-
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file
@@ -108,7 +107,6 @@ bool read_texts(const char *file_name, c
char lang_path[FN_REFLEN];
uchar *buff;
uchar head[32],*pos;
- const char *errmsg;
DBUG_ENTER("read_texts");
LINT_INIT(buff);
@@ -185,18 +183,9 @@ Check that the above file is the right v
DBUG_RETURN(0);
err:
- switch (funktpos) {
- case 2:
- errmsg= "Not enough memory for messagefile '%s'";
- break;
- case 1:
- errmsg= "Can't read from messagefile '%s'";
- break;
- default:
- errmsg= "Can't find messagefile '%s'";
- break;
- }
- sql_print_error(errmsg, name);
+ sql_print_error((funktpos == 2) ? "Not enough memory for messagefile '%s'" :
+ ((funktpos == 1) ? "Can't read from messagefile '%s'" :
+ "Can't find messagefile '%s'"), name);
if (file != FERR)
(void) mysql_file_close(file, MYF(MY_WME));
DBUG_RETURN(1);
=== modified file 'sql/events.cc'
--- a/sql/events.cc 2010-11-11 17:11:05 +0000
+++ b/sql/events.cc 2011-05-17 09:56:41 +0000
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -445,7 +445,7 @@ Events::update_event(THD *thd, Event_par
!sortcmp_lex_string(parse_data->name, *new_name,
system_charset_info))
{
- my_error(ER_EVENT_SAME_NAME, MYF(0), parse_data->name.str);
+ my_error(ER_EVENT_SAME_NAME, MYF(0));
DBUG_RETURN(TRUE);
}
=== modified file 'sql/field.cc'
--- a/sql/field.cc 2011-05-12 12:38:14 +0000
+++ b/sql/field.cc 2011-05-17 09:56:41 +0000
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -11,8 +11,7 @@
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 */
-
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file
@@ -9268,7 +9267,7 @@ bool Create_field::init(THD *thd, char *
if (decimals >= NOT_FIXED_DEC)
{
my_error(ER_TOO_BIG_SCALE, MYF(0), decimals, fld_name,
- NOT_FIXED_DEC-1);
+ static_cast<ulong>(NOT_FIXED_DEC - 1));
DBUG_RETURN(TRUE);
}
@@ -9338,8 +9337,8 @@ bool Create_field::init(THD *thd, char *
my_decimal_trim(&length, &decimals);
if (length > DECIMAL_MAX_PRECISION)
{
- my_error(ER_TOO_BIG_PRECISION, MYF(0), length, fld_name,
- DECIMAL_MAX_PRECISION);
+ my_error(ER_TOO_BIG_PRECISION, MYF(0), static_cast<int>(length),
+ fld_name, static_cast<ulong>(DECIMAL_MAX_PRECISION));
DBUG_RETURN(TRUE);
}
if (length < decimals)
@@ -9563,7 +9562,7 @@ bool Create_field::init(THD *thd, char *
if (length > MAX_BIT_FIELD_LENGTH)
{
my_error(ER_TOO_BIG_DISPLAYWIDTH, MYF(0), fld_name,
- MAX_BIT_FIELD_LENGTH);
+ static_cast<ulong>(MAX_BIT_FIELD_LENGTH));
DBUG_RETURN(TRUE);
}
pack_length= (length + 7) / 8;
=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc 2010-11-11 17:11:05 +0000
+++ b/sql/ha_ndbcluster.cc 2011-05-17 09:56:41 +0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -11,8 +11,7 @@
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
-*/
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file
@@ -8699,7 +8698,7 @@ NDB_SHARE *ndbcluster_get_share(const ch
DBUG_PRINT("error", ("get_share: failed to alloc share"));
if (!have_lock)
mysql_mutex_unlock(&ndbcluster_mutex);
- my_error(ER_OUTOFMEMORY, MYF(0), sizeof(*share));
+ my_error(ER_OUTOFMEMORY, MYF(0), static_cast<int>(sizeof(*share)));
DBUG_RETURN(0);
}
}
=== modified file 'sql/ha_ndbcluster_binlog.cc'
--- a/sql/ha_ndbcluster_binlog.cc 2010-09-20 14:17:32 +0000
+++ b/sql/ha_ndbcluster_binlog.cc 2011-05-17 09:56:41 +0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -11,8 +11,7 @@
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
-*/
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "sql_priv.h"
#include "unireg.h" // REQUIRED: for other includes
@@ -1225,12 +1224,14 @@ ndbcluster_update_slock(THD *thd,
}
if (ndb_error)
+ {
+ char buf[1024];
+ my_snprintf(buf, sizeof(buf), "Could not release lock on '%s.%s'",
+ db, table_name);
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
- ndb_error->code,
- ndb_error->message,
- "Could not release lock on '%s.%s'",
- db, table_name);
+ ndb_error->code, ndb_error->message, buf);
+ }
if (trans)
ndb->closeTransaction(trans);
ndb->setDatabaseName(save_db);
=== modified file 'sql/ha_partition.cc'
--- a/sql/ha_partition.cc 2011-05-10 13:24:34 +0000
+++ b/sql/ha_partition.cc 2011-05-17 09:56:41 +0000
@@ -11,7 +11,7 @@
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 */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
This handler was developed by Mikael Ronstrom for version 5.1 of MySQL.
@@ -1069,6 +1069,10 @@ static int handle_opt_part(THD *thd, HA_
static bool print_admin_msg(THD* thd, const char* msg_type,
const char* db_name, const char* table_name,
const char* op_name, const char *fmt, ...)
+ ATTRIBUTE_FORMAT(printf, 6, 7);
+static bool print_admin_msg(THD* thd, const char* msg_type,
+ const char* db_name, const char* table_name,
+ const char* op_name, const char *fmt, ...)
{
va_list args;
Protocol *protocol= thd->protocol;
=== modified file 'sql/handler.cc'
--- a/sql/handler.cc 2011-04-20 17:53:08 +0000
+++ b/sql/handler.cc 2011-05-17 09:56:41 +0000
@@ -278,7 +278,7 @@ handler *get_ha_partition(partition_info
}
else
{
- my_error(ER_OUTOFMEMORY, MYF(0), sizeof(ha_partition));
+ my_error(ER_OUTOFMEMORY, MYF(0), static_cast<int>(sizeof(ha_partition)));
}
DBUG_RETURN(((handler*) partition));
}
@@ -1638,7 +1638,8 @@ int ha_recover(HASH *commit_list)
}
if (!info.list)
{
- sql_print_error(ER(ER_OUTOFMEMORY), info.len*sizeof(XID));
+ sql_print_error(ER(ER_OUTOFMEMORY),
+ static_cast<int>(info.len*sizeof(XID)));
DBUG_RETURN(1);
}
=== modified file 'sql/item_create.cc'
--- a/sql/item_create.cc 2010-11-26 10:44:39 +0000
+++ b/sql/item_create.cc 2011-05-17 09:56:41 +0000
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2010 Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -11,7 +11,7 @@
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 */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file
@@ -5215,8 +5215,8 @@ create_func_cast(THD *thd, Item *a, Cast
decoded_size= strtoul(c_len, NULL, 10);
if (errno != 0)
{
- my_error(ER_TOO_BIG_PRECISION, MYF(0), c_len, a->name,
- DECIMAL_MAX_PRECISION);
+ my_error(ER_TOO_BIG_PRECISION, MYF(0), INT_MAX, a->name,
+ static_cast<ulong>(DECIMAL_MAX_PRECISION));
return NULL;
}
len= decoded_size;
@@ -5229,8 +5229,8 @@ create_func_cast(THD *thd, Item *a, Cast
decoded_size= strtoul(c_dec, NULL, 10);
if ((errno != 0) || (decoded_size > UINT_MAX))
{
- my_error(ER_TOO_BIG_SCALE, MYF(0), c_dec, a->name,
- DECIMAL_MAX_SCALE);
+ my_error(ER_TOO_BIG_SCALE, MYF(0), INT_MAX, a->name,
+ static_cast<ulong>(DECIMAL_MAX_SCALE));
return NULL;
}
dec= decoded_size;
@@ -5243,14 +5243,14 @@ create_func_cast(THD *thd, Item *a, Cast
}
if (len > DECIMAL_MAX_PRECISION)
{
- my_error(ER_TOO_BIG_PRECISION, MYF(0), len, a->name,
- DECIMAL_MAX_PRECISION);
+ my_error(ER_TOO_BIG_PRECISION, MYF(0), static_cast<int>(len), a->name,
+ static_cast<ulong>(DECIMAL_MAX_PRECISION));
return 0;
}
if (dec > DECIMAL_MAX_SCALE)
{
my_error(ER_TOO_BIG_SCALE, MYF(0), dec, a->name,
- DECIMAL_MAX_SCALE);
+ static_cast<ulong>(DECIMAL_MAX_SCALE));
return 0;
}
res= new (thd->mem_root) Item_decimal_typecast(a, len, dec);
=== modified file 'sql/item_func.cc'
--- a/sql/item_func.cc 2011-05-06 11:39:40 +0000
+++ b/sql/item_func.cc 2011-05-17 09:56:41 +0000
@@ -11,8 +11,7 @@
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 */
-
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file
@@ -1094,7 +1093,7 @@ err:
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_DATA_OUT_OF_RANGE,
ER(ER_WARN_DATA_OUT_OF_RANGE),
- name, 1);
+ name, 1L);
return dec;
}
@@ -3152,7 +3151,7 @@ udf_handler::fix_fields(THD *thd, Item_r
if (!tmp_udf)
{
- my_error(ER_CANT_FIND_UDF, MYF(0), u_d->name.str, errno);
+ my_error(ER_CANT_FIND_UDF, MYF(0), u_d->name.str);
DBUG_RETURN(TRUE);
}
u_d=tmp_udf;
=== modified file 'sql/item_strfunc.cc'
--- a/sql/item_strfunc.cc 2011-05-06 11:39:40 +0000
+++ b/sql/item_strfunc.cc 2011-05-17 09:56:41 +0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -11,8 +11,7 @@
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 */
-
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file
@@ -3702,7 +3701,8 @@ String *Item_func_uncompress::val_str(St
push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TOO_BIG_FOR_UNCOMPRESS,
ER(ER_TOO_BIG_FOR_UNCOMPRESS),
- current_thd->variables.max_allowed_packet);
+ static_cast<int>(current_thd->variables.
+ max_allowed_packet));
goto err;
}
if (buffer.realloc((uint32)new_size))
=== modified file 'sql/log.h'
--- a/sql/log.h 2011-03-01 16:39:28 +0000
+++ b/sql/log.h 2011-05-17 09:56:41 +0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -11,7 +11,7 @@
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 */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef LOG_H
#define LOG_H
@@ -687,7 +687,7 @@ void sql_print_warning(const char *forma
void sql_print_information(const char *format, ...)
ATTRIBUTE_FORMAT(printf, 1, 2);
typedef void (*sql_print_message_func)(const char *format, ...)
- ATTRIBUTE_FORMAT(printf, 1, 2);
+ ATTRIBUTE_FORMAT_FPTR(printf, 1, 2);
extern sql_print_message_func sql_print_message_handlers[];
int error_log_print(enum loglevel level, const char *format,
=== modified file 'sql/set_var.cc'
--- a/sql/set_var.cc 2011-03-25 12:55:22 +0000
+++ b/sql/set_var.cc 2011-05-17 09:56:41 +0000
@@ -117,7 +117,8 @@ void sys_var_end()
sys_var constructor
@param chain variables are linked into chain for mysql_add_sys_var_chain()
- @param name_arg the name of the variable. @sa my_option::name
+ @param name_arg the name of the variable. Must be 0-terminated and exist
+ for the liftime of the sys_var object. @sa my_option::name
@param comment shown in mysqld --help, @sa my_option::comment
@param flags_arg or'ed flag_enum values
@param off offset of the global variable value from the
@@ -164,8 +165,8 @@ sys_var::sys_var(sys_var_chain *chain, c
*/
DBUG_ASSERT(parse_flag == PARSE_NORMAL || getopt_id <= 0 || getopt_id >= 255);
- name.str= name_arg;
- name.length= strlen(name_arg);
+ name.str= name_arg; // ER_NO_DEFAULT relies on 0-termination of name_arg
+ name.length= strlen(name_arg); // and so does this.
DBUG_ASSERT(name.length <= NAME_CHAR_LEN);
bzero(&option, sizeof(option));
=== modified file 'sql/sp_head.cc'
--- a/sql/sp_head.cc 2011-04-15 12:02:22 +0000
+++ b/sql/sp_head.cc 2011-05-17 09:56:41 +0000
@@ -11,7 +11,7 @@
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 */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_priv.h"
@@ -1066,7 +1066,7 @@ void sp_head::recursion_level_error(THD
if (m_type == TYPE_ENUM_PROCEDURE)
{
my_error(ER_SP_RECURSION_LIMIT, MYF(0),
- thd->variables.max_sp_recursion_depth,
+ static_cast<int>(thd->variables.max_sp_recursion_depth),
m_name.str);
}
else
=== modified file 'sql/sql_acl.cc'
--- a/sql/sql_acl.cc 2011-05-16 08:50:42 +0000
+++ b/sql/sql_acl.cc 2011-05-17 09:56:41 +0000
@@ -2275,13 +2275,12 @@ static int replace_user_table(THD *thd,
*/
else if (!password_len && !combo.plugin.length && no_auto_create)
{
- my_error(ER_PASSWORD_NO_MATCH, MYF(0), combo.user.str, combo.host.str);
+ my_error(ER_PASSWORD_NO_MATCH, MYF(0));
goto end;
}
else if (!can_create_user)
{
- my_error(ER_CANT_CREATE_USER_WITH_GRANT, MYF(0),
- thd->security_ctx->user, thd->security_ctx->host_or_ip);
+ my_error(ER_CANT_CREATE_USER_WITH_GRANT, MYF(0));
goto end;
}
else if (combo.plugin.str[0])
@@ -2309,8 +2308,8 @@ static int replace_user_table(THD *thd,
/* what == 'N' means revoke */
if (combo.plugin.length && what != 'N')
{
- my_error(ER_GRANT_PLUGIN_USER_EXISTS, MYF(0), combo.user.length,
- combo.user.str);
+ my_error(ER_GRANT_PLUGIN_USER_EXISTS, MYF(0),
+ static_cast<int>(combo.user.length), combo.user.str);
goto end;
}
if (combo.password.str) // If password given
@@ -8901,7 +8900,7 @@ err:
if (mpvio->status == MPVIO_EXT::FAILURE)
{
inc_host_errors(mpvio->ip);
- my_error(ER_HANDSHAKE_ERROR, MYF(0), mpvio->auth_info.host_or_ip);
+ my_error(ER_HANDSHAKE_ERROR, MYF(0));
}
DBUG_RETURN(-1);
}
@@ -9487,7 +9486,7 @@ static int native_password_authenticate(
}
inc_host_errors(mpvio->ip);
- my_error(ER_HANDSHAKE_ERROR, MYF(0), mpvio->auth_info.host_or_ip);
+ my_error(ER_HANDSHAKE_ERROR, MYF(0));
DBUG_RETURN(CR_ERROR);
}
@@ -9541,7 +9540,7 @@ static int old_password_authenticate(MYS
}
inc_host_errors(mpvio->ip);
- my_error(ER_HANDSHAKE_ERROR, MYF(0), mpvio->auth_info.host_or_ip);
+ my_error(ER_HANDSHAKE_ERROR, MYF(0));
return CR_ERROR;
}
=== modified file 'sql/sql_base.cc'
--- a/sql/sql_base.cc 2011-05-06 08:27:04 +0000
+++ b/sql/sql_base.cc 2011-05-17 09:56:41 +0000
@@ -3854,7 +3854,7 @@ static bool auto_repair_table(THD *thd,
{
/* Give right error message */
thd->clear_error();
- my_error(ER_NOT_KEYFILE, MYF(0), share->table_name.str, my_errno);
+ my_error(ER_NOT_KEYFILE, MYF(0), share->table_name.str);
sql_print_error("Couldn't repair table: %s.%s", share->db.str,
share->table_name.str);
if (entry->file)
@@ -7921,7 +7921,7 @@ bool setup_tables(THD *thd, Name_resolut
}
if (tablenr > MAX_TABLES)
{
- my_error(ER_TOO_MANY_TABLES,MYF(0),MAX_TABLES);
+ my_error(ER_TOO_MANY_TABLES,MYF(0), static_cast<int>(MAX_TABLES));
DBUG_RETURN(1);
}
for (table_list= tables;
=== modified file 'sql/sql_binlog.cc'
--- a/sql/sql_binlog.cc 2010-11-28 10:06:02 +0000
+++ b/sql/sql_binlog.cc 2011-05-17 09:56:41 +0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2006 MySQL AB
+/* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -242,7 +242,7 @@ void mysql_client_binlog_statement(THD*
TODO: Maybe a better error message since the BINLOG statement
now contains several events.
*/
- my_error(ER_UNKNOWN_ERROR, MYF(0), "Error executing BINLOG statement");
+ my_error(ER_UNKNOWN_ERROR, MYF(0));
goto end;
}
}
=== modified file 'sql/sql_class.cc'
--- a/sql/sql_class.cc 2011-04-21 05:34:21 +0000
+++ b/sql/sql_class.cc 2011-05-17 09:56:41 +0000
@@ -11,7 +11,8 @@
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 */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
/*****************************************************************************
**
@@ -2191,7 +2192,7 @@ bool select_export::send_data(List<Item>
ER_TRUNCATED_WRONG_VALUE_FOR_FIELD,
ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD),
"string", printable_buff,
- item->name, row_count);
+ item->name, static_cast<long>(row_count));
}
else if (from_end_pos < res->ptr() + res->length())
{
@@ -2200,7 +2201,7 @@ bool select_export::send_data(List<Item>
*/
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
WARN_DATA_TRUNCATED, ER(WARN_DATA_TRUNCATED),
- item->full_name(), row_count);
+ item->full_name(), static_cast<long>(row_count));
}
cvt_str.length(bytes);
res= &cvt_str;
=== modified file 'sql/sql_connect.cc'
--- a/sql/sql_connect.cc 2011-03-15 14:56:11 +0000
+++ b/sql/sql_connect.cc 2011-05-17 09:56:41 +0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -11,8 +11,7 @@
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 */
-
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Functions to autenticate and handle reqests for a connection
@@ -466,7 +465,7 @@ static int check_connection(THD *thd)
if (vio_peer_addr(net->vio, ip, &thd->peer_port, NI_MAXHOST))
{
- my_error(ER_BAD_HOST_ERROR, MYF(0), thd->main_security_ctx.host_or_ip);
+ my_error(ER_BAD_HOST_ERROR, MYF(0));
return 1;
}
if (!(thd->main_security_ctx.ip= my_strdup(ip,MYF(MY_WME))))
@@ -477,7 +476,7 @@ static int check_connection(THD *thd)
if (ip_to_hostname(&net->vio->remote, thd->main_security_ctx.ip,
&thd->main_security_ctx.host, &connect_errors))
{
- my_error(ER_BAD_HOST_ERROR, MYF(0), ip);
+ my_error(ER_BAD_HOST_ERROR, MYF(0));
return 1;
}
=== modified file 'sql/sql_insert.cc'
--- a/sql/sql_insert.cc 2011-01-31 13:11:05 +0000
+++ b/sql/sql_insert.cc 2011-05-17 09:56:41 +0000
@@ -1,4 +1,4 @@
-/* Copyright 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -11,8 +11,7 @@
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 */
-
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Insert of records */
@@ -3889,7 +3888,7 @@ select_create::prepare(List<Item> &value
if (table->s->fields < values.elements)
{
- my_error(ER_WRONG_VALUE_COUNT_ON_ROW, MYF(0), 1);
+ my_error(ER_WRONG_VALUE_COUNT_ON_ROW, MYF(0), 1L);
DBUG_RETURN(-1);
}
=== modified file 'sql/sql_parse.cc'
--- a/sql/sql_parse.cc 2011-05-06 08:27:04 +0000
+++ b/sql/sql_parse.cc 2011-05-17 09:56:41 +0000
@@ -11,7 +11,7 @@
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 */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#define MYSQL_LEX 1
#include "my_global.h"
@@ -3412,8 +3412,7 @@ end_with_restore_list:
hostname_requires_resolving(user->host.str))
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_HOSTNAME_WONT_WORK,
- ER(ER_WARN_HOSTNAME_WONT_WORK),
- user->host.str);
+ ER(ER_WARN_HOSTNAME_WONT_WORK));
// Are we trying to change a password of another user
DBUG_ASSERT(user->host.str != 0);
@@ -5305,7 +5304,7 @@ mysql_new_select(LEX *lex, bool move_dow
lex->nest_level++;
if (lex->nest_level > (int) MAX_SELECT_NESTING)
{
- my_error(ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT,MYF(0),MAX_SELECT_NESTING);
+ my_error(ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT, MYF(0));
DBUG_RETURN(1);
}
select_lex->nest_level= lex->nest_level;
=== modified file 'sql/sql_partition.cc'
--- a/sql/sql_partition.cc 2011-05-06 08:53:42 +0000
+++ b/sql/sql_partition.cc 2011-05-17 09:56:41 +0000
@@ -7024,7 +7024,7 @@ void set_key_field_ptr(KEY *key_info, co
void mem_alloc_error(size_t size)
{
- my_error(ER_OUTOFMEMORY, MYF(0), size);
+ my_error(ER_OUTOFMEMORY, MYF(0), static_cast<int>(size));
}
#ifdef WITH_PARTITION_STORAGE_ENGINE
=== modified file 'sql/sql_plugin.cc'
--- a/sql/sql_plugin.cc 2010-12-02 07:16:26 +0000
+++ b/sql/sql_plugin.cc 2011-05-17 09:56:41 +0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 MySQL AB, 2009 Sun Microsystems, Inc.
+/* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -11,7 +11,7 @@
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 */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "sql_priv.h" // SHOW_MY_BOOL
#include "unireg.h"
@@ -548,7 +548,8 @@ static st_plugin_dl *plugin_dl_add(const
if (!cur)
{
free_plugin_mem(&plugin_dl);
- report_error(report, ER_OUTOFMEMORY, plugin_dl.dl.length);
+ report_error(report, ER_OUTOFMEMORY,
+ static_cast<int>(plugin_dl.dl.length));
DBUG_RETURN(0);
}
/*
@@ -570,7 +571,8 @@ static st_plugin_dl *plugin_dl_add(const
if (! (plugin_dl.dl.str= (char*) my_malloc(plugin_dl.dl.length, MYF(0))))
{
free_plugin_mem(&plugin_dl);
- report_error(report, ER_OUTOFMEMORY, plugin_dl.dl.length);
+ report_error(report, ER_OUTOFMEMORY,
+ static_cast<int>(plugin_dl.dl.length));
DBUG_RETURN(0);
}
plugin_dl.dl.length= copy_and_convert(plugin_dl.dl.str, plugin_dl.dl.length,
@@ -581,7 +583,8 @@ static st_plugin_dl *plugin_dl_add(const
if (! (tmp= plugin_dl_insert_or_reuse(&plugin_dl)))
{
free_plugin_mem(&plugin_dl);
- report_error(report, ER_OUTOFMEMORY, sizeof(struct st_plugin_dl));
+ report_error(report, ER_OUTOFMEMORY,
+ static_cast<int>(sizeof(struct st_plugin_dl)));
DBUG_RETURN(0);
}
DBUG_RETURN(tmp);
=== modified file 'sql/sql_prepare.cc'
--- a/sql/sql_prepare.cc 2011-04-15 12:02:22 +0000
+++ b/sql/sql_prepare.cc 2011-05-17 09:56:41 +0000
@@ -11,7 +11,7 @@
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 */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file
@@ -1467,7 +1467,7 @@ static int mysql_test_select(Prepared_st
if (!lex->result && !(lex->result= new (stmt->mem_root) select_send))
{
- my_error(ER_OUTOFMEMORY, MYF(0), sizeof(select_send));
+ my_error(ER_OUTOFMEMORY, MYF(0), static_cast<int>(sizeof(select_send)));
goto error;
}
@@ -2543,7 +2543,7 @@ void mysqld_stmt_execute(THD *thd, char
if (!(stmt= find_prepared_statement(thd, stmt_id)))
{
char llbuf[22];
- my_error(ER_UNKNOWN_STMT_HANDLER, MYF(0), sizeof(llbuf),
+ my_error(ER_UNKNOWN_STMT_HANDLER, MYF(0), static_cast<int>(sizeof(llbuf)),
llstr(stmt_id, llbuf), "mysqld_stmt_execute");
DBUG_VOID_RETURN;
}
@@ -2597,7 +2597,7 @@ void mysql_sql_stmt_execute(THD *thd)
if (!(stmt= (Prepared_statement*) thd->stmt_map.find_by_name(name)))
{
my_error(ER_UNKNOWN_STMT_HANDLER, MYF(0),
- name->length, name->str, "EXECUTE");
+ static_cast<int>(name->length), name->str, "EXECUTE");
DBUG_VOID_RETURN;
}
@@ -2639,7 +2639,7 @@ void mysqld_stmt_fetch(THD *thd, char *p
if (!(stmt= find_prepared_statement(thd, stmt_id)))
{
char llbuf[22];
- my_error(ER_UNKNOWN_STMT_HANDLER, MYF(0), sizeof(llbuf),
+ my_error(ER_UNKNOWN_STMT_HANDLER, MYF(0), static_cast<int>(sizeof(llbuf)),
llstr(stmt_id, llbuf), "mysqld_stmt_fetch");
DBUG_VOID_RETURN;
}
@@ -2699,7 +2699,7 @@ void mysqld_stmt_reset(THD *thd, char *p
if (!(stmt= find_prepared_statement(thd, stmt_id)))
{
char llbuf[22];
- my_error(ER_UNKNOWN_STMT_HANDLER, MYF(0), sizeof(llbuf),
+ my_error(ER_UNKNOWN_STMT_HANDLER, MYF(0), static_cast<int>(sizeof(llbuf)),
llstr(stmt_id, llbuf), "mysqld_stmt_reset");
DBUG_VOID_RETURN;
}
@@ -2774,7 +2774,7 @@ void mysql_sql_stmt_close(THD *thd)
if (! (stmt= (Prepared_statement*) thd->stmt_map.find_by_name(name)))
my_error(ER_UNKNOWN_STMT_HANDLER, MYF(0),
- name->length, name->str, "DEALLOCATE PREPARE");
+ static_cast<int>(name->length), name->str, "DEALLOCATE
PREPARE");
else if (stmt->is_in_use())
my_error(ER_PS_NO_RECURSION, MYF(0));
else
=== modified file 'sql/sql_reload.cc'
--- a/sql/sql_reload.cc 2011-03-07 09:08:10 +0000
+++ b/sql/sql_reload.cc 2011-05-17 09:56:41 +0000
@@ -86,7 +86,7 @@ bool reload_acl_and_cache(THD *thd, unsi
When an error is returned, my_message may have not been called and
the client will hang waiting for a response.
*/
- my_error(ER_UNKNOWN_ERROR, MYF(0), "FLUSH PRIVILEGES failed");
+ my_error(ER_UNKNOWN_ERROR, MYF(0));
}
}
=== modified file 'sql/sql_repl.cc'
--- a/sql/sql_repl.cc 2011-02-16 16:27:35 +0000
+++ b/sql/sql_repl.cc 2011-05-17 09:56:41 +0000
@@ -1490,7 +1490,7 @@ bool change_master(THD* thd, Master_info
get_dynamic(&lex_mi->repl_ignore_server_ids, (uchar*) &s_id, i);
if (s_id == ::server_id && replicate_same_server_id)
{
- my_error(ER_SLAVE_IGNORE_SERVER_IDS, MYF(0), s_id);
+ my_error(ER_SLAVE_IGNORE_SERVER_IDS, MYF(0), static_cast<int>(s_id));
ret= TRUE;
goto err;
}
=== modified file 'sql/sql_table.cc'
--- a/sql/sql_table.cc 2011-05-06 08:27:04 +0000
+++ b/sql/sql_table.cc 2011-05-17 09:56:41 +0000
@@ -2618,7 +2618,8 @@ int prepare_create_field(Create_field *s
MAX_FIELD_CHARLENGTH)
{
my_printf_error(ER_TOO_BIG_FIELDLENGTH, ER(ER_TOO_BIG_FIELDLENGTH),
- MYF(0), sql_field->field_name, MAX_FIELD_CHARLENGTH);
+ MYF(0), sql_field->field_name,
+ static_cast<ulong>(MAX_FIELD_CHARLENGTH));
DBUG_RETURN(1);
}
}
@@ -3614,12 +3615,12 @@ mysql_prepare_create_table(THD *thd, HA_
(MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES)))
{
my_error(ER_TOO_LONG_INDEX_COMMENT, MYF(0),
- key_info->name, (uint) INDEX_COMMENT_MAXLEN);
+ key_info->name, static_cast<ulong>(INDEX_COMMENT_MAXLEN));
DBUG_RETURN(-1);
}
char warn_buff[MYSQL_ERRMSG_SIZE];
my_snprintf(warn_buff, sizeof(warn_buff), ER(ER_TOO_LONG_INDEX_COMMENT),
- key_info->name, (uint) INDEX_COMMENT_MAXLEN);
+ key_info->name, static_cast<ulong>(INDEX_COMMENT_MAXLEN));
/* do not push duplicate warnings */
if (!check_duplicate_warning(thd, warn_buff, strlen(warn_buff)))
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
@@ -3747,7 +3748,8 @@ static bool prepare_blob_field(THD *thd,
MODE_STRICT_ALL_TABLES)))
{
my_error(ER_TOO_BIG_FIELDLENGTH, MYF(0), sql_field->field_name,
- MAX_FIELD_VARCHARLENGTH / sql_field->charset->mbmaxlen);
+ static_cast<ulong>(MAX_FIELD_VARCHARLENGTH /
+ sql_field->charset->mbmaxlen));
DBUG_RETURN(1);
}
sql_field->sql_type= MYSQL_TYPE_BLOB;
=== modified file 'sql/sys_vars.cc'
--- a/sql/sys_vars.cc 2011-03-25 12:55:22 +0000
+++ b/sql/sys_vars.cc 2011-05-17 09:56:41 +0000
@@ -695,7 +695,7 @@ static bool event_scheduler_update(sys_v
: Events::stop();
mysql_mutex_lock(&LOCK_global_system_variables);
if (ret)
- my_error(ER_EVENT_SET_VAR_ERROR, MYF(0));
+ my_error(ER_EVENT_SET_VAR_ERROR, MYF(0), 0);
return ret;
}
@@ -2504,7 +2504,7 @@ static bool update_last_insert_id(THD *t
{
if (!var->value)
{
- my_error(ER_NO_DEFAULT, MYF(0), var->var->name);
+ my_error(ER_NO_DEFAULT, MYF(0), var->var->name.str);
return true;
}
thd->first_successful_insert_id_in_prev_stmt=
@@ -2553,7 +2553,7 @@ static bool update_insert_id(THD *thd, s
{
if (!var->value)
{
- my_error(ER_NO_DEFAULT, MYF(0), var->var->name);
+ my_error(ER_NO_DEFAULT, MYF(0), var->var->name.str);
return true;
}
thd->force_one_auto_inc_interval(var->save_result.ulonglong_value);
@@ -2576,7 +2576,7 @@ static bool update_rand_seed1(THD *thd,
{
if (!var->value)
{
- my_error(ER_NO_DEFAULT, MYF(0), var->var->name);
+ my_error(ER_NO_DEFAULT, MYF(0), var->var->name.str);
return true;
}
thd->rand.seed1= (ulong) var->save_result.ulonglong_value;
@@ -2598,7 +2598,7 @@ static bool update_rand_seed2(THD *thd,
{
if (!var->value)
{
- my_error(ER_NO_DEFAULT, MYF(0), var->var->name);
+ my_error(ER_NO_DEFAULT, MYF(0), var->var->name.str);
return true;
}
thd->rand.seed2= (ulong) var->save_result.ulonglong_value;
=== modified file 'sql/table.cc'
--- a/sql/table.cc 2011-03-25 14:03:44 +0000
+++ b/sql/table.cc 2011-05-17 09:56:41 +0000
@@ -2422,7 +2422,7 @@ void open_table_error(TABLE_SHARE *share
default: /* Better wrong error than none */
case 4:
strxmov(buff, share->normalized_path.str, reg_ext, NullS);
- my_error(ER_NOT_FORM_FILE, errortype, buff, 0);
+ my_error(ER_NOT_FORM_FILE, errortype, buff);
break;
}
DBUG_VOID_RETURN;
@@ -3009,7 +3009,8 @@ Table_check_intact::check(TABLE *table,
report_error(ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE,
ER(ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE),
table->alias, table_def->count, table->s->fields,
- table->s->mysql_version, MYSQL_VERSION_ID);
+ static_cast<int>(table->s->mysql_version),
+ MYSQL_VERSION_ID);
DBUG_RETURN(TRUE);
}
else if (MYSQL_VERSION_ID == table->s->mysql_version)
=== modified file 'sql/unireg.cc'
--- a/sql/unireg.cc 2011-03-04 08:41:29 +0000
+++ b/sql/unireg.cc 2011-05-17 09:56:41 +0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -11,8 +11,7 @@
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 */
-
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Functions to create a unireg form-file from a FIELD and a fieldname-fieldinfo
@@ -230,13 +229,13 @@ bool mysql_create_frm(THD *thd, const ch
(MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES)))
{
my_error(ER_TOO_LONG_TABLE_COMMENT, MYF(0),
- real_table_name, (uint) TABLE_COMMENT_MAXLEN);
+ real_table_name, static_cast<ulong>(TABLE_COMMENT_MAXLEN));
my_free(screen_buff);
DBUG_RETURN(1);
}
char warn_buff[MYSQL_ERRMSG_SIZE];
my_snprintf(warn_buff, sizeof(warn_buff), ER(ER_TOO_LONG_TABLE_COMMENT),
- real_table_name, (uint) TABLE_COMMENT_MAXLEN);
+ real_table_name, static_cast<ulong>(TABLE_COMMENT_MAXLEN));
/* do not push duplicate warnings */
if (!check_duplicate_warning(current_thd, warn_buff, strlen(warn_buff)))
push_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
@@ -737,13 +736,14 @@ static bool pack_header(uchar *forminfo,
if ((current_thd->variables.sql_mode &
(MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES)))
{
- my_error(ER_TOO_LONG_FIELD_COMMENT, MYF(0),
- field->field_name, (uint) COLUMN_COMMENT_MAXLEN);
+ my_error(ER_TOO_LONG_FIELD_COMMENT, MYF(0), field->field_name,
+ static_cast<ulong>(COLUMN_COMMENT_MAXLEN));
DBUG_RETURN(1);
}
char warn_buff[MYSQL_ERRMSG_SIZE];
my_snprintf(warn_buff, sizeof(warn_buff), ER(ER_TOO_LONG_FIELD_COMMENT),
- field->field_name, (uint) COLUMN_COMMENT_MAXLEN);
+ field->field_name,
+ static_cast<ulong>(COLUMN_COMMENT_MAXLEN));
/* do not push duplicate warnings */
if (!check_duplicate_warning(current_thd, warn_buff, strlen(warn_buff)))
push_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
@@ -831,7 +831,7 @@ static bool pack_header(uchar *forminfo,
if (reclength > (ulong) file->max_record_length())
{
- my_error(ER_TOO_BIG_ROWSIZE, MYF(0), (uint) file->max_record_length());
+ my_error(ER_TOO_BIG_ROWSIZE, MYF(0),
static_cast<long>(file->max_record_length()));
DBUG_RETURN(1);
}
/* Hack to avoid bugs with small static rows in MySQL */
=== modified file 'storage/example/ha_example.cc'
--- a/storage/example/ha_example.cc 2010-10-06 14:34:28 +0000
+++ b/storage/example/ha_example.cc 2011-05-17 09:56:41 +0000
@@ -984,7 +984,7 @@ static int show_func_example(MYSQL_THD t
var->type= SHOW_CHAR;
var->value= buf; // it's of SHOW_VAR_FUNC_BUFF_SIZE bytes
my_snprintf(buf, SHOW_VAR_FUNC_BUFF_SIZE,
- "enum_var is %u, ulong_var is %lu, %.6b", // %b is MySQL extension
+ "enum_var is %lu, ulong_var is %lu, %.6b", // %b is MySQL extension
srv_enum_var, srv_ulong_var, "really");
return 0;
}
Attachment: [text/bzr-bundle] bzr/guilhem.bichot@oracle.com-20110517095641-wcub5kcnsjaadgay.bundle
| Thread |
|---|
| • [Resend] bzr commit into mysql-5.5 branch (guilhem.bichot:3388) Bug#11755168 | Guilhem Bichot | 19 May |