summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatg@krsna.patg.net <>2005-10-31 17:17:16 -0800
committerpatg@krsna.patg.net <>2005-10-31 17:17:16 -0800
commit7b611b33f287941e80a7a8d17b59c2a32ae056a2 (patch)
treeb2722d0704885b69ff36e4b942cfcc49bf53d4cb
parent1137a376a7262134672364cc3c73029864d9b1f7 (diff)
downloadmariadb-git-7b611b33f287941e80a7a8d17b59c2a32ae056a2.tar.gz
BUG #14532
Added FIELD_TYPE_BIT to field method 'needs_quotes' to make BIT columns work.
-rw-r--r--mysql-test/r/federated.result53
-rw-r--r--mysql-test/t/federated.test34
-rw-r--r--sql/field.cc1
3 files changed, 88 insertions, 0 deletions
diff --git a/mysql-test/r/federated.result b/mysql-test/r/federated.result
index 7e18cb9f75f..a633b2b2451 100644
--- a/mysql-test/r/federated.result
+++ b/mysql-test/r/federated.result
@@ -1490,6 +1490,59 @@ id name
DROP TABLE federated.alter_me;
DROP TABLE federated.normal_table;
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 TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
diff --git a/mysql-test/t/federated.test b/mysql-test/t/federated.test
index 9880cd78653..82635f617af 100644
--- a/mysql-test/t/federated.test
+++ b/mysql-test/t/federated.test
@@ -1188,5 +1188,39 @@ connection slave;
DROP TABLE federated.normal_table;
# 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;
diff --git a/sql/field.cc b/sql/field.cc
index 4a73d8e7981..03d20b4bfe2 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -1628,6 +1628,7 @@ bool Field::needs_quotes(void)
case FIELD_TYPE_MEDIUM_BLOB :
case FIELD_TYPE_LONG_BLOB :
case FIELD_TYPE_GEOMETRY :
+ case FIELD_TYPE_BIT:
DBUG_RETURN(1);
case FIELD_TYPE_DECIMAL :