List:Internals« Previous MessageNext Message »
From:eugene Date:November 3 2005 10:20am
Subject:bk commit into 5.0 tree (evgen:1.1962) BUG#13622
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of evgen. When evgen 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.1962 05/11/03 13:19:51 evgen@stripped +9 -0
  Fix bug #13622 Wrong view .frm created if some field's alias contain \n
  
  View .frm parser assumes that query string will take only 1 line, with \n in
  aliases query stringmay take several lines thus produces bad .frm file.
  
  Item::set_name() now changes all \n in alias to spaces.

  mysql-test/r/comments.result
    1.7 05/11/03 13:19:08 evgen@stripped +1 -2
    Fixed test case after bug #13622

  mysql-test/r/date_formats.result
    1.19 05/11/03 13:18:52 evgen@stripped +1 -2
    Fixed test case after bug #13622

  mysql-test/r/ps_3innodb.result
    1.42 05/11/03 13:18:30 evgen@stripped +3 -9
    Fixed test case after bug #13622

  mysql-test/r/ps_2myisam.result
    1.39 05/11/03 13:18:17 evgen@stripped +3 -9
     Fixed test case after bug #13622

  mysql-test/r/ps_4heap.result
    1.38 05/11/03 13:18:00 evgen@stripped +3 -9
    Fixed test case after bug #13622

  mysql-test/r/ps_5merge.result
    1.39 05/11/03 13:17:27 evgen@stripped +6 -18
    Fixed test case after bug #13622

  mysql-test/t/view.test
    1.118 05/11/03 13:17:08 evgen@stripped +9 -0
    Test case for bug #13622 Wrong view .frm created if some field's alias contain \n

  mysql-test/r/view.result
    1.127 05/11/03 13:16:37 evgen@stripped +7 -0
    Test case for bug #13622 Wrong view .frm created if some field's alias contain \n

  sql/item.cc
    1.196 05/11/03 13:15:22 evgen@stripped +10 -0
    Fix bug #13622 Wrong view .frm created if some field's alias contain \n
    Item::set_name() now changes all \n in alias to spaces.

# 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:	evgen
# Host:	moonbone.local
# Root:	/work/13622-bug-5.0-mysql

--- 1.195/sql/item.cc	2005-10-28 11:12:30 +04:00
+++ 1.196/sql/item.cc	2005-11-03 13:15:22 +03:00
@@ -578,6 +578,16 @@
   }
   else
     name= sql_strmake(str, (name_length= min(length,MAX_ALIAS_NAME)));
+  /* Change all \n and \r to spaces in alias */
+  {
+    char *end= name + length;
+    while (end >= name)
+    {
+      if (*end == '\n' || *end == '\r')
+        *end= ' ';
+      end--;
+    }
+  }
 }
 
 

--- 1.126/mysql-test/r/view.result	2005-10-28 16:50:29 +04:00
+++ 1.127/mysql-test/r/view.result	2005-11-03 13:16:37 +03:00
@@ -2323,3 +2323,10 @@
 1	PRIMARY	t3	ALL	NULL	NULL	NULL	NULL	3	Using where
 DROP VIEW v1,v2;
 DROP TABLE t1,t2,t3;
+create table t1 (f1 int);
+create view v1 as select t1.f1 as '123
+456' from t1;
+select * from v1;
+123 456
+drop view v1;
+drop table t1;

--- 1.117/mysql-test/t/view.test	2005-10-28 14:11:24 +04:00
+++ 1.118/mysql-test/t/view.test	2005-11-03 13:17:08 +03:00
@@ -2189,4 +2189,13 @@
 DROP VIEW v1,v2;
 DROP TABLE t1,t2,t3;
 
+#
+# Bug #13622 Wrong view .frm created if some field's alias contain \n
+#
+create table t1 (f1 int);
+create view v1 as select t1.f1 as '123
+456' from t1;
+select * from v1;
+drop view v1;
+drop table t1;
 

--- 1.18/mysql-test/r/date_formats.result	2005-10-27 21:04:31 +04:00
+++ 1.19/mysql-test/r/date_formats.result	2005-11-03 13:18:52 +03:00
@@ -76,8 +76,7 @@
 SET datetime_format=default;
 select str_to_date(concat('15-01-2001',' 2:59:58.999'),
 concat('%d-%m-%Y',' ','%H:%i:%s.%f'));
-str_to_date(concat('15-01-2001',' 2:59:58.999'),
-concat('%d-%m-%Y',' ','%H:%i:%s.%f'))
+str_to_date(concat('15-01-2001',' 2:59:58.999'), concat('%d-%m-%Y',' ','%H:%i:%s.%f'))
 2001-01-15 02:59:58.999000
 select STR_TO_DATE('2004.12.12 22.30.61','%Y.%m.%d %T');
 STR_TO_DATE('2004.12.12 22.30.61','%Y.%m.%d %T')

--- 1.38/mysql-test/r/ps_2myisam.result	2005-09-27 19:07:20 +04:00
+++ 1.39/mysql-test/r/ps_2myisam.result	2005-11-03 13:18:17 +03:00
@@ -878,23 +878,17 @@
                      where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
                      group by t5.a order by sum limit 1) from t7 ' ;
 execute stmt1 ;
-a	(select count(distinct t5.b) as sum from t5, t6
-                     where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
-                     group by t5.a order by sum limit 1)
+a	(select count(distinct t5.b) as sum from t5, t6                      where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b                      group by t5.a order by sum limit 1)
 3	1
 2	2
 1	2
 execute stmt1 ;
-a	(select count(distinct t5.b) as sum from t5, t6
-                     where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
-                     group by t5.a order by sum limit 1)
+a	(select count(distinct t5.b) as sum from t5, t6                      where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b                      group by t5.a order by sum limit 1)
 3	1
 2	2
 1	2
 execute stmt1 ;
-a	(select count(distinct t5.b) as sum from t5, t6
-                     where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
-                     group by t5.a order by sum limit 1)
+a	(select count(distinct t5.b) as sum from t5, t6                      where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b                      group by t5.a order by sum limit 1)
 3	1
 2	2
 1	2

--- 1.41/mysql-test/r/ps_3innodb.result	2005-09-27 19:07:20 +04:00
+++ 1.42/mysql-test/r/ps_3innodb.result	2005-11-03 13:18:30 +03:00
@@ -878,23 +878,17 @@
                      where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
                      group by t5.a order by sum limit 1) from t7 ' ;
 execute stmt1 ;
-a	(select count(distinct t5.b) as sum from t5, t6
-                     where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
-                     group by t5.a order by sum limit 1)
+a	(select count(distinct t5.b) as sum from t5, t6                      where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b                      group by t5.a order by sum limit 1)
 3	1
 2	2
 1	2
 execute stmt1 ;
-a	(select count(distinct t5.b) as sum from t5, t6
-                     where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
-                     group by t5.a order by sum limit 1)
+a	(select count(distinct t5.b) as sum from t5, t6                      where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b                      group by t5.a order by sum limit 1)
 3	1
 2	2
 1	2
 execute stmt1 ;
-a	(select count(distinct t5.b) as sum from t5, t6
-                     where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
-                     group by t5.a order by sum limit 1)
+a	(select count(distinct t5.b) as sum from t5, t6                      where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b                      group by t5.a order by sum limit 1)
 3	1
 2	2
 1	2

--- 1.37/mysql-test/r/ps_4heap.result	2005-09-27 19:07:20 +04:00
+++ 1.38/mysql-test/r/ps_4heap.result	2005-11-03 13:18:00 +03:00
@@ -879,23 +879,17 @@
                      where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
                      group by t5.a order by sum limit 1) from t7 ' ;
 execute stmt1 ;
-a	(select count(distinct t5.b) as sum from t5, t6
-                     where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
-                     group by t5.a order by sum limit 1)
+a	(select count(distinct t5.b) as sum from t5, t6                      where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b                      group by t5.a order by sum limit 1)
 3	1
 2	2
 1	2
 execute stmt1 ;
-a	(select count(distinct t5.b) as sum from t5, t6
-                     where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
-                     group by t5.a order by sum limit 1)
+a	(select count(distinct t5.b) as sum from t5, t6                      where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b                      group by t5.a order by sum limit 1)
 3	1
 2	2
 1	2
 execute stmt1 ;
-a	(select count(distinct t5.b) as sum from t5, t6
-                     where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
-                     group by t5.a order by sum limit 1)
+a	(select count(distinct t5.b) as sum from t5, t6                      where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b                      group by t5.a order by sum limit 1)
 3	1
 2	2
 1	2

--- 1.38/mysql-test/r/ps_5merge.result	2005-09-27 19:07:20 +04:00
+++ 1.39/mysql-test/r/ps_5merge.result	2005-11-03 13:17:27 +03:00
@@ -921,23 +921,17 @@
                      where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
                      group by t5.a order by sum limit 1) from t7 ' ;
 execute stmt1 ;
-a	(select count(distinct t5.b) as sum from t5, t6
-                     where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
-                     group by t5.a order by sum limit 1)
+a	(select count(distinct t5.b) as sum from t5, t6                      where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b                      group by t5.a order by sum limit 1)
 3	1
 2	2
 1	2
 execute stmt1 ;
-a	(select count(distinct t5.b) as sum from t5, t6
-                     where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
-                     group by t5.a order by sum limit 1)
+a	(select count(distinct t5.b) as sum from t5, t6                      where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b                      group by t5.a order by sum limit 1)
 3	1
 2	2
 1	2
 execute stmt1 ;
-a	(select count(distinct t5.b) as sum from t5, t6
-                     where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
-                     group by t5.a order by sum limit 1)
+a	(select count(distinct t5.b) as sum from t5, t6                      where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b                      group by t5.a order by sum limit 1)
 3	1
 2	2
 1	2
@@ -3933,23 +3927,17 @@
                      where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
                      group by t5.a order by sum limit 1) from t7 ' ;
 execute stmt1 ;
-a	(select count(distinct t5.b) as sum from t5, t6
-                     where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
-                     group by t5.a order by sum limit 1)
+a	(select count(distinct t5.b) as sum from t5, t6                      where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b                      group by t5.a order by sum limit 1)
 3	1
 2	2
 1	2
 execute stmt1 ;
-a	(select count(distinct t5.b) as sum from t5, t6
-                     where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
-                     group by t5.a order by sum limit 1)
+a	(select count(distinct t5.b) as sum from t5, t6                      where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b                      group by t5.a order by sum limit 1)
 3	1
 2	2
 1	2
 execute stmt1 ;
-a	(select count(distinct t5.b) as sum from t5, t6
-                     where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b
-                     group by t5.a order by sum limit 1)
+a	(select count(distinct t5.b) as sum from t5, t6                      where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b                      group by t5.a order by sum limit 1)
 3	1
 2	2
 1	2

--- 1.6/mysql-test/r/comments.result	2003-06-04 19:28:46 +04:00
+++ 1.7/mysql-test/r/comments.result	2005-11-03 13:19:08 +03:00
@@ -18,8 +18,7 @@
 2
 select 1 --2
 +1;
-1 --2
-+1
+1 --2 +1
 4
 select 1 # The rest of the row will be ignored
 ;
Thread
bk commit into 5.0 tree (evgen:1.1962) BUG#13622eugene3 Nov