[Pkg-mysql-commits] r1247 - in trunk/debian: . patches

Norbert Tretkowski nobse at alioth.debian.org
Thu Jun 5 09:15:09 UTC 2008


Author: nobse
Date: 2008-06-05 09:15:09 +0000 (Thu, 05 Jun 2008)
New Revision: 1247

Added:
   trunk/debian/patches/50_fix_mysqldump.dpatch
   trunk/debian/patches/51_incorrect-order.dpatch
   trunk/debian/patches/52_ndb-gcc-4.2.dpatch
   trunk/debian/patches/53_integer-gcc-4.2.dpatch
   trunk/debian/patches/54_ssl-client-support.dpatch
   trunk/debian/patches/55_testsuite-2008.dpatch
   trunk/debian/patches/56_fix_order_by.dpatch
   trunk/debian/patches/57_fix_mysql_replication.dpatch
   trunk/debian/patches/90_upstreamdebiandir.dpatch
   trunk/debian/patches/91_SECURITY_CVE-2007-5925.dpatch
Modified:
   trunk/debian/changelog
   trunk/debian/mysql-server-5.0.files
   trunk/debian/mysql-server-5.0.postinst
   trunk/debian/patches/00list
   trunk/debian/patches/25_mysys__default.c.dpatch
   trunk/debian/rules
Log:
Revert to 5.0.51.

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2008-05-28 12:31:47 UTC (rev 1246)
+++ trunk/debian/changelog	2008-06-05 09:15:09 UTC (rev 1247)
@@ -1,40 +1,20 @@
-mysql-dfsg-5.0 (5.0.60-1) unstable; urgency=high
+mysql-dfsg-5.0 (5.0.51a-7) UNRELEASED; urgency=low
 
   [ Norbert Tretkowski ]
