Skip to content

Commit 38ea6ec

Browse files
author
VadimTk
committed
fixes to load.c
1 parent bd78fe1 commit 38ea6ec

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

src/load.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ LoadWare()
455455
MakeAddress(w_street_1, w_street_2, w_city, w_state, w_zip);
456456

457457
w_tax = ((float) RandomNumber(10L, 20L)) / 100.0;
458-
w_ytd = 3000000.00;
458+
w_ytd = 300000.00
459459

460460
if (option_debug)
461461
printf("WID = %ld, Name= %16s, Tax = %5.2f\n",
@@ -1139,7 +1139,7 @@ Orders(d_id, w_id)
11391139
order_line
11401140
values(:o_id,:o_d_id,:o_w_id,:ol,
11411141
:ol_i_id,:ol_supply_w_id, NULL,
1142-
:ol_quantity,:ol_amount,:ol_dist_info);*/
1142+
:ol_quantity,:tmp_float,:ol_dist_info);*/
11431143

11441144
memset(param, 0, sizeof(MYSQL_BIND) * 9); /* initialize */
11451145
param[0].buffer_type = MYSQL_TYPE_LONG;
@@ -1157,7 +1157,7 @@ Orders(d_id, w_id)
11571157
param[6].buffer_type = MYSQL_TYPE_LONG;
11581158
param[6].buffer = &ol_quantity;
11591159
param[7].buffer_type = MYSQL_TYPE_FLOAT;
1160-
param[7].buffer = &ol_amount;
1160+
param[7].buffer = &tmp_float;
11611161
param[8].buffer_type = MYSQL_TYPE_STRING;
11621162
param[8].buffer = ol_dist_info;
11631163
param[8].buffer_length = strlen(ol_dist_info);
@@ -1170,7 +1170,7 @@ Orders(d_id, w_id)
11701170
values(:o_id,:o_d_id,:o_w_id,:ol,
11711171
:ol_i_id,:ol_supply_w_id,
11721172
:timestamp,
1173-
:ol_quantity,:tmp_float,:ol_dist_info);*/
1173+
:ol_quantity,:ol_amount,:ol_dist_info);*/
11741174

11751175
memset(param, 0, sizeof(MYSQL_BIND) * 10); /* initialize */
11761176
param[0].buffer_type = MYSQL_TYPE_LONG;
@@ -1191,7 +1191,7 @@ Orders(d_id, w_id)
11911191
param[7].buffer_type = MYSQL_TYPE_LONG;
11921192
param[7].buffer = &ol_quantity;
11931193
param[8].buffer_type = MYSQL_TYPE_FLOAT;
1194-
param[8].buffer = &tmp_float;
1194+
param[8].buffer = &ol_amount;
11951195
param[9].buffer_type = MYSQL_TYPE_STRING;
11961196
param[9].buffer = ol_dist_info;
11971197
param[9].buffer_length = strlen(ol_dist_info);

src/main.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ char node_string[NUM_NODE_MAX][DB_STRING_MAX];
5353
int time_count;
5454
int PRINT_INTERVAL=10;
5555
int multi_schema = 0;
56+
int multi_schema_offset = 0;
5657

5758
int success[5];
5859
int late[5];
@@ -152,7 +153,7 @@ int main( int argc, char *argv[] )
152153

153154
/* Parse args */
154155

155-
while ( (c = getopt(argc, argv, "h:P:d:u:p:w:c:r:l:i:f:t:m:S:")) != -1) {
156+
while ( (c = getopt(argc, argv, "h:P:d:u:p:w:c:r:l:i:f:t:m:o:S:")) != -1) {
156157
switch (c) {
157158
case 'h':
158159
printf ("option h with value '%s'\n", optarg);
@@ -198,6 +199,10 @@ int main( int argc, char *argv[] )
198199
printf ("option m (multiple schemas) with value '%s'\n", optarg);
199200
multi_schema = atoi(optarg);
200201
break;
202+
case 'o':
203+
printf ("option o (multiple schemas offset) with value '%s'\n", optarg);
204+
multi_schema_offset = atoi(optarg);
205+
break;
201206
case 'i':
202207
printf ("option i with value '%s'\n", optarg);
203208
PRINT_INTERVAL = atoi(optarg);
@@ -700,11 +705,13 @@ int thread_main (thread_arg* arg)
700705
}
701706

702707
if (multi_schema) {
703-
sprintf(db_string_full,"%s_%d",db_string, t_num % multi_schema);
708+
sprintf(db_string_full,"%s_%d",db_string, (t_num % multi_schema) + multi_schema_offset);
704709
}else {
705710
sprintf(db_string_full,"%s",db_string);
706711
}
707712

713+
printf("Using schema: %s\n", db_string_full);
714+
708715
if(is_local==1){
709716
/* exec sql connect :connect_string; */
710717
resp = mysql_real_connect(ctx[t_num], "localhost", db_user, db_password, db_string_full, port, db_socket, 0);

0 commit comments

Comments
 (0)