summaryrefslogtreecommitdiff
path: root/client
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
commit24eba429dd20b858a593d640b31b87529548cf51 (patch)
tree3aaab4f9373830110fd23c2e0cbc351237b951cc /client
parentad4c839f2cd7a011c179c5eae7d63ba42219fd00 (diff)
parentdb36f63984154a223d5eeeeb51e9a1db4c2fb937 (diff)
downloadmariadb-git-24eba429dd20b858a593d640b31b87529548cf51.tar.gz
Merging from mysql-5.1.
Diffstat (limited to 'client')
-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++;