~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_load.cc

Merge with trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
#include <drizzled/data_home.h>
23
23
#include <drizzled/session.h>
24
24
#include <drizzled/sql_base.h>
25
 
#include <drizzled/field/timestamp.h>
 
25
#include <drizzled/field/epoch.h>
26
26
#include "drizzled/internal/my_sys.h"
27
27
#include "drizzled/internal/iocache.h"
28
28
#include <drizzled/db.h>
484
484
        push_warning_printf(session, DRIZZLE_ERROR::WARN_LEVEL_WARN,
485
485
                            ER_WARN_TOO_FEW_RECORDS,
486
486
                            ER(ER_WARN_TOO_FEW_RECORDS), session->row_count);
 
487
 
487
488
        if (!field->maybe_null() && field->type() == DRIZZLE_TYPE_TIMESTAMP)
488
 
            ((Field_timestamp*) field)->set_time();
 
489
            ((field::Epoch::pointer) field)->set_time();
489
490
      }
490
491
      else
491
492
      {
604
605
          if (!field->maybe_null())
605
606
          {
606
607
            if (field->type() == DRIZZLE_TYPE_TIMESTAMP)
607
 
              ((Field_timestamp*) field)->set_time();
 
608
            {
 
609
              ((field::Epoch::pointer) field)->set_time();
 
610
            }
608
611
            else if (field != table->next_number_field)
609
 
              field->set_warning(DRIZZLE_ERROR::WARN_LEVEL_WARN,
610
 
                                 ER_WARN_NULL_TO_NOTNULL, 1);
 
612
            {
 
613
              field->set_warning(DRIZZLE_ERROR::WARN_LEVEL_WARN, ER_WARN_NULL_TO_NOTNULL, 1);
 
614
            }
611
615
          }
612
616
        }
613
617
        else if (item->type() == Item::STRING_ITEM)
669
673
            return(1);
670
674
          }
671
675
          if (!field->maybe_null() && field->type() == DRIZZLE_TYPE_TIMESTAMP)
672
 
              ((Field_timestamp*) field)->set_time();
 
676
              ((field::Epoch::pointer) field)->set_time();
673
677
          /*
674
678
            QQ: We probably should not throw warning for each field.
675
679
            But how about intention to always have the same number