mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 04:22:27 +01:00
Merge mysql.com:/home/psergey/mysql-5.0-bugteam
into mysql.com:/home/psergey/mysql-5.1-bugteam BUG#36139: manual merge sql/item.cc: Auto merged mysql-test/r/subselect.result: BUG#36139: Manual merge mysql-test/t/subselect.test: BUG#36139: Manual merge
This commit is contained in:
commit
6b4179ec5b
3 changed files with 27 additions and 3 deletions
|
@ -4339,6 +4339,13 @@ a4 f3 a6
|
|||
1 NULL NULL
|
||||
2 NULL NULL
|
||||
DROP TABLE t1, t2, t3, t4;
|
||||
create table t1 (a float(5,4) zerofill);
|
||||
create table t2 (a float(5,4),b float(2,0));
|
||||
select t1.a from t1 where
|
||||
t1.a= (select b from t2 limit 1) and not
|
||||
t1.a= (select a from t2 limit 1) ;
|
||||
a
|
||||
drop table t1;
|
||||
End of 5.0 tests.
|
||||
CREATE TABLE t1 (a int, b int);
|
||||
INSERT INTO t1 VALUES (2,22),(1,11),(2,22);
|
||||
|
|
|
@ -3213,6 +3213,18 @@ GROUP BY a4;
|
|||
|
||||
DROP TABLE t1, t2, t3, t4;
|
||||
|
||||
#
|
||||
# BUG#36139 "float, zerofill, crash with subquery"
|
||||
#
|
||||
create table t1 (a float(5,4) zerofill);
|
||||
create table t2 (a float(5,4),b float(2,0));
|
||||
|
||||
select t1.a from t1 where
|
||||
t1.a= (select b from t2 limit 1) and not
|
||||
t1.a= (select a from t2 limit 1) ;
|
||||
|
||||
drop table t1;
|
||||
|
||||
--echo End of 5.0 tests.
|
||||
|
||||
#
|
||||
|
|
11
sql/item.cc
11
sql/item.cc
|
@ -4245,9 +4245,14 @@ static void convert_zerofill_number_to_string(Item **item, Field_num *field)
|
|||
String tmp(buff,sizeof(buff), field->charset()), *res;
|
||||
|
||||
res= (*item)->val_str(&tmp);
|
||||
field->prepend_zeros(res);
|
||||
pos= (char *) sql_strmake (res->ptr(), res->length());
|
||||
*item= new Item_string(pos, res->length(), field->charset());
|
||||
if ((*item)->is_null())
|
||||
*item= new Item_null();
|
||||
else
|
||||
{
|
||||
field->prepend_zeros(res);
|
||||
pos= (char *) sql_strmake (res->ptr(), res->length());
|
||||
*item= new Item_string(pos, res->length(), field->charset());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue