Gearman Server and Client Libraries

Error compiling Drizzle queue on CentOS 5.x or 6.x

Reported by Orlando on 2012-12-01
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Gearman
Low
Brian Aker

Bug Description

When running make under CentOS 5.8 or 6.3 with drizzle 7.1.35-stable and gearmand 1.1.3

Configure options:

libdrizzle_CFLAGS="-I/usr/local/include/libdrizzle-1.0" libdrizzle_LIBS="-ldrizzle" ./configure

Make fails with the following info:

libgearman-server/plugins/queue/drizzle/queue.cc: In constructor 'gearmand::plugins::queue::Drizzle::Drizzle()':
libgearman-server/plugins/queue/drizzle/queue.cc:192: warning: 'gearmand::plugins::queue::Drizzle::port' will be initialized after
libgearman-server/plugins/queue/drizzle/queue.cc:191: warning: 'bool gearmand::plugins::queue::Drizzle::mysql_protocol'
libgearman-server/plugins/queue/drizzle/queue.cc:199: warning: when initialized here
libgearman-server/plugins/queue/drizzle/queue.cc: In function 'gearmand_error_t gearman_server_queue_libdrizzle_init(gearmand::plugins::queue::Drizzle*, gearman_server_st*)':
libgearman-server/plugins/queue/drizzle/queue.cc:493: error: no matching function for call to 'gearman_server_set_queue(gearman_server_st*&, gearmand::plugins::queue::Drizzle*&, gearmand_error_t (&)(gearman_server_st*, void*, const char*, size_t, const char*, size_t, const void*, size_t, gearman_job_priority_t, int64_t), gearmand_error_t (&)(gearman_server_st*, void*), gearmand_error_t (&)(gearman_server_st*, void*, const char*, size_t, const char*, size_t), gearmand_error_t (&)(gearman_server_st*, void*, gearmand_error_t (*)(gearman_server_st*, void*, const char*, size_t, const char*, size_t, const void*, size_t, gearman_job_priority_t, int64_t), void*))'
./libgearman-server/queue.hpp:65: note: candidates are: void gearman_server_set_queue(gearman_server_st&, void*, gearmand_error_t (*)(gearman_server_st*, void*, const char*, size_t, const char*, size_t, const void*, size_t, gearman_job_priority_t, int64_t), gearmand_error_t (*)(gearman_server_st*, void*), gearmand_error_t (*)(gearman_server_st*, void*, const char*, size_t, const char*, size_t), gearmand_error_t (*)(gearman_server_st*, void*, gearmand_error_t (*)(gearman_server_st*, void*, const char*, size_t, const char*, size_t, const void*, size_t, gearman_job_priority_t, int64_t), void*))
./libgearman-server/queue.hpp:72: note: void gearman_server_set_queue(gearman_server_st&, gearmand::queue::Context*)
libgearman-server/plugins/queue/drizzle/queue.cc: In function 'gearmand_error_t _libdrizzle_add(gearman_server_st*, void*, const char*, size_t, const char*, size_t, const void*, size_t, gearman_job_priority_t, int64_t)':
libgearman-server/plugins/queue/drizzle/queue.cc:541: warning: field precision should have type 'int', but argument 4 has type 'size_t'
libgearman-server/plugins/queue/drizzle/queue.cc:541: warning: field precision should have type 'int', but argument 6 has type 'size_t'
libgearman-server/plugins/queue/drizzle/queue.cc:541: warning: field precision should have type 'int', but argument 10 has type 'size_t'
libgearman-server/plugins/queue/drizzle/queue.cc:541: warning: field precision should have type 'int', but argument 12 has type 'size_t'
libgearman-server/plugins/queue/drizzle/queue.cc:541: warning: field precision should have type 'int', but argument 4 has type 'size_t'
libgearman-server/plugins/queue/drizzle/queue.cc:541: warning: field precision should have type 'int', but argument 6 has type 'size_t'
libgearman-server/plugins/queue/drizzle/queue.cc:541: warning: field precision should have type 'int', but argument 10 has type 'size_t'
libgearman-server/plugins/queue/drizzle/queue.cc:541: warning: field precision should have type 'int', but argument 12 has type 'size_t'
libgearman-server/plugins/queue/drizzle/queue.cc:552: warning: field precision should have type 'int', but argument 4 has type 'size_t'
libgearman-server/plugins/queue/drizzle/queue.cc:552: warning: field precision should have type 'int', but argument 6 has type 'size_t'
libgearman-server/plugins/queue/drizzle/queue.cc:552: warning: field precision should have type 'int', but argument 9 has type 'size_t'
libgearman-server/plugins/queue/drizzle/queue.cc:552: warning: field precision should have type 'int', but argument 11 has type 'size_t'
libgearman-server/plugins/queue/drizzle/queue.cc:552: warning: field precision should have type 'int', but argument 4 has type 'size_t'
libgearman-server/plugins/queue/drizzle/queue.cc:552: warning: field precision should have type 'int', but argument 6 has type 'size_t'
libgearman-server/plugins/queue/drizzle/queue.cc:552: warning: field precision should have type 'int', but argument 9 has type 'size_t'
libgearman-server/plugins/queue/drizzle/queue.cc:552: warning: field precision should have type 'int', but argument 11 has type 'size_t'
libgearman-server/plugins/queue/drizzle/queue.cc: In function 'gearmand_error_t _libdrizzle_done(gearman_server_st*, void*, const char*, size_t, const char*, size_t)':
libgearman-server/plugins/queue/drizzle/queue.cc:611: warning: field precision should have type 'int', but argument 4 has type 'size_t'
libgearman-server/plugins/queue/drizzle/queue.cc:611: warning: field precision should have type 'int', but argument 6 has type 'size_t'
libgearman-server/plugins/queue/drizzle/queue.cc:611: warning: field precision should have type 'int', but argument 8 has type 'size_t'
libgearman-server/plugins/queue/drizzle/queue.cc:611: warning: field precision should have type 'int', but argument 10 has type 'size_t'
libgearman-server/plugins/queue/drizzle/queue.cc:611: warning: field precision should have type 'int', but argument 4 has type 'size_t'
libgearman-server/plugins/queue/drizzle/queue.cc:611: warning: field precision should have type 'int', but argument 6 has type 'size_t'
libgearman-server/plugins/queue/drizzle/queue.cc:611: warning: field precision should have type 'int', but argument 8 has type 'size_t'
libgearman-server/plugins/queue/drizzle/queue.cc:611: warning: field precision should have type 'int', but argument 10 has type 'size_t'
make[1]: *** [libgearman-server/plugins/queue/drizzle/libgearman_server_libgearman_server_la-queue.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/usr/gearmand-patch/gearmand-1.1.3'
make: *** [all] Error 2

We modified libgearman-server/plugins/queue/drizzle/queue.cc as listed below and allowed us to complete the installation, so far our tests have worked with no issues.

Patch below, per Rick Stevens (AllDigital Inc.)

--- libgearman-server/plugins/queue/drizzle/queue.cc 2012-11-07 20:30:48.000000000 -0800
+++ /root/queue.cc 2012-11-30 18:15:09.415263144 -0800
@@ -490,7 +490,8 @@
     drizzle_result_free(queue->result());
   }

- gearman_server_set_queue(server, queue, _libdrizzle_add, _libdrizzle_flush, _libdrizzle_done, _libdrizzle_replay);
+// Fixing coercions here!
+ gearman_server_set_queue((gearman_server_st &)server, (void *)queue, (gearman_queue_add_fn *)_libdrizzle_add, (gearman_queue_flush_fn *)_libdrizzle_flush, (gearman_queue_done_fn *)_libdrizzle_done, (gearman_queue_replay_fn *)_libdrizzle_replay);

   return GEARMAN_SUCCESS;
 }
@@ -532,23 +533,23 @@
   {
     query_size= (size_t)snprintf(query_buffer, sizeof(query_buffer),
                                  "INSERT INTO %.*s.%.*s SET priority=%u,when_to_run=%lld,unique_key='%.*s',function_name='%.*s',data='",
- queue->schema.size(), queue->schema.c_str(),
- queue->table.size(), queue->table.c_str(),
+ (int)queue->schema.size(), queue->schema.c_str(),
+ (int)queue->table.size(), queue->table.c_str(),
                                  uint32_t(priority),
                                  (long long unsigned int)when,
- escaped_unique_name.size(), &escaped_unique_name[0],
- escaped_function_name.size(), &escaped_function_name[0]
+ (int)escaped_unique_name.size(), &escaped_unique_name[0],
+ (int)escaped_function_name.size(), &escaped_function_name[0]
                                 );
   }
   else
   {
     query_size= (size_t)snprintf(query_buffer, sizeof(query_buffer),
                                  "INSERT INTO %.*s.%.*s SET priority=%u,unique_key='%.*s',function_name='%.*s',data='",
- queue->schema.size(), queue->schema.c_str(),
- queue->table.size(), queue->table.c_str(),
+ (int)queue->schema.size(), queue->schema.c_str(),
+ (int)queue->table.size(), queue->table.c_str(),
                                  uint32_t(priority),
- escaped_unique_name.size(), &escaped_unique_name[0],
- escaped_function_name.size(), &escaped_function_name[0]
+ (int)escaped_unique_name.size(), &escaped_unique_name[0],
+ (int)escaped_function_name.size(), &escaped_function_name[0]
                                 );
   }

@@ -604,10 +605,10 @@

   int query_size= snprintf(&query[0], query.size(),
                            "DELETE FROM %.*s.%.*s WHERE unique_key='%.*s' and function_name= '%.*s'",
- queue->schema.size(), queue->schema.c_str(),
- queue->table.size(), queue->table.c_str(),
- escaped_unique_name.size(), &escaped_unique_name[0],
- escaped_function_name.size(), &escaped_function_name[0]
+ (int)queue->schema.size(), queue->schema.c_str(),
+ (int)queue->table.size(), queue->table.c_str(),
+ (int)escaped_unique_name.size(), &escaped_unique_name[0],
+ (int)escaped_function_name.size(), &escaped_function_name[0]
                           );

   if (query_size < 0 or size_t(query_size) > query.size())

Brian Aker (brianaker) on 2012-12-07
summary: - Error on CentOS 5.x or 6.x
+ Error compiling Drizzle queue on CentOS 5.x or 6.x
Brian Aker (brianaker) on 2013-01-09
Changed in gearmand:
milestone: none → 1.0.3
assignee: nobody → Brian Aker (brianaker)
importance: Undecided → Low
status: New → In Progress
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers