~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_load.cc

Merged build changes from Antony.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
/* 2006-12 Erik Wetterberg : LOAD XML added */
19
19
 
20
20
#include "mysql_priv.h"
21
 
#include <my_dir.h>
22
 
#include <m_ctype.h>
23
21
#include "sql_repl.h"
24
22
 
25
23
class XML_TAG {
328
326
  }
329
327
 
330
328
  COPY_INFO info;
331
 
  bzero((char*) &info,sizeof(info));
 
329
  memset((char*) &info, 0, sizeof(info));
332
330
  info.ignore= ignore;
333
331
  info.handle_duplicates=handle_duplicates;
334
332
  info.escape_char=escaped->length() ? (*escaped)[0] : INT_MAX;
595
593
        push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 
596
594
                            ER_WARN_TOO_FEW_RECORDS, 
597
595
                            ER(ER_WARN_TOO_FEW_RECORDS), thd->row_count);
598
 
        if (!field->maybe_null() && field->type() == FIELD_TYPE_TIMESTAMP)
 
596
        if (!field->maybe_null() && field->type() == DRIZZLE_TYPE_TIMESTAMP)
599
597
            ((Field_timestamp*) field)->set_time();
600
598
      }
601
599
      else
711
709
          field->set_null();
712
710
          if (!field->maybe_null())
713
711
          {
714
 
            if (field->type() == MYSQL_TYPE_TIMESTAMP)
 
712
            if (field->type() == DRIZZLE_TYPE_TIMESTAMP)
715
713
              ((Field_timestamp*) field)->set_time();
716
714
            else if (field != table->next_number_field)
717
715
              field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
776
774
                     thd->row_count);
777
775
            return(1);
778
776
          }
779
 
          if (!field->maybe_null() && field->type() == FIELD_TYPE_TIMESTAMP)
 
777
          if (!field->maybe_null() && field->type() == DRIZZLE_TYPE_TIMESTAMP)
780
778
              ((Field_timestamp*) field)->set_time();
781
779
          /*
782
780
            QQ: We probably should not throw warning for each field.
839
837
read_xml_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
840
838
               List<Item> &fields_vars, List<Item> &set_fields,
841
839
               List<Item> &set_values, READ_INFO &read_info,
842
 
               String &row_tag __attribute__((__unused__)),
 
840
               String &row_tag __attribute__((unused)),
843
841
               ulong skip_lines,
844
842
               bool ignore_check_option_errors)
845
843
{
894
892
            table->auto_increment_field_not_null= true;
895
893
          if (!field->maybe_null())
896
894
          {
897
 
            if (field->type() == FIELD_TYPE_TIMESTAMP)
 
895
            if (field->type() == DRIZZLE_TYPE_TIMESTAMP)
898
896
              ((Field_timestamp *) field)->set_time();
899
897
            else if (field != table->next_number_field)
900
898
              field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN,