~ubuntu-branches/ubuntu/natty/mysql-5.1/natty-proposed

« back to all changes in this revision

Viewing changes to client/mysqlslap.c

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 08:30:45 UTC
  • mfrom: (1.4.1)
  • Revision ID: package-import@ubuntu.com-20120222083045-2rd53r4bnyx7qus4
Tags: 5.1.61-0ubuntu0.11.04.1
* SECURITY UPDATE: Update to 5.1.61 to fix multiple security issues
  (LP: #937869)
  - http://www.oracle.com/technetwork/topics/security/cpujan2012-366304.html
  - CVE-2011-2262
  - CVE-2012-0075
  - CVE-2012-0112
  - CVE-2012-0113
  - CVE-2012-0114
  - CVE-2012-0115
  - CVE-2012-0116
  - CVE-2012-0117
  - CVE-2012-0118
  - CVE-2012-0119
  - CVE-2012-0120
  - CVE-2012-0484
  - CVE-2012-0485
  - CVE-2012-0486
  - CVE-2012-0487
  - CVE-2012-0488
  - CVE-2012-0489
  - CVE-2012-0490
  - CVE-2012-0491
  - CVE-2012-0492
  - CVE-2012-0493
  - CVE-2012-0494
  - CVE-2012-0495
  - CVE-2012-0496

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2005 MySQL AB, 2009 Sun Microsystems, Inc.
 
1
/*
 
2
   Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
2
3
 
3
4
   This program is free software; you can redistribute it and/or modify
4
5
   it under the terms of the GNU General Public License as published by
11
12
 
12
13
   You should have received a copy of the GNU General Public License
13
14
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
15
16
 
16
17
   original idea: Brian Aker via playing with ab for too many years
17
18
   coded by: Patrick Galbraith
131
132
 
132
133
const char *create_schema_string= "mysqlslap";
133
134
 
134
 
static my_bool opt_preserve= TRUE;
 
135
static my_bool opt_preserve= TRUE, opt_no_drop= FALSE;
135
136
static my_bool debug_info_flag= 0, debug_check_flag= 0;
136
137
static my_bool opt_only_print= FALSE;
137
138
static my_bool opt_compress= FALSE, tty_password= FALSE,
599
600
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
600
601
  {"iterations", 'i', "Number of times to run the tests.", &iterations,
601
602
    &iterations, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0},
 
603
  {"no-drop", OPT_SLAP_NO_DROP, "Do not drop the schema after the test.",
 
604
   &opt_no_drop, &opt_no_drop, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
602
605
  {"number-char-cols", 'x', 
603
606
    "Number of VARCHAR columns to create in table if specifying --auto-generate-sql.",
604
607
    &num_char_cols_opt, &num_char_cols_opt, 0, GET_STR, REQUIRED_ARG,
1147
1150
  if (!user)
1148
1151
    user= (char *)"root";
1149
1152
 
1150
 
  /* If something is created we clean it up, otherwise we leave schemas alone */
1151
 
  if (create_string || auto_generate_sql)
 
1153
  /*
 
1154
    If something is created and --no-drop is not specified, we drop the
 
1155
    schema.
 
1156
  */
 
1157
  if (!opt_no_drop && (create_string || auto_generate_sql))
1152
1158
    opt_preserve= FALSE;
1153
1159
 
1154
1160
  if (auto_generate_sql && (create_string || user_supplied_query))
1519
1525
      exit(1);
1520
1526
    }
1521
1527
 
1522
 
    result= mysql_store_result(mysql);
 
1528
    if (!(result= mysql_store_result(mysql)))
 
1529
    {
 
1530
      fprintf(stderr, "%s: Error when storing result: %d %s\n",
 
1531
              my_progname, mysql_errno(mysql), mysql_error(mysql));
 
1532
      exit(1);
 
1533
    }
1523
1534
    primary_keys_number_of= mysql_num_rows(result);
1524
1535
 
1525
1536
    /* So why check this? Blackhole :) */
1891
1902
      {
1892
1903
        if (mysql_field_count(mysql))
1893
1904
        {
1894
 
          result= mysql_store_result(mysql);
1895
 
          while ((row = mysql_fetch_row(result)))
1896
 
            counter++;
1897
 
          mysql_free_result(result);
 
1905
          if (!(result= mysql_store_result(mysql)))
 
1906
            fprintf(stderr, "%s: Error when storing result: %d %s\n",
 
1907
                    my_progname, mysql_errno(mysql), mysql_error(mysql));
 
1908
          else
 
1909
          {
 
1910
            while ((row= mysql_fetch_row(result)))
 
1911
              counter++;
 
1912
            mysql_free_result(result);
 
1913
          }
1898
1914
        }
1899
1915
      } while(mysql_next_result(mysql) == 0);
1900
1916
      queries++;