~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/xa_resource_manager.cc

Merge with trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
111
111
  
112
112
    while ((got= resource_manager->xaRecover(trans_list, trans_len)) > 0 )
113
113
    {
114
 
      errmsg_printf(ERRMSG_LVL_INFO,
 
114
      errmsg_printf(error::INFO,
115
115
                    _("Found %d prepared transaction(s) in resource manager."),
116
116
                    got);
117
117
      for (int i=0; i < got; i ++)
174
174
  }
175
175
  if (!trans_list)
176
176
  {
177
 
    errmsg_printf(ERRMSG_LVL_ERROR, ER(ER_OUTOFMEMORY), trans_len*sizeof(XID));
 
177
    errmsg_printf(error::ERROR, ER(ER_OUTOFMEMORY), trans_len*sizeof(XID));
178
178
    return(1);
179
179
  }
180
180
 
181
181
  if (commit_list.size())
182
 
    errmsg_printf(ERRMSG_LVL_INFO, _("Starting crash recovery..."));
 
182
    errmsg_printf(error::INFO, _("Starting crash recovery..."));
183
183
 
184
184
  XaRecover recover_func(trans_list, trans_len, commit_list, dry_run);
185
185
  std::for_each(xa_resource_managers.begin(),
188
188
  free(trans_list);
189
189
 
190
190
  if (recover_func.getForeignXIDs())
191
 
    errmsg_printf(ERRMSG_LVL_WARN,
 
191
    errmsg_printf(error::WARN,
192
192
                  _("Found %d prepared XA transactions"),
193
193
                  recover_func.getForeignXIDs());
 
194
 
194
195
  if (dry_run && recover_func.getMyXIDs())
195
196
  {
196
 
    errmsg_printf(ERRMSG_LVL_ERROR,
 
197
    errmsg_printf(error::ERROR,
197
198
                  _("Found %d prepared transactions! It means that drizzled "
198
199
                    "was not shut down properly last time and critical "
199
200
                    "recovery information (last binlog or %s file) was "
203
204
                    recover_func.getMyXIDs(), opt_tc_log_file);
204
205
    return(1);
205
206
  }
 
207
 
206
208
  if (commit_list.size())
207
 
    errmsg_printf(ERRMSG_LVL_INFO, _("Crash recovery finished."));
 
209
    errmsg_printf(error::INFO, _("Crash recovery finished."));
 
210
 
208
211
  return(0);
209
212
}
210
213