Commit 83c5552b authored by Gleb Shchepa's avatar Gleb Shchepa

manual merge 5.1-bugteam --> 5.5-merge (bug 55779)

parents 68c14bca 79c1faa0
...@@ -503,6 +503,27 @@ f1 f2-f3 ...@@ -503,6 +503,27 @@ f1 f2-f3
5 0 5 0
DROP TABLE t1; DROP TABLE t1;
End of 5.0 tests End of 5.0 tests
#
# Bug #55779: select does not work properly in mysql server
# Version "5.1.42 SUSE MySQL RPM"
#
CREATE TABLE t1 (a TIMESTAMP, KEY (a));
INSERT INTO t1 VALUES ('2000-01-01 00:00:00'), ('2000-01-01 00:00:00'),
('2000-01-01 00:00:01'), ('2000-01-01 00:00:01');
SELECT a FROM t1 WHERE a >= 20000101000000;
a
2000-01-01 00:00:00
2000-01-01 00:00:00
2000-01-01 00:00:01
2000-01-01 00:00:01
SELECT a FROM t1 WHERE a >= '20000101000000';
a
2000-01-01 00:00:00
2000-01-01 00:00:00
2000-01-01 00:00:01
2000-01-01 00:00:01
DROP TABLE t1;
End of 5.1 tests
Bug#50888 valgrind warnings in Field_timestamp::val_str Bug#50888 valgrind warnings in Field_timestamp::val_str
......
...@@ -347,6 +347,23 @@ DROP TABLE t1; ...@@ -347,6 +347,23 @@ DROP TABLE t1;
--echo End of 5.0 tests --echo End of 5.0 tests
--echo #
--echo # Bug #55779: select does not work properly in mysql server
--echo # Version "5.1.42 SUSE MySQL RPM"
--echo #
CREATE TABLE t1 (a TIMESTAMP, KEY (a));
INSERT INTO t1 VALUES ('2000-01-01 00:00:00'), ('2000-01-01 00:00:00'),
('2000-01-01 00:00:01'), ('2000-01-01 00:00:01');
SELECT a FROM t1 WHERE a >= 20000101000000;
SELECT a FROM t1 WHERE a >= '20000101000000';
DROP TABLE t1;
--echo End of 5.1 tests
--echo --echo
--echo Bug#50888 valgrind warnings in Field_timestamp::val_str --echo Bug#50888 valgrind warnings in Field_timestamp::val_str
--echo --echo
......
...@@ -7287,14 +7287,16 @@ int stored_field_cmp_to_item(THD *thd, Field *field, Item *item) ...@@ -7287,14 +7287,16 @@ int stored_field_cmp_to_item(THD *thd, Field *field, Item *item)
enum_field_types field_type= field->type(); enum_field_types field_type= field->type();
if (field_type == MYSQL_TYPE_DATE || field_type == MYSQL_TYPE_DATETIME) if (field_type == MYSQL_TYPE_DATE || field_type == MYSQL_TYPE_DATETIME ||
field_type == MYSQL_TYPE_TIMESTAMP)
{ {
enum_mysql_timestamp_type type= MYSQL_TIMESTAMP_ERROR; enum_mysql_timestamp_type type= MYSQL_TIMESTAMP_ERROR;
if (field_type == MYSQL_TYPE_DATE) if (field_type == MYSQL_TYPE_DATE)
type= MYSQL_TIMESTAMP_DATE; type= MYSQL_TIMESTAMP_DATE;
if (field_type == MYSQL_TYPE_DATETIME) if (field_type == MYSQL_TYPE_DATETIME ||
field_type == MYSQL_TYPE_TIMESTAMP)
type= MYSQL_TIMESTAMP_DATETIME; type= MYSQL_TIMESTAMP_DATETIME;
const char *field_name= field->field_name; const char *field_name= field->field_name;
......
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