diff options
author | unknown <serg@serg.mysql.com> | 2003-03-04 18:02:56 +0100 |
---|---|---|
committer | unknown <serg@serg.mysql.com> | 2003-03-04 18:02:56 +0100 |
commit | 8529b744b7dbddb0be58c7c2a62ab1131a35ccad (patch) | |
tree | ba1e6fb743205a17d02a54645937ce5834903ffa | |
parent | 5b15b39c8f28db89425386911b97ed0bd49b395c (diff) | |
download | mariadb-git-8529b744b7dbddb0be58c7c2a62ab1131a35ccad.tar.gz |
fixed Field::eq() to work with CHAR(0) fields
BitKeeper/etc/ignore:
Added configure.lineno innobase/configure.lineno to the ignore list
-rw-r--r-- | .bzrignore | 2 | ||||
-rw-r--r-- | mysql-test/r/delete.result | 4 | ||||
-rw-r--r-- | mysql-test/t/delete.test | 20 | ||||
-rw-r--r-- | sql/field.h | 2 |
4 files changed, 27 insertions, 1 deletions
diff --git a/.bzrignore b/.bzrignore index 5b35d1f6611..7929adbf881 100644 --- a/.bzrignore +++ b/.bzrignore @@ -333,3 +333,5 @@ innobase/autom4te.cache/requests innobase/autom4te.cache/traces.0 innobase/stamp-h1 stamp-h1 +configure.lineno +innobase/configure.lineno diff --git a/mysql-test/r/delete.result b/mysql-test/r/delete.result new file mode 100644 index 00000000000..169232b72d8 --- /dev/null +++ b/mysql-test/r/delete.result @@ -0,0 +1,4 @@ +bool not_null misc +NULL c 6 +NULL d 7 +bool not_null misc diff --git a/mysql-test/t/delete.test b/mysql-test/t/delete.test index 953e22cdd55..13fa617b3cf 100644 --- a/mysql-test/t/delete.test +++ b/mysql-test/t/delete.test @@ -35,3 +35,23 @@ create table t1 (a bigint not null, primary key (a,a,a,a,a,a,a,a,a,a)); insert into t1 values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23),(27); delete from t1 where a=27; drop table t1; + +# +# CHAR(0) bug - not actually DELETE bug, but anyway... +# + +CREATE TABLE t1 ( + bool char(0) default NULL, + not_null varchar(20) binary NOT NULL default '', + misc integer not null, + PRIMARY KEY (not_null) +) TYPE=MyISAM; + +INSERT INTO t1 VALUES (NULL,'a',4), (NULL,'b',5), (NULL,'c',6), (NULL,'d',7); + +select * from t1 where misc > 5 and bool is null; +delete from t1 where misc > 5 and bool is null; +select * from t1 where misc > 5 and bool is null; + +drop table t1; + diff --git a/sql/field.h b/sql/field.h index e822f6a71d6..fb3cf2178e2 100644 --- a/sql/field.h +++ b/sql/field.h @@ -64,7 +64,7 @@ public: virtual String *val_str(String*,String *)=0; virtual Item_result result_type () const=0; virtual Item_result cmp_type () const { return result_type(); } - bool eq(Field *field) { return ptr == field->ptr; } + bool eq(Field *field) { return ptr == field->ptr && null_ptr == field->null_ptr; } virtual bool eq_def(Field *field); virtual uint32 pack_length() const { return (uint32) field_length; } virtual void reset(void) { bzero(ptr,pack_length()); } |