summaryrefslogtreecommitdiff
path: root/sql/sql_load.cc
diff options
context:
space:
mode:
authormsvensson@neptunus.(none) <>2005-09-23 14:37:22 +0200
committermsvensson@neptunus.(none) <>2005-09-23 14:37:22 +0200
commitd55eeed8fd85427c2431bd54dfc387b59629f50b (patch)
tree2eaeadd57a23c5370c6f6a873954cbf3dd210ccf /sql/sql_load.cc
parent02c7645cc10671954195c3d45271c819643dbddd (diff)
downloadmariadb-git-d55eeed8fd85427c2431bd54dfc387b59629f50b.tar.gz
Merge from 4.1 to 5.0
Diffstat (limited to 'sql/sql_load.cc')
-rw-r--r--sql/sql_load.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index 269c19b36d0..30398375360 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -677,8 +677,6 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
pos=read_info.row_start;
length=(uint) (read_info.row_end-pos);
- if (field == table->next_number_field)
- table->auto_increment_field_not_null= TRUE;
if (!read_info.enclosed &&
(enclosed_length && length == 4 && !memcmp(pos,"NULL",4)) ||
(length == 1 && read_info.found_null))
@@ -688,6 +686,8 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
Field *field= ((Item_field *)item)->field;
field->reset();
field->set_null();
+ if (field == table->next_number_field)
+ table->auto_increment_field_not_null= TRUE;
if (!field->maybe_null())
{
if (field->type() == FIELD_TYPE_TIMESTAMP)
@@ -705,9 +705,12 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
if (item->type() == Item::FIELD_ITEM)
{
+
Field *field= ((Item_field *)item)->field;
field->set_notnull();
read_info.row_end[0]=0; // Safe to change end marker
+ if (field == table->next_number_field)
+ table->auto_increment_field_not_null= TRUE;
field->store((char*) pos, length, read_info.read_charset);
}
else