Skip to content

Commit fa81a82

Browse files
author
monty@mysql.com/nosik.monty.fi
committed
Fixed a LOT of compiler warnings
Added missing DBUG_RETURN statements (in mysqldump.c) Added missing enums Fixed a lot of wrong DBUG_PRINT() statements, some of which could cause crashes Removed usage of %lld and %p in printf strings as these are not portable or produces different results on different systems.
1 parent 89570bf commit fa81a82

File tree

97 files changed

+504
-417
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+504
-417
lines changed

client/mysqldump.c

+16-16
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@
3030
** master/autocommit code by Brian Aker <brian@tangent.org>
3131
** SSL by
3232
** Andrei Errapart <andreie@no.spam.ee>
33-
** Tõnu Samuel <tonu@please.do.not.remove.this.spam.ee>
33+
** Tõnu Samuel <tonu@please.do.not.remove.this.spam.ee>
3434
** XML by Gary Huntress <ghuntress@mediaone.net> 10/10/01, cleaned up
3535
** and adapted to mysqldump 05/11/01 by Jani Tolonen
3636
** Added --single-transaction option 06/06/2002 by Peter Zaitsev
3737
** 10 Jun 2003: SET NAMES and --no-set-names by Alexander Barkov
3838
*/
3939

40-
#define DUMP_VERSION "10.11"
40+
#define DUMP_VERSION "10.12"
4141

4242
#include <my_global.h>
4343
#include <my_sys.h>
@@ -540,8 +540,10 @@ static void write_header(FILE *sql_file, char *db_name)
540540
if (opt_xml)
541541
{
542542
fputs("<?xml version=\"1.0\"?>\n", sql_file);
543-
/* Schema reference. Allows use of xsi:nil for NULL values and
544-
xsi:type to define an element's data type. */
543+
/*
544+
Schema reference. Allows use of xsi:nil for NULL values and
545+
xsi:type to define an element's data type.
546+
*/
545547
fputs("<mysqldump ", sql_file);
546548
fputs("xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"",
547549
sql_file);
@@ -2349,7 +2351,7 @@ static void dump_table(char *table, char *db)
23492351
The "table" could be a view. If so, we don't do anything here.
23502352
*/
23512353
if (strcmp (table_type, "VIEW") == 0)
2352-
return;
2354+
DBUG_VOID_RETURN;
23532355

23542356
/* Check --no-data flag */
23552357
if (opt_no_data)
@@ -2657,16 +2659,16 @@ static void dump_table(char *table, char *db)
26572659
{
26582660
if (opt_hex_blob && is_blob && length)
26592661
{
2660-
/* Define xsi:type="xs:hexBinary" for hex encoded data */
2661-
print_xml_tag(md_result_file, "\t\t", "", "field", "name=",
2662-
field->name, "xsi:type=", "xs:hexBinary", NullS);
2663-
print_blob_as_hex(md_result_file, row[i], length);
2662+
/* Define xsi:type="xs:hexBinary" for hex encoded data */
2663+
print_xml_tag(md_result_file, "\t\t", "", "field", "name=",
2664+
field->name, "xsi:type=", "xs:hexBinary", NullS);
2665+
print_blob_as_hex(md_result_file, row[i], length);
26642666
}
26652667
else
26662668
{
2667-
print_xml_tag(md_result_file, "\t\t", "", "field", "name=",
2668-
field->name, NullS);
2669-
print_quoted_xml(md_result_file, row[i], length);
2669+
print_xml_tag(md_result_file, "\t\t", "", "field", "name=",
2670+
field->name, NullS);
2671+
print_quoted_xml(md_result_file, row[i], length);
26702672
}
26712673
fputs("</field>\n", md_result_file);
26722674
}
@@ -3155,10 +3157,8 @@ static int dump_all_tables_in_db(char *database)
31553157
afterdot= strmov(hash_key, database);
31563158
*afterdot++= '.';
31573159

3158-
if (!strcmp(database, NDB_REP_DB)) /* Skip cluster internal database */
3159-
return 0;
31603160
if (init_dumping(database, init_dumping_tables))
3161-
return 1;
3161+
DBUG_RETURN(1);
31623162
if (opt_xml)
31633163
print_xml_tag(md_result_file, "", "\n", "database", "name=", database, NullS);
31643164
if (lock_tables)
@@ -3218,7 +3218,7 @@ static int dump_all_tables_in_db(char *database)
32183218
fprintf(md_result_file,"\n--\n-- Flush Grant Tables \n--\n");
32193219
fprintf(md_result_file,"\n/*! FLUSH PRIVILEGES */;\n");
32203220
}
3221-
return 0;
3221+
DBUG_RETURN(0);
32223222
} /* dump_all_tables_in_db */
32233223

