summaryrefslogtreecommitdiff
path: root/sql/sql_load.cc
diff options
context:
space:
mode:
authorunknown <msvensson@neptunus.(none)>2005-09-23 14:37:22 +0200
committerunknown <msvensson@neptunus.(none)>2005-09-23 14:37:22 +0200
commit72a8049b0dda6e06d893f3be64a2aced4c94eed4 (patch)
tree2eaeadd57a23c5370c6f6a873954cbf3dd210ccf /sql/sql_load.cc
parent129300f13dbc77d77c0f25aebcf70e209041c609 (diff)
downloadmariadb-git-72a8049b0dda6e06d893f3be64a2aced4c94eed4.tar.gz
Merge from 4.1 to 5.0
mysql-test/r/loaddata.result: Add drop tablea after test case mysql-test/r/type_decimal.result: Update warnings mysql-test/r/union.result: Miss in merge mysql-test/t/loaddata.test: Add drop table after test case sql/opt_sum.cc: Add missing } sql/sql_load.cc: Manual merge
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