summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/r/loaddata.result1
-rw-r--r--mysql-test/r/type_decimal.result4
-rw-r--r--mysql-test/r/union.result15
-rw-r--r--mysql-test/t/loaddata.test1
-rw-r--r--sql/opt_sum.cc1
-rw-r--r--sql/sql_load.cc7
6 files changed, 11 insertions, 18 deletions
diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result
index e2cd89a58dc..f9d47e3533c 100644
--- a/mysql-test/r/loaddata.result
+++ b/mysql-test/r/loaddata.result
@@ -76,6 +76,7 @@ select * from t1;
id
0
SET @@SQL_MODE=@OLD_SQL_MODE;
+drop table t1;
create table t1 (a int default 100, b int, c varchar(60));
load data infile '../../std_data/rpl_loaddata.dat' into table t1 (a, @b) set b=@b+10, c=concat("b=",@b);
select * from t1;
diff --git a/mysql-test/r/type_decimal.result b/mysql-test/r/type_decimal.result
index 45334886823..56a2bceeccf 100644
--- a/mysql-test/r/type_decimal.result
+++ b/mysql-test/r/type_decimal.result
@@ -674,9 +674,11 @@ a
drop table t1;
create table t1(a decimal(10,5), b decimal(10,1));
insert into t1 values(123.12345, 123.12345);
+Warnings:
+Note 1265 Data truncated for column 'b' at row 1
update t1 set b=a;
Warnings:
-Warning 1265 Data truncated for column 'b' at row 1
+Note 1265 Data truncated for column 'b' at row 1
select * from t1;
a b
123.12345 123.1
diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result
index eb129e32983..042dfb5ad8d 100644
--- a/mysql-test/r/union.result
+++ b/mysql-test/r/union.result
@@ -780,21 +780,6 @@ t1 CREATE TABLE `t1` (
`b` longblob
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1,t2;
-create table t1 (d decimal(10,1));
-create table t2 (d decimal(10,9));
-insert into t1 values ("100000000.0");
-insert into t2 values ("1.23456780");
-create table t3 select * from t2 union select * from t1;
-select * from t3;
-d
-1.234567800
-100000000.000000000
-show create table t3;
-Table Create Table
-t3 CREATE TABLE `t3` (
- `d` decimal(18,9) default NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-drop table t1,t2,t3;
create table t1 select 1 union select -1;
select * from t1;
1
diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test
index 54309e45c7e..cd3a8f0fd92 100644
--- a/mysql-test/t/loaddata.test
+++ b/mysql-test/t/loaddata.test
@@ -57,6 +57,7 @@ enable_query_log;
select * from t1;
--exec rm $MYSQL_TEST_DIR/var/tmp/t1
SET @@SQL_MODE=@OLD_SQL_MODE;
+drop table t1;
# End of 4.1 tests
diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc
index d598b8e6402..2f54cce0275 100644
--- a/sql/opt_sum.cc
+++ b/sql/opt_sum.cc
@@ -167,6 +167,7 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
{
((Item_sum_count*) item)->make_const(count);
recalc_const_item= 1;
+ }
}
else
const_result= 0;
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