List:Commits« Previous MessageNext Message »
From:Gleb Shchepa Date:September 13 2010 7:38am
Subject:bzr push into mysql-trunk-merge branch (gshchepa:3193 to 3194)
View as plain text  
 3194 Gleb Shchepa	2010-09-13 [merge]
      auto-merge mysql-5.5-merge --> mysql-trunk-merge

    modified:
      mysql-test/r/type_timestamp.result
      mysql-test/t/type_timestamp.test
      sql/item.cc
 3193 Bjorn Munch	2010-09-10 [merge]
      upmerge from 5.5-merge

    modified:
      include/mysql.h
      include/mysql.h.pp
      libmysql/libmysql.c
      mysql-test/r/gis.result
      mysql-test/r/multi_update.result
      mysql-test/r/row.result
      mysql-test/r/select.result
      mysql-test/r/subselect.result
      mysql-test/r/subselect4.result
      mysql-test/r/trigger_notembedded.result
      mysql-test/t/gis.test
      mysql-test/t/multi_update.test
      mysql-test/t/row.test
      mysql-test/t/select.test
      mysql-test/t/subselect4.test
      mysql-test/t/trigger_notembedded.test
      sql/item.cc
      sql/item_cmpfunc.cc
      sql/item_subselect.cc
      sql/spatial.cc
      sql/sql_trigger.cc
      tests/mysql_client_test.c
=== modified file 'mysql-test/r/type_timestamp.result'
--- a/mysql-test/r/type_timestamp.result	2010-03-20 09:35:40 +0000
+++ b/mysql-test/r/type_timestamp.result	2010-09-13 07:35:53 +0000
@@ -503,6 +503,27 @@ f1	f2-f3
 5	0
 DROP TABLE t1;
 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
 

=== modified file 'mysql-test/t/type_timestamp.test'
--- a/mysql-test/t/type_timestamp.test	2010-03-09 14:54:12 +0000
+++ b/mysql-test/t/type_timestamp.test	2010-09-13 07:30:10 +0000
@@ -347,6 +347,23 @@ DROP TABLE t1;
 
 --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 Bug#50888 valgrind warnings in Field_timestamp::val_str
 --echo

=== modified file 'sql/item.cc'
--- a/sql/item.cc	2010-09-10 08:06:58 +0000
+++ b/sql/item.cc	2010-09-13 07:35:53 +0000
@@ -7287,14 +7287,16 @@ int stored_field_cmp_to_item(THD *thd, F
 
     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;
 
       if (field_type == MYSQL_TYPE_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;
         
       const char *field_name= field->field_name;


Attachment: [text/bzr-bundle] bzr/gshchepa@mysql.com-20100913073553-jkz6rgykpe9ls2zf.bundle
Thread
bzr push into mysql-trunk-merge branch (gshchepa:3193 to 3194)Gleb Shchepa13 Sep