~ubuntu-branches/ubuntu/lucid/mysql-dfsg-5.1/lucid-proposed

« back to all changes in this revision

Viewing changes to debian/patches/60_CVE-2010-3836.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum
  • Date: 2010-11-20 12:06:00 UTC
  • mfrom: (28.1.2 lucid-security)
  • Revision ID: james.westby@ubuntu.com-20101120120600-df3877irtd9n6kyt
Tags: 5.1.41-3ubuntu12.8
raising kill timeout to 300 to help avoid table corruption (LP: #620441)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh /usr/share/dpatch/dpatch-run
 
2
# Description: fix denial of service via pre-evaluation of LIKE
 
3
#  predicates during view preparation.
 
4
# Origin: upstream, http://bazaar.launchpad.net/~mysql/mysql-server/mysql-5.1/revision/3452.1.22
 
5
# Bug: http://bugs.mysql.com/bug.php?id=54568
 
6
 
 
7
@DPATCH@
 
8
diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' mysql-dfsg-5.1-5.1.41~/mysql-test/r/subselect4.result mysql-dfsg-5.1-5.1.41/mysql-test/r/subselect4.result
 
9
--- mysql-dfsg-5.1-5.1.41~/mysql-test/r/subselect4.result       2009-11-04 14:01:28.000000000 -0500
 
10
+++ mysql-dfsg-5.1-5.1.41/mysql-test/r/subselect4.result        2010-11-08 12:56:38.000000000 -0500
 
11
@@ -59,3 +59,24 @@
 
12
 (SELECT 1 FROM t1,t2 WHERE t2.b > t3.b)
 
13
 DROP TABLE t1,t2,t3;
 
14
 End of 5.0 tests.
 
15
+#
 
16
+# Bug#54568: create view cause Assertion failed: 0, 
 
17
+# file .\item_subselect.cc, line 836
 
18
+#
 
19
+EXPLAIN SELECT 1 LIKE ( 1 IN ( SELECT 1 ) );
 
20
+id     select_type     table   type    possible_keys   key     key_len ref     rows    Extra
 
21
+1      PRIMARY NULL    NULL    NULL    NULL    NULL    NULL    NULL    No tables used
 
22
+Warnings:
 
23
+Note   1249    Select 2 was reduced during optimization
 
24
+DESCRIBE SELECT 1 LIKE ( 1 IN ( SELECT 1 ) );
 
25
+id     select_type     table   type    possible_keys   key     key_len ref     rows    Extra
 
26
+1      PRIMARY NULL    NULL    NULL    NULL    NULL    NULL    NULL    No tables used
 
27
+Warnings:
 
28
+Note   1249    Select 2 was reduced during optimization
 
29
+# None of the below should crash
 
30
+CREATE VIEW v1 AS SELECT 1 LIKE ( 1 IN ( SELECT 1 ) );
 
31
+CREATE VIEW v2 AS SELECT 1 LIKE '%' ESCAPE ( 1 IN ( SELECT 1 ) );
 
32
+DROP VIEW v1, v2;
 
33
+#
 
34
+# End of 5.1 tests.
 
35
+#
 
36
diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' mysql-dfsg-5.1-5.1.41~/mysql-test/t/subselect4.test mysql-dfsg-5.1-5.1.41/mysql-test/t/subselect4.test
 
37
--- mysql-dfsg-5.1-5.1.41~/mysql-test/t/subselect4.test 2009-11-04 14:00:59.000000000 -0500
 
38
+++ mysql-dfsg-5.1-5.1.41/mysql-test/t/subselect4.test  2010-11-08 12:56:38.000000000 -0500
 
39
@@ -62,3 +62,19 @@
 
40
 DROP TABLE t1,t2,t3;
 
41
 
 
42
 --echo End of 5.0 tests.
 
43
+
 
44
+--echo #
 
45
+--echo # Bug#54568: create view cause Assertion failed: 0, 
 
46
+--echo # file .\item_subselect.cc, line 836
 
47
+--echo #
 
48
+EXPLAIN SELECT 1 LIKE ( 1 IN ( SELECT 1 ) );
 
49
+DESCRIBE SELECT 1 LIKE ( 1 IN ( SELECT 1 ) );
 
50
+--echo # None of the below should crash
 
51
+CREATE VIEW v1 AS SELECT 1 LIKE ( 1 IN ( SELECT 1 ) );
 
52
+CREATE VIEW v2 AS SELECT 1 LIKE '%' ESCAPE ( 1 IN ( SELECT 1 ) );
 
53
+DROP VIEW v1, v2;
 
54
+
 
55
+
 
56
+--echo #
 
57
+--echo # End of 5.1 tests.
 
58
+--echo #
 
59
diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' mysql-dfsg-5.1-5.1.41~/sql/item_cmpfunc.cc mysql-dfsg-5.1-5.1.41/sql/item_cmpfunc.cc
 
60
--- mysql-dfsg-5.1-5.1.41~/sql/item_cmpfunc.cc  2010-11-08 12:56:34.000000000 -0500
 
61
+++ mysql-dfsg-5.1-5.1.41/sql/item_cmpfunc.cc   2010-11-08 12:56:38.000000000 -0500
 
62
@@ -4431,7 +4431,7 @@
 
63
     return TRUE;
 
64
   }
 
65
   
 
66
-  if (escape_item->const_item())
 
67
+  if (escape_item->const_item() && !thd->lex->view_prepare_mode)
 
68
   {
 
69
     /* If we are on execution stage */
 
70
     String *escape_str= escape_item->val_str(&tmp_value1);