[tpcc-mysql] payment.c c_new_data not used

Bug #1075383 reported by Andy Grove
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
percona-tools
New
Undecided
Unassigned

Bug Description

in payment.c, a field c_new_data is populated and the value is never used.

The comment indicates that c_new_data should be written to the customer table:

  /*EXEC_SQL UPDATE customer
   SET c_balance = :c_balance, c_data = :c_new_data
   WHERE c_w_id = :c_w_id
   AND c_d_id = :c_d_id
   AND c_id = :c_id;*/

However, the code writes c_data instead of c_new_data:

  memset(param, 0, sizeof(MYSQL_BIND) * 5); /* initialize */
  param[0].buffer_type = MYSQL_TYPE_FLOAT;
  param[0].buffer = &c_balance;
  param[1].buffer_type = MYSQL_TYPE_STRING;
  param[1].buffer = c_data;
  param[1].buffer_length = strlen(c_data);

It should be:

  param[1].buffer = c_new_data;
  param[1].buffer_length = strlen(c_new_data);

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.