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
c118eeae
Commit
c118eeae
authored
Jan 31, 2007
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into olga.mysql.com:/home/igor/mysql-5.0-opt
parents
0375a7a8
309f2a60
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
14 deletions
+16
-14
sql/opt_sum.cc
sql/opt_sum.cc
+5
-5
sql/sql_select.cc
sql/sql_select.cc
+11
-9
No files found.
sql/opt_sum.cc
View file @
c118eeae
...
...
@@ -67,9 +67,9 @@ static int maxmin_in_range(bool max_fl, Field* field, COND *cond);
GROUP BY part.
RETURN VALUES
0
N
o errors
0
n
o errors
1 if all items were resolved
-1
on impossible conditions
HA_ERR_KEY_NOT_FOUND
on impossible conditions
OR an error number from my_base.h HA_ERR_... if a deadlock or a lock
wait timeout happens, for example
*/
...
...
@@ -224,7 +224,7 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
if
(
error
)
{
if
(
error
==
HA_ERR_KEY_NOT_FOUND
||
error
==
HA_ERR_END_OF_FILE
)
return
-
1
;
// No rows matching WHERE
return
HA_ERR_KEY_NOT_FOUND
;
// No rows matching WHERE
/* HA_ERR_LOCK_DEADLOCK or some other error */
table
->
file
->
print_error
(
error
,
MYF
(
0
));
return
(
error
);
...
...
@@ -311,7 +311,7 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
if
(
error
)
{
if
(
error
==
HA_ERR_KEY_NOT_FOUND
||
error
==
HA_ERR_END_OF_FILE
)
return
-
1
;
// No rows matching WHERE
return
HA_ERR_KEY_NOT_FOUND
;
// No rows matching WHERE
/* HA_ERR_LOCK_DEADLOCK or some other error */
table
->
file
->
print_error
(
error
,
MYF
(
0
));
return
(
error
);
...
...
sql/sql_select.cc
View file @
c118eeae
...
...
@@ -707,11 +707,20 @@ JOIN::optimize()
{
int
res
;
/*
opt_sum_query() returns -1 if no rows match to the WHERE conditions,
or 1 if all items were resolved, or 0, or an error number HA_ERR_...
opt_sum_query() returns HA_ERR_KEY_NOT_FOUND if no rows match
to the WHERE conditions,
or 1 if all items were resolved,
or 0, or an error number HA_ERR_...
*/
if
((
res
=
opt_sum_query
(
select_lex
->
leaf_tables
,
all_fields
,
conds
)))
{
if
(
res
==
HA_ERR_KEY_NOT_FOUND
)
{
DBUG_PRINT
(
"info"
,(
"No matching min/max row"
));
zero_result_cause
=
"No matching min/max row"
;
error
=
0
;
DBUG_RETURN
(
0
);
}
if
(
res
>
1
)
{
thd
->
fatal_error
();
...
...
@@ -719,13 +728,6 @@ JOIN::optimize()
DBUG_PRINT
(
"error"
,(
"Error from opt_sum_query"
));
DBUG_RETURN
(
1
);
}
if
(
res
<
0
)
{
DBUG_PRINT
(
"info"
,(
"No matching min/max row"
));
zero_result_cause
=
"No matching min/max row"
;
error
=
0
;
DBUG_RETURN
(
0
);
}
DBUG_PRINT
(
"info"
,(
"Select tables optimized away"
));
zero_result_cause
=
"Select tables optimized away"
;
tables_list
=
0
;
// All tables resolved
...
...
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