Commit 67c6d0f0 authored by unknown's avatar unknown

BUG #14532

Added FIELD_TYPE_BIT to field method 'needs_quotes' to make BIT columns
work.


mysql-test/r/federated.result:
  BUG# 14532
  
  Test fix by creating table with bit column and inserting,selecting
mysql-test/t/federated.test:
  BUG# 14532
  
  Test fix by creating table with bit column and inserting,selecting
sql/field.cc:
  BUG #14532
  
  Just needed to quote/escape bit field, add FIELD_TYPE_BIT to switch
parent 11632315
...@@ -1490,6 +1490,59 @@ id name ...@@ -1490,6 +1490,59 @@ id name
DROP TABLE federated.alter_me; DROP TABLE federated.alter_me;
DROP TABLE federated.normal_table; DROP TABLE federated.normal_table;
DROP TABLE IF EXISTS federated.t1; DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`bitty` bit(3)
) DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`bitty` bit(3)
) ENGINE="FEDERATED" DEFAULT CHARSET=latin1
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
INSERT INTO federated.t1 VALUES (b'001');
INSERT INTO federated.t1 VALUES (b'010');
INSERT INTO federated.t1 VALUES (b'011');
INSERT INTO federated.t1 VALUES (b'100');
INSERT INTO federated.t1 VALUES (b'101');
INSERT INTO federated.t1 VALUES (b'110');
INSERT INTO federated.t1 VALUES (b'111');
select * FROM federated.t1;
bitty







select * FROM federated.t1;
bitty







delete from federated.t1;
INSERT INTO federated.t1 VALUES (b'001');
INSERT INTO federated.t1 VALUES (b'010');
INSERT INTO federated.t1 VALUES (b'011');
INSERT INTO federated.t1 VALUES (b'100');
INSERT INTO federated.t1 VALUES (b'101');
INSERT INTO federated.t1 VALUES (b'110');
INSERT INTO federated.t1 VALUES (b'111');
select * FROM federated.t1;
bitty







drop table federated.t1;
drop table federated.t1;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated; DROP DATABASE IF EXISTS federated;
DROP TABLE IF EXISTS federated.t1; DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated; DROP DATABASE IF EXISTS federated;
...@@ -1188,5 +1188,39 @@ connection slave; ...@@ -1188,5 +1188,39 @@ connection slave;
DROP TABLE federated.normal_table; DROP TABLE federated.normal_table;
# END ALTER TEST # END ALTER TEST
#
# Test BUG #14532
#
--disable_warnings
DROP TABLE IF EXISTS federated.t1;
--enable_warnings
CREATE TABLE federated.t1 (
`bitty` bit(3)
) DEFAULT CHARSET=latin1;
connection master;
--disable_warnings
DROP TABLE IF EXISTS federated.t1;
--enable_warnings
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval CREATE TABLE federated.t1 (
`bitty` bit(3)
) ENGINE="FEDERATED" DEFAULT CHARSET=latin1
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1';
INSERT INTO federated.t1 VALUES (b'001');
INSERT INTO federated.t1 VALUES (b'010');
INSERT INTO federated.t1 VALUES (b'011');
INSERT INTO federated.t1 VALUES (b'100');
INSERT INTO federated.t1 VALUES (b'101');
INSERT INTO federated.t1 VALUES (b'110');
INSERT INTO federated.t1 VALUES (b'111');
select * FROM federated.t1;
drop table federated.t1;
connection slave;
drop table federated.t1;
source include/federated_cleanup.inc; source include/federated_cleanup.inc;
...@@ -1628,6 +1628,7 @@ bool Field::needs_quotes(void) ...@@ -1628,6 +1628,7 @@ bool Field::needs_quotes(void)
case FIELD_TYPE_MEDIUM_BLOB : case FIELD_TYPE_MEDIUM_BLOB :
case FIELD_TYPE_LONG_BLOB : case FIELD_TYPE_LONG_BLOB :
case FIELD_TYPE_GEOMETRY : case FIELD_TYPE_GEOMETRY :
case FIELD_TYPE_BIT:
DBUG_RETURN(1); DBUG_RETURN(1);
case FIELD_TYPE_DECIMAL : case FIELD_TYPE_DECIMAL :
......
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