32243224

client/mysqlslap.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,7 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit)
10311031
for (x= 0; x < concur; x++)
10321032
{
10331033
int pid;
1034-
DBUG_PRINT("info", ("x %d concurrency %d", x, concurrency));
1034+
DBUG_PRINT("info", ("x: %d concurrency: %u", x, *concurrency));
10351035
pid= fork();
10361036
switch(pid)
10371037
{

client/mysqltest.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ enum {
8080
OPT_SSL_CA, OPT_SSL_CAPATH, OPT_SSL_CIPHER, OPT_PS_PROTOCOL,
8181
OPT_SP_PROTOCOL, OPT_CURSOR_PROTOCOL, OPT_VIEW_PROTOCOL,
8282
OPT_SSL_VERIFY_SERVER_CERT, OPT_MAX_CONNECT_RETRIES,
83-
OPT_MARK_PROGRESS, OPT_CHARSETS_DIR, OPT_LOG_DIR, OPT_DEBUG_INFO};
83+
OPT_MARK_PROGRESS, OPT_CHARSETS_DIR, OPT_LOG_DIR, OPT_DEBUG_INFO
8484
};
8585

8686
static int record= 0, opt_sleep= -1;

extra/yassl/taocrypt/include/algebra.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class TAOCRYPT_NO_VTABLE AbstractRing : public AbstractGroup
7575
typedef Integer Element;
7676

7777
AbstractRing() : AbstractGroup() {m_mg.m_pRing = this;}
78-
AbstractRing(const AbstractRing &source) {m_mg.m_pRing = this;}
78+
AbstractRing(const AbstractRing &source) :AbstractGroup() {m_mg.m_pRing = this;}
7979
AbstractRing& operator=(const AbstractRing &source) {return *this;}
8080

8181
virtual bool IsUnit(const Element &a) const =0;

mysql-test/include/im_check_env.inc

+1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ SHOW VARIABLES LIKE 'server_id';
2222
# Check that IM understands that mysqld1 is online, while mysqld2 is
2323
# offline.
2424

25+
--replace_result starting XXXXX online XXXXX
2526
SHOW INSTANCES;

mysql-test/mysql-test-run.pl

+5-7
Original file line numberDiff line numberDiff line change
@@ -1576,7 +1576,8 @@ ()
15761576
if ( $opt_source_dist )
15771577
{
15781578
push(@ld_library_paths, "$glob_basedir/libmysql/.libs/",
1579-
"$glob_basedir/libmysql_r/.libs/");
1579+
"$glob_basedir/libmysql_r/.libs/",
1580+
"$glob_basedir/zlib.libs/");
15801581
}
15811582
else
15821583
{
@@ -2992,10 +2993,6 @@ ($)
29922993
# Save info from this testcase run to mysqltest.log
29932994
mtr_appendfile_to_file($path_timefile, $path_mysqltest_log)
29942995
if -f $path_timefile;
2995-
2996-
# Remove the file that mysqltest writes info to
2997-
unlink($path_timefile);
2998-
29992996
}
30002997

30012998

@@ -3183,6 +3180,9 @@ ($)
31833180
}
31843181
}
31853182

