mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
A fix (bug #10179: error in default value setting).
include/my_handler.h: A fix (bug #10179: error in default value setting). Proper masks added: we should not touch extra bits. sql/key.cc: A fix (bug #10179: error in default value setting). Unnecessary code removed. sql/unireg.cc: A fix (bug #10179: error in default value setting). 1. we should take into account uneven bits (for bit fields) stored among NULL bits. 2. changed code which sets NULL bits for fields. 3. changed code which sets unused bits after NULL bits. 4. unused variables removed. BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
This commit is contained in:
@ -437,3 +437,24 @@ a+0 b+0
|
||||
2303 2
|
||||
12345 4
|
||||
drop table t1, t2;
|
||||
create table t1 (a int, b time, c tinyint, d bool, e char(10), f bit(1),
|
||||
g bit(1) NOT NULL default 1, h char(1) default 'a');
|
||||
insert into t1 set a=1;
|
||||
select hex(g), h from t1;
|
||||
hex(g) h
|
||||
1 a
|
||||
drop table t1;
|
||||
create table t1 (a int, b time, c tinyint, d bool, e char(10), f bit(1),
|
||||
g bit(1) NOT NULL default 1);
|
||||
insert into t1 set a=1;
|
||||
select hex(g) from t1;
|
||||
hex(g)
|
||||
1
|
||||
drop table t1;
|
||||
create table t1 (a int, b time, c tinyint, d bool, e char(10), f bit(1),
|
||||
h char(1) default 'a') engine=myisam;
|
||||
insert into t1 set a=1;
|
||||
select h from t1;
|
||||
h
|
||||
a
|
||||
drop table t1;
|
||||
|
@ -140,3 +140,25 @@ drop table t1;
|
||||
create table t1 select * from t2;
|
||||
select a+0, b+0 from t1;
|
||||
drop table t1, t2;
|
||||
|
||||
#
|
||||
# Bug #10179: problem with NULLs and default values
|
||||
#
|
||||
|
||||
create table t1 (a int, b time, c tinyint, d bool, e char(10), f bit(1),
|
||||
g bit(1) NOT NULL default 1, h char(1) default 'a');
|
||||
insert into t1 set a=1;
|
||||
select hex(g), h from t1;
|
||||
drop table t1;
|
||||
|
||||
create table t1 (a int, b time, c tinyint, d bool, e char(10), f bit(1),
|
||||
g bit(1) NOT NULL default 1);
|
||||
insert into t1 set a=1;
|
||||
select hex(g) from t1;
|
||||
drop table t1;
|
||||
|
||||
create table t1 (a int, b time, c tinyint, d bool, e char(10), f bit(1),
|
||||
h char(1) default 'a') engine=myisam;
|
||||
insert into t1 set a=1;
|
||||
select h from t1;
|
||||
drop table t1;
|
||||
|
Reference in New Issue
Block a user