-  * New upstream release.
-  * Remove patches:
-    + debian/patches/50_fix_mysqldump.dpatch
-    + debian/patches/51_incorrect-order.dpatch
-    + debian/patches/52_ndb-gcc-4.2.dpatch
-    + debian/patches/53_integer-gcc-4.2.dpatch
-    + debian/patches/54_ssl-client-support.dpatch
-    + debian/patches/55_testsuite-2008.dpatch
-    + debian/patches/56_fix_order_by.dpatch
-    + debian/patches/57_fix_mysql_replication.dpatch
-    + debian/patches/90_upstreamdebiandir.dpatch
-    + debian/patches/91_SECURITY_CVE-2007-5925.dpatch
-  * Update patches:
-    + debian/patches/25_mysys__default.c.dpatch
-  * SECURITY:
-    Fix for CVE-2008-2079: It was possible to circumvent privileges through
-    the creation of MyISAM tables employing the DATA DIRECTORY and INDEX
-    DIRECTORY options to overwrite existing table files in the MySQL data
-    directory. Use of the MySQL data directory in DATA DIRECTORY and INDEX
-    DIRECTORY is now disallowed. (closes: #480292)
   * Fix build on non-linux systems like hurd-i386. (closes: #480362)
   * Include symlinks for mysqlcheck. (closes: #480647)
-  * Fix sections of ndb_mgmd and ndbd manpages.
 
   [ Monty Taylor ]
-  * Remove ndb_cpcd, as it is only for the NDB test suite and not useful as a
-    public program.
+  * Remove ndb_cpcd, as it is  only for the NDB test suite and not useful as
+    a public program.
   * Fix debian-start.inc.sh for table names with characters needing quotes.
     Thanks Felix Rublack! (closes: #481154, #481303) 
-  * Delete mysql-common.README.Debian. Nothing in it was relevant, and the
-    useful information is in mysql-server anyway. (closes: #480940)
-  * Remove a spurious HOME= in logrotate script.  
+  * Deleted mysql-common.README.Debian. Nothing in it was relevant, and the
+    useful information is in mysql-server anyway. 
+    (closes: #480940)
+  * Removed a spurious HOME= in logrotate script.  
 
- -- Norbert Tretkowski <nobse at debian.org>  Tue, 27 May 2008 21:15:32 +0200
+ -- Monty Taylor <mordred at inaugust.com>  Fri, 16 May 2008 11:13:27 -0700
 
 mysql-dfsg-5.0 (5.0.51a-6) unstable; urgency=low
 

Modified: trunk/debian/mysql-server-5.0.files
===================================================================
--- trunk/debian/mysql-server-5.0.files	2008-05-28 12:31:47 UTC (rev 1246)
+++ trunk/debian/mysql-server-5.0.files	2008-06-05 09:15:09 UTC (rev 1247)
@@ -75,13 +75,13 @@
 usr/share/man/man1/ndb_drop_table.1
 usr/share/man/man1/ndb_error_reporter.1
 usr/share/man/man1/ndb_mgm.1
+usr/share/man/man1/ndb_mgmd.1
 usr/share/man/man1/ndb_restore.1
 usr/share/man/man1/ndb_select_all.1
 usr/share/man/man1/ndb_select_count.1
 usr/share/man/man1/ndb_show_tables.1
 usr/share/man/man1/ndb_size.pl.1
 usr/share/man/man1/ndb_waiter.1
+usr/share/man/man1/ndbd.1
 usr/share/man/man8/mysqld.8
-usr/share/man/man8/ndb_mgmd.8
-usr/share/man/man8/ndbd.8
 usr/share/mysql/

Modified: trunk/debian/mysql-server-5.0.postinst
===================================================================
--- trunk/debian/mysql-server-5.0.postinst	2008-05-28 12:31:47 UTC (rev 1246)
+++ trunk/debian/mysql-server-5.0.postinst	2008-06-05 09:15:09 UTC (rev 1247)
@@ -21,7 +21,7 @@
 MYSQL_BOOTSTRAP="/usr/sbin/mysqld --bootstrap --user=mysql --skip-grant-tables  --skip-bdb  --skip-innodb --skip-ndbcluster"
 
 test_mysql_access() {
-	echo "" | mysql --no-defaults -u root -h localhost >/dev/null 2>&1
+	mysql --no-defaults -u root -h localhost </dev/null >/dev/null 2>&1
 }
 
 # call with $1 = "online" to connect to the server, otherwise it bootstraps

Modified: trunk/debian/patches/00list
===================================================================
--- trunk/debian/patches/00list	2008-05-28 12:31:47 UTC (rev 1246)
+++ trunk/debian/patches/00list	2008-06-05 09:15:09 UTC (rev 1247)
@@ -6,5 +6,15 @@
 41_scripts__mysql_install_db.sh__no_test.dpatch
 44_scripts__mysql_config__libs.dpatch
 45_warn-CLI-passwords.dpatch
+50_fix_mysqldump.dpatch
+51_incorrect-order.dpatch
+52_ndb-gcc-4.2.dpatch
+53_integer-gcc-4.2.dpatch
+54_ssl-client-support.dpatch
+55_testsuite-2008.dpatch
+56_fix_order_by.dpatch
+57_fix_mysql_replication.dpatch
 86_PATH_MAX.dpatch
 89_ndb__staticlib.dpatch
+90_upstreamdebiandir.dpatch
+91_SECURITY_CVE-2007-5925.dpatch

Modified: trunk/debian/patches/25_mysys__default.c.dpatch
===================================================================
--- trunk/debian/patches/25_mysys__default.c.dpatch	2008-05-28 12:31:47 UTC (rev 1246)
+++ trunk/debian/patches/25_mysys__default.c.dpatch	2008-06-05 09:15:09 UTC (rev 1247)
@@ -5,15 +5,15 @@
 ## DP: mysys__default.c
 
 @DPATCH@
-diff -Nur mysql-dfsg-5.0-5.0.60.orig/mysys/default.c mysql-dfsg-5.0-5.0.60/mysys/default.c
---- mysql-dfsg-5.0-5.0.60.orig/mysys/default.c	2008-04-29 00:30:15.000000000 +0200
-+++ mysql-dfsg-5.0-5.0.60/mysys/default.c	2008-05-27 21:13:29.000000000 +0200
-@@ -1115,7 +1115,7 @@
- static void init_default_directories_unix()
- {
-   bzero((char *) default_directories, sizeof(default_directories));
--  ADD_DIRECTORY("/etc/");
-+  ADD_DIRECTORY("/etc/mysql/");
- #ifdef DEFAULT_SYSCONFDIR
-   if (DEFAULT_SYSCONFDIR != "")
-     ADD_DIRECTORY(DEFAULT_SYSCONFDIR);
+
+--- old/mysys/default.c	2005-05-26 15:26:56.000000000 +0200
++++ new/mysys/default.c	2005-06-08 19:54:26.434959920 +0200
+@@ -866,7 +866,7 @@
+   if ((env= getenv("ETC")))
+     *ptr++= env;
+ #endif
+-  *ptr++= "/etc/";
++  *ptr++= "/etc/mysql/";
+ #endif
+   if ((env= getenv(STRINGIFY_ARG(DEFAULT_HOME_ENV))))
+     *ptr++= env;

Added: trunk/debian/patches/50_fix_mysqldump.dpatch
===================================================================
--- trunk/debian/patches/50_fix_mysqldump.dpatch	                        (rev 0)
+++ trunk/debian/patches/50_fix_mysqldump.dpatch	2008-06-05 09:15:09 UTC (rev 1247)
@@ -0,0 +1,55 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 50_fix_mysqldump.dpatch by Norbert Tretkowski <nobse at debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: SHOW FIELDS FROM a view with no valid definer was possible (since fix
+## DP: for Bug#26817), but gave NULL as a field-type. This led to mysqldump-ing
+## DP: of such views being successful, but loading such a dump with the client
+## DP: failing. Patch allows SHOW FIELDS to give data-type of field in underlying
+## DP: table.
+
+ at DPATCH@
+diff -Nrup a/mysql-test/r/information_schema_db.result b/mysql-test/r/information_schema_db.result
+--- a/mysql-test/r/information_schema_db.result	2007-08-20 08:23:06 +02:00
++++ b/mysql-test/r/information_schema_db.result	2007-10-26 09:01:28 +02:00
+@@ -130,7 +130,7 @@ Warnings:
+ Warning	1356	View 'testdb_1.v7' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+ show fields from testdb_1.v7;
+ Field	Type	Null	Key	Default	Extra
+-f1	null	YES		NULL	
++f1	char(4)	YES		NULL	
+ Warnings:
+ Note	1449	There is no 'no_such_user'@'no_such_host' registered
+ create table t3 (f1 char(4), f2 char(4));
+@@ -150,7 +150,7 @@ View	Create View
+ v6	CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `testdb_1`.`v6` AS select `testdb_1`.`t1`.`f1` AS `f1` from `testdb_1`.`t1`
+ show fields from testdb_1.v7;
+ Field	Type	Null	Key	Default	Extra
+-f1	null	YES		NULL	
++f1	char(4)	YES		NULL	
+ Warnings:
+ Note	1449	There is no 'no_such_user'@'no_such_host' registered
+ show create view testdb_1.v7;
+@@ -178,7 +178,7 @@ show create view v4;
+ ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+ show fields from v4;
+ Field	Type	Null	Key	Default	Extra
+-f1	null	YES		NULL	
++f1	char(4)	YES		NULL	
+ f2	char(4)	YES		NULL	
+ show fields from v2;
+ Field	Type	Null	Key	Default	Extra
+diff -Nrup a/sql/sql_base.cc b/sql/sql_base.cc
+--- a/sql/sql_base.cc	2007-09-27 11:17:13 +02:00
++++ b/sql/sql_base.cc	2007-10-26 09:01:28 +02:00
+@@ -3958,7 +3958,9 @@ find_field_in_tables(THD *thd, Item_iden
+   {
+     Field *cur_field= find_field_in_table_ref(thd, cur_table, name, length,
+                                               item->name, db, table_name, ref,
+-                                              check_privileges,
++                                              (thd->lex->sql_command ==
++                                               SQLCOM_SHOW_FIELDS)
++                                              ? false : check_privileges,
+                                               allow_rowid,
+                                               &(item->cached_field_index),
+                                               register_tree_change,

Added: trunk/debian/patches/51_incorrect-order.dpatch
===================================================================
--- trunk/debian/patches/51_incorrect-order.dpatch	                        (rev 0)
+++ trunk/debian/patches/51_incorrect-order.dpatch	2008-06-05 09:15:09 UTC (rev 1247)
@@ -0,0 +1,115 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 51_incorrect-order.dpatch by Norbert Tretkowski <nobse at debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: http://lists.mysql.com/commits/37246
+
+ at DPATCH@
+diff -Nrup a/mysql-test/r/select.result b/mysql-test/r/select.result
+--- a/mysql-test/r/select.result	2007-09-13 17:31:07 +04:00
++++ b/mysql-test/r/select.result	2007-11-07 14:00:41 +03:00
+@@ -4096,4 +4096,43 @@ SELECT `x` FROM v3;
+ x
+ 1
+ DROP VIEW v1, v2, v3;
++CREATE TABLE t1 (c11 INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY);
++CREATE TABLE t2 (c21 INT UNSIGNED NOT NULL, 
++c22 INT DEFAULT NULL, 
++KEY(c21, c22));
++CREATE TABLE t3 (c31 INT UNSIGNED NOT NULL DEFAULT 0, 
++c32 INT DEFAULT NULL, 
++c33 INT NOT NULL, 
++c34 INT UNSIGNED DEFAULT 0,
++KEY (c33, c34, c32));
++INSERT INTO t1 values (),(),(),(),();
++INSERT INTO t2 SELECT a.c11, b.c11 FROM t1 a, t1 b;
++INSERT INTO t3 VALUES (1, 1, 1, 0), 
++(2, 2, 0, 0), 
++(3, 3, 1, 0), 
++(4, 4, 0, 0), 
++(5, 5, 1, 0);
++SELECT c32 FROM t1, t2, t3 WHERE t1.c11 IN (1, 3, 5) AND 
++t3.c31 = t1.c11 AND t2.c21 = t1.c11 AND 
++t3.c33 = 1 AND t2.c22 in (1, 3) 
++ORDER BY c32;
++c32
++1
++1
++3
++3
++5
++5
++SELECT c32 FROM t1, t2, t3 WHERE t1.c11 IN (1, 3, 5) AND 
++t3.c31 = t1.c11 AND t2.c21 = t1.c11 AND 
++t3.c33 = 1 AND t2.c22 in (1, 3) 
++ORDER BY c32 DESC;
++c32
++5
++5
++3
++3
++1
++1
++DROP TABLE t1, t2, t3;
+ End of 5.0 tests
+diff -Nrup a/mysql-test/t/select.test b/mysql-test/t/select.test
+--- a/mysql-test/t/select.test	2007-09-15 09:02:02 +04:00
++++ b/mysql-test/t/select.test	2007-11-07 14:00:41 +03:00
+@@ -3484,4 +3484,40 @@ DROP VIEW v1, v2, v3;
+ 
+ --enable_ps_protocol
+ 
++#
++# Bug #30666: Incorrect order when using range conditions on 2 tables or more
++#
++
++CREATE TABLE t1 (c11 INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY);
++CREATE TABLE t2 (c21 INT UNSIGNED NOT NULL, 
++                 c22 INT DEFAULT NULL, 
++                 KEY(c21, c22));
++CREATE TABLE t3 (c31 INT UNSIGNED NOT NULL DEFAULT 0, 
++                 c32 INT DEFAULT NULL, 
++                 c33 INT NOT NULL, 
++                 c34 INT UNSIGNED DEFAULT 0,
++                 KEY (c33, c34, c32));
++
++INSERT INTO t1 values (),(),(),(),();
++INSERT INTO t2 SELECT a.c11, b.c11 FROM t1 a, t1 b;
++INSERT INTO t3 VALUES (1, 1, 1, 0), 
++                      (2, 2, 0, 0), 
++                      (3, 3, 1, 0), 
++                      (4, 4, 0, 0), 
++                      (5, 5, 1, 0);
++
++# Show that ORDER BY produces the correct results order
++SELECT c32 FROM t1, t2, t3 WHERE t1.c11 IN (1, 3, 5) AND 
++                                 t3.c31 = t1.c11 AND t2.c21 = t1.c11 AND 
++                                 t3.c33 = 1 AND t2.c22 in (1, 3) 
++                           ORDER BY c32; 
++
++# Show that ORDER BY DESC produces the correct results order
++SELECT c32 FROM t1, t2, t3 WHERE t1.c11 IN (1, 3, 5) AND 
++                                 t3.c31 = t1.c11 AND t2.c21 = t1.c11 AND 
++                                 t3.c33 = 1 AND t2.c22 in (1, 3) 
++                           ORDER BY c32 DESC; 
++
++DROP TABLE t1, t2, t3;
++
+ --echo End of 5.0 tests
+diff -Nrup a/sql/sql_select.cc b/sql/sql_select.cc
+--- a/sql/sql_select.cc	2007-10-02 18:45:48 +04:00
++++ b/sql/sql_select.cc	2007-11-07 14:00:42 +03:00
+@@ -6071,10 +6071,9 @@ make_join_readinfo(JOIN *join, ulonglong
+       ordered. If there is a temp table the ordering is done as a last
+       operation and doesn't prevent join cache usage.
+     */
+-    if (!ordered_set && !join->need_tmp &&
+-        ((table == join->sort_by_table &&
+-         (!join->order || join->skip_sort_order)) ||
+-        (join->sort_by_table == (TABLE *) 1 && i != join->const_tables)))
++    if (!ordered_set && !join->need_tmp && 
++        (table == join->sort_by_table ||
++         (join->sort_by_table == (TABLE *) 1 && i != join->const_tables)))
+       ordered_set= 1;
+ 
+     switch (tab->type) {

Added: trunk/debian/patches/52_ndb-gcc-4.2.dpatch
===================================================================
--- trunk/debian/patches/52_ndb-gcc-4.2.dpatch	                        (rev 0)
+++ trunk/debian/patches/52_ndb-gcc-4.2.dpatch	2008-06-05 09:15:09 UTC (rev 1247)
@@ -0,0 +1,153 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 52_ndb-gcc-4.2.dpatch by Norbert Tretkowski <nobse at debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: http://bugs.mysql.com/bug.php?id=31761
+
+ at DPATCH@
+--- 1.8/ndb/include/kernel/AttributeHeader.hpp	2007-10-23 16:46:03 +02:00
++++ 1.9/ndb/include/kernel/AttributeHeader.hpp	2007-10-23 16:46:03 +02:00
+@@ -41,8 +41,7 @@ public:
+   STATIC_CONST( FRAGMENT_MEMORY= 0xFFF9 );
+ 
+   /** Initialize AttributeHeader at location aHeaderPtr */
+-  static AttributeHeader& init(void* aHeaderPtr, Uint32 anAttributeId, 
+-			       Uint32 aDataSize);
++  static void init(Uint32* aHeaderPtr, Uint32 anAttributeId, Uint32 aDataSize);
+ 
+   /** Returns size of AttributeHeader (usually one or two words) */
+   Uint32 getHeaderSize() const; // In 32-bit words
+@@ -100,10 +99,11 @@ public:
+  */
+ 
+ inline
+-AttributeHeader& AttributeHeader::init(void* aHeaderPtr, Uint32 anAttributeId, 
+-				       Uint32 aDataSize)
++void AttributeHeader::init(Uint32* aHeaderPtr, Uint32 anAttributeId, 
++                           Uint32 aDataSize)
+ {
+-  return * new (aHeaderPtr) AttributeHeader(anAttributeId, aDataSize);
++  AttributeHeader ah(anAttributeId, aDataSize);
++  *aHeaderPtr = ah.m_value;
+ }
+ 
+ inline
+
+--- 1.25/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp	2007-10-23 16:46:03 +02:00
++++ 1.26/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp	2007-10-23 16:46:03 +02:00
+@@ -1577,8 +1577,8 @@ int Dbtup::interpreterNextLab(Signal* si
+ 	  Uint32 TdataForUpdate[3];
+ 	  Uint32 Tlen;
+ 
+-	  AttributeHeader& ah = AttributeHeader::init(&TdataForUpdate[0], 
+-						      TattrId, TattrNoOfWords);
++	  AttributeHeader ah(TattrId, TattrNoOfWords);
++          TdataForUpdate[0] = ah.m_value;
+ 	  TdataForUpdate[1] = TregMemBuffer[theRegister + 2];
+ 	  TdataForUpdate[2] = TregMemBuffer[theRegister + 3];
+ 	  Tlen = TattrNoOfWords + 1;
+@@ -1594,6 +1594,7 @@ int Dbtup::interpreterNextLab(Signal* si
+ 		// Write a NULL value into the attribute
+ 		/* --------------------------------------------------------- */
+ 		ah.setNULL();
++                TdataForUpdate[0] = ah.m_value;
+ 		Tlen = 1;
+ 	      }//if
+ 	      int TnoDataRW= updateAttributes(pagePtr,
+
+--- 1.20/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp	2007-10-23 16:46:03 +02:00
++++ 1.21/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp	2007-10-23 16:46:03 +02:00
+@@ -676,8 +676,6 @@ bool
+ Dbtup::checkUpdateOfPrimaryKey(Uint32* updateBuffer, Tablerec* const regTabPtr)
+ {
+   Uint32 keyReadBuffer[MAX_KEY_SIZE_IN_WORDS];
+-  Uint32 attributeHeader;
+-  AttributeHeader* ahOut = (AttributeHeader*)&attributeHeader;
+   AttributeHeader ahIn(*updateBuffer);
+   Uint32 attributeId = ahIn.getAttributeId();
+   Uint32 attrDescriptorIndex = regTabPtr->tabDescriptor + (attributeId << ZAD_LOG_SIZE);
+@@ -700,16 +698,17 @@ Dbtup::checkUpdateOfPrimaryKey(Uint32* u
+ 
+   ReadFunction f = regTabPtr->readFunctionArray[attributeId];
+ 
+-  AttributeHeader::init(&attributeHeader, attributeId, 0);
++  AttributeHeader attributeHeader(attributeId, 0);
+   tOutBufIndex = 0;
+   tMaxRead = MAX_KEY_SIZE_IN_WORDS;
+ 
+   bool tmp = tXfrmFlag;
+   tXfrmFlag = true;
+-  ndbrequire((this->*f)(&keyReadBuffer[0], ahOut, attrDescriptor, attributeOffset));
++  ndbrequire((this->*f)(&keyReadBuffer[0], &attributeHeader, attrDescriptor,
++                        attributeOffset));
+   tXfrmFlag = tmp;
+-  ndbrequire(tOutBufIndex == ahOut->getDataSize());
+-  if (ahIn.getDataSize() != ahOut->getDataSize()) {
++  ndbrequire(tOutBufIndex == attributeHeader.getDataSize());
++  if (ahIn.getDataSize() != attributeHeader.getDataSize()) {
+     ljam();
+     return true;
+   }//if
+
+--- 1.13/ndb/src/kernel/blocks/dbutil/DbUtil.cpp	2007-10-23 16:46:03 +02:00
++++ 1.14/ndb/src/kernel/blocks/dbutil/DbUtil.cpp	2007-10-23 16:46:03 +02:00
+@@ -1168,9 +1168,7 @@ DbUtil::prepareOperation(Signal* signal,
+     /**************************************************************
+      * Attribute found - store in mapping  (AttributeId, Position)
+      **************************************************************/
+-    AttributeHeader & attrMap = 
+-      AttributeHeader::init(attrMappingIt.data, 
+-			    attrDesc.AttributeId,    // 1. Store AttrId
++    AttributeHeader attrMap(attrDesc.AttributeId,    // 1. Store AttrId
+ 			    0);
+     
+     if (attrDesc.AttributeKeyFlag) {
+@@ -1199,6 +1197,7 @@ DbUtil::prepareOperation(Signal* signal,
+ 	return;
+       }
+     }
++    *(attrMappingIt.data) = attrMap.m_value;
+ #if 0
+     ndbout << "BEFORE: attrLength: " << attrLength << endl;
+ #endif
+
+--- 1.24/ndb/src/ndbapi/NdbOperationDefine.cpp	2007-10-23 16:46:03 +02:00
++++ 1.25/ndb/src/ndbapi/NdbOperationDefine.cpp	2007-10-23 16:46:03 +02:00
+@@ -392,9 +392,8 @@ NdbOperation::getValue_impl(const NdbCol
+ 	return NULL;
+       }//if
+     }//if
+-    Uint32 ah;
+-    AttributeHeader::init(&ah, tAttrInfo->m_attrId, 0);
+-    if (insertATTRINFO(ah) != -1) {	
++    AttributeHeader ah(tAttrInfo->m_attrId, 0);
++    if (insertATTRINFO(ah.m_value) != -1) {	
+       // Insert Attribute Id into ATTRINFO part. 
+       
+       /************************************************************************
+@@ -525,12 +524,11 @@ NdbOperation::setValue( const NdbColumnI
+   
+   tAttrId = tAttrInfo->m_attrId;
+   const char *aValue = aValuePassed; 
+-  Uint32 ahValue;
+   if (aValue == NULL) {
+     if (tAttrInfo->m_nullable) {
+-      AttributeHeader& ah = AttributeHeader::init(&ahValue, tAttrId, 0);
++      AttributeHeader ah(tAttrId, 0);
+       ah.setNULL();
+-      insertATTRINFO(ahValue);
++      insertATTRINFO(ah.m_value);
+       // Insert Attribute Id with the value
+       // NULL into ATTRINFO part. 
+       DBUG_RETURN(0);
+@@ -563,8 +561,8 @@ NdbOperation::setValue( const NdbColumnI
+   }//if
+   const Uint32 totalSizeInWords = (sizeInBytes + 3)/4; // Including bits in last word
+   const Uint32 sizeInWords = sizeInBytes / 4;          // Excluding bits in last word
+-  (void) AttributeHeader::init(&ahValue, tAttrId, totalSizeInWords);
+-  insertATTRINFO( ahValue );
++  AttributeHeader ah(tAttrId, totalSizeInWords);
++  insertATTRINFO( ah.m_value );
+ 
+   /***********************************************************************
+    * Check if the pointer of the value passed is aligned on a 4 byte boundary.

Added: trunk/debian/patches/53_integer-gcc-4.2.dpatch
===================================================================
--- trunk/debian/patches/53_integer-gcc-4.2.dpatch	                        (rev 0)
+++ trunk/debian/patches/53_integer-gcc-4.2.dpatch	2008-06-05 09:15:09 UTC (rev 1247)
@@ -0,0 +1,303 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 53_integer-gcc-4.2.dpatch by Norbert Tretkowski <nobse at debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: http://bugs.mysql.com/bug.php?id=31799
+
+ at DPATCH@
+--- 1.9/strings/int2str.c	2007-10-24 09:26:32 +02:00
++++ 1.10/strings/int2str.c	2007-10-24 09:26:32 +02:00
+@@ -57,6 +57,7 @@ int2str(register long int val, register 
+   register char *p;
+   long int new_val;
+   char *dig_vec= upcase ? _dig_vec_upper : _dig_vec_lower;
++  ulong uval= (ulong) val;
+ 
+   if (radix < 0)
+   {
+@@ -65,7 +66,8 @@ int2str(register long int val, register 
+     if (val < 0)
+     {
+       *dst++ = '-';
+-      val = -val;
++      /* Avoid integer overflow in (-val) for LONGLONG_MIN (BUG#31799). */
++      uval = (ulong)0 - uval;
+     }
+     radix = -radix;
+   }
+@@ -86,8 +88,8 @@ int2str(register long int val, register 
+   */
+   p = &buffer[sizeof(buffer)-1];
+   *p = '\0';
+-  new_val=(ulong) val / (ulong) radix;
+-  *--p = dig_vec[(uchar) ((ulong) val- (ulong) new_val*(ulong) radix)];
++  new_val= uval / (ulong) radix;
++  *--p = dig_vec[(uchar) (uval- (ulong) new_val*(ulong) radix)];
+   val = new_val;
+ #ifdef HAVE_LDIV
+   while (val != 0)
+@@ -133,20 +135,22 @@ char *int10_to_str(long int val,char *ds
+   char buffer[65];
+   register char *p;
+   long int new_val;
++  unsigned long int uval = (unsigned long int) val;
+ 
+   if (radix < 0)				/* -10 */
+   {
+     if (val < 0)
+     {
+       *dst++ = '-';
+-      val = -val;
++      /* Avoid integer overflow in (-val) for LONGLONG_MIN (BUG#31799). */
++      uval = (unsigned long int)0 - uval;
+     }
+   }
+ 
+   p = &buffer[sizeof(buffer)-1];
+   *p = '\0';
+-  new_val= (long) ((unsigned long int) val / 10);
+-  *--p = '0'+ (char) ((unsigned long int) val - (unsigned long) new_val * 10);
++  new_val= (long) (uval / 10);
++  *--p = '0'+ (char) (uval - (unsigned long) new_val * 10);
+   val = new_val;
+ 
+   while (val != 0)
+
+--- 1.9/strings/longlong2str.c	2007-10-24 09:26:32 +02:00
++++ 1.10/strings/longlong2str.c	2007-10-24 09:26:32 +02:00
+@@ -51,13 +51,15 @@ char *longlong2str(longlong val,char *ds
+   char buffer[65];
+   register char *p;
+   long long_val;
++  ulonglong uval= (ulonglong) val;
+ 
+   if (radix < 0)
+   {
+     if (radix < -36 || radix > -2) return (char*) 0;
+     if (val < 0) {
+       *dst++ = '-';
+-      val = -val;
++      /* Avoid integer overflow in (-val) for LONGLONG_MIN (BUG#31799). */
++      uval = (ulonglong)0 - uval;
+     }
+     radix = -radix;
+   }
+@@ -65,7 +67,7 @@ char *longlong2str(longlong val,char *ds
+   {
+     if (radix > 36 || radix < 2) return (char*) 0;
+   }
+-  if (val == 0)
++  if (uval == 0)
+   {
+     *dst++='0';
+     *dst='\0';
+@@ -74,14 +76,14 @@ char *longlong2str(longlong val,char *ds
+   p = &buffer[sizeof(buffer)-1];
+   *p = '\0';
+ 
+-  while ((ulonglong) val > (ulonglong) LONG_MAX)
++  while (uval > (ulonglong) LONG_MAX)
+   {
+-    ulonglong quo=(ulonglong) val/(uint) radix;
+-    uint rem= (uint) (val- quo* (uint) radix);
++    ulonglong quo= uval/(uint) radix;
++    uint rem= (uint) (uval- quo* (uint) radix);
+     *--p = _dig_vec_upper[rem];
+-    val= quo;
++    uval= quo;
+   }
+-  long_val= (long) val;
++  long_val= (long) uval;
+   while (long_val != 0)
+   {
+     long quo= long_val/radix;
+@@ -100,17 +102,19 @@ char *longlong10_to_str(longlong val,cha
+   char buffer[65];
+   register char *p;
+   long long_val;
++  ulonglong uval= (ulonglong) val;
+ 
+   if (radix < 0)
+   {
+     if (val < 0)
+     {
+       *dst++ = '-';
+-      val = -val;
++      /* Avoid integer overflow in (-val) for LONGLONG_MIN (BUG#31799). */
++      uval = (ulonglong)0 - uval;
+     }
+   }
+ 
+-  if (val == 0)
++  if (uval == 0)
+   {
+     *dst++='0';
+     *dst='\0';
+@@ -119,14 +123,14 @@ char *longlong10_to_str(longlong val,cha
+   p = &buffer[sizeof(buffer)-1];
+   *p = '\0';
+ 
+-  while ((ulonglong) val > (ulonglong) LONG_MAX)
++  while (uval > (ulonglong) LONG_MAX)
+   {
+-    ulonglong quo=(ulonglong) val/(uint) 10;
+-    uint rem= (uint) (val- quo* (uint) 10);
++    ulonglong quo= uval/(uint) 10;
++    uint rem= (uint) (uval- quo* (uint) 10);
+     *--p = _dig_vec_upper[rem];
+-    val= quo;
++    uval= quo;
+   }
+-  long_val= (long) val;
++  long_val= (long) uval;
+   while (long_val != 0)
+   {
+     long quo= long_val/10;
+
+--- 1.65/strings/ctype-ucs2.c	2007-10-24 09:26:32 +02:00
++++ 1.66/strings/ctype-ucs2.c	2007-10-24 09:26:32 +02:00
+@@ -1018,6 +1018,7 @@ int my_l10tostr_ucs2(CHARSET_INFO *cs,
+   register char *p, *db, *de;
+   long int new_val;
+   int  sl=0;
++  unsigned long int uval = (unsigned long int) val;
+   
+   p = &buffer[sizeof(buffer)-1];
+   *p='\0';
+@@ -1027,12 +1028,13 @@ int my_l10tostr_ucs2(CHARSET_INFO *cs,
+     if (val < 0)
+     {
+       sl   = 1;
+-      val  = -val;
++      /* Avoid integer overflow in (-val) for LONGLONG_MIN (BUG#31799). */
++      uval  = (unsigned long int)0 - uval;
+     }
+   }
+   
+-  new_val = (long) ((unsigned long int) val / 10);
+-  *--p    = '0'+ (char) ((unsigned long int) val - (unsigned long) new_val * 10);
++  new_val = (long) (uval / 10);
++  *--p    = '0'+ (char) (uval - (unsigned long) new_val * 10);
+   val     = new_val;
+   
+   while (val != 0)
+@@ -1065,34 +1067,36 @@ int my_ll10tostr_ucs2(CHARSET_INFO *cs _
+   register char *p, *db, *de;
+   long long_val;
+   int  sl=0;
++  ulonglong uval= (ulonglong) val;
+   
+   if (radix < 0)
+   {
+     if (val < 0)
+     {
+       sl=1;
+-      val = -val;
++      /* Avoid integer overflow in (-val) for LONGLONG_MIN (BUG#31799). */
++      uval = (ulonglong)0 - uval;
+     }
+   }
+   
+   p = &buffer[sizeof(buffer)-1];
+   *p='\0';
+   
+-  if (val == 0)
++  if (uval == 0)
+   {
+     *--p='0';
+     goto cnv;
+   }
+   
+-  while ((ulonglong) val > (ulonglong) LONG_MAX)
++  while (uval > (ulonglong) LONG_MAX)
+   {
+-    ulonglong quo=(ulonglong) val/(uint) 10;
+-    uint rem= (uint) (val- quo* (uint) 10);
++    ulonglong quo= uval/(uint) 10;
++    uint rem= (uint) (uval- quo* (uint) 10);
+     *--p = '0' + rem;
+-    val= quo;
++    uval= quo;
+   }
+   
+-  long_val= (long) val;
++  long_val= (long) uval;
+   while (long_val != 0)
+   {
+     long quo= long_val/10;
+
+--- 1.82/strings/ctype-simple.c	2007-10-24 09:26:32 +02:00
++++ 1.83/strings/ctype-simple.c	2007-10-24 09:26:32 +02:00
+@@ -837,6 +837,7 @@ int my_long10_to_str_8bit(CHARSET_INFO *
+   register char *p, *e;
+   long int new_val;
+   uint sign=0;
++  unsigned long int uval = (unsigned long int) val;
+ 
+   e = p = &buffer[sizeof(buffer)-1];
+   *p= 0;
+@@ -845,15 +846,16 @@ int my_long10_to_str_8bit(CHARSET_INFO *
+   {
+     if (val < 0)
+     {
+-      val= -val;
++      /* Avoid integer overflow in (-val) for LONGLONG_MIN (BUG#31799). */
++      uval= (unsigned long int)0 - uval;
+       *dst++= '-';
+       len--;
+       sign= 1;
+     }
+   }
+   
+-  new_val = (long) ((unsigned long int) val / 10);
+-  *--p    = '0'+ (char) ((unsigned long int) val - (unsigned long) new_val * 10);
++  new_val = (long) (uval / 10);
++  *--p    = '0'+ (char) (uval - (unsigned long) new_val * 10);
+   val     = new_val;
+   
+   while (val != 0)
+@@ -876,12 +878,14 @@ int my_longlong10_to_str_8bit(CHARSET_IN
+   register char *p, *e;
+   long long_val;
+   uint sign= 0;
++  ulonglong uval = (ulonglong)val;
+   
+   if (radix < 0)
+   {
+     if (val < 0)
+     {
+-      val = -val;
++      /* Avoid integer overflow in (-val) for LONGLONG_MIN (BUG#31799). */
++      uval = (ulonglong)0 - uval;
+       *dst++= '-';
+       len--;
+       sign= 1;
+@@ -891,22 +895,22 @@ int my_longlong10_to_str_8bit(CHARSET_IN
+   e = p = &buffer[sizeof(buffer)-1];
+   *p= 0;
+   
+-  if (val == 0)
++  if (uval == 0)
+   {
+     *--p= '0';
+     len= 1;
+     goto cnv;
+   }
+   
+-  while ((ulonglong) val > (ulonglong) LONG_MAX)
++  while (uval > (ulonglong) LONG_MAX)
+   {
+-    ulonglong quo=(ulonglong) val/(uint) 10;
+-    uint rem= (uint) (val- quo* (uint) 10);
++    ulonglong quo= uval/(uint) 10;
++    uint rem= (uint) (uval- quo* (uint) 10);
+     *--p = '0' + rem;
+-    val= quo;
++    uval= quo;
+   }
+   
+-  long_val= (long) val;
++  long_val= (long) uval;
+   while (long_val != 0)
+   {
+     long quo= long_val/10;

Added: trunk/debian/patches/54_ssl-client-support.dpatch
===================================================================
--- trunk/debian/patches/54_ssl-client-support.dpatch	                        (rev 0)
+++ trunk/debian/patches/54_ssl-client-support.dpatch	2008-06-05 09:15:09 UTC (rev 1247)
@@ -0,0 +1,80 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 54_ssl-client-support.dpatch by Norbert Tretkowski <nobse at debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: http://bugs.mysql.com/bug.php?id=33292
+
+ at DPATCH@
+
+diff -Nrup a/vio/viossl.c b/vio/viossl.c
+--- a/vio/viossl.c	2007-08-28 11:34:42 +02:00
++++ b/vio/viossl.c	2008-02-07 08:48:27 +01:00
+@@ -172,20 +172,15 @@ void vio_ssl_delete(Vio *vio)
+   vio_delete(vio);
+ }
+ 
+-int sslaccept(struct st_VioSSLFd *ptr, Vio *vio, long timeout)
+-{
+-  DBUG_ENTER("sslaccept");
+-  DBUG_RETURN(sslconnect(ptr, vio, timeout));
+-}
+-
+ 
+-int sslconnect(struct st_VioSSLFd *ptr, Vio *vio, long timeout)
++static int ssl_do(struct st_VioSSLFd *ptr, Vio *vio, long timeout,
++                  int (*connect_accept_func)(SSL*))
+ {
+   SSL *ssl;
+   my_bool unused;
+   my_bool was_blocking;
+ 
+-  DBUG_ENTER("sslconnect");
++  DBUG_ENTER("ssl_do");
+   DBUG_PRINT("enter", ("ptr: 0x%lx, sd: %d  ctx: 0x%lx",
+                        (long) ptr, vio->sd, (long) ptr->ssl_context));
+ 
+@@ -204,13 +199,9 @@ int sslconnect(struct st_VioSSLFd *ptr, 
+   SSL_SESSION_set_timeout(SSL_get_session(ssl), timeout);
+   SSL_set_fd(ssl, vio->sd);
+ 
+-  /*
+-    SSL_do_handshake will select between SSL_connect
+-    or SSL_accept depending on server or client side
+-  */
+-  if (SSL_do_handshake(ssl) < 1)
++  if (connect_accept_func(ssl) < 1)
+   {
+-    DBUG_PRINT("error", ("SSL_do_handshake failure"));
++    DBUG_PRINT("error", ("SSL_connect/accept failure"));
+     report_errors(ssl);
+     SSL_free(ssl);
+     vio_blocking(vio, was_blocking, &unused);
+@@ -259,6 +250,20 @@ int sslconnect(struct st_VioSSLFd *ptr, 
+ }
+ 
+ 
++int sslaccept(struct st_VioSSLFd *ptr, Vio *vio, long timeout)
++{
++  DBUG_ENTER("sslaccept");
++  DBUG_RETURN(ssl_do(ptr, vio, timeout, SSL_accept));
++}
++
++
++int sslconnect(struct st_VioSSLFd *ptr, Vio *vio, long timeout)
++{
++  DBUG_ENTER("sslconnect");
++  DBUG_RETURN(ssl_do(ptr, vio, timeout, SSL_connect));
++}
++
++
+ int vio_ssl_blocking(Vio *vio __attribute__((unused)),
+ 		     my_bool set_blocking_mode,
+ 		     my_bool *old_mode)
+@@ -268,5 +273,7 @@ int vio_ssl_blocking(Vio *vio __attribut
+   /* Return error if we try to change to non_blocking mode */
+   return (set_blocking_mode ? 0 : 1);
+ }
++
++
+ 
+ #endif /* HAVE_OPENSSL */

Added: trunk/debian/patches/55_testsuite-2008.dpatch
===================================================================
--- trunk/debian/patches/55_testsuite-2008.dpatch	                        (rev 0)
+++ trunk/debian/patches/55_testsuite-2008.dpatch	2008-06-05 09:15:09 UTC (rev 1247)
@@ -0,0 +1,67 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 55_testsuite-2008.dpatch by Norbert Tretkowski <nobse at debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: http://bugs.mysql.com/bug.php?id=33623
+
+ at DPATCH@
+diff -Nrup a/mysql-test/r/view.result b/mysql-test/r/view.result
+--- a/mysql-test/r/view.result	2007-09-24 17:34:09 +05:00
++++ b/mysql-test/r/view.result	2007-10-10 12:16:12 +05:00
+@@ -2706,18 +2706,19 @@ CREATE TABLE t1(
+ fName varchar(25) NOT NULL,
+ lName varchar(25) NOT NULL,
+ DOB date NOT NULL,
++test_date date NOT NULL,
+ uID int unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY);
+-INSERT INTO t1(fName, lName, DOB) VALUES
+-('Hank', 'Hill', '1964-09-29'),
+-('Tom', 'Adams', '1908-02-14'),
+-('Homer', 'Simpson', '1968-03-05');
++INSERT INTO t1(fName, lName, DOB, test_date) VALUES
++('Hank', 'Hill', '1964-09-29', '2007-01-01'),
++('Tom', 'Adams', '1908-02-14', '2007-01-01'),
++('Homer', 'Simpson', '1968-03-05', '2007-01-01');
+ CREATE VIEW v1 AS
+-SELECT (year(now())-year(DOB)) AS Age
++SELECT (year(test_date)-year(DOB)) AS Age
+ FROM t1 HAVING Age < 75;
+ SHOW CREATE VIEW v1;
+ View	Create View
+-v1	CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select (year(now()) - year(`t1`.`DOB`)) AS `Age` from `t1` having (`Age` < 75)
+-SELECT (year(now())-year(DOB)) AS Age FROM t1 HAVING Age < 75;
++v1	CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select (year(`t1`.`test_date`) - year(`t1`.`DOB`)) AS `Age` from `t1` having (`Age` < 75)
++SELECT (year(test_date)-year(DOB)) AS Age FROM t1 HAVING Age < 75;
+ Age
+ 43
+ 39
+diff -Nrup a/mysql-test/t/view.test b/mysql-test/t/view.test
+--- a/mysql-test/t/view.test	2007-09-24 17:34:09 +05:00
++++ b/mysql-test/t/view.test	2007-10-10 12:16:12 +05:00
+@@ -2548,19 +2548,20 @@ CREATE TABLE t1(
+   fName varchar(25) NOT NULL,
+   lName varchar(25) NOT NULL,
+   DOB date NOT NULL,
++  test_date date NOT NULL,
+   uID int unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY);
+  
+-INSERT INTO t1(fName, lName, DOB) VALUES
+-  ('Hank', 'Hill', '1964-09-29'),
+-  ('Tom', 'Adams', '1908-02-14'),
+-  ('Homer', 'Simpson', '1968-03-05');
++INSERT INTO t1(fName, lName, DOB, test_date) VALUES
++  ('Hank', 'Hill', '1964-09-29', '2007-01-01'),
++  ('Tom', 'Adams', '1908-02-14', '2007-01-01'),
++  ('Homer', 'Simpson', '1968-03-05', '2007-01-01');
+ 
+ CREATE VIEW v1 AS
+-  SELECT (year(now())-year(DOB)) AS Age
++  SELECT (year(test_date)-year(DOB)) AS Age
+     FROM t1 HAVING Age < 75; 
+ SHOW CREATE VIEW v1;           
+ 
+-SELECT (year(now())-year(DOB)) AS Age FROM t1 HAVING Age < 75;
++SELECT (year(test_date)-year(DOB)) AS Age FROM t1 HAVING Age < 75;
+ SELECT * FROM v1;
+ 
+ DROP VIEW v1;

Added: trunk/debian/patches/56_fix_order_by.dpatch
===================================================================
--- trunk/debian/patches/56_fix_order_by.dpatch	                        (rev 0)
+++ trunk/debian/patches/56_fix_order_by.dpatch	2008-06-05 09:15:09 UTC (rev 1247)
@@ -0,0 +1,147 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 56_fix_order_by.dpatch by Jamie Strandboge <jamie at ubuntu.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: http://bugs.mysql.com/bug.php?id=32202
+
+ at DPATCH@
+diff -urNad mysql-dfsg-5.0-5.0.51a~/mysql-test/r/group_by.result mysql-dfsg-5.0-5.0.51a/mysql-test/r/group_by.result
+--- mysql-dfsg-5.0-5.0.51a~/mysql-test/r/group_by.result	2008-01-11 10:23:35.000000000 -0500
++++ mysql-dfsg-5.0-5.0.51a/mysql-test/r/group_by.result	2008-03-19 16:18:19.000000000 -0400
+@@ -1113,3 +1113,68 @@
+ 3	1
+ 3	2
+ DROP TABLE t1;
++CREATE TABLE t1(
++id INT AUTO_INCREMENT PRIMARY KEY, 
++c1 INT NOT NULL, 
++c2 INT NOT NULL,
++UNIQUE KEY (c2,c1));
++INSERT INTO t1(c1,c2) VALUES (5,1), (4,1), (3,5), (2,3), (1,3);
++SELECT * FROM t1 ORDER BY c1;
++id	c1	c2
++5	1	3
++4	2	3
++3	3	5
++2	4	1
++1	5	1
++SELECT * FROM t1 GROUP BY id ORDER BY c1;
++id	c1	c2
++5	1	3
++4	2	3
++3	3	5
++2	4	1
++1	5	1
++SELECT * FROM t1 GROUP BY id ORDER BY id DESC;
++id	c1	c2
++5	1	3
++4	2	3
++3	3	5
++2	4	1
++1	5	1
++SELECT * FROM t1 GROUP BY c2 ,c1, id ORDER BY c2, c1;
++id	c1	c2
++2	4	1
++1	5	1
++5	1	3
++4	2	3
++3	3	5
++SELECT * FROM t1 GROUP BY c2, c1, id ORDER BY c2 DESC, c1;
++id	c1	c2
++3	3	5
++5	1	3
++4	2	3
++2	4	1
++1	5	1
++SELECT * FROM t1 GROUP BY c2, c1, id ORDER BY c2 DESC, c1 DESC;
++id	c1	c2
++3	3	5
++4	2	3
++5	1	3
++1	5	1
++2	4	1
++SELECT * FROM t1 GROUP BY c2  ORDER BY c2, c1;
++id	c1	c2
++1	5	1
++4	2	3
++3	3	5
++SELECT * FROM t1 GROUP BY c2  ORDER BY c2 DESC, c1;
++id	c1	c2
++3	3	5
++4	2	3
++1	5	1
++SELECT * FROM t1 GROUP BY c2  ORDER BY c2 DESC, c1 DESC;
++id	c1	c2
++3	3	5
++4	2	3
++1	5	1
++DROP TABLE t1;
++End of 5.0 tests
+diff -urNad mysql-dfsg-5.0-5.0.51a~/mysql-test/t/group_by.test mysql-dfsg-5.0-5.0.51a/mysql-test/t/group_by.test
+--- mysql-dfsg-5.0-5.0.51a~/mysql-test/t/group_by.test	2008-01-11 10:23:11.000000000 -0500
++++ mysql-dfsg-5.0-5.0.51a/mysql-test/t/group_by.test	2008-03-19 16:18:19.000000000 -0400
+@@ -815,3 +815,38 @@
+ SELECT c,b   FROM t1 GROUP BY c,b;
+ 
+ DROP TABLE t1;
++
++#
++# Bug #32202: ORDER BY not working with GROUP BY
++#
++
++CREATE TABLE t1(
++  id INT AUTO_INCREMENT PRIMARY KEY, 
++  c1 INT NOT NULL, 
++  c2 INT NOT NULL,
++  UNIQUE KEY (c2,c1));
++
++INSERT INTO t1(c1,c2) VALUES (5,1), (4,1), (3,5), (2,3), (1,3);
++
++# Show that the test cases from the bug report pass
++SELECT * FROM t1 ORDER BY c1;
++SELECT * FROM t1 GROUP BY id ORDER BY c1;
++
++# Show that DESC is handled correctly
++SELECT * FROM t1 GROUP BY id ORDER BY id DESC;
++
++# Show that results are correctly ordered when ORDER BY fields
++# are a subset of GROUP BY ones
++SELECT * FROM t1 GROUP BY c2 ,c1, id ORDER BY c2, c1;
++SELECT * FROM t1 GROUP BY c2, c1, id ORDER BY c2 DESC, c1;
++SELECT * FROM t1 GROUP BY c2, c1, id ORDER BY c2 DESC, c1 DESC;
++
++# Show that results are correctly ordered when GROUP BY fields
++# are a subset of ORDER BY ones
++SELECT * FROM t1 GROUP BY c2  ORDER BY c2, c1;
++SELECT * FROM t1 GROUP BY c2  ORDER BY c2 DESC, c1;
++SELECT * FROM t1 GROUP BY c2  ORDER BY c2 DESC, c1 DESC;
++
++DROP TABLE t1;
++
++--echo End of 5.0 tests
+diff -urNad mysql-dfsg-5.0-5.0.51a~/sql/sql_select.cc mysql-dfsg-5.0-5.0.51a/sql/sql_select.cc
+--- mysql-dfsg-5.0-5.0.51a~/sql/sql_select.cc	2008-03-19 16:18:01.000000000 -0400
++++ mysql-dfsg-5.0-5.0.51a/sql/sql_select.cc	2008-03-19 16:18:19.000000000 -0400
+@@ -1065,10 +1065,19 @@
+         We have found that grouping can be removed since groups correspond to
+         only one row anyway, but we still have to guarantee correct result
+         order. The line below effectively rewrites the query from GROUP BY
+-        <fields> to ORDER BY <fields>. One exception is if skip_sort_order is
+-        set (see above), then we can simply skip GROUP BY.
++        <fields> to ORDER BY <fields>. There are two exceptions:
++        - if skip_sort_order is set (see above), then we can simply skip
++          GROUP BY;
++        - we can only rewrite ORDER BY if the ORDER BY fields are 'compatible'
++          with the GROUP BY ones, i.e. either one is a prefix of another.
++          We only check if the ORDER BY is a prefix of GROUP BY. In this case
++          test_if_subpart() copies the ASC/DESC attributes from the original
++          ORDER BY fields.
++          If GROUP BY is a prefix of ORDER BY, then it is safe to leave
++          'order' as is.
+        */
+-      order= skip_sort_order ? 0 : group_list;
++      if (!order || test_if_subpart(group_list, order))
++          order= skip_sort_order ? 0 : group_list;
+       group_list= 0;
+       group= 0;
+     }

Added: trunk/debian/patches/57_fix_mysql_replication.dpatch
===================================================================
--- trunk/debian/patches/57_fix_mysql_replication.dpatch	                        (rev 0)
+++ trunk/debian/patches/57_fix_mysql_replication.dpatch	2008-06-05 09:15:09 UTC (rev 1247)
@@ -0,0 +1,53 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 57_fix_mysql_replication.dpatch by Norbert Tretkowski <nobse at debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: http://bugs.mysql.com/bug.php?id=28597
+
+ at DPATCH@
+diff -Nrup a/mysql-test/t/rpl_dual_pos_advance.test b/mysql-test/t/rpl_dual_pos_advance.test
+--- a/mysql-test/t/rpl_dual_pos_advance.test	2007-03-20 12:15:14 +02:00
++++ b/mysql-test/t/rpl_dual_pos_advance.test	2007-11-05 17:20:08 +02:00
+@@ -106,9 +106,3 @@ connection slave;
+ sync_with_master;
+ 
+ # End of 4.1 tests
+-
+-# Cleanup
+-# The A->B->A replication causes the master to start writing relay logs
+-# in var/run, remove them
+-remove_file $MYSQLTEST_VARDIR/run/master-relay-bin.000001;
+-remove_file $MYSQLTEST_VARDIR/run/master-relay-bin.index;
+diff -Nrup a/mysql-test/t/rpl_temporary.test b/mysql-test/t/rpl_temporary.test
+--- a/mysql-test/t/rpl_temporary.test	2007-02-27 15:54:31 +02:00
++++ b/mysql-test/t/rpl_temporary.test	2007-11-05 17:20:08 +02:00
+@@ -211,6 +211,8 @@ select * from t1;
+ connection master; 
+ drop table t1;
+ 
++--remove_file $MYSQLTEST_VARDIR/tmp/bug14157.sql
++
+ # Delete the anonymous users
+ source include/delete_anonymous_users.inc;
+ 
+diff -Nrup a/sql/log.cc b/sql/log.cc
+--- a/sql/log.cc	2007-07-30 18:27:30 +03:00
++++ b/sql/log.cc	2007-11-05 17:20:08 +02:00
+@@ -448,13 +448,10 @@ const char *MYSQL_LOG::generate_name(con
+ {
+   if (!log_name || !log_name[0])
+   {
+-    /*
+-      TODO: The following should be using fn_format();  We just need to
+-      first change fn_format() to cut the file name if it's too long.
+-    */
+-    strmake(buff, pidfile_name,FN_REFLEN-5);
+-    strmov(fn_ext(buff),suffix);
+-    return (const char *)buff;
++    strmake(buff, pidfile_name, FN_REFLEN - strlen(suffix) - 1);
++    return (const char *)
++      fn_format(buff, buff, "", suffix, MYF(MY_REPLACE_EXT|MY_REPLACE_DIR));
++
+   }
+   // get rid of extension if the log is binary to avoid problems
+   if (strip_ext)

Added: trunk/debian/patches/90_upstreamdebiandir.dpatch
===================================================================
--- trunk/debian/patches/90_upstreamdebiandir.dpatch	                        (rev 0)
+++ trunk/debian/patches/90_upstreamdebiandir.dpatch	2008-06-05 09:15:09 UTC (rev 1247)
@@ -0,0 +1,73 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 90_upstreamdebiandir.dpatch by  <sean at rangda.stickybit.se>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+ at DPATCH@
+diff -urNad mysql-dfsg-5.0-5.0.51a~/Makefile.am mysql-dfsg-5.0-5.0.51a/Makefile.am
+--- mysql-dfsg-5.0-5.0.51a~/Makefile.am	2008-01-11 12:43:18.000000000 -0200
++++ mysql-dfsg-5.0-5.0.51a/Makefile.am	2008-02-19 16:38:21.948929495 -0300
+@@ -33,7 +33,7 @@
+ 			@thread_dirs@ pstack \
+ 			@sql_union_dirs@ scripts @man_dirs@ tests SSL\
+ 			BUILD netware os2 @libmysqld_dirs@ \
+-			@bench_dirs@ support-files @tools_dirs@ win debian
++			@bench_dirs@ support-files @tools_dirs@ win
+ 
+ # Run these targets before any others, also make part of clean target,
+ # to make sure we create new links after a clean.
+diff -urNad mysql-dfsg-5.0-5.0.51a~/Makefile.in mysql-dfsg-5.0-5.0.51a/Makefile.in
+--- mysql-dfsg-5.0-5.0.51a~/Makefile.in	2008-02-19 16:34:10.506600613 -0300
++++ mysql-dfsg-5.0-5.0.51a/Makefile.in	2008-02-19 16:37:53.079284308 -0300
+@@ -386,7 +386,7 @@
+ 			@thread_dirs@ pstack \
+ 			@sql_union_dirs@ scripts @man_dirs@ tests SSL\
+ 			BUILD netware os2 @libmysqld_dirs@ \
+-			@bench_dirs@ support-files @tools_dirs@ win debian
++			@bench_dirs@ support-files @tools_dirs@ win 
+ 
+ 
+ # Run these targets before any others, also make part of clean target,
+@@ -594,7 +594,7 @@
+ distdir: $(DISTFILES)
+ 	$(am__remove_distdir)
+ 	mkdir $(distdir)
+-	$(mkdir_p) $(distdir)/bdb $(distdir)/config/ac-macros $(distdir)/debian $(distdir)/include $(distdir)/libmysql $(distdir)/ndb/include $(distdir)/ndb/src
++	$(mkdir_p) $(distdir)/bdb $(distdir)/config/ac-macros $(distdir)/include $(distdir)/libmysql $(distdir)/ndb/include $(distdir)/ndb/src
+ 	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ 	list='$(DISTFILES)'; for file in $$list; do \
+diff -urNad mysql-dfsg-5.0-5.0.51a~/configure mysql-dfsg-5.0-5.0.51a/configure
+--- mysql-dfsg-5.0-5.0.51a~/configure	2008-02-19 16:34:14.378821279 -0300
++++ mysql-dfsg-5.0-5.0.51a/configure	2008-02-19 16:34:53.177032263 -0300
+@@ -41886,7 +41886,7 @@
+ 
+ 
+ # Output results
+-                                                                                                                                                                                                                                                                                                                                                                                                                                                        ac_config_files="$ac_config_files Makefile extra/Makefile mysys/Makefile strings/Makefile regex/Makefile heap/Makefile myisam/Makefile myisammrg/Makefile os2/Makefile os2/include/Makefile os2/include/sys/Makefile man/Makefile BUILD/Makefile vio/Makefile libmysql/Makefile client/Makefile pstack/Makefile pstack/aout/Makefile sql/Makefile sql/share/Makefile sql-common/Makefile SSL/Makefile dbug/Makefile scripts/Makefile include/Makefile sql-bench/Makefile server-tools/Makefile server-tools/instance-manager/Makefile tests/Makefile Docs/Makefile support-files/Makefile support-files/MacOSX/Makefile support-files/RHEL4-SElinux/Makefile mysql-test/Makefile netware/Makefile include/mysql_version.h cmd-line-utils/Makefile cmd-line-utils/libedit/Makefile win/Makefile zlib/Makefile debian/Makefile debian/defs.mk debian/control cmd-line-utils/readline/Makefile"
++                                                                                                                                                                                                                                                                                                                                                                                                                                                        ac_config_files="$ac_config_files Makefile extra/Makefile mysys/Makefile strings/Makefile regex/Makefile heap/Makefile myisam/Makefile myisammrg/Makefile os2/Makefile os2/include/Makefile os2/include/sys/Makefile man/Makefile BUILD/Makefile vio/Makefile libmysql/Makefile client/Makefile pstack/Makefile pstack/aout/Makefile sql/Makefile sql/share/Makefile sql-common/Makefile SSL/Makefile dbug/Makefile scripts/Makefile include/Makefile sql-bench/Makefile server-tools/Makefile server-tools/instance-manager/Makefile tests/Makefile Docs/Makefile support-files/Makefile support-files/MacOSX/Makefile support-files/RHEL4-SElinux/Makefile mysql-test/Makefile netware/Makefile include/mysql_version.h cmd-line-utils/Makefile cmd-line-utils/libedit/Makefile win/Makefile zlib/Makefile cmd-line-utils/readline/Makefile"
+ 
+            ac_config_commands="$ac_config_commands default"
+ 
+@@ -42612,9 +42612,6 @@
+   "cmd-line-utils/libedit/Makefile" ) CONFIG_FILES="$CONFIG_FILES cmd-line-utils/libedit/Makefile" ;;
+   "win/Makefile" ) CONFIG_FILES="$CONFIG_FILES win/Makefile" ;;
+   "zlib/Makefile" ) CONFIG_FILES="$CONFIG_FILES zlib/Makefile" ;;
+-  "debian/Makefile" ) CONFIG_FILES="$CONFIG_FILES debian/Makefile" ;;
+-  "debian/defs.mk" ) CONFIG_FILES="$CONFIG_FILES debian/defs.mk" ;;
+-  "debian/control" ) CONFIG_FILES="$CONFIG_FILES debian/control" ;;
+   "cmd-line-utils/readline/Makefile" ) CONFIG_FILES="$CONFIG_FILES cmd-line-utils/readline/Makefile" ;;
+   "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
+diff -urNad mysql-dfsg-5.0-5.0.51a~/configure.in mysql-dfsg-5.0-5.0.51a/configure.in
+--- mysql-dfsg-5.0-5.0.51a~/configure.in	2008-02-19 16:34:15.042859120 -0300
++++ mysql-dfsg-5.0-5.0.51a/configure.in	2008-02-19 16:38:06.916072821 -0300
+@@ -3000,7 +3000,6 @@
+  cmd-line-utils/libedit/Makefile dnl
+  win/Makefile dnl
+  zlib/Makefile dnl
+- debian/Makefile debian/defs.mk debian/control dnl
+  cmd-line-utils/readline/Makefile)
+  AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)
+  AC_OUTPUT


Property changes on: trunk/debian/patches/90_upstreamdebiandir.dpatch
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/debian/patches/91_SECURITY_CVE-2007-5925.dpatch
===================================================================
--- trunk/debian/patches/91_SECURITY_CVE-2007-5925.dpatch	                        (rev 0)
+++ trunk/debian/patches/91_SECURITY_CVE-2007-5925.dpatch	2008-06-05 09:15:09 UTC (rev 1247)
@@ -0,0 +1,123 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 91_SECURITY_CVE-2007-5925.dpatch by Norbert Tretkowski <nobse at debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Fix for CVE-2007-5925: The convert_search_mode_to_innobase function in
+## DP: ha_innodb.cc in the InnoDB engine in MySQL 5.1.23-BK and earlier allows
+## DP: remote authenticated users to cause a denial of service (database crash)
+## DP: via a certain CONTAINS operation on an indexed column, which triggers an
+## DP: assertion error. (closes: #451235)
+
+ at DPATCH@
+diff -ru old/innobase/include/db0err.h new/innobase/include/db0err.h
+--- old/innobase/include/db0err.h	2007-07-04 16:06:59.000000000 +0300
++++ new/innobase/include/db0err.h	2007-11-15 10:23:51.000000000 +0200
+@@ -57,6 +57,18 @@
+ 					buffer pool (for big transactions,
+ 					InnoDB stores the lock structs in the
+ 					buffer pool) */
++#define DB_FOREIGN_DUPLICATE_KEY 46	/* foreign key constraints
++					activated by the operation would
++					lead to a duplicate key in some
++					table */
++#define DB_TOO_MANY_CONCURRENT_TRXS 47	/* when InnoDB runs out of the
++					preconfigured undo slots, this can
++					only happen when there are too many
++					concurrent transactions */
++#define DB_UNSUPPORTED		48	/* when InnoDB sees any artefact or
++					a feature that it can't recoginize or
++					work with e.g., FT indexes created by
++					a later version of the engine. */
+ 
+ /* The following are partial failure codes */
+ #define DB_FAIL 		1000
+diff -ru old/innobase/include/page0cur.h new/innobase/include/page0cur.h
+--- old/innobase/include/page0cur.h	2007-07-04 16:06:10.000000000 +0300
++++ new/innobase/include/page0cur.h	2007-11-15 10:23:51.000000000 +0200
+@@ -22,6 +22,7 @@
+ 
+ /* Page cursor search modes; the values must be in this order! */
+ 
++#define	PAGE_CUR_UNSUPP	0
+ #define	PAGE_CUR_G	1
+ #define	PAGE_CUR_GE	2
+ #define	PAGE_CUR_L	3
+diff -ru old/sql/ha_innodb.cc new/sql/ha_innodb.cc
+--- old/sql/ha_innodb.cc	2007-07-04 16:06:48.000000000 +0300
++++ new/sql/ha_innodb.cc	2007-11-15 10:25:55.000000000 +0200
+@@ -526,6 +526,9 @@
+  		}
+ 
+     		return(HA_ERR_LOCK_TABLE_FULL);
++ 	} else if (error == DB_UNSUPPORTED) {
++ 
++ 		return(HA_ERR_UNSUPPORTED);
+     	} else {
+     		return(-1);			// Unknown error
+     	}
+@@ -3689,11 +3692,21 @@
+ 		  and comparison of non-latin1 char type fields in
+ 		  innobase_mysql_cmp() to get PAGE_CUR_LE_OR_EXTENDS to
+ 		  work correctly. */
+-
+-		default:			assert(0);
++		case HA_READ_MBR_CONTAIN:
++		case HA_READ_MBR_INTERSECT:
++		case HA_READ_MBR_WITHIN:
++		case HA_READ_MBR_DISJOINT:
++			my_error(ER_TABLE_CANT_HANDLE_SPKEYS, MYF(0));
++			return(PAGE_CUR_UNSUPP);
++		/* do not use "default:" in order to produce a gcc warning:
++		enumeration value '...' not handled in switch
++		(if -Wswitch or -Wall is used)
++		*/
+ 	}
+ 
+-	return(0);
++	my_error(ER_CHECK_NOT_IMPLEMENTED, MYF(0), "this functionality");
++
++	return(PAGE_CUR_UNSUPP);
+ }
+ 
+ /*
+@@ -3831,11 +3844,18 @@
+ 
+ 	last_match_mode = (uint) match_mode;
+ 
+-	innodb_srv_conc_enter_innodb(prebuilt->trx);
++	if (mode != PAGE_CUR_UNSUPP) {
+ 
+-	ret = row_search_for_mysql((byte*) buf, mode, prebuilt, match_mode, 0);
++		innodb_srv_conc_enter_innodb(prebuilt->trx);
+ 
+-	innodb_srv_conc_exit_innodb(prebuilt->trx);
++		ret = row_search_for_mysql((byte*) buf, mode, prebuilt,
++					   match_mode, 0);
++
++		innodb_srv_conc_exit_innodb(prebuilt->trx);
++	} else {
++
++		ret = DB_UNSUPPORTED;
++	}
+ 
+ 	if (ret == DB_SUCCESS) {
+ 		error = 0;
+@@ -5150,8 +5170,16 @@
+ 	mode2 = convert_search_mode_to_innobase(max_key ? max_key->flag :
+                                                 HA_READ_KEY_EXACT);
+ 
+-	n_rows = btr_estimate_n_rows_in_range(index, range_start,
+-						mode1, range_end, mode2);
++	if (mode1 != PAGE_CUR_UNSUPP && mode2 != PAGE_CUR_UNSUPP) {
++
++		n_rows = btr_estimate_n_rows_in_range(index, range_start,
++						      mode1, range_end,
++						      mode2);
++	} else {
++
++		n_rows = 0;
++	}
++
+ 	dtuple_free_for_mysql(heap1);
+ 	dtuple_free_for_mysql(heap2);
+ 

Modified: trunk/debian/rules
===================================================================
--- trunk/debian/rules	2008-05-28 12:31:47 UTC (rev 1246)
+++ trunk/debian/rules	2008-06-05 09:15:09 UTC (rev 1247)
@@ -105,6 +105,7 @@
 		--with-csv-storage-engine \
 		--with-federated-storage-engine \
 		--with-blackhole-storage-engine \
+		--with-sphinx-storage-engine \
 		--without-embedded-server \
 		--with-ndbcluster \
 		--with-ndb-ccflags="-fPIC" \




More information about the Pkg-mysql-commits mailing list