MDEV-6052 Inconsistent results with bit type
Remove the "don't update the row for b'' and store uninitialized bytes on disk" change. Update test cases to allow DEFAULT b'', because b'' is a valid expression elsewhere.
This commit is contained in:
parent
321f589c81
commit
cf4814b397
@ -722,7 +722,12 @@ DROP TABLE t1;
|
|||||||
CREATE TABLE IF NOT EXISTS t1 (
|
CREATE TABLE IF NOT EXISTS t1 (
|
||||||
f1 bit(2) NOT NULL default b''
|
f1 bit(2) NOT NULL default b''
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
|
||||||
ERROR 42000: Invalid default value for 'f1'
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`f1` bit(2) NOT NULL DEFAULT b'0'
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci
|
||||||
|
DROP TABLE t1;
|
||||||
create table t1bit7 (a1 bit(7) not null) engine=MyISAM;
|
create table t1bit7 (a1 bit(7) not null) engine=MyISAM;
|
||||||
create table t2bit7 (b1 bit(7)) engine=MyISAM;
|
create table t2bit7 (b1 bit(7)) engine=MyISAM;
|
||||||
insert into t1bit7 values (b'1100000');
|
insert into t1bit7 values (b'1100000');
|
||||||
|
@ -413,3 +413,12 @@ a
|
|||||||
`
|
`
|
||||||
drop table t1;
|
drop table t1;
|
||||||
End of 5.0 tests
|
End of 5.0 tests
|
||||||
|
create table t1(f1 bit(2) not null default b'10',f2 bit(14) not null default b'11110000111100');
|
||||||
|
insert into t1 (f1) values (default);
|
||||||
|
insert into t1 values (b'',b''),('','');
|
||||||
|
select hex(f1), hex(f2) from t1;
|
||||||
|
hex(f1) hex(f2)
|
||||||
|
2 3C3C
|
||||||
|
0 0
|
||||||
|
0 0
|
||||||
|
drop table t1;
|
||||||
|
@ -362,11 +362,11 @@ f2 bit(14) NOT NULL default b'11110000111100'
|
|||||||
SHOW CREATE TABLE t1;
|
SHOW CREATE TABLE t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
--error ER_INVALID_DEFAULT
|
|
||||||
CREATE TABLE IF NOT EXISTS t1 (
|
CREATE TABLE IF NOT EXISTS t1 (
|
||||||
f1 bit(2) NOT NULL default b''
|
f1 bit(2) NOT NULL default b''
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
#
|
#
|
||||||
# Bug#31399 Wrong query result when doing join buffering over BIT fields
|
# Bug#31399 Wrong query result when doing join buffering over BIT fields
|
||||||
|
@ -148,3 +148,12 @@ select * from t1;
|
|||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
--echo End of 5.0 tests
|
--echo End of 5.0 tests
|
||||||
|
|
||||||
|
#
|
||||||
|
# MDEV-6052 Inconsistent results with bit type
|
||||||
|
#
|
||||||
|
create table t1(f1 bit(2) not null default b'10',f2 bit(14) not null default b'11110000111100');
|
||||||
|
insert into t1 (f1) values (default);
|
||||||
|
insert into t1 values (b'',b''),('','');
|
||||||
|
select hex(f1), hex(f2) from t1;
|
||||||
|
drop table t1;
|
||||||
|
@ -6389,8 +6389,6 @@ int Item_hex_hybrid::save_in_field(Field *field, bool no_conversions)
|
|||||||
|
|
||||||
ulonglong nr;
|
ulonglong nr;
|
||||||
uint32 length= str_value.length();
|
uint32 length= str_value.length();
|
||||||
if (!length)
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
if (length > 8)
|
if (length > 8)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user