~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzletest.cc

  • Committer: Mark Atwood
  • Date: 2011-08-21 06:58:08 UTC
  • mfrom: (2407.1.6 client)
  • Revision ID: me@mark.atwood.name-20110821065808-l3xxgvbreily086c
mergeĀ lp:~olafvdspek/drizzle/client

Show diffs side-by-side

added added

removed removed

Lines of Context:
242
242
 
243
243
  operator drizzle_con_st*()
244
244
  {
245
 
    return &con.b_;
 
245
    return con;
246
246
  }
247
247
 
248
248
  drizzle::drizzle_c drizzle;
2636
2636
 
2637
2637
  drizzle::result_c result;
2638
2638
  drizzle_return_t ret;
2639
 
  drizzle_quit(*con, &result.b_, &ret);
 
2639
  drizzle_quit(*con, result, &ret);
2640
2640
}
2641
2641
 
2642
2642
 
4388
4388
 
4389
4389
static int append_warnings(string& ds, drizzle::connection_c& con, drizzle::result_c& res)
4390
4390
{
4391
 
  uint32_t count= drizzle_result_warning_count(&res.b_);
 
4391
  uint32_t count= drizzle_result_warning_count(res);
4392
4392
  if (!count)
4393
4393
    return 0;
4394
4394
 
4430
4430
     * Send the query
4431
4431
     */
4432
4432
 
4433
 
    (void) drizzle_query(con, &res.b_, query, query_len, &ret);
 
4433
    (void) drizzle_query(con, res, query, query_len, &ret);
4434
4434
    if (ret != DRIZZLE_RETURN_OK)
4435
4435
    {
4436
4436
      if (ret == DRIZZLE_RETURN_ERROR_CODE ||
4437
4437
          ret == DRIZZLE_RETURN_HANDSHAKE_FAILED)
4438
4438
      {
4439
4439
        err= res.error_code();
4440
 
        handle_error(command, err, res.error(), drizzle_result_sqlstate(&res.b_), ds);
 
4440
        handle_error(command, err, res.error(), drizzle_result_sqlstate(res), ds);
4441
4441
      }
4442
4442
      else
4443
4443
      {
4454
4454
    /*
4455
4455
     * Read the result packet
4456
4456
     */
4457
 
    if (drizzle_result_read(con, &res.b_, &ret) == NULL ||
 
4457
    if (drizzle_result_read(con, res, &ret) == NULL ||
4458
4458
        ret != DRIZZLE_RETURN_OK)
4459
4459
    {
4460
4460
      if (ret == DRIZZLE_RETURN_ERROR_CODE)
4461
4461
      {
4462
 
        handle_error(command, res.error_code(), res.error(), drizzle_result_sqlstate(&res.b_), ds);
 
4462
        handle_error(command, res.error_code(), res.error(), drizzle_result_sqlstate(res), ds);
4463
4463
      }
4464
4464
      else
4465
4465
        handle_error(command, ret, drizzle_con_error(con), "", ds);
4470
4470
    /*
4471
4471
      Store the result of the query if it will return any fields
4472
4472
    */
4473
 
    if (res.column_count() &&
4474
 
        (ret= drizzle_result_buffer(&res.b_)) != DRIZZLE_RETURN_OK)
 
4473
    if (res.column_count() && (ret= drizzle_result_buffer(res)) != DRIZZLE_RETURN_OK)
4475
4474
    {
4476
4475
      if (ret == DRIZZLE_RETURN_ERROR_CODE)
4477
4476
      {
4478
 
        handle_error(command, res.error_code(), res.error(), drizzle_result_sqlstate(&res.b_), ds);
 
4477
        handle_error(command, res.error_code(), res.error(), drizzle_result_sqlstate(res), ds);
4479
4478
      }
4480
4479
      else
4481
4480
        handle_error(command, ret, drizzle_con_error(con), "", ds);
4503
4502
        query to find the warnings
4504
4503
      */
4505
4504
      if (!disable_info)
4506
 
        affected_rows= drizzle_result_affected_rows(&res.b_);
 
4505
        affected_rows= drizzle_result_affected_rows(res);
4507
4506
 
4508
4507
      /*
4509
4508
        Add all warnings to the result. We can't do this if we are in
4521
4520
      }
4522
4521
 
4523
4522
      if (!disable_info)
4524
 
        append_info(ds, affected_rows, drizzle_result_info(&res.b_));
 
4523
        append_info(ds, affected_rows, drizzle_result_info(res));
4525
4524
    }
4526
4525
 
4527
4526
  }
5373
5372
        {
5374
5373
          drizzle::result_c result;
5375
5374
          drizzle_return_t ret;
5376
 
          (void) drizzle_ping(*cur_con, &result.b_, &ret);
 
5375
          (void) drizzle_ping(*cur_con, result, &ret);
5377
5376
        }
5378
5377
        break;
5379
5378
      case Q_EXEC: