List:Commits« Previous MessageNext Message »
From:Alexander Barkov Date:November 18 2011 10:45am
Subject:bzr push into mysql-trunk branch (alexander.barkov:3566 to 3567)
Bug#13354387 Bug#13399082
View as plain text  
 3567 Alexander Barkov	2011-11-18
      The fix for Bug#13399082 also fixes the Bug#13354387
      Adding test case for Bug#13354387.

    modified:
      mysql-test/r/type_temporal_fractional.result
      mysql-test/t/type_temporal_fractional.test
 3566 Alexander Barkov	2011-11-18
      WL#946: Bug#13399082 ABARKOV ASSERTION `MON > 0 && MON < 13' FAILED IN TZTIME.CC:794 | SEC_SINCE_EPOCH

    modified:
      mysql-test/r/timezone2.result
      mysql-test/r/type_temporal_fractional.result
      mysql-test/t/timezone2.test
      mysql-test/t/type_temporal_fractional.test
      sql/field.cc
      sql/field.h
      sql/item.cc
      sql/item.h
      sql/item_timefunc.cc
      sql/sql_time.cc
      sql/sql_time.h
=== modified file 'mysql-test/r/type_temporal_fractional.result'
--- a/mysql-test/r/type_temporal_fractional.result	2011-11-18 09:52:00 +0000
+++ b/mysql-test/r/type_temporal_fractional.result	2011-11-18 10:44:11 +0000
@@ -16756,3 +16756,39 @@ UNIX_TIMESTAMP(TIMESTAMP('0000-00-00 10:
 SELECT UNIX_TIMESTAMP(TIMESTAMP('0000-00-00 00:00:00.1'));
 UNIX_TIMESTAMP(TIMESTAMP('0000-00-00 00:00:00.1'))
 0.0
+#
+# Bug#13354387 - CRASH IN IN MY_DECIMAL::OPERATOR FOR VIEW AND FUNCTION UNIX_TIMESTAMP
+#
+SET timestamp=UNIX_TIMESTAMP('2011-11-18 14:36:00');
+CREATE TABLE t1 (
+pk time(2) NOT NULL DEFAULT '00:00:00.00',  
+col_timestamp_3_not_null timestamp(3) NULL DEFAULT '0000-00-00 00:00:00.000',
+col_datetime_1_key datetime(1) DEFAULT NULL,
+col_datetime_6_not_null_key datetime(6) NOT NULL,
+col_datetime_2_not_null datetime(2) NOT NULL,
+PRIMARY KEY (pk),
+KEY col_datetime_1_key (col_datetime_1_key),
+KEY col_datetime_6_not_null_key (col_datetime_6_not_null_key))
+ENGINE=MyISAM DEFAULT CHARSET=latin1;
+INSERT INTO t1 VALUES ('19:14:35.36','0000-00-00 00:00:00.000','0000-00-00 00:00:00.0','2000-08-28 07:34:20.051690','2009-09-20 07:32:39.06');
+INSERT INTO t1 VALUES ('19:14:37.36','2005-07-04 08:03:50.051','0000-00-00 00:00:00.0','0000-00-00 00:00:00.000000','0000-00-00 00:00:00.00');
+INSERT INTO t1 VALUES ('19:14:39.36','0000-00-00 00:00:00.000',NULL,'2005-10-11 07:24:45.059064','2009-11-19 00:00:00.00');
+INSERT INTO t1 VALUES ('19:14:41.36','2005-11-22 21:00:00.000',NULL,'0000-00-00 00:00:00.000000','0000-00-00 00:00:00.00');
+INSERT INTO t1 VALUES ('19:14:43.36','2009-11-06 21:00:00.000','2007-07-03 11:13:08.0','2002-09-02 00:17:37.037583','2003-09-25 09:29:41.00');
+INSERT INTO t1 VALUES ('19:14:36.36','2009-08-15 05:43:18.029','2009-01-18 00:00:00.0','0000-00-00 00:00:00.000000','2007-07-20 08:31:37.02');
+INSERT INTO t1 VALUES ('19:14:38.36','0000-00-00 00:00:00.000','0000-00-00 00:00:00.0','0000-00-00 00:00:00.000000','2004-08-16 05:11:47.04');
+INSERT INTO t1 VALUES ('19:14:40.36','2000-04-16 21:00:00.000',NULL,'2004-04-27 00:00:00.000000','2009-06-03 00:18:49.04');
+INSERT INTO t1 VALUES ('19:14:42.36','2009-01-18 20:46:41.035','2003-03-23 11:37:04.0','0000-00-00 00:00:00.000000','2009-12-26 00:00:00.00');
+INSERT INTO t1 VALUES ('19:14:44.36','0000-00-00 00:00:00.000','0000-00-00 00:00:00.0','2005-09-14 15:13:53.062460','0000-00-00 00:00:00.00');
+CREATE OR REPLACE VIEW v1 AS SELECT * FROM t1;
+SELECT UNIX_TIMESTAMP(col_datetime_2_not_null) AS c1
+FROM  v1
+WHERE col_datetime_6_not_null_key > col_datetime_1_key
+AND col_timestamp_3_not_null IS NOT NULL
+ORDER BY 1;
+c1
+0.00
+1253421159.06
+DROP VIEW v1;
+DROP TABLE t1;
+SET timestamp=DEFAULT;

=== modified file 'mysql-test/t/type_temporal_fractional.test'
--- a/mysql-test/t/type_temporal_fractional.test	2011-11-18 09:52:00 +0000
+++ b/mysql-test/t/type_temporal_fractional.test	2011-11-18 10:44:11 +0000
@@ -7296,6 +7296,42 @@ SELECT UNIX_TIMESTAMP(TIMESTAMP'0000-00-
 SELECT UNIX_TIMESTAMP(TIMESTAMP('0000-00-00 10:10:20'));
 SELECT UNIX_TIMESTAMP(TIMESTAMP('0000-00-00 00:00:00.1'));
 
+
+--echo #
+--echo # Bug#13354387 - CRASH IN IN MY_DECIMAL::OPERATOR FOR VIEW AND FUNCTION UNIX_TIMESTAMP
+--echo #
+SET timestamp=UNIX_TIMESTAMP('2011-11-18 14:36:00');
+CREATE TABLE t1 (
+  pk time(2) NOT NULL DEFAULT '00:00:00.00',  
+  col_timestamp_3_not_null timestamp(3) NULL DEFAULT '0000-00-00 00:00:00.000',
+  col_datetime_1_key datetime(1) DEFAULT NULL,
+  col_datetime_6_not_null_key datetime(6) NOT NULL,
+  col_datetime_2_not_null datetime(2) NOT NULL,
+  PRIMARY KEY (pk),
+  KEY col_datetime_1_key (col_datetime_1_key),
+  KEY col_datetime_6_not_null_key (col_datetime_6_not_null_key))
+ENGINE=MyISAM DEFAULT CHARSET=latin1;
+INSERT INTO t1 VALUES ('19:14:35.36','0000-00-00 00:00:00.000','0000-00-00 00:00:00.0','2000-08-28 07:34:20.051690','2009-09-20 07:32:39.06');
+INSERT INTO t1 VALUES ('19:14:37.36','2005-07-04 08:03:50.051','0000-00-00 00:00:00.0','0000-00-00 00:00:00.000000','0000-00-00 00:00:00.00');
+INSERT INTO t1 VALUES ('19:14:39.36','0000-00-00 00:00:00.000',NULL,'2005-10-11 07:24:45.059064','2009-11-19 00:00:00.00');
+INSERT INTO t1 VALUES ('19:14:41.36','2005-11-22 21:00:00.000',NULL,'0000-00-00 00:00:00.000000','0000-00-00 00:00:00.00');
+INSERT INTO t1 VALUES ('19:14:43.36','2009-11-06 21:00:00.000','2007-07-03 11:13:08.0','2002-09-02 00:17:37.037583','2003-09-25 09:29:41.00');
+INSERT INTO t1 VALUES ('19:14:36.36','2009-08-15 05:43:18.029','2009-01-18 00:00:00.0','0000-00-00 00:00:00.000000','2007-07-20 08:31:37.02');
+INSERT INTO t1 VALUES ('19:14:38.36','0000-00-00 00:00:00.000','0000-00-00 00:00:00.0','0000-00-00 00:00:00.000000','2004-08-16 05:11:47.04');
+INSERT INTO t1 VALUES ('19:14:40.36','2000-04-16 21:00:00.000',NULL,'2004-04-27 00:00:00.000000','2009-06-03 00:18:49.04');
+INSERT INTO t1 VALUES ('19:14:42.36','2009-01-18 20:46:41.035','2003-03-23 11:37:04.0','0000-00-00 00:00:00.000000','2009-12-26 00:00:00.00');
+INSERT INTO t1 VALUES ('19:14:44.36','0000-00-00 00:00:00.000','0000-00-00 00:00:00.0','2005-09-14 15:13:53.062460','0000-00-00 00:00:00.00');
+CREATE OR REPLACE VIEW v1 AS SELECT * FROM t1;
+SELECT UNIX_TIMESTAMP(col_datetime_2_not_null) AS c1
+FROM  v1
+WHERE col_datetime_6_not_null_key > col_datetime_1_key
+AND col_timestamp_3_not_null IS NOT NULL
+ORDER BY 1;
+DROP VIEW v1;
+DROP TABLE t1;
+SET timestamp=DEFAULT;
+
+
 ## TS-TODO: SELECT CAST('00:00:00' AS DATETIME) -> should it use curdate?
 
 ## TS-TODO: reuse count_datetime_length()/count_string_result_length()

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (alexander.barkov:3566 to 3567)Bug#13354387 Bug#13399082Alexander Barkov21 Nov