Index: trunk/tools/trainwreck/trainwreck.c |
— | — | @@ -937,15 +937,18 @@ |
938 | 938 | |
939 | 939 | self->wr_status = ST_EXECUTING; |
940 | 940 | self->wr_last_executed_time = e->le_time; |
941 | | - if (mysql_select_db(self->wr_conn, e->le_database) != 0) { |
942 | | - logmsg("%s,%lu: cannot select \"%s\": %s", |
943 | | - e->le_file, (unsigned long) e->le_pos, |
944 | | - e->le_database, mysql_error(self->wr_conn)); |
945 | | - exit(1); |
946 | | - } |
| 941 | + |
| 942 | + if (e->le_database && *e->le_database) |
| 943 | + if (mysql_select_db(self->wr_conn, e->le_database) != 0) { |
| 944 | + logmsg("%s,%lu: cannot select \"%s\": %s", |
| 945 | + e->le_file, (unsigned long) e->le_pos, |
| 946 | + e->le_database, mysql_error(self->wr_conn)); |
| 947 | + exit(1); |
| 948 | + } |
947 | 949 | |
948 | 950 | switch (e->le_type) { |
949 | 951 | case ET_SYNC: |
| 952 | + logmsg("syncing for binlog rotation..."); |
950 | 953 | sync_ack(self); |
951 | 954 | break; |
952 | 955 | |
— | — | @@ -993,6 +996,7 @@ |
994 | 997 | { |
995 | 998 | pthread_mutex_lock(&sync_mtx); |
996 | 999 | --nsyncs; |
| 1000 | + pthread_cond_signal(&sync_cond); |
997 | 1001 | pthread_mutex_unlock(&sync_mtx); |
998 | 1002 | } |
999 | 1003 | |