~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_class.cc

Merged build changes from Antony.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#include "rpl_rli.h"
30
30
#include "rpl_record.h"
31
31
#include "slave.h"
32
 
#include <my_bitmap.h>
33
32
#include "log_event.h"
34
 
#include <m_ctype.h>
35
33
#include <sys/stat.h>
36
 
#include <thr_alarm.h>
37
 
#include <mysys_err.h>
 
34
#include <mysys/thr_alarm.h>
 
35
#include <mysys/mysys_err.h>
38
36
 
39
37
/*
40
38
  The following is used to initialise Table_ident with a internal
239
237
 
240
238
extern "C"
241
239
const char *set_thd_proc_info(THD *thd, const char *info,
242
 
                              const char *calling_function __attribute__((__unused__)),
243
 
                              const char *calling_file __attribute__((__unused__)),
244
 
                              const unsigned int calling_line __attribute__((__unused__)))
 
240
                              const char *calling_function __attribute__((unused)),
 
241
                              const char *calling_file __attribute__((unused)),
 
242
                              const unsigned int calling_line __attribute__((unused)))
245
243
{
246
244
  const char *old_info= thd->proc_info;
247
245
  thd->proc_info= info;
432
430
*/
433
431
 
434
432
void
435
 
Diagnostics_area::set_error_status(THD *thd __attribute__((__unused__)),
 
433
Diagnostics_area::set_error_status(THD *thd __attribute__((unused)),
436
434
                                   uint sql_errno_arg,
437
435
                                   const char *message_arg)
438
436
{
528
526
  utime_after_lock= 0L;
529
527
  current_linfo =  0;
530
528
  slave_thread = 0;
531
 
  bzero(&variables, sizeof(variables));
 
529
  memset(&variables, 0, sizeof(variables));
532
530
  thread_id= 0;
533
531
  one_shot_set= 0;
534
532
  file_id = 0;
535
533
  query_id= 0;
536
534
  warn_id= 0;
537
535
  db_charset= global_system_variables.collation_database;
538
 
  bzero(ha_data, sizeof(ha_data));
 
536
  memset(ha_data, 0, sizeof(ha_data));
539
537
  mysys_var=0;
540
538
  binlog_evt_union.do_union= false;
541
539
  enable_slow_log= 0;
573
571
    my_init_dynamic_array(&user_var_events,
574
572
                          sizeof(BINLOG_USER_VAR_EVENT *), 16, 16);
575
573
  else
576
 
    bzero((char*) &user_var_events, sizeof(user_var_events));
 
574
    memset(&user_var_events, 0, sizeof(user_var_events));
577
575
 
578
576
  /* Protocol */
579
577
  protocol= &protocol_text;                     // Default protocol
700
698
                        TL_WRITE);
701
699
  session_tx_isolation= (enum_tx_isolation) variables.tx_isolation;
702
700
  warn_list.empty();
703
 
  bzero((char*) warn_count, sizeof(warn_count));
 
701
  memset((char*) warn_count, 0, sizeof(warn_count));
704
702
  total_warn_count= 0;
705
703
  update_charset();
706
704
  reset_current_stmt_binlog_row_based();
707
 
  bzero((char *) &status_var, sizeof(status_var));
 
705
  memset((char *) &status_var, 0, sizeof(status_var));
708
706
}
709
707
 
710
708
 
1101
1099
 
1102
1100
void THD::update_charset()
1103
1101
{
1104
 
  uint32 not_used;
 
1102
  uint32_t not_used;
1105
1103
  charset_is_system_charset= !String::needs_conversion(0,charset(),
1106
1104
                                                       system_charset_info,
1107
1105
                                                       &not_used);
1197
1195
  List<Item> field_list;
1198
1196
  Item *item;
1199
1197
  CHARSET_INFO *cs= system_charset_info;
1200
 
  field_list.push_back(new Item_return_int("id",3, MYSQL_TYPE_LONGLONG));
 
1198
  field_list.push_back(new Item_return_int("id",3, DRIZZLE_TYPE_LONGLONG));
1201
1199
  field_list.push_back(new Item_empty_string("select_type", 19, cs));
1202
1200
  field_list.push_back(item= new Item_empty_string("table", NAME_CHAR_LEN, cs));
1203
1201
  item->maybe_null= 1;
1219
1217
                                                  cs));
