Skip to content

Commit

Permalink
Merge pull request #19 from webbed88/master
Browse files Browse the repository at this point in the history
correct 'this ‘if’ clause does not guard' error when using make
  • Loading branch information
maxbube committed Oct 21, 2016
2 parents fb07aea + a59526b commit 03cb519
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
23 changes: 13 additions & 10 deletions mydumper.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,9 +404,10 @@ void *process_queue(struct thread_data *td) {
MYSQL *thrconn = mysql_init(NULL);
g_mutex_unlock(init_mutex);

if (defaults_file != NULL)
mysql_options(thrconn,MYSQL_READ_DEFAULT_FILE,defaults_file);
mysql_options(thrconn,MYSQL_READ_DEFAULT_GROUP,"mydumper");
if (defaults_file != NULL) {
mysql_options(thrconn,MYSQL_READ_DEFAULT_FILE,defaults_file);
mysql_options(thrconn,MYSQL_READ_DEFAULT_GROUP,"mydumper");
}

if (compress_protocol)
mysql_options(thrconn,MYSQL_OPT_COMPRESS,NULL);
Expand Down Expand Up @@ -606,10 +607,11 @@ void *process_queue_less_locking(struct thread_data *td) {
g_mutex_lock(init_mutex);
MYSQL *thrconn = mysql_init(NULL);
g_mutex_unlock(init_mutex);

if (defaults_file != NULL)
mysql_options(thrconn,MYSQL_READ_DEFAULT_FILE,defaults_file);
mysql_options(thrconn,MYSQL_READ_DEFAULT_GROUP,"mydumper");

if (defaults_file != NULL) {
mysql_options(thrconn,MYSQL_READ_DEFAULT_FILE,defaults_file);
mysql_options(thrconn,MYSQL_READ_DEFAULT_GROUP,"mydumper");
}

if (compress_protocol)
mysql_options(thrconn,MYSQL_OPT_COMPRESS,NULL);
Expand Down Expand Up @@ -946,9 +948,10 @@ MYSQL *create_main_connection()
{
MYSQL *conn;
conn = mysql_init(NULL);
if (defaults_file != NULL)
mysql_options(conn,MYSQL_READ_DEFAULT_FILE,defaults_file);
mysql_options(conn,MYSQL_READ_DEFAULT_GROUP,"mydumper");
if (defaults_file != NULL) {
mysql_options(conn,MYSQL_READ_DEFAULT_FILE,defaults_file);
mysql_options(conn,MYSQL_READ_DEFAULT_GROUP,"mydumper");
}

if (!mysql_real_connect(conn, hostname, username, password, db, port, socket_path, 0)) {
g_critical("Error connecting to database: %s", mysql_error(conn));
Expand Down
14 changes: 8 additions & 6 deletions myloader.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,10 @@ int main(int argc, char *argv[]) {

MYSQL *conn;
conn= mysql_init(NULL);
if (defaults_file != NULL)
mysql_options(conn,MYSQL_READ_DEFAULT_FILE,defaults_file);
mysql_options(conn, MYSQL_READ_DEFAULT_GROUP, "myloader");
if (defaults_file != NULL) {
mysql_options(conn,MYSQL_READ_DEFAULT_FILE,defaults_file);
mysql_options(conn, MYSQL_READ_DEFAULT_GROUP, "myloader");
}

if (!mysql_real_connect(conn, hostname, username, password, NULL, port, socket_path, 0)) {
g_critical("Error connection to database: %s", mysql_error(conn));
Expand Down Expand Up @@ -407,9 +408,10 @@ void *process_queue(struct thread_data *td) {
MYSQL *thrconn= mysql_init(NULL);
g_mutex_unlock(init_mutex);

if (defaults_file != NULL)
mysql_options(thrconn,MYSQL_READ_DEFAULT_FILE,defaults_file);
mysql_options(thrconn, MYSQL_READ_DEFAULT_GROUP, "myloader");
if (defaults_file != NULL) {
mysql_options(thrconn,MYSQL_READ_DEFAULT_FILE,defaults_file);
mysql_options(thrconn, MYSQL_READ_DEFAULT_GROUP, "myloader");
}

if (compress_protocol)
mysql_options(thrconn, MYSQL_OPT_COMPRESS, NULL);
Expand Down

0 comments on commit 03cb519

Please sign in to comment.