Commit 72a8049b authored by unknown's avatar unknown

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
parent 129300f1
...@@ -76,6 +76,7 @@ select * from t1; ...@@ -76,6 +76,7 @@ select * from t1;
id id
0 0
SET @@SQL_MODE=@OLD_SQL_MODE; SET @@SQL_MODE=@OLD_SQL_MODE;
drop table t1;
create table t1 (a int default 100, b int, c varchar(60)); 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); load data infile '../../std_data/rpl_loaddata.dat' into table t1 (a, @b) set b=@b+10, c=concat("b=",@b);
select * from t1; select * from t1;
......
...@@ -674,9 +674,11 @@ a ...@@ -674,9 +674,11 @@ a
drop table t1; drop table t1;
create table t1(a decimal(10,5), b decimal(10,1)); create table t1(a decimal(10,5), b decimal(10,1));
insert into t1 values(123.12345, 123.12345); insert into t1 values(123.12345, 123.12345);
Warnings:
Note 1265 Data truncated for column 'b' at row 1
update t1 set b=a; update t1 set b=a;
Warnings: Warnings:
Warning 1265 Data truncated for column 'b' at row 1 Note 1265 Data truncated for column 'b' at row 1
select * from t1; select * from t1;
a b a b
123.12345 123.1 123.12345 123.1
......
...@@ -780,21 +780,6 @@ t1 CREATE TABLE `t1` ( ...@@ -780,21 +780,6 @@ t1 CREATE TABLE `t1` (
`b` longblob `b` longblob
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1,t2; 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; create table t1 select 1 union select -1;
select * from t1; select * from t1;
1 1
......
...@@ -57,6 +57,7 @@ enable_query_log; ...@@ -57,6 +57,7 @@ enable_query_log;
select * from t1; select * from t1;
--exec rm $MYSQL_TEST_DIR/var/tmp/t1 --exec rm $MYSQL_TEST_DIR/var/tmp/t1
SET @@SQL_MODE=@OLD_SQL_MODE; SET @@SQL_MODE=@OLD_SQL_MODE;
drop table t1;
# End of 4.1 tests # End of 4.1 tests
......
...@@ -168,6 +168,7 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds) ...@@ -168,6 +168,7 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
((Item_sum_count*) item)->make_const(count); ((Item_sum_count*) item)->make_const(count);
recalc_const_item= 1; recalc_const_item= 1;
} }
}
else else
const_result= 0; const_result= 0;
break; break;
......
...@@ -677,8 +677,6 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list, ...@@ -677,8 +677,6 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
pos=read_info.row_start; pos=read_info.row_start;
length=(uint) (read_info.row_end-pos); length=(uint) (read_info.row_end-pos);
if (field == table->next_number_field)
table->auto_increment_field_not_null= TRUE;
if (!read_info.enclosed && if (!read_info.enclosed &&
(enclosed_length && length == 4 && !memcmp(pos,"NULL",4)) || (enclosed_length && length == 4 && !memcmp(pos,"NULL",4)) ||
(length == 1 && read_info.found_null)) (length == 1 && read_info.found_null))
...@@ -688,6 +686,8 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list, ...@@ -688,6 +686,8 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
Field *field= ((Item_field *)item)->field; Field *field= ((Item_field *)item)->field;
field->reset(); field->reset();
field->set_null(); field->set_null();
if (field == table->next_number_field)
table->auto_increment_field_not_null= TRUE;
if (!field->maybe_null()) if (!field->maybe_null())
{ {
if (field->type() == FIELD_TYPE_TIMESTAMP) if (field->type() == FIELD_TYPE_TIMESTAMP)
...@@ -705,9 +705,12 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list, ...@@ -705,9 +705,12 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
if (item->type() == Item::FIELD_ITEM) if (item->type() == Item::FIELD_ITEM)
{ {
Field *field= ((Item_field *)item)->field; Field *field= ((Item_field *)item)->field;
field->set_notnull(); field->set_notnull();
read_info.row_end[0]=0; // Safe to change end marker 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); field->store((char*) pos, length, read_info.read_charset);
} }
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment