mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 02:51:44 +01:00
BUG#31450: Query causes error 1048
- Let Item::save_in_field() call set_field_to_null_with_conversions() for decimal type, like this is done for the other item result types.
This commit is contained in:
parent
d0f53297f6
commit
28e5063d93
3 changed files with 31 additions and 1 deletions
|
@ -805,3 +805,14 @@ SELECT 1 % .12345678912345678912345678912345678912345678912345678912345678912345
|
|||
SELECT MOD(1, .123456789123456789123456789123456789123456789123456789123456789123456789123456789) AS 'MOD()';
|
||||
MOD()
|
||||
0.012345687012345687012345687012345687012345687012345687012345687012345687000000000
|
||||
create table t1 (
|
||||
ua_id decimal(22,0) not null,
|
||||
ua_invited_by_id decimal(22,0) default NULL,
|
||||
primary key(ua_id)
|
||||
);
|
||||
insert into t1 values (123, NULL), (456, NULL);
|
||||
this must not produce error 1048:
|
||||
select * from t1 where ua_invited_by_id not in (select ua_id from t1);
|
||||
ua_id ua_invited_by_id
|
||||
drop table t1;
|
||||
End of 5.0 tests
|
||||
|
|
|
@ -416,3 +416,22 @@ DROP TABLE t1;
|
|||
|
||||
SELECT 1 % .123456789123456789123456789123456789123456789123456789123456789123456789123456789 AS '%';
|
||||
SELECT MOD(1, .123456789123456789123456789123456789123456789123456789123456789123456789123456789) AS 'MOD()';
|
||||
|
||||
|
||||
#
|
||||
# BUG#31450 "Query causes error 1048"
|
||||
#
|
||||
create table t1 (
|
||||
ua_id decimal(22,0) not null,
|
||||
ua_invited_by_id decimal(22,0) default NULL,
|
||||
primary key(ua_id)
|
||||
);
|
||||
insert into t1 values (123, NULL), (456, NULL);
|
||||
|
||||
--echo this must not produce error 1048:
|
||||
select * from t1 where ua_invited_by_id not in (select ua_id from t1);
|
||||
|
||||
drop table t1;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
||||
|
|
|
@ -4548,7 +4548,7 @@ int Item::save_in_field(Field *field, bool no_conversions)
|
|||
my_decimal decimal_value;
|
||||
my_decimal *value= val_decimal(&decimal_value);
|
||||
if (null_value)
|
||||
return set_field_to_null(field);
|
||||
return set_field_to_null_with_conversions(field, no_conversions);
|
||||
field->set_notnull();
|
||||
error=field->store_decimal(value);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue