List:Commits« Previous MessageNext Message »
From:igor Date:May 17 2006 8:46pm
Subject:bk commit into 5.1 tree (igor:1.2157)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of igor. When igor does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2157 06/05/17 11:46:21 igor@stripped +3 -0
  Merge rurik.mysql.com:/home/igor/tmp_merge
  into  rurik.mysql.com:/home/igor/dev/mysql-5.1-0

  sql/item_timefunc.cc
    1.118 06/05/17 11:46:14 igor@stripped +0 -0
    Auto merged

  mysql-test/t/view.test
    1.146 06/05/17 11:46:13 igor@stripped +0 -0
    Auto merged

  mysql-test/r/view.result
    1.160 06/05/17 11:46:13 igor@stripped +0 -0
    Auto merged

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	igor
# Host:	rurik.mysql.com
# Root:	/home/igor/dev/mysql-5.1-0/RESYNC

--- 1.117/sql/item_timefunc.cc	2006-05-15 18:32:17 -07:00
+++ 1.118/sql/item_timefunc.cc	2006-05-17 11:46:14 -07:00
@@ -2024,8 +2024,13 @@
   Item_date_add_interval *other= (Item_date_add_interval*) item;
 
   if ((int_type != other->int_type) ||
-      (!args[0]->eq(other->args[0], binary_cmp)) ||
-      (get_interval_value(args[1], int_type, &val, &interval)))
+      (!args[0]->eq(other->args[0], binary_cmp)))
+    return FALSE;
+
+  if (!args[1]->const_item() || !other->args[1]->const_item())
+    return (args[1]->eq(other->args[1], binary_cmp)); 
+
+  if (get_interval_value(args[1], int_type, &val, &interval))
     return FALSE;
 
   val= other->value;

--- 1.159/mysql-test/r/view.result	2006-05-17 03:29:12 -07:00
+++ 1.160/mysql-test/r/view.result	2006-05-17 11:46:13 -07:00
@@ -2649,3 +2649,14 @@
 2006-01-01 03:00:00
 drop view v1, v2;
 drop table t1;
+CREATE TABLE t1 (id int NOT NULL PRIMARY KEY, d datetime);
+CREATE VIEW v1 AS
+SELECT id, date(d) + INTERVAL TIME_TO_SEC(d) SECOND AS t, COUNT(*)
+FROM t1 GROUP BY id, t;
+SHOW CREATE VIEW v1;
+View	Create View
+v1	CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1`
AS select `t1`.`id` AS `id`,(cast(`t1`.`d` as date) + interval time_to_sec(`t1`.`d`)
second) AS `t`,count(0) AS `COUNT(*)` from `t1` group by `t1`.`id`,(cast(`t1`.`d` as
date) + interval time_to_sec(`t1`.`d`) second)
+SELECT * FROM v1;
+id	t	COUNT(*)
+DROP VIEW v1;
+DROP TABLE t1;

--- 1.145/mysql-test/t/view.test	2006-04-25 07:09:27 -07:00
+++ 1.146/mysql-test/t/view.test	2006-05-17 11:46:13 -07:00
@@ -2517,3 +2517,19 @@
 select * from v2;
 drop view v1, v2;
 drop table t1;
+
+#
+# Bug #19490: usage of view specified by a query with GROUP BY
+#             an expression containing non-constant interval
+
+CREATE TABLE t1 (id int NOT NULL PRIMARY KEY, d datetime);
+
+CREATE VIEW v1 AS
+SELECT id, date(d) + INTERVAL TIME_TO_SEC(d) SECOND AS t, COUNT(*)
+  FROM t1 GROUP BY id, t;
+
+SHOW CREATE VIEW v1;
+SELECT * FROM v1;
+
+DROP VIEW v1;
+DROP TABLE t1;
Thread
bk commit into 5.1 tree (igor:1.2157)igor17 May