Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
2e16838c
Commit
2e16838c
authored
Jul 02, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/my/mysql-4.1 sql/sql_select.cc: Auto merged
parents
b7e409a5
f831ab65
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
5 deletions
+19
-5
client/mysqltest.c
client/mysqltest.c
+5
-0
sql/sql_select.cc
sql/sql_select.cc
+14
-5
No files found.
client/mysqltest.c
View file @
2e16838c
...
@@ -60,7 +60,12 @@
...
@@ -60,7 +60,12 @@
#include <sys/stat.h>
#include <sys/stat.h>
#include <violite.h>
#include <violite.h>
#include <regex.h>
/* Our own version of lib */
#include <regex.h>
/* Our own version of lib */
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#include <sys/wait.h>
#endif
#ifndef WEXITSTATUS
# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
#endif
#define MAX_QUERY 131072
#define MAX_QUERY 131072
#define MAX_VAR_NAME 256
#define MAX_VAR_NAME 256
#define MAX_COLUMNS 256
#define MAX_COLUMNS 256
...
...
sql/sql_select.cc
View file @
2e16838c
...
@@ -134,8 +134,8 @@ static void read_cached_record(JOIN_TAB *tab);
...
@@ -134,8 +134,8 @@ static void read_cached_record(JOIN_TAB *tab);
static
bool
cmp_buffer_with_ref
(
JOIN_TAB
*
tab
);
static
bool
cmp_buffer_with_ref
(
JOIN_TAB
*
tab
);
static
bool
setup_new_fields
(
THD
*
thd
,
TABLE_LIST
*
tables
,
List
<
Item
>
&
fields
,
static
bool
setup_new_fields
(
THD
*
thd
,
TABLE_LIST
*
tables
,
List
<
Item
>
&
fields
,
List
<
Item
>
&
all_fields
,
ORDER
*
new_order
);
List
<
Item
>
&
all_fields
,
ORDER
*
new_order
);
static
ORDER
*
create_distinct_group
(
THD
*
thd
,
ORDER
*
order
,
static
ORDER
*
create_distinct_group
(
THD
*
thd
,
Item
**
ref_pointer_array
,
List
<
Item
>
&
fields
,
ORDER
*
order
,
List
<
Item
>
&
fields
,
bool
*
all_order_by_fields_used
);
bool
*
all_order_by_fields_used
);
static
bool
test_if_subpart
(
ORDER
*
a
,
ORDER
*
b
);
static
bool
test_if_subpart
(
ORDER
*
a
,
ORDER
*
b
);
static
TABLE
*
get_sort_by_table
(
ORDER
*
a
,
ORDER
*
b
,
TABLE_LIST
*
tables
);
static
TABLE
*
get_sort_by_table
(
ORDER
*
a
,
ORDER
*
b
,
TABLE_LIST
*
tables
);
...
@@ -642,7 +642,8 @@ JOIN::optimize()
...
@@ -642,7 +642,8 @@ JOIN::optimize()
bool
all_order_fields_used
;
bool
all_order_fields_used
;
if
(
order
)
if
(
order
)
skip_sort_order
=
test_if_skip_sort_order
(
tab
,
order
,
select_limit
,
1
);
skip_sort_order
=
test_if_skip_sort_order
(
tab
,
order
,
select_limit
,
1
);
if
((
group_list
=
create_distinct_group
(
thd
,
order
,
fields_list
,
if
((
group_list
=
create_distinct_group
(
thd
,
select_lex
->
ref_pointer_array
,
order
,
fields_list
,
&
all_order_fields_used
)))
&
all_order_fields_used
)))
{
{
bool
skip_group
=
(
skip_sort_order
&&
bool
skip_group
=
(
skip_sort_order
&&
...
@@ -8438,12 +8439,14 @@ setup_new_fields(THD *thd,TABLE_LIST *tables,List<Item> &fields,
...
@@ -8438,12 +8439,14 @@ setup_new_fields(THD *thd,TABLE_LIST *tables,List<Item> &fields,
*/
*/
static
ORDER
*
static
ORDER
*
create_distinct_group
(
THD
*
thd
,
ORDER
*
order_list
,
List
<
Item
>
&
fields
,
create_distinct_group
(
THD
*
thd
,
Item
**
ref_pointer_array
,
ORDER
*
order_list
,
List
<
Item
>
&
fields
,
bool
*
all_order_by_fields_used
)
bool
*
all_order_by_fields_used
)
{
{
List_iterator
<
Item
>
li
(
fields
);
List_iterator
<
Item
>
li
(
fields
);
Item
*
item
;
Item
*
item
;
ORDER
*
order
,
*
group
,
**
prev
;
ORDER
*
order
,
*
group
,
**
prev
;
uint
index
=
0
;
*
all_order_by_fields_used
=
1
;
*
all_order_by_fields_used
=
1
;
while
((
item
=
li
++
))
while
((
item
=
li
++
))
...
@@ -8475,11 +8478,17 @@ create_distinct_group(THD *thd, ORDER *order_list, List<Item> &fields,
...
@@ -8475,11 +8478,17 @@ create_distinct_group(THD *thd, ORDER *order_list, List<Item> &fields,
ORDER
*
ord
=
(
ORDER
*
)
thd
->
calloc
(
sizeof
(
ORDER
));
ORDER
*
ord
=
(
ORDER
*
)
thd
->
calloc
(
sizeof
(
ORDER
));
if
(
!
ord
)
if
(
!
ord
)
return
0
;
return
0
;
ord
->
item
=
li
.
ref
();
/*
We have here only field_list (not all_field_list), so we can use
simple indexing of ref_pointer_array (order in the array and in the
list are same)
*/
ord
->
item
=
ref_pointer_array
+
index
;
ord
->
asc
=
1
;
ord
->
asc
=
1
;
*
prev
=
ord
;
*
prev
=
ord
;
prev
=
&
ord
->
next
;
prev
=
&
ord
->
next
;
}
}
index
++
;
}
}
*
prev
=
0
;
*
prev
=
0
;
return
group
;
return
group
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment