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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
64e98031
Commit
64e98031
authored
May 28, 2004
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.0
into gw.mysql.r18.ru:/usr/home/ram/work/4.0.b3738
parents
7aa93578
0cb0e7f5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
2 deletions
+40
-2
mysql-test/r/select_found.result
mysql-test/r/select_found.result
+17
-0
mysql-test/t/select_found.test
mysql-test/t/select_found.test
+19
-0
sql/sql_select.cc
sql/sql_select.cc
+4
-2
No files found.
mysql-test/r/select_found.result
View file @
64e98031
...
@@ -206,3 +206,20 @@ WHERE ( r = 1 AND a IN ( 1, 2 ) AND ( u = 'w' OR u LIKE 'w/%' ) )
...
@@ -206,3 +206,20 @@ WHERE ( r = 1 AND a IN ( 1, 2 ) AND ( u = 'w' OR u LIKE 'w/%' ) )
OR ( r = 1 AND a IN ( 3 ) AND ( u = 'w/U' OR u LIKE 'w/U/%' ) )
OR ( r = 1 AND a IN ( 3 ) AND ( u = 'w/U' OR u LIKE 'w/U/%' ) )
OR ( r = 1 AND a IN ( 1, 2, 3 ) AND ( u = 'w' ) );
OR ( r = 1 AND a IN ( 1, 2, 3 ) AND ( u = 'w' ) );
drop table t1;
drop table t1;
CREATE TABLE t1 (a VARCHAR(16), UNIQUE(a));
INSERT INTO t1 VALUES ('1'), ('2'), ('3');
SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a = '2' LIMIT 0, 1;
a
2
SELECT FOUND_ROWS();
FOUND_ROWS()
1
DROP TABLE t1;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (0), (0), (1), (2);
SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a = 0 GROUP BY a HAVING a > 10;
a
SELECT FOUND_ROWS();
FOUND_ROWS()
0
DROP TABLE t1;
mysql-test/t/select_found.test
View file @
64e98031
...
@@ -127,3 +127,22 @@ WHERE ( r = 1 AND a IN ( 1, 2 ) AND ( u = 'w' OR u LIKE 'w/%' ) )
...
@@ -127,3 +127,22 @@ WHERE ( r = 1 AND a IN ( 1, 2 ) AND ( u = 'w' OR u LIKE 'w/%' ) )
OR
(
r
=
1
AND
a
IN
(
1
,
2
,
3
)
AND
(
u
=
'w'
)
);
OR
(
r
=
1
AND
a
IN
(
1
,
2
,
3
)
AND
(
u
=
'w'
)
);
drop
table
t1
;
drop
table
t1
;
#
# Bug #3738: we have a ref key
#
CREATE
TABLE
t1
(
a
VARCHAR
(
16
),
UNIQUE
(
a
));
INSERT
INTO
t1
VALUES
(
'1'
),
(
'2'
),
(
'3'
);
SELECT
SQL_CALC_FOUND_ROWS
*
FROM
t1
WHERE
a
=
'2'
LIMIT
0
,
1
;
SELECT
FOUND_ROWS
();
DROP
TABLE
t1
;
#
# Bug #3845: group by, having and empty result
#
CREATE
TABLE
t1
(
a
INT
);
INSERT
INTO
t1
VALUES
(
0
),
(
0
),
(
1
),
(
2
);
SELECT
SQL_CALC_FOUND_ROWS
*
FROM
t1
WHERE
a
=
0
GROUP
BY
a
HAVING
a
>
10
;
SELECT
FOUND_ROWS
();
DROP
TABLE
t1
;
sql/sql_select.cc
View file @
64e98031
...
@@ -5348,7 +5348,8 @@ end_send(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
...
@@ -5348,7 +5348,8 @@ end_send(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
if
((
join
->
tables
==
1
)
&&
!
join
->
tmp_table
&&
!
join
->
sort_and_group
if
((
join
->
tables
==
1
)
&&
!
join
->
tmp_table
&&
!
join
->
sort_and_group
&&
!
join
->
send_group_parts
&&
!
join
->
having
&&
!
jt
->
select_cond
&&
&&
!
join
->
send_group_parts
&&
!
join
->
having
&&
!
jt
->
select_cond
&&
!
(
jt
->
select
&&
jt
->
select
->
quick
)
&&
!
(
jt
->
select
&&
jt
->
select
->
quick
)
&&
!
(
jt
->
table
->
file
->
table_flags
()
&
HA_NOT_EXACT_COUNT
))
!
(
jt
->
table
->
file
->
table_flags
()
&
HA_NOT_EXACT_COUNT
)
&&
(
jt
->
ref
.
key
<
0
))
{
{
/* Join over all rows in table; Return number of found rows */
/* Join over all rows in table; Return number of found rows */
TABLE
*
table
=
jt
->
table
;
TABLE
*
table
=
jt
->
table
;
...
@@ -5429,6 +5430,7 @@ end_send_group(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
...
@@ -5429,6 +5430,7 @@ end_send_group(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
DBUG_RETURN
(
-
1
);
/* purecov: inspected */
DBUG_RETURN
(
-
1
);
/* purecov: inspected */
if
(
end_of_records
)
if
(
end_of_records
)
{
{
if
(
!
error
)
join
->
send_records
++
;
join
->
send_records
++
;
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
}
}
...
...
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