1220
1218
  item->maybe_null=1;
1221
1219
  field_list.push_back(item= new Item_return_int("rows", 10,
1222
 
                                                 MYSQL_TYPE_LONGLONG));
 
1220
                                                 DRIZZLE_TYPE_LONGLONG));
1223
1221
  if (lex->describe & DESCRIBE_EXTENDED)
1224
1222
  {
1225
1223
    field_list.push_back(item= new Item_float("filtered", 0.1234, 2, 4));
1250
1248
  Item **place;
1251
1249
  Item *old_value;
1252
1250
  /* Placement new was hidden by `new' in ilink (TODO: check): */
1253
 
  static void *operator new(size_t size __attribute__((__unused__)),
 
1251
  static void *operator new(size_t size __attribute__((unused)),
1254
1252
                            void *mem)
1255
1253
    { return mem; }
1256
 
  static void operator delete(void *ptr __attribute__((__unused__)),
1257
 
                              size_t size __attribute__((__unused__)))
 
1254
  static void operator delete(void *ptr __attribute__((unused)),
 
1255
                              size_t size __attribute__((unused)))
1258
1256
    {}
1259
 
  static void operator delete(void *ptr __attribute__((__unused__)),
1260
 
                              void *mem __attribute__((__unused__)))
 
1257
  static void operator delete(void *ptr __attribute__((unused)),
 
1258
                              void *mem __attribute__((unused)))
1261
1259
    { /* never called */ }
1262
1260
};
1263
1261
 
1820
1818
        if (!space_inited)
1821
1819
        {
1822
1820
          space_inited=1;
1823
 
          bfill(space,sizeof(space),' ');
 
1821
          memset(space, ' ', sizeof(space));
1824
1822
        }
1825
1823
        uint length=item->max_length-used_length;
1826
1824
        for (; length > sizeof(space) ; length-=sizeof(space))
2044
2042
     sortcmp(val1, val2, cache->collation.collation) < 0);
2045
2043
}
2046
2044
 
2047
 
bool select_exists_subselect::send_data(List<Item> &items __attribute__((__unused__)))
 
2045
bool select_exists_subselect::send_data(List<Item> &items __attribute__((unused)))
2048
2046
{
2049
2047
  Item_exists_subselect *it= (Item_exists_subselect *)item;
2050
2048
  if (unit->offset_limit_cnt)
2281
2279
 
2282
2280
void THD::set_status_var_init()
2283
2281
{
2284
 
  bzero((char*) &status_var, sizeof(status_var));
 
2282
  memset((char*) &status_var, 0, sizeof(status_var));
2285
2283
}
2286
2284
 
2287
2285
 
2529
2527
 */
2530
2528
 
2531
2529
template <class RowsEventT> Rows_log_event* 
2532
 
THD::binlog_prepare_pending_rows_event(TABLE* table, uint32 serv_id,
 
2530
THD::binlog_prepare_pending_rows_event(TABLE* table, uint32_t serv_id,
2533
2531
                                       size_t needed,
2534
2532
                                       bool is_transactional,
2535
2533
                                       RowsEventT *hint __attribute__((unused)))
2605
2603
  compiling option.
2606
2604
*/
2607
2605
template Rows_log_event*
2608
 
THD::binlog_prepare_pending_rows_event(TABLE*, uint32, size_t, bool,
 
2606
THD::binlog_prepare_pending_rows_event(TABLE*, uint32_t, size_t, bool,
2609
2607
                                       Write_rows_log_event*);
2610
2608
 
2611
2609
template Rows_log_event*
2612
 
THD::binlog_prepare_pending_rows_event(TABLE*, uint32, size_t, bool,
 
2610
THD::binlog_prepare_pending_rows_event(TABLE*, uint32_t, size_t, bool,
2613
2611
                                       Delete_rows_log_event *);
2614
2612
 
2615
2613
template Rows_log_event* 
2616
 
THD::binlog_prepare_pending_rows_event(TABLE*, uint32, size_t, bool,
 
2614
THD::binlog_prepare_pending_rows_event(TABLE*, uint32_t, size_t, bool,
2617
2615
                                       Update_rows_log_event *);
2618
2616
#endif
2619
2617