Hello community,
here is the log from the commit of package mysql for openSUSE:Factory
checked in at Thu Jul 30 22:39:12 CEST 2009.
--------
--- mysql/mysql.changes 2009-07-24 17:35:48.000000000 +0200
+++ /mounts/work_src_done/STABLE/mysql/mysql.changes 2009-07-30 08:08:28.000000000 +0200
@@ -1,0 +2,14 @@
+Tue Jul 28 17:10:31 CEST 2009 - mhrusecky@suse.cz
+
+- Applying upstream patch for upstream bug#43594
+ (hotcopy will ignore log tables) (bnc#525325)
+- Not using bmove512 as it may slow things down
+ (see upstream bug#19975)
+
+-------------------------------------------------------------------
+Mon Jul 27 14:45:24 CEST 2009 - mhrusecky@suse.cz
+
+- Applying upstream patch for upstream bug#36259
+ 'Optimizing with ORDER BY'
+
+-------------------------------------------------------------------
@@ -4,0 +19,11 @@
+
+-------------------------------------------------------------------
+Tue Jul 7 11:19:05 CEST 2009 - mhrusecky@suse.cz
+
+- updated to 5.1.36, see
+ http://dev.mysql.com/doc/refman/5.1/en/news-5-1-36.html
+
+-------------------------------------------------------------------
+Fri Jun 26 11:09:34 CEST 2009 - mhrusecky@suse.cz
+
+- fixed rcmysql status
calling whatdependson for head-i586
Old:
----
minmem
mysql-5.1.35-test-events_stress-cleanup.patch
mysql-5.1.35.tar.bz2
New:
----
mysql-5.1.36-bmove512.patch
mysql-5.1.36-bug36259.patch
mysql-5.1.36-hotcopy.patch
mysql-5.1.36.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ mysql.spec ++++++
--- /var/tmp/diff_new_pack.tVGZu2/_old 2009-07-30 22:37:09.000000000 +0200
+++ /var/tmp/diff_new_pack.tVGZu2/_new 2009-07-30 22:37:09.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package mysql (Version 5.1.35)
+# spec file for package mysql (Version 5.1.36)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -26,11 +26,12 @@
Name: mysql
Summary: A True Multiuser, Multithreaded SQL Database Server
-Version: 5.1.35
-Release: 2
+Version: 5.1.36
+Release: 1
License: GPL v2 only
Group: Productivity/Databases/Servers
Url: http://www.mysql.com
+# http://dev.mysql.com/get/Downloads/MySQL-5.1/%{name}-%{version}.tar.gz/from/pick
Source: mysql-%{version}.tar.bz2
Source3: README.debug
Source4: suse-test-run
@@ -80,11 +81,17 @@
Patch32: mysql-5.1.34-code-cleanup.patch
# PATCH-FIX-SUSE mysql-5.1.35-test-rpl_ndb_circular.patch [] mhrusecky@suse.cz -- better cleanup after rpl_ndb_circular* tests - bug is known to upstream but no clean solution exists (this may also fail, it just happens less)
Patch33: mysql-5.1.35-test-rpl_ndb_circular.patch
-# PATCH-FIX-UPSTREAM mysql-5.1.35-test-events_stress-cleanup.patch [ upstream#45617 ] mhrusecky@suse.cz -- cleanup at the end of the test
-# http://bugs.mysql.com/bug.php?id=45617
-Patch34: mysql-5.1.35-test-events_stress-cleanup.patch
# PATCH-FIX-SUSE mysql-5.1.35-test-utf8.patch [] mhrusecky@suse.cz -- we use utf-8 by default which produces different output with few tests
Patch35: mysql-5.1.35-test-utf8.patch
+# PATCH-FIX_UPSTREAM mysql-5.1.36-bug36259.patch [ upstream#36259 ] mhrusecky@suse.cz -- optimization of 'ORDER BY' query
+# http://bugs.mysql.com/bug.php?id=36259
+Patch36: mysql-5.1.36-bug36259.patch
+# PATCH-FIX-UPSTREAM mysql-5.1.36-bmove512.patch [ upstream#19975 ] mhrusecky@suse.cz -- using standard memcpy instead of bmove512 as it should be beeter
+# http://bugs.mysql.com/bug.php?id=19975
+Patch37: mysql-5.1.36-bmove512.patch
+# PATCH-FIX-UPSTREAM mysql-5.1.36-hotcopy.patch [ upstream#43594, bnc#525325 ] mhrusecky@suse.cz -- hotcopy ignores log tables
+# http://bugs.mysql.com/bug.php?id=43594
+Patch38: mysql-5.1.36-hotcopy.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
PreReq: /usr/sbin/useradd /usr/sbin/groupadd
PreReq: coreutils sed grep
@@ -107,7 +114,6 @@
Requires: mysql-client = %{version} perl-base
Obsoletes: mysql-Max <= %{version}
Provides: mysql-Max = %{version}
-#-------------------------------------------------------------------------------
%description
SQL is the most popular database language in the world. MySQL is a
@@ -138,7 +144,6 @@
Michael Widenius
David Axmark
---------------------------------------------------------------------------------
%package -n libmysqlclient-devel
#-------------------------------------------------------------------------------
@@ -149,7 +154,6 @@
Summary: MySQL Development Header Files and Libraries
License: GPL v2 only ; with additional permissions: EXCEPTIONS-CLIENT
Group: Development/Libraries/C and C++
-#-------------------------------------------------------------------------------
%description -n libmysqlclient-devel
This package contains the development header files and libraries
@@ -160,29 +164,24 @@
Michael Widenius
David Axmark
---------------------------------------------------------------------------------
%package -n libmysqld-devel
-License: GPL v2 only ; with additional permissions: EXCEPTIONS-CLIENT
#-------------------------------------------------------------------------------
+License: GPL v2 only ; with additional permissions: EXCEPTIONS-CLIENT
Summary: MySQL embedded server development files
# the headers files are the shared
Requires: libmysqlclient-devel = %version
Group: Development/Libraries/C and C++
-#-------------------------------------------------------------------------------
%description -n libmysqld-devel
This package contains the development header files and libraries
for developing application that embed the MySQL server
---------------------------------------------------------------------------------
-
%package client
-License: GPL v2 only ; with additional permissions: EXCEPTIONS-CLIENT
#-------------------------------------------------------------------------------
+License: GPL v2 only ; with additional permissions: EXCEPTIONS-CLIENT
Summary: MySQL Client
Group: Productivity/Databases/Clients
-#-------------------------------------------------------------------------------
%description client
This package contains the standard MySQL clients.
@@ -192,7 +191,6 @@
Michael Widenius
David Axmark
---------------------------------------------------------------------------------
%package bench
#-------------------------------------------------------------------------------
@@ -200,7 +198,6 @@
License: LGPL v2.1 only
Summary: MySQL - Benchmarks
Group: Productivity/Databases/Tools
-#-------------------------------------------------------------------------------
%description bench
This package contains MySQL benchmark scripts and data.
@@ -213,14 +210,11 @@
Michael Widenius
David Axmark
---------------------------------------------------------------------------------
-
%package -n libmysqlclient16
#-------------------------------------------------------------------------------
Summary: MySQL Shared Libraries
License: GPL v2 only ; with additional permissions: EXCEPTIONS-CLIENT
Group: Development/Libraries/Other
-#-------------------------------------------------------------------------------
%description -n libmysqlclient16
This package contains the shared libraries (.so) which certain
@@ -231,14 +225,11 @@
Michael Widenius
David Axmark
---------------------------------------------------------------------------------
-
%package -n libmysqlclient_r16
#-------------------------------------------------------------------------------
Summary: MySQL Shared Libraries
License: GPL v2 only ; with additional permissions: EXCEPTIONS-CLIENT
Group: Development/Libraries/Other
-#-------------------------------------------------------------------------------
%description -n libmysqlclient_r16
This package contains the shared libraries (.so) which certain
@@ -249,15 +240,13 @@
Michael Widenius
David Axmark
---------------------------------------------------------------------------------
%package debug
-License: GPL v2 only ; with additional permissions: EXCEPTIONS-CLIENT
#-------------------------------------------------------------------------------
+License: GPL v2 only ; with additional permissions: EXCEPTIONS-CLIENT
Summary: MySQL server with debug options turned on
Group: Productivity/Databases/Servers
Requires: mysql = %{version}
-#-------------------------------------------------------------------------------
%description debug
A version of the mysql server that has some debug code turned on.
@@ -271,18 +260,15 @@
Michael Widenius
David Axmark
---------------------------------------------------------------------------------
-
%package test
-License: GPL v2 only ; with additional permissions: EXCEPTIONS-CLIENT
#-------------------------------------------------------------------------------
+License: GPL v2 only ; with additional permissions: EXCEPTIONS-CLIENT
Summary: MySQL testsuite
Group: Productivity/Databases/Servers
Requires: mysql = %{version} mysql-client = %{version} perl-DBD-mysql mysql-tools = %{version} mysql-bench = %{version}
%if 0%{?sles_version} > 10 || 0%{?suse_version} > 1030
Recommends: mysql-ndb-storage = %{version} mysql-ndb-tools = %{version} mysql-ndb-management = %{version}
%endif
-#-------------------------------------------------------------------------------
%description test
This package contains the MySQL test scripts and data.
@@ -294,17 +280,14 @@
Michael Widenius
David Axmark
---------------------------------------------------------------------------------
-
%package tools
-License: GPL v2 only ; with additional permissions: EXCEPTIONS-CLIENT
#-------------------------------------------------------------------------------
+License: GPL v2 only ; with additional permissions: EXCEPTIONS-CLIENT
Summary: MySQL tools
Group: Productivity/Databases/Servers
Requires: perl-DBD-mysql
# make sure this package is installed when updating from 10.2 and older
Provides: mysql:/usr/bin/mysqlhotcopy mysql-client:/usr/bin/perror
-#-------------------------------------------------------------------------------
%description tools
A set of scripts for administering a MySQL server or developing
@@ -315,25 +298,21 @@
Michael Widenius
David Axmark
---------------------------------------------------------------------------------
%package ndb-storage
-License: GPL v2 only ; with additional permissions: EXCEPTIONS-CLIENT
#-------------------------------------------------------------------------------
+License: GPL v2 only ; with additional permissions: EXCEPTIONS-CLIENT
Summary: MySQL - ndbcluster storage engine
Group: Productivity/Databases/Servers
-#-------------------------------------------------------------------------------
%description ndb-storage
This package contains the ndbcluster storage engine.
It is necessary to have this package installed on all
computers that should store ndbcluster table data.
---------------------------------------------------------------------------------
-
%package ndb-management
-License: GPL v2 only ; with additional permissions: EXCEPTIONS-CLIENT
#-------------------------------------------------------------------------------
+License: GPL v2 only ; with additional permissions: EXCEPTIONS-CLIENT
Summary: MySQL - ndbcluster storage engine management
Group: Productivity/Databases/Servers
#-------------------------------------------------------------------------------
@@ -343,40 +322,32 @@
It is necessary to have this package installed on at least
one computer in the cluster.
---------------------------------------------------------------------------------
-
%package ndb-tools
-License: GPL v2 only ; with additional permissions: EXCEPTIONS-CLIENT
#-------------------------------------------------------------------------------
+License: GPL v2 only ; with additional permissions: EXCEPTIONS-CLIENT
Summary: MySQL - ndbcluster storage engine basic tools
Group: Productivity/Databases/Servers
-#-------------------------------------------------------------------------------
%description ndb-tools
This package contains ndbcluster storage engine basic tools.
---------------------------------------------------------------------------------
-
%package ndb-extra
-License: GPL v2 only ; with additional permissions: EXCEPTIONS-CLIENT
#-------------------------------------------------------------------------------
+License: GPL v2 only ; with additional permissions: EXCEPTIONS-CLIENT
Summary: MySQL - ndbcluster storage engine extra tools
Group: Productivity/Databases/Servers
-#-------------------------------------------------------------------------------
%description ndb-extra
This package contains some extra ndbcluster storage engine tools for the
advanced user. They should be used with caution.
---------------------------------------------------------------------------------
-
%prep
#-------------------------------------------------------------------------------
%setup -q -n mysql-%version
cp %_sourcedir/suse-test-run .
-%patch2 -p1
+%patch2
%patch3
-%patch4 -p1
+%patch4
%patch5
%patch7
%patch8
@@ -394,8 +365,10 @@
%patch31
%patch32 -p1
%patch33
-%patch34
%patch35
+%patch36
+%patch37
+%patch38
# remove unneeded manpages ('make install' basically installs everything under
# man/*)
rm -f man/mysqlman.1 # dummy fallback manpage
@@ -740,6 +713,7 @@
%{_bindir}/my_safe_process
%_mandir/man1/mysql-test-run.pl.1*
%_mandir/man1/mysql-stress-test.pl.1*
+/usr/share/mysql-test/valgrind.supp
%dir %attr(755, root, root)/usr/share/mysql-test
/usr/share/mysql-test/[^v]*
%dir %attr(755, mysql, mysql) /usr/share/mysql-test/var
@@ -763,7 +737,5 @@
%files ndb-extra -f mysql-ndb-extra.files
#-------------------------------------------------------------------------------
-#-------------------------------------------------------------------------------
-#-------------------------------------------------------------------------------
%changelog
++++++ mysql-5.1.36-bmove512.patch ++++++
Index: mysys/mf_keycache.c
===================================================================
--- mysys/mf_keycache.c.orig
+++ mysys/mf_keycache.c
@@ -2646,10 +2646,7 @@ uchar *key_cache_read(KEY_CACHE *keycach
#endif
/* Copy data from the cache buffer */
- if (!(read_length & 511))
- bmove512(buff, block->buffer+offset, read_length);
- else
- memcpy(buff, block->buffer+offset, (size_t) read_length);
+ memcpy(buff, block->buffer+offset, (size_t) read_length);
#if !defined(SERIALIZED_READ_FROM_CACHE)
keycache_pthread_mutex_lock(&keycache->cache_lock);
@@ -2857,10 +2854,7 @@ int key_cache_insert(KEY_CACHE *keycache
#endif
/* Copy data from buff */
- if (!(read_length & 511))
- bmove512(block->buffer+offset, buff, read_length);
- else
- memcpy(block->buffer+offset, buff, (size_t) read_length);
+ memcpy(block->buffer+offset, buff, (size_t) read_length);
#if !defined(SERIALIZED_READ_FROM_CACHE)
keycache_pthread_mutex_lock(&keycache->cache_lock);
@@ -3164,10 +3158,7 @@ int key_cache_write(KEY_CACHE *keycache,
#if !defined(SERIALIZED_READ_FROM_CACHE)
keycache_pthread_mutex_unlock(&keycache->cache_lock);
#endif
- if (!(read_length & 511))
- bmove512(block->buffer+offset, buff, read_length);
- else
- memcpy(block->buffer+offset, buff, (size_t) read_length);
+ memcpy(block->buffer+offset, buff, (size_t) read_length);
#if !defined(SERIALIZED_READ_FROM_CACHE)
keycache_pthread_mutex_lock(&keycache->cache_lock);
++++++ mysql-5.1.36-bug36259.patch ++++++
=== modified file 'mysql-test/include/mix1.inc'
Index: mysql-test/include/mix1.inc
===================================================================
--- mysql-test/include/mix1.inc.orig
+++ mysql-test/include/mix1.inc
@@ -1498,9 +1498,9 @@ INSERT INTO t1 VALUES
(4,1,3,'pk',NULL),(5,1,3,'c2',NULL),
(2,1,4,'c_extra',NULL),(3,1,4,'c_extra',NULL);
-EXPLAIN SELECT * FROM t1 WHERE tid = 1 AND vid = 3 ORDER BY idx DESC;
+EXPLAIN SELECT * FROM t1 FORCE INDEX (PRIMARY) WHERE tid = 1 AND vid = 3 ORDER BY idx DESC;
-SELECT * FROM t1 WHERE tid = 1 AND vid = 3 ORDER BY idx DESC;
+SELECT * FROM t1 FORCE INDEX (PRIMARY) WHERE tid = 1 AND vid = 3 ORDER BY idx DESC;
DROP TABLE t1;
Index: mysql-test/r/innodb_mysql.result
===================================================================
--- mysql-test/r/innodb_mysql.result.orig
+++ mysql-test/r/innodb_mysql.result
@@ -1701,10 +1701,10 @@ INSERT INTO t1 VALUES
(4,1,2,'c2',NULL),(5,1,2,'c1',NULL),(2,1,3,'c2',NULL),(3,1,3,'c2',NULL),
(4,1,3,'pk',NULL),(5,1,3,'c2',NULL),
(2,1,4,'c_extra',NULL),(3,1,4,'c_extra',NULL);
-EXPLAIN SELECT * FROM t1 WHERE tid = 1 AND vid = 3 ORDER BY idx DESC;
+EXPLAIN SELECT * FROM t1 FORCE INDEX (PRIMARY) WHERE tid = 1 AND vid = 3 ORDER BY idx DESC;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index vid PRIMARY 12 NULL 16 Using where
-SELECT * FROM t1 WHERE tid = 1 AND vid = 3 ORDER BY idx DESC;
+1 SIMPLE t1 index NULL PRIMARY 12 NULL 16 Using where
+SELECT * FROM t1 FORCE INDEX (PRIMARY) WHERE tid = 1 AND vid = 3 ORDER BY idx DESC;
vid tid idx name type
3 1 4 c_extra NULL
3 1 3 c2 NULL
@@ -2137,4 +2137,85 @@ GROUP BY t1.b;
a b c d a b e a b
1 1 1 0 1 1 2 1 1
DROP TABLE t1, t2, t3;
+#
+# Bug #45828: Optimizer won't use partial primary key if another
+# index can prevent filesort
+#
+CREATE TABLE `t1` (
+c1 int NOT NULL,
+c2 int NOT NULL,
+c3 int NOT NULL,
+PRIMARY KEY (c1,c2),
+KEY (c3)
+) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (5,2,1246276747);
+INSERT INTO t1 VALUES (2,1,1246281721);
+INSERT INTO t1 VALUES (7,3,1246281756);
+INSERT INTO t1 VALUES (4,2,1246282139);
+INSERT INTO t1 VALUES (3,1,1246282230);
+INSERT INTO t1 VALUES (1,0,1246282712);
+INSERT INTO t1 VALUES (8,3,1246282765);
+INSERT INTO t1 SELECT c1+10,c2+10,c3+10 FROM t1;
+INSERT INTO t1 SELECT c1+100,c2+100,c3+100 from t1;
+INSERT INTO t1 SELECT c1+1000,c2+1000,c3+1000 from t1;
+INSERT INTO t1 SELECT c1+10000,c2+10000,c3+10000 from t1;
+INSERT INTO t1 SELECT c1+100000,c2+100000,c3+100000 from t1;
+INSERT INTO t1 SELECT c1+1000000,c2+1000000,c3+1000000 from t1;
+SELECT * FROM t1 WHERE c1 = 99999999 AND c3 > 1 ORDER BY c3;
+c1 c2 c3
+EXPLAIN SELECT * FROM t1 WHERE c1 = 99999999 AND c3 > 1 ORDER BY c3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref PRIMARY,c3 PRIMARY 4 const 1 Using where; Using filesort
+EXPLAIN SELECT * FROM t1 FORCE INDEX (PRIMARY) WHERE c1 = 99999999 AND c3 > 1 ORDER BY c3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref PRIMARY PRIMARY 4 const 1 Using where; Using filesort
+CREATE TABLE t2 (
+c1 int NOT NULL,
+c2 int NOT NULL,
+c3 int NOT NULL,
+KEY (c1,c2),
+KEY (c3)
+) ENGINE=InnoDB;
+explain SELECT * FROM t2 WHERE c1 = 99999999 AND c3 > 1 ORDER BY c3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ref c1,c3 c1 4 const 1 Using where; Using filesort
+DROP TABLE t1,t2;
+#
+# 36259: Optimizing with ORDER BY
+#
+CREATE TABLE `testable2` (
+`col1` int(10) NOT NULL AUTO_INCREMENT,
+`col2` int(10) unsigned NOT NULL DEFAULT '0',
+`col3` int(10) unsigned NOT NULL DEFAULT '0',
+`col4` varchar(5) DEFAULT NULL,
+`col5` int(10) unsigned NOT NULL,
+PRIMARY KEY (`col1`) USING BTREE,
+KEY `I2` (`col2`,`col3`,`col4`) USING BTREE
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+;
+insert into testable2 (col2, col3, col4, col5) values (1,1,'a', 1), (2,2,'b', 2);
+insert into testable2 (col2, col3, col4, col5) select rand()*10000, rand(
+)*10000, col4, col5 from testable2;
+insert into testable2 (col2, col3, col4, col5) select rand()*10000, rand(
+)*10000, col4, col5 from testable2;
+insert into testable2 (col2, col3, col4, col5) select rand()*10000, rand(
+)*10000, col4, col5 from testable2;
+insert into testable2 (col2, col3, col4, col5) select rand()*10000, rand(
+)*10000, col4, col5 from testable2;
+insert into testable2 (col2, col3, col4, col5) select rand()*10000, rand(
+)*10000, col4, col5 from testable2;
+insert into testable2 (col2, col3, col4, col5) select rand()*10000, rand(
+)*10000, col4, col5 from testable2;
+EXPLAIN SELECT * FROM testable2 where col2=1 and col3=1 order by col1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE testable2 ref I2 I2 8 const,const 1 Using where; Using filesort
+EXPLAIN SELECT * FROM testable2 force index(i2) where col2=1 and col3=1 order by
+col1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE testable2 ref I2 I2 8 const,const 1 Using where; Using filesort
+EXPLAIN SELECT * FROM testable2 force index(PRIMARY) where col2=1 and col3=1 order by
+col1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE testable2 index NULL PRIMARY 4 NULL 128 Using where
+DROP TABLE testable2;
End of 5.1 tests
Index: mysql-test/t/innodb_mysql.test
===================================================================
--- mysql-test/t/innodb_mysql.test.orig
+++ mysql-test/t/innodb_mysql.test
@@ -380,4 +380,94 @@ SELECT * FROM t1, t2, t3
DROP TABLE t1, t2, t3;
+--echo #
+--echo # Bug #45828: Optimizer won't use partial primary key if another
+--echo # index can prevent filesort
+--echo #
+
+# Create the table
+CREATE TABLE `t1` (
+ c1 int NOT NULL,
+ c2 int NOT NULL,
+ c3 int NOT NULL,
+ PRIMARY KEY (c1,c2),
+ KEY (c3)
+) ENGINE=InnoDB;
+
+# populate with data
+INSERT INTO t1 VALUES (5,2,1246276747);
+INSERT INTO t1 VALUES (2,1,1246281721);
+INSERT INTO t1 VALUES (7,3,1246281756);
+INSERT INTO t1 VALUES (4,2,1246282139);
+INSERT INTO t1 VALUES (3,1,1246282230);
+INSERT INTO t1 VALUES (1,0,1246282712);
+INSERT INTO t1 VALUES (8,3,1246282765);
+INSERT INTO t1 SELECT c1+10,c2+10,c3+10 FROM t1;
+INSERT INTO t1 SELECT c1+100,c2+100,c3+100 from t1;
+INSERT INTO t1 SELECT c1+1000,c2+1000,c3+1000 from t1;
+INSERT INTO t1 SELECT c1+10000,c2+10000,c3+10000 from t1;
+INSERT INTO t1 SELECT c1+100000,c2+100000,c3+100000 from t1;
+INSERT INTO t1 SELECT c1+1000000,c2+1000000,c3+1000000 from t1;
+
+# query and no rows will match the c1 condition, whereas all will match c3
+SELECT * FROM t1 WHERE c1 = 99999999 AND c3 > 1 ORDER BY c3;
+
+# SHOULD use the pk.
+# index on c3 will be used instead of primary key
+EXPLAIN SELECT * FROM t1 WHERE c1 = 99999999 AND c3 > 1 ORDER BY c3;
+
+# if we force the primary key, we can see the estimate is 1
+EXPLAIN SELECT * FROM t1 FORCE INDEX (PRIMARY) WHERE c1 = 99999999 AND c3 > 1 ORDER BY c3;
+
+
+CREATE TABLE t2 (
+ c1 int NOT NULL,
+ c2 int NOT NULL,
+ c3 int NOT NULL,
+ KEY (c1,c2),
+ KEY (c3)
+) ENGINE=InnoDB;
+
+# SHOULD use the pk.
+# if we switch it from a primary key to a regular index, it works correctly as well
+explain SELECT * FROM t2 WHERE c1 = 99999999 AND c3 > 1 ORDER BY c3;
+
+DROP TABLE t1,t2;
+
+
+--echo #
+--echo # 36259: Optimizing with ORDER BY
+--echo #
+
+CREATE TABLE `testable2` (
+ `col1` int(10) NOT NULL AUTO_INCREMENT,
+ `col2` int(10) unsigned NOT NULL DEFAULT '0',
+ `col3` int(10) unsigned NOT NULL DEFAULT '0',
+ `col4` varchar(5) DEFAULT NULL,
+ `col5` int(10) unsigned NOT NULL,
+ PRIMARY KEY (`col1`) USING BTREE,
+ KEY `I2` (`col2`,`col3`,`col4`) USING BTREE
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+;
+insert into testable2 (col2, col3, col4, col5) values (1,1,'a', 1), (2,2,'b', 2);
+insert into testable2 (col2, col3, col4, col5) select rand()*10000, rand(
+)*10000, col4, col5 from testable2;
+insert into testable2 (col2, col3, col4, col5) select rand()*10000, rand(
+)*10000, col4, col5 from testable2;
+insert into testable2 (col2, col3, col4, col5) select rand()*10000, rand(
+)*10000, col4, col5 from testable2;
+insert into testable2 (col2, col3, col4, col5) select rand()*10000, rand(
+)*10000, col4, col5 from testable2;
+insert into testable2 (col2, col3, col4, col5) select rand()*10000, rand(
+)*10000, col4, col5 from testable2;
+insert into testable2 (col2, col3, col4, col5) select rand()*10000, rand(
+)*10000, col4, col5 from testable2;
+EXPLAIN SELECT * FROM testable2 where col2=1 and col3=1 order by col1;
+EXPLAIN SELECT * FROM testable2 force index(i2) where col2=1 and col3=1 order by
+col1;
+EXPLAIN SELECT * FROM testable2 force index(PRIMARY) where col2=1 and col3=1 order by
+col1;
+
+DROP TABLE testable2;
+
--echo End of 5.1 tests
Index: sql/sql_select.cc
===================================================================
--- sql/sql_select.cc.orig
+++ sql/sql_select.cc
@@ -13147,7 +13147,7 @@ test_if_skip_sort_order(JOIN_TAB *tab,OR
temporary table + filesort could be cheaper for grouping
queries too.
*/
- if (is_covering ||
+ if ((ref_key < 0 && is_covering) ||
select_limit != HA_POS_ERROR ||
ref_key < 0 && (group || table->force_index))
{
++++++ mysql-5.1.36-hotcopy.patch ++++++
=== modified file 'scripts/mysqlhotcopy.sh'
--- scripts/mysqlhotcopy.sh 2008-03-07 20:45:40 +0000
+++ scripts/mysqlhotcopy.sh 2009-03-12 13:06:42 +0000
@@ -777,7 +777,24 @@ sub get_list_of_tables {
} || [];
warn "Unable to retrieve list of tables in $db: $@" if $@;
- return (map { $_->[0] } @$tables);
+ my @ignore_tables = ();
+
+ # Ignore tables for the mysql database
+ if ($db eq 'mysql') {
+ @ignore_tables = qw(general_log slow_log schema apply_status);
+ }
+
+ my @res = ();
+ if ($#ignore_tables > 1) {
+ my @tmp = (map { $_->[0] } @$tables);
+ for my $t (@tmp) {
+ push(@res, $t) if not exists { map { $_=>1 } @ignore_tables }->{$t};
+ }
+ } else {
+ @res = (map { $_->[0] } @$tables);
+ }
+
+ return @res;
}
sub quote_names {
++++++ mysql-5.1.35.tar.bz2 -> mysql-5.1.36.tar.bz2 ++++++
mysql/mysql-5.1.35.tar.bz2 /mounts/work_src_done/STABLE/mysql/mysql-5.1.36.tar.bz2 differ: char 11, line 1
++++++ mysql-cnf.patch ++++++
--- /var/tmp/diff_new_pack.tVGZu2/_old 2009-07-30 22:37:10.000000000 +0200
+++ /var/tmp/diff_new_pack.tVGZu2/_new 2009-07-30 22:37:10.000000000 +0200
@@ -1,7 +1,8 @@
-diff -Naru mysql-5.1.33-bak/support-files/my-huge.cnf.sh mysql-5.1.33/support-files/my-huge.cnf.sh
---- mysql-5.1.33-bak/support-files/my-huge.cnf.sh 2009-04-03 15:24:32.000000000 +0200
-+++ mysql-5.1.33/support-files/my-huge.cnf.sh 2009-04-03 15:24:49.000000000 +0200
-@@ -134,6 +134,10 @@
+Index: support-files/my-huge.cnf.sh
+===================================================================
+--- support-files/my-huge.cnf.sh.orig
++++ support-files/my-huge.cnf.sh
+@@ -131,6 +131,10 @@ server-id = 1
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50
@@ -12,10 +13,11 @@
[mysqldump]
quick
max_allowed_packet = 16M
-diff -Naru mysql-5.1.33-bak/support-files/my-large.cnf.sh mysql-5.1.33/support-files/my-large.cnf.sh
---- mysql-5.1.33-bak/support-files/my-large.cnf.sh 2009-04-03 15:24:32.000000000 +0200
-+++ mysql-5.1.33/support-files/my-large.cnf.sh 2009-04-03 15:24:49.000000000 +0200
-@@ -134,6 +134,10 @@
+Index: support-files/my-large.cnf.sh
+===================================================================
+--- support-files/my-large.cnf.sh.orig
++++ support-files/my-large.cnf.sh
+@@ -131,6 +131,10 @@ server-id = 1
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50
@@ -26,19 +28,20 @@
[mysqldump]
quick
max_allowed_packet = 16M
-diff -Naru mysql-5.1.33-bak/support-files/my-medium.cnf.sh mysql-5.1.33/support-files/my-medium.cnf.sh
---- mysql-5.1.33-bak/support-files/my-medium.cnf.sh 2009-04-03 15:24:32.000000000 +0200
-+++ mysql-5.1.33/support-files/my-medium.cnf.sh 2009-04-03 15:24:49.000000000 +0200
-@@ -26,6 +26,8 @@
+Index: support-files/my-medium.cnf.sh
+===================================================================
+--- support-files/my-medium.cnf.sh.orig
++++ support-files/my-medium.cnf.sh
+@@ -26,6 +26,8 @@ socket = @MYSQL_UNIX_ADDR@
[mysqld]
port = @MYSQL_TCP_PORT@
socket = @MYSQL_UNIX_ADDR@
+# Change following line if you want to store your database elsewhere
+datadir = /var/lib/mysql
skip-locking
- key_buffer = 16M
+ key_buffer_size = 16M
max_allowed_packet = 1M
-@@ -132,7 +134,13 @@
+@@ -129,7 +131,13 @@ server-id = 1
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50
@@ -52,10 +55,11 @@
quick
max_allowed_packet = 16M
-diff -Naru mysql-5.1.33-bak/support-files/my-small.cnf.sh mysql-5.1.33/support-files/my-small.cnf.sh
---- mysql-5.1.33-bak/support-files/my-small.cnf.sh 2009-04-03 15:24:32.000000000 +0200
-+++ mysql-5.1.33/support-files/my-small.cnf.sh 2009-04-03 15:24:49.000000000 +0200
-@@ -65,6 +65,10 @@
+Index: support-files/my-small.cnf.sh
+===================================================================
+--- support-files/my-small.cnf.sh.orig
++++ support-files/my-small.cnf.sh
+@@ -65,6 +65,10 @@ server-id = 1
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50
++++++ mysql-group.patch ++++++
--- /var/tmp/diff_new_pack.tVGZu2/_old 2009-07-30 22:37:10.000000000 +0200
+++ /var/tmp/diff_new_pack.tVGZu2/_new 2009-07-30 22:37:10.000000000 +0200
@@ -1,7 +1,8 @@
-diff -Naru mysql-5.1.34-bak/configure.in mysql-5.1.34/configure.in
---- mysql-5.1.34-bak/configure.in 2009-03-31 16:35:39.000000000 +0200
-+++ mysql-5.1.34/configure.in 2009-04-20 16:49:56.000000000 +0200
-@@ -772,6 +772,14 @@
+Index: configure.in
+===================================================================
+--- configure.in.orig
++++ configure.in
+@@ -772,6 +772,14 @@ AC_ARG_WITH(mysqld-user,
[ MYSQLD_USER=mysql ]
)
AC_SUBST(MYSQLD_USER)
@@ -16,10 +17,11 @@
# If we should allow LOAD DATA LOCAL
AC_MSG_CHECKING(If we should should enable LOAD DATA LOCAL by default)
-diff -Naru mysql-5.1.34-bak/scripts/Makefile.am mysql-5.1.34/scripts/Makefile.am
---- mysql-5.1.34-bak/scripts/Makefile.am 2009-03-31 16:38:52.000000000 +0200
-+++ mysql-5.1.34/scripts/Makefile.am 2009-04-20 16:49:56.000000000 +0200
-@@ -185,6 +185,7 @@
+Index: scripts/Makefile.am
+===================================================================
+--- scripts/Makefile.am.orig
++++ scripts/Makefile.am
+@@ -185,6 +185,7 @@ SUFFIXES = .sh
-e 's!@''TARGET_LINUX''@!@TARGET_LINUX@!' \
-e "s!@""CONF_COMMAND""@!@CONF_COMMAND@!" \
-e 's!@''MYSQLD_USER''@!@MYSQLD_USER@!' \
@@ -27,10 +29,11 @@
-e 's!@''STATIC_NSS_FLAGS''@!@STATIC_NSS_FLAGS@!' \
-e 's!@''NON_THREADED_LIBS''@!@NON_THREADED_LIBS@!' \
-e 's!@''ZLIB_DEPS''@!@ZLIB_DEPS@!' \
-diff -Naru mysql-5.1.34-bak/scripts/mysqld_safe.sh mysql-5.1.34/scripts/mysqld_safe.sh
---- mysql-5.1.34-bak/scripts/mysqld_safe.sh 2009-03-31 16:38:52.000000000 +0200
-+++ mysql-5.1.34/scripts/mysqld_safe.sh 2009-04-20 16:50:41.000000000 +0200
-@@ -19,6 +19,7 @@
+Index: scripts/mysqld_safe.sh
+===================================================================
+--- scripts/mysqld_safe.sh.orig
++++ scripts/mysqld_safe.sh
+@@ -19,6 +19,7 @@ logging=init
want_syslog=0
syslog_tag=
user='@MYSQLD_USER@'
@@ -38,7 +41,7 @@
pid_file=
err_log=
-@@ -162,6 +163,7 @@
+@@ -162,6 +163,7 @@ parse_arguments() {
--datadir=*) DATADIR="$val" ;;
--pid-file=*) pid_file="$val" ;;
--user=*) user="$val"; SET_USER=1 ;;
@@ -46,7 +49,7 @@
# these might have been set in a [mysqld_safe] section of my.cnf
# they are added to mysqld command line to override settings from my.cnf
-@@ -388,11 +390,17 @@
+@@ -388,11 +390,17 @@ then
if test "$user" != "root" -o $SET_USER = 1
then
USER_OPTION="--user=$user"
@@ -54,8 +57,8 @@
fi
# Change the err log to the right user, if it is in use
if [ $want_syslog -eq 0 ]; then
- touch $err_log
-- chown $user $err_log
+ touch "$err_log"
+- chown $user "$err_log"
+ if [ "$user" -a "$group" ]; then
+ chown $user:$group $err_log
+ else
@@ -65,7 +68,7 @@
fi
if test -n "$open_files"
then
-@@ -407,7 +415,12 @@
+@@ -407,7 +415,12 @@ mysql_unix_port_dir=`dirname $safe_mysql
if [ ! -d $mysql_unix_port_dir ]
then
mkdir $mysql_unix_port_dir
@@ -79,10 +82,11 @@
chmod 755 $mysql_unix_port_dir
fi
-diff -Naru mysql-5.1.34-bak/scripts/mysql_install_db.sh mysql-5.1.34/scripts/mysql_install_db.sh
---- mysql-5.1.34-bak/scripts/mysql_install_db.sh 2009-03-31 16:38:52.000000000 +0200
-+++ mysql-5.1.34/scripts/mysql_install_db.sh 2009-04-20 16:49:56.000000000 +0200
-@@ -28,6 +28,7 @@
+Index: scripts/mysql_install_db.sh
+===================================================================
+--- scripts/mysql_install_db.sh.orig
++++ scripts/mysql_install_db.sh
+@@ -28,6 +28,7 @@ args=""
defaults=""
mysqld_opt=""
user=""
@@ -90,7 +94,7 @@
force=0
in_rpm=0
-@@ -63,6 +64,11 @@
+@@ -63,6 +64,11 @@ Usage: $0 [OPTIONS]
user. You must be root to use this option. By default
mysqld runs using your current login name and files and
directories that it creates will be owned by you.
@@ -102,7 +106,7 @@
All other options are passed to the mysqld program
-@@ -103,11 +109,11 @@
+@@ -103,11 +109,11 @@ parse_arguments()
--builddir=*) builddir=`parse_arg "$arg"` ;;
--srcdir=*) srcdir=`parse_arg "$arg"` ;;
--ldata=*|--datadir=*) ldata=`parse_arg "$arg"` ;;
@@ -116,7 +120,7 @@
--skip-name-resolve) ip_only=1 ;;
--verbose) verbose=1 ;; # Obsolete
--rpm) in_rpm=1 ;;
-@@ -360,7 +366,12 @@
+@@ -360,7 +366,12 @@ do
fi
if test -w / -a ! -z "$user"
then
@@ -130,7 +134,7 @@
fi
done
-@@ -369,6 +380,11 @@
+@@ -369,6 +380,11 @@ then
args="$args --user=$user"
fi
++++++ mysqld_multi.patch ++++++
--- /var/tmp/diff_new_pack.tVGZu2/_old 2009-07-30 22:37:10.000000000 +0200
+++ /var/tmp/diff_new_pack.tVGZu2/_new 2009-07-30 22:37:10.000000000 +0200
@@ -2,6 +2,8 @@
scripts/mysqld_multi.sh | 108 ++++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 100 insertions(+), 8 deletions(-)
+Index: scripts/mysqld_multi.sh
+===================================================================
--- scripts/mysqld_multi.sh.orig
+++ scripts/mysqld_multi.sh
@@ -2,6 +2,7 @@
@@ -82,15 +84,7 @@
if ("--mysqladmin=" eq substr($options[$j], 0, 13))
{
# catch this and ignore
-@@ -316,6 +355,7 @@ sub start_mysqlds()
- $tmp.= " $options[$j]";
- }
- }
-+
- if ($opt_verbose && $com =~ m/\/safe_mysqld$/ && !$info_sent)
- {
- print "WARNING: safe_mysqld is being used to start mysqld. In this case you ";
-@@ -347,6 +387,58 @@ sub start_mysqlds()
+@@ -347,6 +386,58 @@ sub start_mysqlds()
}
####
@@ -149,7 +143,7 @@
#### stop multiple servers
####
-@@ -709,7 +801,7 @@ sub usage
+@@ -709,7 +800,7 @@ sub usage
$my_progname version $VER by Jani Tolonen
Description:
@@ -158,7 +152,7 @@
mysqld processes running in different TCP/IP ports and UNIX sockets.
$my_progname can read group [mysqld_multi] from my.cnf file. You may
-@@ -727,16 +819,16 @@ starting from 1. These groups should be
+@@ -727,16 +818,16 @@ starting from 1. These groups should be
[mysqld] group, but with those port, socket and any other options
that are to be used with each separate mysqld process. The number
in the group name has another function; it can be used for starting,
++++++ rc.mysql-multi ++++++
--- /var/tmp/diff_new_pack.tVGZu2/_old 2009-07-30 22:37:10.000000000 +0200
+++ /var/tmp/diff_new_pack.tVGZu2/_new 2009-07-30 22:37:10.000000000 +0200
@@ -472,7 +472,8 @@
mount -n -t proc proc /proc
test -e /proc/version || set_return_value 100
fi
- if [ -d "/proc/`cat "$pid_file"`" ]; then
+ pid="`cat "$pid_file"`"
+ if [ -d "/proc/$pid" ]; then
if exe=`readlink "/proc/$pid/exe"`; then
if [ "`echo "$exe" | grep "^$MYSQLD"`" ]; then
set_return_value 0
@@ -480,7 +481,7 @@
set_return_value 1
fi
else
- set_return_value 100
+ set_return_value 1
fi
else
set_return_value 1
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org