~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzle.c

  • Committer: Brian Aker
  • Date: 2008-08-10 01:37:46 UTC
  • Revision ID: brian@tangent.org-20080810013746-9hp3l1f59j9xdmm0
ulong cleanp in client apps

Show diffs side-by-side

added added

removed removed

Lines of Context:
157
157
static bool debug_info_flag, debug_check_flag;
158
158
static bool column_types_flag;
159
159
static bool preserve_comments= 0;
160
 
static ulong opt_max_allowed_packet, opt_net_buffer_length;
 
160
static uint32_t opt_max_allowed_packet, opt_net_buffer_length;
161
161
static int verbose=0,opt_silent=0,opt_drizzle_port=0, opt_local_infile=0;
162
162
static uint my_end_arg;
163
163
static char * opt_drizzle_unix_port=0;
174
174
static STATUS status;
175
175
static uint32_t select_limit;
176
176
static uint32_t max_join_size;
177
 
static ulong opt_connect_timeout= 0;
 
177
static uint32_t opt_connect_timeout= 0;
178
178
static char drizzle_charsets_dir[FN_REFLEN+1];
179
179
// TODO: Need to i18n these
180
180
static const char *day_names[]={"Sun","Mon","Tue","Wed","Thu","Fri","Sat"};
224
224
static int put_info(const char *str,INFO_TYPE info,uint error,
225
225
                    const char *sql_state);
226
226
static int put_error(DRIZZLE *drizzle);
227
 
static void safe_put_field(const char *pos,ulong length);
 
227
static void safe_put_field(const char *pos,uint32_t length);
228
228
static void init_pager(void);
229
229
static void end_pager(void);
230
230
static void init_tee(const char *);
1006
1006
static void print_tab_data(DRIZZLE_RES *result);
1007
1007
static void print_table_data_vertically(DRIZZLE_RES *result);
1008
1008
static void print_warnings(void);
1009
 
static ulong start_timer(void);
1010
 
static void end_timer(ulong start_time,char *buff);
1011
 
static void drizzle_end_timer(ulong start_time,char *buff);
 
1009
static uint32_t start_timer(void);
 
1010
static void end_timer(uint32_t start_time,char *buff);
 
1011
static void drizzle_end_timer(uint32_t start_time,char *buff);
1012
1012
static void nice_time(double sec,char *buff,bool part_second);
1013
1013
extern sig_handler drizzle_end(int sig);
1014
1014
extern sig_handler handle_sigint(int sig);
1671
1671
{
1672
1672
  char *line;
1673
1673
  char in_string=0;
1674
 
  ulong line_number=0;
 
1674
  uint32_t line_number=0;
1675
1675
  bool ml_comment= 0;
1676
1676
  COMMANDS *com;
1677
1677
  status.exit_status=1;
2673
2673
  char          buff[200]; /* about 110 chars used so far */
2674
2674
  char          time_buff[52+3+1]; /* time max + space&parens + NUL */
2675
2675
  DRIZZLE_RES     *result;
2676
 
  ulong         timer, warnings= 0;
 
2676
  uint32_t         timer, warnings= 0;
2677
2677
  uint          error= 0;
2678
2678
  int           err= 0;
2679
2679
 
3242
3242
 
3243
3243
 
3244
3244
static void
3245
 
safe_put_field(const char *pos,ulong length)
 
3245
safe_put_field(const char *pos,uint32_t length)
3246
3246
{
3247
3247
  if (!pos)
3248
3248
    tee_fputs("NULL", PAGER);
4077
4077
#define CLOCKS_PER_SEC (sysconf(_SC_CLK_TCK))
4078
4078
#endif
4079
4079
 
4080
 
static ulong start_timer(void)
 
4080
static uint32_t start_timer(void)
4081
4081
{
4082
4082
  struct tms tms_tmp;
4083
4083
  return times(&tms_tmp);
4092
4092
*/
4093
4093
static void nice_time(double sec,char *buff,bool part_second)
4094
4094
{
4095
 
  ulong tmp;
 
4095
  uint32_t tmp;
4096
4096
  if (sec >= 3600.0*24)
4097
4097
  {
4098
 
    tmp=(ulong) floor(sec/(3600.0*24));
 
4098
    tmp=(uint32_t) floor(sec/(3600.0*24));
4099
4099
    sec-=3600.0*24*tmp;
4100
4100
    buff=int10_to_str((long) tmp, buff, 10);
4101
4101
    buff=stpcpy(buff,tmp > 1 ? " days " : " day ");
4102
4102
  }
4103
4103
  if (sec >= 3600.0)
4104
4104
  {
4105
 
    tmp=(ulong) floor(sec/3600.0);
 
4105
    tmp=(uint32_t) floor(sec/3600.0);
4106
4106
    sec-=3600.0*tmp;
4107
4107
    buff=int10_to_str((long) tmp, buff, 10);
4108
4108
    buff=stpcpy(buff,tmp > 1 ? " hours " : " hour ");
4109
4109
  }
4110
4110
  if (sec >= 60.0)
4111
4111
  {
4112
 
    tmp=(ulong) floor(sec/60.0);
 
4112
    tmp=(uint32_t) floor(sec/60.0);
4113
4113
    sec-=60.0*tmp;
4114
4114
    buff=int10_to_str((long) tmp, buff, 10);
4115
4115
    buff=stpcpy(buff," min ");
4121
4121
}
4122
4122
 
4123
4123
 
4124
 
static void end_timer(ulong start_time,char *buff)
 
4124
static void end_timer(uint32_t start_time,char *buff)
4125
4125
{
4126
4126
  nice_time((double) (start_timer() - start_time) /
4127
4127
            CLOCKS_PER_SEC,buff,1);
4128
4128
}
4129
4129
 
4130
4130
 
4131
 
static void drizzle_end_timer(ulong start_time,char *buff)
 
4131
static void drizzle_end_timer(uint32_t start_time,char *buff)
4132
4132
{
4133
4133
  buff[0]=' ';
4134
4134
  buff[1]='(';