3183+
# Remove the file that mysqltest writes info to
3184+
unlink($path_timefile);
3185+
31863186
# ----------------------------------------------------------------------
31873187
# Stop Instance Manager if we are processing an IM-test case.
31883188
# ----------------------------------------------------------------------
@@ -4094,7 +4094,6 @@ ($)
40944094
}
40954095

40964096
if ( $clusters->[0]->{'pid'} and ! $master->[1]->{'pid'} )
4097-
{
40984097
{
40994098
# Test needs cluster, start an extra mysqld connected to cluster
41004099

@@ -4848,4 +4847,3 @@ ($)
48484847
mtr_exit(1);
48494848

48504849
}
4851-

mysql-test/r/ctype_cp1250_ch.result

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
drop table if exists t1;
12
DROP TABLE IF EXISTS t1;
23
SHOW COLLATION LIKE 'cp1250_czech_cs';
34
Collation Charset Id Default Compiled Sortlen

mysql-test/r/im_cmd_line.result

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Variable_name Value
33
server_id 1
44
SHOW INSTANCES;
55
instance_name state
6-
mysqld1 starting
6+
mysqld1 XXXXX
77
mysqld2 offline
88
--> Listing users...
99
im_admin

mysql-test/r/im_daemon_life_cycle.result

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Variable_name Value
33
server_id 1
44
SHOW INSTANCES;
55
instance_name state
6-
mysqld1 online
6+
mysqld1 XXXXX
77
mysqld2 offline
88
Killing the process...
99
Sleeping...

mysql-test/r/im_instance_conf.result

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Variable_name Value
33
server_id 1
44
SHOW INSTANCES;
55
instance_name state
6-
mysqld1 online
6+
mysqld1 XXXXX
77
mysqld2 offline
88
--------------------------------------------------------------------
99
server_id = 1

mysql-test/r/im_life_cycle.result

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Variable_name Value
33
server_id 1
44
SHOW INSTANCES;
55
instance_name state
6-
mysqld1 online
6+
mysqld1 XXXXX
77
mysqld2 offline
88

99
--------------------------------------------------------------------

mysql-test/r/im_utils.result

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Variable_name Value
33
server_id 1
44
SHOW INSTANCES;
55
instance_name state
6-
mysqld1 online
6+
mysqld1 XXXXX
77
mysqld2 offline
88
SHOW INSTANCE OPTIONS mysqld1;
99
option_name value

mysql-test/r/log_tables.result

+1
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ create table general_log_new like general_log;
280280
create table slow_log_new like slow_log;
281281
show tables like "%log%";
282282
Tables_in_mysql (%log%)
283+
binlog_index
283284
general_log
284285
general_log_new
285286
slow_log

mysql-test/t/disabled.def

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ concurrent_innodb : BUG#21579 2006-08-11 mleich innodb_concurrent random
1616
ndb_autodiscover : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog
1717
ndb_autodiscover2 : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog
1818
ndb_load : BUG#17233 2006-05-04 tomas failed load data from infile causes mysqld dbug_assert, binlog not flushed
19+
ndb_restore_partition : Problem with cluster/def/schema table that is in std_data/ndb_backup51; Pekka will schdule this to someone
20+
rpl_ndb_sync : Problem with cluster/def/schema table that is in std_data/ndb_backup51; Pekka will schdule this to someone
21+
1922
partition_03ndb : BUG#16385 2006-03-24 mikael Partitions: crash when updating a range partitioned NDB table
2023
ps_7ndb : BUG#18950 2006-02-16 jmiller create table like does not obtain LOCK_open
2124
rpl_ndb_2innodb : BUG#19227 2006-04-20 pekka pk delete apparently not replicated

mysys/my_compress.c

+7-6
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,14 @@ int packfrm(const void *data, uint len,
138138
uint blob_len;
139139
struct frm_blob_struct *blob;
140140
DBUG_ENTER("packfrm");
141-
DBUG_PRINT("enter", ("data: %x, len: %d", data, len));
141+
DBUG_PRINT("enter", ("data: 0x%lx, len: %d", (long) data, len));
142142

143143
error= 1;
144144
org_len= len;
145145
if (my_compress((byte*)data, &org_len, &comp_len))
146146
goto err;
147147

148-
DBUG_PRINT("info", ("org_len: %d, comp_len: %d", org_len, comp_len));
148+
DBUG_PRINT("info", ("org_len: %lu comp_len: %lu", org_len, comp_len));
149149
DBUG_DUMP("compressed", (char*)data, org_len);
150150

151151
error= 2;
@@ -165,7 +165,8 @@ int packfrm(const void *data, uint len,
165165
*pack_len= blob_len;
166166
error= 0;
167167

168-
DBUG_PRINT("exit", ("pack_data: %x, pack_len: %d", *pack_data, *pack_len));
168+
DBUG_PRINT("exit", ("pack_data: 0x%lx pack_len: %d",
169+
(long) *pack_data, *pack_len));
169170
err:
170171
DBUG_RETURN(error);
171172

@@ -194,13 +195,13 @@ int unpackfrm(const void **unpack_data, uint *unpack_len,
194195
byte *data;
195196
ulong complen, orglen, ver;
196197
DBUG_ENTER("unpackfrm");
197-
DBUG_PRINT("enter", ("pack_data: %x", pack_data));
198+
DBUG_PRINT("enter", ("pack_data: 0x%lx", (long) pack_data));
198199

199200
complen= uint4korr((char*)&blob->head.complen);
200201
orglen= uint4korr((char*)&blob->head.orglen);
201202
ver= uint4korr((char*)&blob->head.ver);
202203

203-
DBUG_PRINT("blob",("ver: %d complen: %d orglen: %d",
204+
DBUG_PRINT("blob",("ver: %lu complen: %lu orglen: %lu",
204205
ver,complen,orglen));
205206
DBUG_DUMP("blob->data", (char*) blob->data, complen);
206207

@@ -220,7 +221,7 @@ int unpackfrm(const void **unpack_data, uint *unpack_len,
220221
*unpack_data= data;
221222
*unpack_len= complen;
222223

223-
DBUG_PRINT("exit", ("frmdata: %x, len: %d", *unpack_data, *unpack_len));
224+
DBUG_PRINT("exit", ("frmdata: 0x%lx len: %d", (long) *unpack_data, *unpack_len));
224225
DBUG_RETURN(0);
225226
}
226227
#endif /* HAVE_COMPRESS */

mysys/my_getopt.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -936,8 +936,8 @@ void my_print_variables(const struct my_option *options)
936936
(*getopt_get_addr)("", 0, optp) : optp->value);
937937
if (value)
938938
{
939-
printf("%s", optp->name);
940-
length= (uint) strlen(optp->name);
939+
printf("%s ", optp->name);
940+
length= (uint) strlen(optp->name)+1;
941941
for (; length < name_space; length++)
942942
putchar(' ');
943943
switch ((optp->var_type & GET_TYPE_MASK)) {

plugin/fulltext/plugin_example.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ static long number_of_calls= 0; /* for SHOW STATUS, see below */
6262
1 failure (cannot happen)
6363
*/
6464

65-
static int simple_parser_plugin_init(void)
65+
static int simple_parser_plugin_init(void *arg __attribute__((unused)))
6666
{
6767
return(0);
6868
}
@@ -81,7 +81,7 @@ static int simple_parser_plugin_init(void)
8181
8282
*/
8383

84-
static int simple_parser_plugin_deinit(void)
84+
static int simple_parser_plugin_deinit(void *arg __attribute__((unused)))
8585
{
8686
return(0);
8787
}

server-tools/instance-manager/mysql_connection.cc

-1
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,6 @@ int Mysql_connection_thread::dispatch_command(enum enum_server_command command,
334334
case COM_QUERY:
335335
{
336336
log_info("query for connection %lu : ----\n%s\n-------------------------",
337-
log_info("query for connection %d : ----\n%s\n-------------------------",
338337
connection_id,packet);
339338
if (Command *command= parse_command(&instance_map, packet))
340339
{

0 commit comments

Comments
 (0)