summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay.choubey@sun.com>2011-01-13 15:59:13 +0530
committerNirbhay Choubey <nirbhay.choubey@sun.com>2011-01-13 15:59:13 +0530
commite17c9279ee1ecb2d9e120a5fb8af521c8f3f9fc8 (patch)
tree3aaab4f9373830110fd23c2e0cbc351237b951cc
parentba38eef6dc48500182da039b77eb0ff51c52a087 (diff)
parentcbeb4e7630e7f8d961b3dbb6450c8cc7c160abfe (diff)
downloadmariadb-git-e17c9279ee1ecb2d9e120a5fb8af521c8f3f9fc8.tar.gz
Merging from mysql-5.1.
-rw-r--r--client/mysqlslap.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/client/mysqlslap.c b/client/mysqlslap.c
index 4e8e4f1aa67..01d96f1f75e 100644
--- a/client/mysqlslap.c
+++ b/client/mysqlslap.c
@@ -1507,7 +1507,12 @@ generate_primary_key_list(MYSQL *mysql, option_string *engine_stmt)
exit(1);
}
- result= mysql_store_result(mysql);
+ if (!(result= mysql_store_result(mysql)))
+ {
+ fprintf(stderr, "%s: Error when storing result: %d %s\n",
+ my_progname, mysql_errno(mysql), mysql_error(mysql));
+ exit(1);
+ }
primary_keys_number_of= mysql_num_rows(result);
/* So why check this? Blackhole :) */
@@ -1879,10 +1884,15 @@ limit_not_met:
{
if (mysql_field_count(mysql))
{
- result= mysql_store_result(mysql);
- while ((row = mysql_fetch_row(result)))
- counter++;
- mysql_free_result(result);
+ if (!(result= mysql_store_result(mysql)))
+ fprintf(stderr, "%s: Error when storing result: %d %s\n",
+ my_progname, mysql_errno(mysql), mysql_error(mysql));
+ else
+ {
+ while ((row= mysql_fetch_row(result)))
+ counter++;
+ mysql_free_result(result);
+ }
}
} while(mysql_next_result(mysql) == 0);
queries++;