FreeBSD Bugzilla – Attachment 72754 Details for
Bug 105679
[PATCH] databases/mysql-server: SELECT DISTINCT sorting bugfix (introduced in 4.1.21)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
mysql-server-4.1.21_1.patch
mysql-server-4.1.21_1.patch (text/plain), 3.53 KB, created by
Michael Ranner
on 2006-11-19 20:30:19 UTC
(
hide
)
Description:
mysql-server-4.1.21_1.patch
Filename:
MIME Type:
Creator:
Michael Ranner
Created:
2006-11-19 20:30:19 UTC
Size:
3.53 KB
patch
obsolete
>diff -ruN --exclude=CVS /usr/ports/databases/mysql-server/Makefile /usr/ports/databases/mysql41-server.update/Makefile >--- /usr/ports/databases/mysql-server/Makefile Sun Nov 19 21:22:10 2006 >+++ /usr/ports/databases/mysql41-server.update/Makefile Sun Nov 19 21:20:54 2006 >@@ -7,7 +7,7 @@ > > PORTNAME?= mysql > PORTVERSION= 4.1.21 >-PORTREVISION?= 0 >+PORTREVISION?= 1 > CATEGORIES= databases > MASTER_SITES= ${MASTER_SITE_MYSQL} > MASTER_SITE_SUBDIR= MySQL-4.1 >diff -ruN --exclude=CVS /usr/ports/databases/mysql-server/files/patch-sql::sql_select.cc /usr/ports/databases/mysql41-server.update/files/patch-sql::sql_select.cc >--- /usr/ports/databases/mysql-server/files/patch-sql::sql_select.cc Thu Jan 1 01:00:00 1970 >+++ /usr/ports/databases/mysql41-server.update/files/patch-sql::sql_select.cc Sun Nov 19 21:20:27 2006 >@@ -0,0 +1,76 @@ >+--- sql/sql_select.cc.orig Wed Jul 19 17:10:38 2006 >++++ sql/sql_select.cc Sun Nov 19 21:07:19 2006 >+@@ -630,6 +630,36 @@ >+ if (!order && org_order) >+ skip_sort_order= 1; >+ } >++ /* >++ Check if we can optimize away GROUP BY/DISTINCT. >++ We can do that if there are no aggregate functions and the >++ fields in DISTINCT clause (if present) and/or columns in GROUP BY >++ (if present) contain direct references to all key parts of >++ an unique index (in whatever order). >++ Note that the unique keys for DISTINCT and GROUP BY should not >++ be the same (as long as they are unique). >++ >++ The FROM clause must contain a single non-constant table. >++ */ >++ if (tables - const_tables == 1 && (group_list || select_distinct) && >++ !tmp_table_param.sum_func_count) >++ { >++ if (group_list && >++ list_contains_unique_index(join_tab[const_tables].table, >++ find_field_in_order_list, >++ (void *) group_list)) >++ { >++ group_list= 0; >++ group= 0; >++ } >++ if (select_distinct && >++ list_contains_unique_index(join_tab[const_tables].table, >++ find_field_in_item_list, >++ (void *) &fields_list)) >++ { >++ select_distinct= 0; >++ } >++ } >+ if (group_list || tmp_table_param.sum_func_count) >+ { >+ if (! hidden_group_fields && rollup.state == ROLLUP::STATE_NONE) >+@@ -698,36 +728,6 @@ >+ &simple_group); >+ if (old_group_list && !group_list) >+ select_distinct= 0; >+- } >+- /* >+- Check if we can optimize away GROUP BY/DISTINCT. >+- We can do that if there are no aggregate functions and the >+- fields in DISTINCT clause (if present) and/or columns in GROUP BY >+- (if present) contain direct references to all key parts of >+- an unique index (in whatever order). >+- Note that the unique keys for DISTINCT and GROUP BY should not >+- be the same (as long as they are unique). >+- >+- The FROM clause must contain a single non-constant table. >+- */ >+- if (tables - const_tables == 1 && (group_list || select_distinct) && >+- !tmp_table_param.sum_func_count) >+- { >+- if (group_list && >+- list_contains_unique_index(join_tab[const_tables].table, >+- find_field_in_order_list, >+- (void *) group_list)) >+- { >+- group_list= 0; >+- group= 0; >+- } >+- if (select_distinct && >+- list_contains_unique_index(join_tab[const_tables].table, >+- find_field_in_item_list, >+- (void *) &fields_list)) >+- { >+- select_distinct= 0; >+- } >+ } >+ if (!group_list && group) >+ {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 105679
: 72754